self.add_config("CSR_DATA_WIDTH", self.csr.data_width)
self.add_config("CSR_ALIGNMENT", self.csr.alignment)
- def add_cpu(self, name="vexriscv", variant="standard", reset_address=None):
+ def add_cpu(self, name="vexriscv", variant="standard", cls=None, reset_address=None):
if name not in cpu.CPUS.keys():
self.logger.error("{} CPU {}, supporteds: {}".format(
colorer(name),
colorer(", ".join(cpu.CPUS.keys()))))
raise
# Add CPU
- self.submodules.cpu = cpu.CPUS[name](self.platform, variant)
+ cpu_cls = cls if cls is not None else cpu.CPUS[name]
+ self.submodules.cpu = cpu_cls(self.platform, variant)
# Update SoC with CPU constraints
for n, (origin, size) in enumerate(self.cpu.io_regions.items()):
self.bus.add_region("io{}".format(n), SoCIORegion(origin=origin, size=size, cached=False))
cpu_type = "vexriscv",
cpu_reset_address = None,
cpu_variant = None,
+ cpu_cls = None,
# ROM parameters
integrated_rom_size = 0,
integrated_rom_init = [],
self.cpu_type = cpu_type
self.cpu_variant = cpu_variant
+ self.cpu_cls = cpu_cls
self.integrated_rom_size = integrated_rom_size
self.integrated_rom_initialized = integrated_rom_init != []
self.add_cpu(
name = str(cpu_type),
variant = "standard" if cpu_variant is None else cpu_variant,
+ cls = cpu_cls,
reset_address = None if integrated_rom_size else cpu_reset_address)
# Add User's interrupts