Edge::arcDelayAnnotateBit resolves issue #299

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2025-09-18 15:48:37 -07:00
parent 892a9a4a3d
commit f18df8a1a2
2 changed files with 11 additions and 4 deletions

View File

@ -1322,7 +1322,7 @@ Edge::arcDelayAnnotated(const TimingArc *arc,
{ {
size_t index = arc->index() * ap_count + ap_index; size_t index = arc->index() * ap_count + ap_index;
if (arc_delay_annotated_is_bits_) if (arc_delay_annotated_is_bits_)
return arc_delay_annotated_.bits_ & (1 << index); return arc_delay_annotated_.bits_ & arcDelayAnnotateBit(index);
else else
return (*arc_delay_annotated_.seq_)[index]; return (*arc_delay_annotated_.seq_)[index];
} }
@ -1334,7 +1334,7 @@ Edge::setArcDelayAnnotated(const TimingArc *arc,
bool annotated) bool annotated)
{ {
size_t index = arc->index() * ap_count + ap_index; size_t index = arc->index() * ap_count + ap_index;
if (index > sizeof(intptr_t) * 8 if (index > sizeof(uintptr_t) * 8
&& arc_delay_annotated_is_bits_) { && arc_delay_annotated_is_bits_) {
arc_delay_annotated_is_bits_ = false; arc_delay_annotated_is_bits_ = false;
size_t bit_count = ap_count * RiseFall::index_count * 2; size_t bit_count = ap_count * RiseFall::index_count * 2;
@ -1342,9 +1342,9 @@ Edge::setArcDelayAnnotated(const TimingArc *arc,
} }
if (arc_delay_annotated_is_bits_) { if (arc_delay_annotated_is_bits_) {
if (annotated) if (annotated)
arc_delay_annotated_.bits_ |= (1 << index); arc_delay_annotated_.bits_ |= arcDelayAnnotateBit(index);
else else
arc_delay_annotated_.bits_ &= ~(1 << index); arc_delay_annotated_.bits_ &= ~arcDelayAnnotateBit(index);
} }
else else
(*arc_delay_annotated_.seq_)[index] = annotated; (*arc_delay_annotated_.seq_)[index] = annotated;
@ -1368,6 +1368,12 @@ Edge::setDelayAnnotationIsIncremental(bool is_incr)
delay_annotation_is_incremental_ = is_incr; delay_annotation_is_incremental_ = is_incr;
} }
uintptr_t
Edge::arcDelayAnnotateBit(size_t index)
{
return static_cast<uintptr_t>(1) << index;
}
const TimingRole * const TimingRole *
Edge::role() const Edge::role() const
{ {

View File

@ -421,6 +421,7 @@ protected:
DcalcAPIndex ap_index, DcalcAPIndex ap_index,
DcalcAPIndex ap_count, DcalcAPIndex ap_count,
bool annotated); bool annotated);
static uintptr_t arcDelayAnnotateBit(size_t index);
TimingArcSet *arc_set_; TimingArcSet *arc_set_;
VertexId from_; VertexId from_;