diff options
author | gatecat <gatecat@ds0.me> | 2021-03-22 09:30:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-22 09:30:38 +0000 |
commit | 68ca923bfefde24fa2b7cbc8c6f9817f1d93e1e5 (patch) | |
tree | bad29dce65cf448e36704e6d7b1773d8dfd573a2 /fpga_interchange/luts.cc | |
parent | f52b5229642cdb54d61b54f5ab9a7478a119298e (diff) | |
parent | 22c6754bcd08f66b6f8e87a58dc09ed260c72c25 (diff) | |
download | nextpnr-68ca923bfefde24fa2b7cbc8c6f9817f1d93e1e5.tar.gz nextpnr-68ca923bfefde24fa2b7cbc8c6f9817f1d93e1e5.tar.bz2 nextpnr-68ca923bfefde24fa2b7cbc8c6f9817f1d93e1e5.zip |
Merge pull request #635 from litghost/refactor_headers
Refactor header structures in FPGA interchange Arch.
Diffstat (limited to 'fpga_interchange/luts.cc')
-rw-r--r-- | fpga_interchange/luts.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fpga_interchange/luts.cc b/fpga_interchange/luts.cc index 6e24847f..bdf728fd 100644 --- a/fpga_interchange/luts.cc +++ b/fpga_interchange/luts.cc @@ -122,6 +122,8 @@ struct LutPin bool operator<(const LutPin &other) const { return max_pin < other.max_pin; } }; +//#define DEBUG_LUT_ROTATION + bool LutMapper::remap_luts(const Context *ctx) { std::unordered_map<NetInfo *, LutPin> lut_pin_map; @@ -262,11 +264,25 @@ bool LutMapper::remap_luts(const Context *ctx) for (size_t bel_pin_idx = 0; bel_pin_idx < lut_bel.pins.size(); ++bel_pin_idx) { if ((used_pins & (1 << bel_pin_idx)) == 0) { NPNR_ASSERT(bel_to_cell_pin_remaps[cell_idx][bel_pin_idx] == -1); - cell->lut_cell.vcc_pins.emplace(lut_bel.pins[bel_pin_idx]); + cell->lut_cell.vcc_pins.emplace(lut_bel.pins.at(bel_pin_idx)); } } } +#ifdef DEBUG_LUT_ROTATION + log_info("Final mapping:\n"); + for (size_t cell_idx = 0; cell_idx < cells.size(); ++cell_idx) { + CellInfo *cell = cells[cell_idx]; + for (auto &cell_pin_pair : cell->cell_bel_pins) { + log_info("%s %s %s =>", cell->type.c_str(ctx), cell->name.c_str(ctx), cell_pin_pair.first.c_str(ctx)); + for (auto bel_pin : cell_pin_pair.second) { + log(" %s", bel_pin.c_str(ctx)); + } + log("\n"); + } + } +#endif + return true; } |