From 86699b42f619960bfefd4d0b479dd44a90527ea4 Mon Sep 17 00:00:00 2001 From: gatecat Date: Sat, 26 Feb 2022 15:17:46 +0000 Subject: Switch to potentially-sparse net users array This uses a new data structure for net.users that allows gaps, so removing a port from a net is no longer an O(n) operation on the number of users the net has. Signed-off-by: gatecat --- common/timing.h | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'common/timing.h') diff --git a/common/timing.h b/common/timing.h index b34fd636..fe1bcaa8 100644 --- a/common/timing.h +++ b/common/timing.h @@ -44,28 +44,6 @@ struct CellPortKey } }; -struct NetPortKey -{ - IdString net; - size_t idx; - NetPortKey(){}; - explicit NetPortKey(IdString net) : net(net), idx(DRIVER_IDX){}; // driver - explicit NetPortKey(IdString net, size_t user) : net(net), idx(user){}; // user - - static const size_t DRIVER_IDX = std::numeric_limits::max(); - - inline bool is_driver() const { return (idx == DRIVER_IDX); } - inline size_t user_idx() const - { - NPNR_ASSERT(idx != DRIVER_IDX); - return idx; - } - - unsigned int hash() const { return mkhash(net.hash(), idx); } - - inline bool operator==(const NetPortKey &other) const { return (net == other.net) && (idx == other.idx); } -}; - struct ClockDomainKey { IdString clock; @@ -194,7 +172,6 @@ struct TimingAnalyser struct PerPort { CellPortKey cell_port; - NetPortKey net_port; PortType type; // per domain timings dict arrival; -- cgit v1.2.3