diff options
author | Eddie Hung <eddie.hung+gitlab@gmail.com> | 2018-07-21 19:03:35 +0000 |
---|---|---|
committer | Eddie Hung <eddie.hung+gitlab@gmail.com> | 2018-07-21 19:03:35 +0000 |
commit | f176ee48cdd6b508f6f26e7b2ccca97a680929cf (patch) | |
tree | 93d8b7f0baad5b504aff26acdba441ea6ba6d8c6 /ice40/arch.h | |
parent | 3eecccc6f7f8c36994e9227adfc8ab1067ea287f (diff) | |
parent | 1f6897733b57f03cf7f5ccab46c27de811d42167 (diff) | |
download | nextpnr-f176ee48cdd6b508f6f26e7b2ccca97a680929cf.tar.gz nextpnr-f176ee48cdd6b508f6f26e7b2ccca97a680929cf.tar.bz2 nextpnr-f176ee48cdd6b508f6f26e7b2ccca97a680929cf.zip |
Merge branch 'redist_slack' into 'redist_slack'
Redist slack
See merge request eddiehung/nextpnr!5
Diffstat (limited to 'ice40/arch.h')
-rw-r--r-- | ice40/arch.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/ice40/arch.h b/ice40/arch.h index 3b6d23dc..beba2ccf 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -350,6 +350,7 @@ struct Arch : BaseCtx mutable std::unordered_map<IdString, int> bel_by_name; mutable std::unordered_map<IdString, int> wire_by_name; mutable std::unordered_map<IdString, int> pip_by_name; + mutable std::unordered_map<Loc, int> bel_by_loc; std::vector<IdString> bel_to_cell; std::vector<IdString> wire_to_net; @@ -440,7 +441,24 @@ struct Arch : BaseCtx return range; } - BelRange getBelsAtSameTile(BelId bel) const; + Loc getBelLocation(BelId bel) const + { + Loc loc; + loc.x = chip_info->bel_data[bel.index].x; + loc.y = chip_info->bel_data[bel.index].y; + loc.z = chip_info->bel_data[bel.index].z; + return loc; + } + + BelId getBelByLocation(Loc loc) const; + BelRange getBelsByTile(int x, int y) const; + + bool getBelGlobalBuf(BelId bel) const + { + return chip_info->bel_data[bel.index].type == TYPE_SB_GB; + } + + BelRange getBelsAtSameTile(BelId bel) const NPNR_DEPRECATED; BelType getBelType(BelId bel) const { @@ -671,7 +689,7 @@ struct Arch : BaseCtx // ------------------------------------------------- - void estimatePosition(BelId bel, int &x, int &y, bool &gb) const; + void estimatePosition(BelId bel, int &x, int &y, bool &gb) const NPNR_DEPRECATED; delay_t estimateDelay(WireId src, WireId dst) const; delay_t getDelayEpsilon() const { return 20; } delay_t getRipupDelayPenalty() const { return 200; } |