aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/arch.h
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-08-01 15:58:38 +0200
committerDavid Shah <davey1576@gmail.com>2018-08-01 15:58:38 +0200
commit0658759495d25fe5d1ffa8d58f86214ccd0e98d9 (patch)
treeb3601585659f692eb3bede0c4b5c0d57a5b41956 /ecp5/arch.h
parent534465d3ad5a2d42766088418eb37f88b029b195 (diff)
downloadnextpnr-0658759495d25fe5d1ffa8d58f86214ccd0e98d9.tar.gz
nextpnr-0658759495d25fe5d1ffa8d58f86214ccd0e98d9.tar.bz2
nextpnr-0658759495d25fe5d1ffa8d58f86214ccd0e98d9.zip
ecp5: Remove libtrellis link for bitstream gen
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ecp5/arch.h')
-rw-r--r--ecp5/arch.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/ecp5/arch.h b/ecp5/arch.h
index 002d69c2..1ddc4003 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -759,17 +759,6 @@ struct Arch : BaseCtx
return range;
}
- std::string getTileByTypeAndLocation(int row, int col, std::string type) const
- {
- auto &tileloc = chip_info->tile_info[row * chip_info->width + col];
- for (int i = 0; i < tileloc.num_tiles; i++) {
- if (chip_info->tiletype_names[tileloc.tile_names[i].type_idx].get() == type)
- return tileloc.tile_names[i].name.get();
- }
- NPNR_ASSERT_FALSE_STR("no tile at (" + std::to_string(col) + ", " + std::to_string(row) + ") with type " +
- type);
- }
-
std::string getPipTilename(PipId pip) const
{
auto &tileloc = chip_info->tile_info[pip.location.y * chip_info->width + pip.location.x];
@@ -851,6 +840,28 @@ struct Arch : BaseCtx
// Helper function for above
bool slicesCompatible(const std::vector<const CellInfo *> &cells) const;
+ std::vector<std::pair<std::string, std::string>> getTilesAtLocation(int row, int col);
+ std::string getTileByTypeAndLocation(int row, int col, std::string type) const
+ {
+ auto &tileloc = chip_info->tile_info[row * chip_info->width + col];
+ for (int i = 0; i < tileloc.num_tiles; i++) {
+ if (chip_info->tiletype_names[tileloc.tile_names[i].type_idx].get() == type)
+ return tileloc.tile_names[i].name.get();
+ }
+ NPNR_ASSERT_FALSE_STR("no tile at (" + std::to_string(col) + ", " + std::to_string(row) + ") with type " +
+ type);
+ }
+
+ std::string getTileByTypeAndLocation(int row, int col, const std::set<std::string> &type) const
+ {
+ auto &tileloc = chip_info->tile_info[row * chip_info->width + col];
+ for (int i = 0; i < tileloc.num_tiles; i++) {
+ if (type.count(chip_info->tiletype_names[tileloc.tile_names[i].type_idx].get()))
+ return tileloc.tile_names[i].name.get();
+ }
+ NPNR_ASSERT_FALSE_STR("no tile at (" + std::to_string(col) + ", " + std::to_string(row) + ") with type in set");
+ }
+
IdString id_trellis_slice;
IdString id_clk, id_lsr;
IdString id_clkmux, id_lsrmux;