Merge pull request #2043 from pepijndevos/moreapicula

fixes for apicula support
This commit is contained in:
Gwenhael Goavec-Merou 2024-08-24 10:37:17 +02:00 committed by GitHub
commit ef775e0b8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 7 deletions

View File

@ -25,16 +25,31 @@ class GowinApiculaToolchain(YosysNextPNRToolchain):
return (self._build_name + ".cst", "CST")
def finalize(self):
devicename = self.platform.devicename
# Non-exhaustive list of family aliases that Gowin IDE supports but don't have a unique database
if devicename == "GW1NR-9C":
devicename = "GW1N-9C"
elif devicename == "GW1NR-9":
devicename = "GW1N-9"
elif devicename == "GW1NSR-4C" or devicename == "GW1NSR-4":
devicename = "GW1NS-4"
elif devicename == "GW1NR-4C" or devicename == "GW1NR-4":
devicename = "GW1N-4"
elif devicename == "GW2AR-18C":
devicename = "GW2A-18C"
elif devicename == "GW2AR-18":
devicename = "GW2A-18"
pnr_opts = "--write {top}_routed.json --top {top} --device {device}" + \
" --vopt family={devicename} --vopt cst={top}.cst"
self._pnr_opts += pnr_opts.format(
top = self._build_name,
device = self.platform.device,
devicename = self.platform.devicename
devicename = devicename
)
self._packer_opts += "-d {devicename} -o {top}.fs {top}_routed.json".format(
devicename = self.platform.devicename,
devicename = devicename,
top = self._build_name
)

View File

@ -255,11 +255,7 @@ class GW1NPLL(LiteXModule):
instance_name = 'PLLVR'
self.params.update(i_VREN=1)
else:
instance_name = 'PLL'
self.params.update(
i_RESET_I = 0, # IDIV reset.
i_RESET_S = 0, # SDIV and DIV3 reset.
)
instance_name = 'rPLL'
for clk_name in ["CLKOUT", "CLKOUTP", "CLKOUTD", "CLKOUTD3"]:
self.params[f"o_{clk_name}"] = config.get(clk_name, Open()) # Clock output.
if clk_name in ["CLKOUTD", "CLKOUTD3"]: # Recopy CLKOUTx to CLKOUTDx