aboutsummaryrefslogtreecommitdiffstats
path: root/nexus/fasm.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-10-12 15:57:33 +0100
committerDavid Shah <dave@ds0.me>2020-11-30 08:45:27 +0000
commitaf3af59df48f2752912d1c788ad56d83a73839ff (patch)
tree703b5a057784b885e2e1ddca9706be2a94c7eba4 /nexus/fasm.cc
parent10ad7d9cfec20e2c2417347e267c633e2f7e2623 (diff)
downloadnextpnr-af3af59df48f2752912d1c788ad56d83a73839ff.tar.gz
nextpnr-af3af59df48f2752912d1c788ad56d83a73839ff.tar.bz2
nextpnr-af3af59df48f2752912d1c788ad56d83a73839ff.zip
nexus: Use tilegroups for IO bitgen
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus/fasm.cc')
-rw-r--r--nexus/fasm.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/nexus/fasm.cc b/nexus/fasm.cc
index e9a4572f..777947e0 100644
--- a/nexus/fasm.cc
+++ b/nexus/fasm.cc
@@ -139,6 +139,17 @@ struct NexusFasmWriter
void push_tile(int loc, IdString tile_type) { push(tile_name(loc, tile_by_type_and_loc(loc, tile_type))); }
void push_tile(int loc) { push(tile_name(loc, tile_at_loc(loc))); }
void push_belname(BelId bel) { push(ctx->nameOf(ctx->bel_data(bel).name)); }
+ void push_belgroup(BelId bel)
+ {
+ int r = bel.tile / ctx->chip_info->width;
+ int c = bel.tile % ctx->chip_info->width;
+ auto bel_data = ctx->bel_data(bel);
+ r += bel_data.rel_y;
+ c += bel_data.rel_x;
+ std::string s = stringf("R%dC%d_%s", r, c, ctx->nameOf(ctx->bel_data(bel).name));
+ push(s);
+ }
+
void write_pip(PipId pip)
{
auto &pd = ctx->pip_data(pip);
@@ -203,7 +214,7 @@ struct NexusFasmWriter
void write_io33(const CellInfo *cell)
{
BelId bel = cell->bel;
- push_tile(bel.tile);
+ push_belgroup(bel);
push_belname(bel);
const NetInfo *t = get_net_or_empty(cell, id_T);
auto tmux = ctx->get_cell_pinmux(cell, id_T);
@@ -221,7 +232,7 @@ struct NexusFasmWriter
void write_io18(const CellInfo *cell)
{
BelId bel = cell->bel;
- push_tile(bel.tile);
+ push_belgroup(bel);
push_belname(bel);
push("SEIO18");
const NetInfo *t = get_net_or_empty(cell, id_T);