Merge pull request #1962 from VOGL-electronic/master
Add support for the Efinix reconfiguration interface
This commit is contained in:
commit
aa9ad61674
|
@ -602,6 +602,31 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True)
|
|||
|
||||
return '\n'.join(cmd) + '\n'
|
||||
|
||||
def generate_remote_update(self, block, verbose=True):
|
||||
name = block["name"]
|
||||
pins = block["pins"]
|
||||
clock = block["clock"]
|
||||
invert_clk = block["invert_clock"]
|
||||
enable = block["enable"]
|
||||
|
||||
def get_pin_name(pin):
|
||||
return pin.backtrace[-1][0]
|
||||
|
||||
cmds = []
|
||||
cmds.append(f"# ---------- REMOTE UPDATE ---------")
|
||||
cmds.append(f'design.set_device_property("ru", "RECONFIG_EN", "{enable}", "RU")')
|
||||
if enable:
|
||||
cmds.append(f'design.set_device_property("ru", "CBSEL_PIN", "{get_pin_name(pins.CBSEL)}", "RU")')
|
||||
cmds.append(f'design.set_device_property("ru", "CLK_PIN", "{clock}", "RU")')
|
||||
cmds.append(f'design.set_device_property("ru", "CONFIG_PIN", "{get_pin_name(pins.CONFIG)}", "RU")')
|
||||
cmds.append(f'design.set_device_property("ru", "ENA_PIN", "{get_pin_name(pins.ENA)}", "RU")')
|
||||
cmds.append(f'design.set_device_property("ru", "ERROR_PIN", "{get_pin_name(pins.ERROR)}", "RU")')
|
||||
if hasattr(pins, 'IN_USER'):
|
||||
cmds.append(f'design.set_device_property("ru", "IN_USER_PIN", "{get_pin_name(pins.IN_USER)}", "RU")')
|
||||
cmds.append(f'design.set_device_property("ru", "INVERT_CLK_EN", "{invert_clk}", "RU")')
|
||||
cmds.append(f"# ---------- END REMOTE UPDATE ---------\n")
|
||||
return "\n".join(cmds)
|
||||
|
||||
def generate(self, partnumber):
|
||||
output = ""
|
||||
for block in self.blocks:
|
||||
|
@ -624,6 +649,8 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True)
|
|||
output += self.generate_jtag(block)
|
||||
if block["type"] == "SPI_FLASH":
|
||||
output += self.generate_spiflash(block)
|
||||
if block["type"] == "REMOTE_UPDATE":
|
||||
output += self.generate_remote_update(block)
|
||||
return output
|
||||
|
||||
def footer(self):
|
||||
|
|
Loading…
Reference in New Issue