Merge pull request #1125 from fjullien/efinix_add_bank_voltage

efinix: add io bank voltage configuration
This commit is contained in:
enjoy-digital 2021-12-09 14:26:33 +01:00 committed by GitHub
commit 7286f95f55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -295,9 +295,10 @@ class EfinityToolchain:
excluded_ios = self.excluded_ios
)
# DDR doesn't have Python API so we need to configure it
# Some IO blocks don't have Python API so we need to configure them
# directly in the peri.xml file
if self.ifacewriter.xml_blocks:
# We also need to configure the bank voltage here
if self.ifacewriter.xml_blocks or platform.iobank_info:
self.ifacewriter.generate_xml_blocks()
# Run

View File

@ -57,6 +57,9 @@ class InterfaceWriter:
if block["type"] == "DRAM":
self.add_dram_xml(root, block)
if self.platform.iobank_info:
self.add_iobank_info_xml(root, self.platform.iobank_info)
xml_string = et.tostring(root, "utf-8")
reparsed = expatbuilder.parseString(xml_string, False)
print_string = reparsed.toprettyxml(indent=" ")
@ -282,3 +285,10 @@ design.save()"""
load = "3"
)
def add_iobank_info_xml(self, root, iobank_info):
dev = root.find("efxpt:device_info", namespaces)
bank_info = dev.find("efxpt:iobank_info", namespaces)
for name, iostd in iobank_info:
for child in bank_info:
if name == child.get("name"):
child.set("iostd", iostd)

View File

@ -18,11 +18,12 @@ from litex.build.efinix import EfinixDbParser
class EfinixPlatform(GenericPlatform):
bitstream_ext = ".bit"
def __init__(self, *args, toolchain="efinity", **kwargs):
def __init__(self, *args, iobank_info=None, toolchain="efinity", **kwargs):
GenericPlatform.__init__(self, *args, **kwargs)
self.timing_model = self.device[-2:]
self.device = self.device[:-2]
self.iobank_info = iobank_info
if os.getenv("LITEX_ENV_EFINITY", False) == False:
msg = "Unable to find or source Efinity toolchain, please either:\n"