From: Luke Kenneth Casson Leighton Date: Fri, 7 Jan 2022 00:41:46 +0000 (+0000) Subject: add MSR to verilator output debug reporting X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0500e35f4e596f9fc823916756648b0246a92cfd;p=microwatt.git add MSR to verilator output debug reporting --- diff --git a/core.vhdl b/core.vhdl index b33086b..f5638c8 100644 --- a/core.vhdl +++ b/core.vhdl @@ -45,6 +45,7 @@ entity core is -- for verilator debugging nia_req: out std_ulogic; nia: out std_ulogic_vector(63 downto 0); + msr_o: out std_ulogic_vector(63 downto 0); insn: out std_ulogic_vector(31 downto 0) ); end core; @@ -442,6 +443,7 @@ begin -- snoop and report instruction being executed nia <= icache_to_decode1.nia; + msr_o <= msr; insn <= icache_to_decode1.insn; nia_req <= icache_to_decode1.valid and fetch1_to_icache.sequential; diff --git a/fpga/top-generic.vhdl b/fpga/top-generic.vhdl index 4524a36..32bdfce 100644 --- a/fpga/top-generic.vhdl +++ b/fpga/top-generic.vhdl @@ -41,6 +41,7 @@ entity toplevel is -- for verilator debugging nia_req: out std_ulogic; nia: out std_ulogic_vector(63 downto 0); + msr_o: out std_ulogic_vector(63 downto 0); insn: out std_ulogic_vector(31 downto 0) ); @@ -113,6 +114,7 @@ begin bram_sel => bram_sel, nia_req => nia_req, nia => nia, + msr_o => msr_o, insn => insn ); diff --git a/soc.vhdl b/soc.vhdl index 8440f54..2212247 100644 --- a/soc.vhdl +++ b/soc.vhdl @@ -122,6 +122,7 @@ entity soc is -- for verilator debugging nia_req: out std_ulogic; nia: out std_ulogic_vector(63 downto 0); + msr_o: out std_ulogic_vector(63 downto 0); insn: out std_ulogic_vector(31 downto 0) ); end entity soc; @@ -275,6 +276,7 @@ architecture behaviour of soc is terminated_out : out std_logic; -- for verilator debugging nia_req: out std_ulogic; + msr_o: out std_ulogic_vector(63 downto 0); nia: out std_ulogic_vector(63 downto 0); insn: out std_ulogic_vector(31 downto 0) ); @@ -325,6 +327,7 @@ begin ext_irq => core_ext_irq, nia_req => nia_req, nia => nia, + msr_o => msr_o, insn => insn ); end generate; @@ -348,6 +351,7 @@ begin ext_irq => core_ext_irq, nia_req => nia_req, nia => nia, + msr_o => msr_o, insn => insn ); end generate; diff --git a/verilator/microwatt-verilator.cpp b/verilator/microwatt-verilator.cpp index a409c6e..b75eb52 100644 --- a/verilator/microwatt-verilator.cpp +++ b/verilator/microwatt-verilator.cpp @@ -197,7 +197,8 @@ int main(int argc, char **argv) #ifdef BRAM_DEBUG if (top->nia_req) { - fprintf(dump, "pc %8x insn %8x\n", top->nia, top->insn); + fprintf(dump, "pc %8x insn %8x msr %16lx\n", + top->nia, top->insn, top->msr_o); } if (top->bram_we) { fprintf(dump, " " \