From 4a2aa6deb49b70ed69f386898bcde7a6b2572618 Mon Sep 17 00:00:00 2001 From: YRabbit Date: Sat, 12 Mar 2022 23:05:42 +1000 Subject: gowin: Add the Global Set/Reset primitive GSR is added automatically if it was not instantiated by the user explicitly. Compatible with old apicula bases, the functionality does not work, but the crash does not happen --- just a warning. Signed-off-by: YRabbit --- gowin/arch.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gowin/arch.cc') diff --git a/gowin/arch.cc b/gowin/arch.cc index e6ee8267..22874810 100644 --- a/gowin/arch.cc +++ b/gowin/arch.cc @@ -991,6 +991,14 @@ Arch::Arch(ArchArgs args) : args(args) int z = 0; bool dff = true; switch (static_cast(bel->type_id)) { + case ID_GSR0: + snprintf(buf, 32, "R%dC%d_GSR0", row + 1, col + 1); + belname = id(buf); + addBel(belname, id_GSR, Loc(col, row, 0), false); + portname = IdString(pairLookup(bel->ports.get(), bel->num_ports, ID_GSRI)->src_id); + snprintf(buf, 32, "R%dC%d_%s", row + 1, col + 1, portname.c_str(this)); + addBelInput(belname, id_GSRI, id(buf)); + break; // fall through the ++ case ID_LUT7: z++; -- cgit v1.2.3