--- /dev/null
+from nmutil.iocontrol import RecordObject
+from nmigen import Signal
+
+
+class CoreState(RecordObject):
+ def __init__(self, name):
+ super().__init__(name=name)
+ self.pc = Signal(64) # Program Counter (CIA, NIA)
+ self.msr = Signal(64) # Machine Status Register (MSR)
from nmutil.iocontrol import RecordObject
from nmigen.utils import log2_int
from nmigen.cli import rtlil
+from soc.config.state import CoreState
# DMI register addresses
# Core status inputs
self.terminate_i = Signal()
self.core_stopped_i = Signal()
- self.nia = Signal(64)
- self.msr = Signal(64)
+ self.state = CoreState("core_dbg")
# GSPR register read port
self.dbg_gpr = DbgReg("dbg_gpr")
with m.Case( DBGCore.STAT):
comb += self.dmi.dout.eq(stat_reg)
with m.Case( DBGCore.NIA):
- comb += self.dmi.dout.eq(self.nia)
+ comb += self.dmi.dout.eq(self.state.pc)
with m.Case( DBGCore.MSR):
- comb += self.dmi.dout.eq(self.msr)
+ comb += self.dmi.dout.eq(self.state.msr)
with m.Case( DBGCore.GSPR_DATA):
comb += self.dmi.dout.eq(self.dbg_gpr.data_i)
with m.Case( DBGCore.LOG_ADDR):
yield self.icache_rst_o
yield self.terminate_i
yield self.core_stopped_i
- yield self.nia
- yield self.msr
+ yield from self.state
yield from self.dbg_gpr
yield self.log_data_i
yield self.log_read_addr_i
# TODO comb += core.reset_i.eq(dbg.core_rst_o)
# TODO comb += core.icache_rst_i.eq(dbg.icache_rst_o)
comb += dbg.terminate_i.eq(core.core_terminate_o)
+ comb += dbg.state.pc.eq(cur_pc)
+ comb += dbg.state.msr.eq(cur_msr)
# temporaries
core_busy_o = core.busy_o # core is busy