def reserved_interrupts(self):
return {}
- def __init__(self, platform, eba_reset, variant="standard"):
+ def __init__(self, platform, variant="standard"):
assert variant in CPU_VARIANTS, "Unsupported variant %s" % variant
self.platform = platform
self.variant = variant
i_adr_o = Signal(32)
d_adr_o = Signal(32)
self.cpu_params = dict(
- p_eba_reset=Instance.PreformattedParam("32'h{:08x}".format(eba_reset)),
-
i_clk_i=ClockSignal(),
i_rst_i=ResetSignal() | self.reset,
# add verilog sources
self.add_sources(platform, variant)
+ def set_reset_address(self, reset_address):
+ assert not hasattr(self, "reset_address")
+ self.reset_address = reset_address
+ self.cpu_params.update(
+ p_eba_reset=Instance.PreformattedParam("32'h{:08x}".format(reset_address))
+ )
+
@staticmethod
def add_sources(platform, variant):
vdir = os.path.join(
raise TypeError("Unknown variant {}".format(variant))
def do_finalize(self):
+ assert hasattr(self, "reset_address")
self.specials += Instance("lm32_cpu", **self.cpu_params)
def reserved_interrupts(self):
return {}
- def __init__(self, platform, cpu_reset_address, variant="standard"):
+ def __init__(self, platform, variant="standard"):
assert variant is "standard", "Unsupported variant %s" % variant
self.platform = platform
self.variant = variant
# add verilog sources
self.add_sources(platform)
+ def set_reset_address(self, reset_address):
+ assert not hasattr(self, "reset_address")
+ self.reset_address = reset_address
+ assert reset_address == 0x00000000, "cpu_reset_addr hardcoded during elaboration!"
+
@staticmethod
def add_sources(platform):
vdir = os.path.join(
platform.add_source(os.path.join(vdir, "minerva.v"))
def do_finalize(self):
+ assert hasattr(self, "reset_address")
self.specials += Instance("minerva_cpu", **self.cpu_params)
def reserved_interrupts(self):
return {"nmi": 0}
- def __init__(self, platform, reset_pc, variant="standard"):
+ def __init__(self, platform, variant="standard"):
assert variant in CPU_VARIANTS, "Unsupported variant %s" % variant
self.platform = platform
self.variant = variant
p_FEATURE_CMOV="ENABLED",
p_FEATURE_FFL1="ENABLED",
p_OPTION_CPU0="CAPPUCCINO",
- p_OPTION_RESET_PC=reset_pc,
p_IBUS_WB_TYPE="B3_REGISTERED_FEEDBACK",
p_DBUS_WB_TYPE="B3_REGISTERED_FEEDBACK",
)
# add verilog sources
self.add_sources(platform)
+ def set_reset_address(self, reset_address):
+ assert not hasattr(self, "reset_address")
+ self.reset_address = reset_address
+ self.cpu_params.update(p_OPTION_RESET_PC=reset_address)
+
@staticmethod
def add_sources(platform):
vdir = os.path.join(
platform.add_verilog_include_path(vdir)
def do_finalize(self):
+ assert hasattr(self, "reset_address")
self.specials += Instance("mor1kx", **self.cpu_params)
"bus_error": 2
}
- def __init__(self, platform, progaddr_reset, variant="standard"):
+ def __init__(self, platform, variant="standard"):
assert variant in CPU_VARIANTS, "Unsupported variant %s" % variant
self.platform = platform
self.variant = variant
p_ENABLE_TRACE=0,
p_MASKED_IRQ=0x00000000,
p_LATCHED_IRQ=0xffffffff,
- p_PROGADDR_RESET=progaddr_reset,
- p_PROGADDR_IRQ=progaddr_reset + 0x00000010,
p_STACKADDR=0xffffffff
)
# add verilog sources
self.add_sources(platform)
+ def set_reset_address(self, reset_address):
+ assert not hasattr(self, "reset_address")
+ self.reset_address = reset_address
+ self.cpu_params.update(
+ p_PROGADDR_RESET=reset_address,
+ p_PROGADDR_IRQ=reset_address + 0x00000010
+ )
+
@staticmethod
def add_sources(platform):
vdir = os.path.join(
platform.add_source(os.path.join(vdir, "picorv32.v"))
def do_finalize(self):
+ assert hasattr(self, "reset_address")
self.specials += Instance("picorv32", **self.cpu_params)
def reserved_interrupts(self):
return {}
- def __init__(self, platform, cpu_reset_addr, variant="standard"):
+ def __init__(self, platform, variant="standard"):
assert variant in CPU_VARIANTS, "Unsupported variant %s" % variant
- assert cpu_reset_addr == 0x10000000, "cpu_reset_addr hardcoded in Chisel elaboration!"
+
self.platform = platform
self.variant = variant
# add verilog sources
self.add_sources(platform, variant)
+ def set_reset_address(self, reset_address):
+ assert not hasattr(self, "reset_address")
+ self.reset_address = reset_address
+ assert reset_address == 0x10000000, "cpu_reset_addr hardcoded in during elaboration!"
+
@staticmethod
def add_sources(platform, variant="standard"):
vdir = os.path.join(
)
def do_finalize(self):
+ assert hasattr(self, "reset_address")
self.specials += Instance("ExampleRocketSystem", **self.cpu_params)
def reserved_interrupts(self):
return {}
- def __init__(self, platform, cpu_reset_address, variant="standard"):
+ def __init__(self, platform, variant="standard"):
assert variant is "standard", "Unsupported variant %s" % variant
self.platform = platform
self.variant = variant
# # #
self.cpu_params -= dict(
- p_RESET_PC=cpu_reset_address,
-
# clock / reset
i_clk = ClockSignal(),
i_i_rst = ResetSignal(),
# add verilog sources
self.add_sources(platform)
+ def set_reset_address(self, reset_address):
+ assert not hasattr(self, "reset_address")
+ self.reset_address = reset_address
+ self.cpu_params.update(p_RESET_PC=reset_address)
+
@staticmethod
def add_sources(platform):
vdir = os.path.join(
platform.add_verilog_include_path(vdir)
def do_finalize(self):
+ assert hasattr(self, "reset_address")
self.specials += Instance("serv_top", **self.cpu_params)
def reserved_interrupts(self):
return {}
- def __init__(self, platform, cpu_reset_address, variant="standard"):
+ def __init__(self, platform, variant="standard"):
assert variant in CPU_VARIANTS, "Unsupported variant %s" % variant
self.platform = platform
self.variant = variant
self.reset = Signal()
self.ibus = ibus = wishbone.Interface()
self.dbus = dbus = wishbone.Interface()
- self.cpu_reset_address = cpu_reset_address
self.interrupt = Signal(32)
i_clk=ClockSignal(),
i_reset=ResetSignal() | self.reset,
- i_externalResetVector=self.cpu_reset_address,
i_externalInterruptArray=self.interrupt,
i_timerInterrupt=0,
i_softwareInterrupt=0,
o_debug_resetOut=self.o_resetOut
)
+ def set_reset_address(self, reset_address):
+ assert not hasattr(self, "reset_address")
+ self.reset_address = reset_address
+ self.cpu_params.update(i_externalResetVector=reset_address)
+
def add_timer(self):
self.submodules.timer = VexRiscvTimer()
self.cpu_params.update(i_timerInterrupt=self.timer.interrupt)
self.platform.add_source(variant_filename)
def do_finalize(self):
+ assert hasattr(self, "reset_address")
if not self.external_variant:
self.add_sources(self.platform, self.variant)
self.specials += Instance("VexRiscv", **self.cpu_params)
# CPU selection / instance
if cpu_type not in cpu.CPUS.keys():
raise ValueError("Unsupported CPU type: {}".format(cpu_type))
- self.add_cpu(cpu.CPUS[cpu_type](platform, self.cpu_reset_address, self.cpu_variant))
+ self.add_cpu(cpu.CPUS[cpu_type](platform, self.cpu_variant))
+ self.cpu.set_reset_address(cpu_reset_address)
# Add Instruction/Data buses as Wisbone masters
self.add_wb_master(self.cpu.ibus)