diff options
author | David Shah <dave@ds0.me> | 2020-10-12 13:40:24 +0100 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2020-11-30 08:45:27 +0000 |
commit | df3866a80033feb2ba3cd01f14f8830e1f49cb1a (patch) | |
tree | 4f18b496d39e5f1d8ae4f987fee30038d8a7e953 /nexus/arch.cc | |
parent | 518ead2e2dd11ba3bcd19085c2c91178ba9e458c (diff) | |
download | nextpnr-df3866a80033feb2ba3cd01f14f8830e1f49cb1a.tar.gz nextpnr-df3866a80033feb2ba3cd01f14f8830e1f49cb1a.tar.bz2 nextpnr-df3866a80033feb2ba3cd01f14f8830e1f49cb1a.zip |
nexus: Add IO packing
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus/arch.cc')
-rw-r--r-- | nexus/arch.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/nexus/arch.cc b/nexus/arch.cc index f309c872..352f789a 100644 --- a/nexus/arch.cc +++ b/nexus/arch.cc @@ -459,7 +459,7 @@ bool Arch::route() // ----------------------------------------------------------------------- -CellPinMux Arch::get_cell_pinmux(CellInfo *cell, IdString pin) const +CellPinMux Arch::get_cell_pinmux(const CellInfo *cell, IdString pin) const { IdString param = id(stringf("%sMUX", pin.c_str(this))); auto fnd_param = cell->params.find(param); @@ -503,7 +503,7 @@ void Arch::set_cell_pinmux(CellInfo *cell, IdString pin, CellPinMux state) // ----------------------------------------------------------------------- -const PadInfoPOD *Arch::get_pin_data(const std::string &pin) const +const PadInfoPOD *Arch::get_pkg_pin_data(const std::string &pin) const { for (size_t i = 0; i < chip_info->num_pads; i++) { const PadInfoPOD *pad = &(chip_info->pads[i]); @@ -537,9 +537,8 @@ Loc Arch::get_pad_loc(const PadInfoPOD *pad) const return loc; } -BelId Arch::get_pin_bel(const std::string &pin) const +BelId Arch::get_pad_pio_bel(const PadInfoPOD *pad) const { - const PadInfoPOD *pad = get_pin_data(pin); if (pad == nullptr) return BelId(); return getBelByLocation(get_pad_loc(pad)); @@ -574,6 +573,17 @@ const PadInfoPOD *Arch::get_bel_pad(BelId bel) const return nullptr; } +std::string Arch::get_pad_functions(const PadInfoPOD *pad) const +{ + std::string s; + for (size_t i = 0; i < pad->num_funcs; i++) { + if (!s.empty()) + s += '/'; + s += IdString(pad->func_strs[i]).str(this); + } + return s; +} + // ----------------------------------------------------------------------- #ifdef WITH_HEAP |