Merge pull request #2128 from VOGL-electronic/efinix-seu

Add efinix SEU interface
This commit is contained in:
enjoy-digital 2024-12-04 09:16:12 +01:00 committed by GitHub
commit bff25c2d61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 28 additions and 0 deletions

View File

@ -629,6 +629,32 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True)
cmds.append(f"# ---------- END REMOTE UPDATE ---------\n") cmds.append(f"# ---------- END REMOTE UPDATE ---------\n")
return "\n".join(cmds) return "\n".join(cmds)
def generate_seu(self, block, verbose=True):
name = block["name"]
pins = block["pins"]
enable = block["enable"]
mode = block["mode"].upper()
def get_pin_name(pin):
return pin.backtrace[-1][0]
cmds = []
cmds.append(f"# ---------- SINGLE-EVENT UPSET ---------")
cmds.append(f'design.set_device_property("seu", "ENA_DETECT", "{enable}", "SEU")')
if enable:
cmds.append(f'design.set_device_property("seu", "CONFIG_PIN", "{get_pin_name(pins.CONFIG)}", "SEU")')
cmds.append(f'design.set_device_property("seu", "DONE_PIN", "{get_pin_name(pins.DONE)}", "SEU")')
cmds.append(f'design.set_device_property("seu", "ERROR_PIN", "{get_pin_name(pins.ERROR)}", "SEU")')
cmds.append(f'design.set_device_property("seu", "INJECT_ERROR_PIN", "{get_pin_name(pins.INJECT_ERROR)}", "SEU")')
cmds.append(f'design.set_device_property("seu", "RST_PIN", "{get_pin_name(pins.RST)}", "SEU")')
if mode == "MANUAL":
cmds.append(f'design.set_device_property("seu", "START_PIN", "{get_pin_name(pins.START)}", "SEU")')
cmds.append(f'design.set_device_property("seu", "MODE", "{mode}", "SEU")')
if mode == "AUTO" and hasattr(block, "wait_interval"):
cmds.append(f'design.set_device_property("seu", "WAIT_INTERVAL", "{block["wait_interval"]}", "SEU")')
cmds.append(f"# ---------- END SINGLE-EVENT UPSET ---------\n")
return "\n".join(cmds)
def generate(self, partnumber): def generate(self, partnumber):
output = "" output = ""
for block in self.blocks: for block in self.blocks:
@ -653,6 +679,8 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True)
output += self.generate_spiflash(block) output += self.generate_spiflash(block)
if block["type"] == "REMOTE_UPDATE": if block["type"] == "REMOTE_UPDATE":
output += self.generate_remote_update(block) output += self.generate_remote_update(block)
if block["type"] == "SEU":
output += self.generate_seu(block)
return output return output
def footer(self): def footer(self):