efinix: get family name from device name

This commit is contained in:
Franck Jullien 2021-12-13 14:36:54 +01:00
parent f37188c358
commit 148d124d03
2 changed files with 9 additions and 7 deletions

View File

@ -242,8 +242,6 @@ class EfinityToolchain:
run = True, run = True,
**kwargs): **kwargs):
family = "Trion" # FIXME: Add Titanium support.
self.ifacewriter.set_build_params(platform, build_name) self.ifacewriter.set_build_params(platform, build_name)
# Create Build Directory. # Create Build Directory.
@ -283,7 +281,7 @@ class EfinityToolchain:
# Generate project file (.xml) # Generate project file (.xml)
_build_xml( _build_xml(
family = family, family = platform.family,
device = platform.device, device = platform.device,
timing_model = platform.timing_model, timing_model = platform.timing_model,
build_name = build_name, build_name = build_name,
@ -318,7 +316,7 @@ class EfinityToolchain:
"--write-efx-verilog", f"outflow/{build_name}.map.v", "--write-efx-verilog", f"outflow/{build_name}.map.v",
"--write-premap-module", f"outflow/{build_name}.elab.vdb", "--write-premap-module", f"outflow/{build_name}.elab.vdb",
"--binary-db", f"{build_name}.vdb", "--binary-db", f"{build_name}.vdb",
"--family", family, "--family", platform.family,
"--device", platform.device, "--device", platform.device,
"--mode", "speed", "--mode", "speed",
"--max_ram", "-1", "--max_ram", "-1",
@ -345,7 +343,7 @@ class EfinityToolchain:
r = tools.subprocess_call_filtered([self.efinity_path + "/bin/python3", r = tools.subprocess_call_filtered([self.efinity_path + "/bin/python3",
self.efinity_path + "/scripts/efx_run_pt.py", self.efinity_path + "/scripts/efx_run_pt.py",
f"{build_name}", f"{build_name}",
family, platform.family,
platform.device platform.device
], common.colors) ], common.colors)
if r != 0: if r != 0:
@ -353,7 +351,7 @@ class EfinityToolchain:
r = tools.subprocess_call_filtered([self.efinity_path + "/bin/efx_pnr", r = tools.subprocess_call_filtered([self.efinity_path + "/bin/efx_pnr",
"--circuit", f"{build_name}", "--circuit", f"{build_name}",
"--family", family, "--family", platform.family,
"--device", platform.device, "--device", platform.device,
"--operating_conditions", platform.timing_model, "--operating_conditions", platform.timing_model,
"--pack", "--pack",
@ -379,7 +377,7 @@ class EfinityToolchain:
"--source", f"work_pnr/{build_name}.lbf", "--source", f"work_pnr/{build_name}.lbf",
"--dest", f"{build_name}.hex", "--dest", f"{build_name}.hex",
"--device", platform.device, "--device", platform.device,
"--family", family, "--family", platform.family,
"--periph", f"outflow/{build_name}.lpf", "--periph", f"outflow/{build_name}.lpf",
"--oscillator_clock_divider", "DIV8", "--oscillator_clock_divider", "DIV8",
"--spi_low_power_mode", "off", "--spi_low_power_mode", "off",

View File

@ -24,6 +24,10 @@ class EfinixPlatform(GenericPlatform):
self.timing_model = self.device[-2:] self.timing_model = self.device[-2:]
self.device = self.device[:-2] self.device = self.device[:-2]
self.iobank_info = iobank_info self.iobank_info = iobank_info
if self.device[:2] == "Ti":
self.family = "Titanium"
else:
self.family = "Trion"
if os.getenv("LITEX_ENV_EFINITY", False) == False: if os.getenv("LITEX_ENV_EFINITY", False) == False:
msg = "Unable to find or source Efinity toolchain, please either:\n" msg = "Unable to find or source Efinity toolchain, please either:\n"