diff --git a/litex/build/efinix/efinity.py b/litex/build/efinix/efinity.py index 04f6df610..2e0b79963 100644 --- a/litex/build/efinix/efinity.py +++ b/litex/build/efinix/efinity.py @@ -361,8 +361,19 @@ class EfinityToolchain(GenericToolchain): "--io_weak_pullup", "on", "--enable_roms", "on", "--mode", self.platform.spi_mode, - "--width", "1", + "--width", self.platform.spi_width, "--enable_crc_check", "on" ], common.colors) if r != 0: raise OSError("Error occurred during efx_pgm execution.") + + # BINARY + os.environ['EFXPGM_HOME'] = self.efinity_path + "/pgm" + r = tools.subprocess_call_filtered([self.efinity_path + "/bin/python3", + self.efinity_path + "/pgm/bin/efx_pgm/export_bitstream.py", + "hex_to_bin", + f"{self._build_name}.hex", + f"{self._build_name}.bin" + ], common.colors) + if r != 0: + raise OSError("Error occurred during export_bitstream execution.") diff --git a/litex/build/efinix/platform.py b/litex/build/efinix/platform.py index 1dc76fb90..52d1fc4cc 100644 --- a/litex/build/efinix/platform.py +++ b/litex/build/efinix/platform.py @@ -23,13 +23,14 @@ class EfinixPlatform(GenericPlatform): _supported_toolchains = ["efinity"] - def __init__(self, *args, iobank_info=None, toolchain="efinity", spi_mode="active", **kwargs): + def __init__(self, *args, iobank_info=None, toolchain="efinity", spi_mode="active", spi_width="1", **kwargs): GenericPlatform.__init__(self, *args, **kwargs) self.timing_model = self.device[-2:] self.device = self.device[:-2] self.iobank_info = iobank_info self.spi_mode = spi_mode + self.spi_width = spi_width if self.device[:2] == "Ti": self.family = "Titanium" else: