diff --git a/kernel/constids.inc b/kernel/constids.inc index 27b652e24..cec9f8799 100644 --- a/kernel/constids.inc +++ b/kernel/constids.inc @@ -154,6 +154,7 @@ X(SRC_EN) X(SRC_PEN) X(SRC_POL) X(SRC_WIDTH) +X(sta_arrival) X(STATE_BITS) X(STATE_NUM) X(STATE_NUM_LOG2) diff --git a/kernel/timinginfo.h b/kernel/timinginfo.h index 4936e42de..c08f6c9d8 100644 --- a/kernel/timinginfo.h +++ b/kernel/timinginfo.h @@ -141,8 +141,8 @@ struct TimingInfo } } else if (cell->type == ID($specrule)) { - auto type = cell->getParam(ID::TYPE).decode_string(); - if (type != "$setup" && type != "$setuphold") + IdString type = cell->getParam(ID::TYPE).decode_string(); + if (type != ID($setup) && type != ID($setuphold)) continue; auto src = cell->getPort(ID::SRC); auto dst = cell->getPort(ID::DST).as_bit(); diff --git a/passes/cmds/sta.cc b/passes/cmds/sta.cc index 0f4f2c671..f1c160014 100644 --- a/passes/cmds/sta.cc +++ b/passes/cmds/sta.cc @@ -135,7 +135,7 @@ struct StaWorker for (const auto &b : sigmap(wire)) queue.emplace_back(b); // All primary inputs to arrive at time zero - wire->set_intvec_attribute(ID(sta_arrival), std::vector(GetSize(wire), 0)); + wire->set_intvec_attribute(ID::sta_arrival, std::vector(GetSize(wire), 0)); } if (wire->port_output) for (const auto &b : sigmap(wire)) @@ -152,12 +152,12 @@ struct StaWorker auto it = data.find(b); if (it == data.end()) continue; - const auto& src_arrivals = b.wire->get_intvec_attribute(ID(sta_arrival)); + const auto& src_arrivals = b.wire->get_intvec_attribute(ID::sta_arrival); log_assert(GetSize(src_arrivals) == GetSize(b.wire)); auto src_arrival = src_arrivals[b.offset]; for (const auto &d : it->second.fanouts) { const auto &dst_bit = std::get<0>(d); - auto dst_arrivals = dst_bit.wire->get_intvec_attribute(ID(sta_arrival)); + auto dst_arrivals = dst_bit.wire->get_intvec_attribute(ID::sta_arrival); if (dst_arrivals.empty()) dst_arrivals = std::vector(GetSize(dst_bit.wire), -1); else @@ -166,7 +166,7 @@ struct StaWorker auto new_arrival = src_arrival + std::get<1>(d); if (dst_arrival < new_arrival) { dst_arrival = std::max(dst_arrival, new_arrival); - dst_bit.wire->set_intvec_attribute(ID(sta_arrival), dst_arrivals); + dst_bit.wire->set_intvec_attribute(ID::sta_arrival, dst_arrivals); queue.emplace_back(dst_bit); data[dst_bit].backtrack = b; @@ -194,7 +194,7 @@ struct StaWorker } auto jt = data.find(b); while (jt != data.end()) { - int arrival = b.wire->get_intvec_attribute(ID(sta_arrival))[b.offset]; + int arrival = b.wire->get_intvec_attribute(ID::sta_arrival)[b.offset]; if (jt->second.driver) { log(" %s\n", log_signal(b)); log(" %6d %s (%s.%s->%s)\n", arrival, log_id(jt->second.driver), log_id(jt->second.driver->type), log_id(jt->second.src_port), log_id(jt->second.dst_port)); @@ -210,11 +210,11 @@ struct StaWorker std::map arrival_histogram; for (const auto &i : endpoints) { const auto &b = i.first; - if (!b.wire->attributes.count(ID(sta_arrival))) { + if (!b.wire->attributes.count(ID::sta_arrival)) { log_warning("Wire %s.%s has no (* sta_arrival *) value.\n", log_id(module), log_signal(b)); continue; } - auto arrival = b.wire->get_intvec_attribute(ID(sta_arrival))[b.offset]; + auto arrival = b.wire->get_intvec_attribute(ID::sta_arrival)[b.offset]; if (arrival < 0) { // FIXME: Might be an unreachable signal // Might be a constant driven signal (e.g. through OBUF)