aboutsummaryrefslogtreecommitdiffstats
path: root/gowin/arch.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gowin/arch.cc')
-rw-r--r--gowin/arch.cc44
1 files changed, 39 insertions, 5 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc
index 99e0ce61..8c654b2e 100644
--- a/gowin/arch.cc
+++ b/gowin/arch.cc
@@ -612,7 +612,7 @@ void Arch::addMuxBels(const DatabasePOD *db, int row, int col)
int gcol = col + 1;
// no MUX2_LUT8 in the last column
- if (j == 7 && col == getGridDimX() - 1) {
+ if (j == 7 && col == getGridDimX() - 2) {
continue;
}
@@ -870,6 +870,39 @@ Arch::Arch(ArchArgs args) : args(args)
snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this));
addBelInput(belname, id_OEN, id(buf));
break;
+ // Simplified IO
+ case ID_IOBJS:
+ z++; /* fall-through*/
+ case ID_IOBIS:
+ z++; /* fall-through*/
+ case ID_IOBHS:
+ z++; /* fall-through*/
+ case ID_IOBGS:
+ z++; /* fall-through*/
+ case ID_IOBFS:
+ z++; /* fall-through*/
+ case ID_IOBES:
+ z++; /* fall-through*/
+ case ID_IOBDS:
+ z++; /* fall-through*/
+ case ID_IOBCS:
+ z++; /* fall-through*/
+ case ID_IOBBS:
+ z++; /* fall-through*/
+ case ID_IOBAS:
+ snprintf(buf, 32, "R%dC%d_IOB%c", row + 1, col + 1, 'A' + z);
+ belname = id(buf);
+ addBel(belname, id_IOBS, Loc(col, row, z), false);
+ portname = IdString(pairLookup(bel->ports.get(), bel->num_ports, ID_O)->src_id);
+ snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this));
+ addBelOutput(belname, id_O, id(buf));
+ portname = IdString(pairLookup(bel->ports.get(), bel->num_ports, ID_I)->src_id);
+ snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this));
+ addBelInput(belname, id_I, id(buf));
+ portname = IdString(pairLookup(bel->ports.get(), bel->num_ports, ID_OE)->src_id);
+ snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this));
+ addBelInput(belname, id_OEN, id(buf));
+ break;
default:
break;
@@ -1171,11 +1204,12 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
return (dx + dy) * args.delayScale + args.delayOffset;
}
-delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const
+delay_t Arch::predictDelay(BelId src_bel, IdString src_pin, BelId dst_bel, IdString dst_pin) const
{
- const auto &driver = net_info->driver;
- auto driver_loc = getBelLocation(driver.cell->bel);
- auto sink_loc = getBelLocation(sink.cell->bel);
+ NPNR_UNUSED(src_pin);
+ NPNR_UNUSED(dst_pin);
+ auto driver_loc = getBelLocation(src_bel);
+ auto sink_loc = getBelLocation(dst_bel);
int dx = abs(sink_loc.x - driver_loc.x);
int dy = abs(sink_loc.y - driver_loc.y);