efinix: don't hardcode timing model

This commit is contained in:
Gwenhael Goavec-Merou 2021-10-16 07:20:17 +02:00
parent 306bdcaed8
commit 627363906c
2 changed files with 6 additions and 2 deletions

View File

@ -160,7 +160,7 @@ def _build_peri(efinity_path, build_name, partnumber, named_sc, named_pc, fragme
# Project configuration ------------------------------------------------------------------------ # Project configuration ------------------------------------------------------------------------
def _build_xml(partnumber, build_name, sources, additional_xml_commands): def _build_xml(partnumber, timing_model, build_name, sources, additional_xml_commands):
root = et.Element('efx:project') root = et.Element('efx:project')
@ -187,7 +187,7 @@ def _build_xml(partnumber, build_name, sources, additional_xml_commands):
device_info = et.SubElement(root, 'efx:device_info') device_info = et.SubElement(root, 'efx:device_info')
et.SubElement(device_info, 'efx:family', name = 'Trion') et.SubElement(device_info, 'efx:family', name = 'Trion')
et.SubElement(device_info, 'efx:device', name = partnumber) et.SubElement(device_info, 'efx:device', name = partnumber)
et.SubElement(device_info, 'efx:timing_model', name = 'C4') et.SubElement(device_info, 'efx:timing_model', name = timing_model)
design_info = et.SubElement(root, 'efx:design_info') design_info = et.SubElement(root, 'efx:design_info')
et.SubElement(design_info, "efx:top_module", name = build_name) et.SubElement(design_info, "efx:top_module", name = build_name)
@ -292,6 +292,7 @@ class EfinityToolchain():
# Generate project file (.xml) # Generate project file (.xml)
_build_xml( _build_xml(
partnumber = platform.device, partnumber = platform.device,
timing_model = platform.timing_model,
build_name = build_name, build_name = build_name,
sources = platform.sources, sources = platform.sources,
additional_xml_commands = self.additional_xml_commands) additional_xml_commands = self.additional_xml_commands)

View File

@ -19,6 +19,9 @@ class EfinixPlatform(GenericPlatform):
def __init__(self, *args, toolchain="efinity", **kwargs): def __init__(self, *args, toolchain="efinity", **kwargs):
GenericPlatform.__init__(self, *args, **kwargs) GenericPlatform.__init__(self, *args, **kwargs)
self.timing_model = self.device[-2:]
self.device = self.device[:-2]
self.pll_available = ['PLL_TL0', 'PLL_TR0', 'PLL_TR1', 'PLL_TR2', 'PLL_TR3', 'PLL_BR0', 'PLL_BR1', 'PLL_BR2', 'PLL_BL0'] self.pll_available = ['PLL_TL0', 'PLL_TR0', 'PLL_TR1', 'PLL_TR2', 'PLL_TR3', 'PLL_BR0', 'PLL_BR1', 'PLL_BR2', 'PLL_BL0']
self.pll_used = [] self.pll_used = []