soc/cores/cpu: add reset signal

This commit is contained in:
Florent Kermarrec 2018-08-06 12:19:23 +02:00
parent 380f8b96dd
commit c0989f65dd
3 changed files with 6 additions and 3 deletions

View File

@ -7,6 +7,7 @@ from litex.soc.interconnect import wishbone
class LM32(Module): class LM32(Module):
def __init__(self, platform, eba_reset, variant=None): def __init__(self, platform, eba_reset, variant=None):
self.reset = Signal()
assert variant == None, "No lm32 variants currently supported." assert variant == None, "No lm32 variants currently supported."
self.ibus = i = wishbone.Interface() self.ibus = i = wishbone.Interface()
self.dbus = d = wishbone.Interface() self.dbus = d = wishbone.Interface()
@ -20,7 +21,7 @@ class LM32(Module):
p_eba_reset=Instance.PreformattedParam("32'h{:08x}".format(eba_reset)), p_eba_reset=Instance.PreformattedParam("32'h{:08x}".format(eba_reset)),
i_clk_i=ClockSignal(), i_clk_i=ClockSignal(),
i_rst_i=ResetSignal(), i_rst_i=ResetSignal() | self.reset,
i_interrupt=self.interrupt, i_interrupt=self.interrupt,

View File

@ -8,6 +8,7 @@ from litex.soc.interconnect import wishbone
class MOR1KX(Module): class MOR1KX(Module):
def __init__(self, platform, reset_pc, variant=None): def __init__(self, platform, reset_pc, variant=None):
assert variant in (None, "linux"), "Unsupported variant %s" % variant assert variant in (None, "linux"), "Unsupported variant %s" % variant
self.reset = Signal()
self.ibus = i = wishbone.Interface() self.ibus = i = wishbone.Interface()
self.dbus = d = wishbone.Interface() self.dbus = d = wishbone.Interface()
self.interrupt = Signal(32) self.interrupt = Signal(32)
@ -69,7 +70,7 @@ class MOR1KX(Module):
**cpu_args, **cpu_args,
i_clk=ClockSignal(), i_clk=ClockSignal(),
i_rst=ResetSignal(), i_rst=ResetSignal() | self.reset,
i_irq_i=self.interrupt, i_irq_i=self.interrupt,

View File

@ -8,6 +8,7 @@ from litex.soc.interconnect.csr import AutoCSR, CSRStatus, CSRStorage
class VexRiscv(Module, AutoCSR): class VexRiscv(Module, AutoCSR):
def __init__(self, platform, cpu_reset_address, variant=None): def __init__(self, platform, cpu_reset_address, variant=None):
assert variant in (None, "debug"), "Unsupported variant %s" % variant assert variant in (None, "debug"), "Unsupported variant %s" % variant
self.reset = Signal()
self.ibus = i = wishbone.Interface() self.ibus = i = wishbone.Interface()
self.dbus = d = wishbone.Interface() self.dbus = d = wishbone.Interface()
i_err = Signal() i_err = Signal()
@ -113,7 +114,7 @@ class VexRiscv(Module, AutoCSR):
**cpu_args, **cpu_args,
i_clk=ClockSignal(), i_clk=ClockSignal(),
i_reset=cpu_reset, i_reset=cpu_reset | self.reset,
i_externalResetVector=cpu_reset_address, i_externalResetVector=cpu_reset_address,
i_externalInterruptArray=self.interrupt, i_externalInterruptArray=self.interrupt,