diff options
-rw-r--r-- | gowin/arch.cc | 38 | ||||
-rw-r--r-- | gowin/constids.inc | 8 |
2 files changed, 46 insertions, 0 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc index dc40b179..2c1e50b7 100644 --- a/gowin/arch.cc +++ b/gowin/arch.cc @@ -1009,6 +1009,44 @@ Arch::Arch(ArchArgs args) : args(args) snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this)); addBelInput(belname, id_GSRI, id(buf)); break; + case ID_OSC: + snprintf(buf, 32, "R%dC%d_OSC", row + 1, col + 1); + belname = id(buf); + addBel(belname, id_OSC, Loc(col, row, 0), false); + portname = IdString(pairLookup(bel->ports.get(), bel->num_ports, ID_OSCOUT)->src_id); + snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this)); + addBelOutput(belname, id_OSCOUT, id(buf)); + break; + case ID_OSCH: + snprintf(buf, 32, "R%dC%d_OSCH", row + 1, col + 1); + belname = id(buf); + addBel(belname, id_OSCH, Loc(col, row, 0), false); + portname = IdString(pairLookup(bel->ports.get(), bel->num_ports, ID_OSCOUT)->src_id); + snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this)); + addBelOutput(belname, id_OSCOUT, id(buf)); + break; + case ID_OSCF: + snprintf(buf, 32, "R%dC%d_OSCF", row + 1, col + 1); + belname = id(buf); + addBel(belname, id_OSCF, Loc(col, row, 0), false); + portname = IdString(pairLookup(bel->ports.get(), bel->num_ports, ID_OSCOUT)->src_id); + snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this)); + addBelOutput(belname, id_OSCOUT, id(buf)); + portname = IdString(pairLookup(bel->ports.get(), bel->num_ports, ID_OSCEN)->src_id); + snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this)); + addBelInput(belname, id_OSCEN, id(buf)); + break; + case ID_OSCZ: + snprintf(buf, 32, "R%dC%d_OSCZ", row + 1, col + 1); + belname = id(buf); + addBel(belname, id_OSCZ, Loc(col, row, 0), false); + portname = IdString(pairLookup(bel->ports.get(), bel->num_ports, ID_OSCOUT)->src_id); + snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this)); + addBelOutput(belname, id_OSCOUT, id(buf)); + portname = IdString(pairLookup(bel->ports.get(), bel->num_ports, ID_OSCEN)->src_id); + snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this)); + addBelInput(belname, id_OSCEN, id(buf)); + break; // fall through the ++ case ID_LUT7: z++; diff --git a/gowin/constids.inc b/gowin/constids.inc index 8159cc10..d2a6b171 100644 --- a/gowin/constids.inc +++ b/gowin/constids.inc @@ -758,6 +758,12 @@ X(GSR) X(GSR0) X(GSRI) +// Oscillators +X(OSC) +X(OSCZ) +X(OSCH) +X(OSCF) + // primitive attributes X(INIT) X(FF_USED) @@ -791,6 +797,8 @@ X(COUT) X(OF) X(V) X(G) +X(OSCOUT) +X(OSCEN) // timing X(X0) |