-Wno-COMBDLY \
-Wno-CASEINCOMPLETE \
-Wno-WIDTH \
- # --trace
+ # --trace \
# --unroll-count 256 \
# --output-split 5000 \
# --output-split-cfuncs 500 \
ext_irq : in std_ulogic;
- terminated_out : out std_logic
+ terminated_out : out std_logic;
+
+ -- for verilator debugging
+ nia_req: out std_ulogic;
+ nia: out std_ulogic_vector(63 downto 0);
+ insn: out std_ulogic_vector(31 downto 0)
);
end core;
log_data(150) <= '0';
log_data(139 downto 135) <= "00000";
+ -- snoop and report instruction being executed
+ nia <= icache_to_decode1.nia;
+ insn <= icache_to_decode1.insn;
+ nia_req <= icache_to_decode1.valid and fetch1_to_icache.sequential;
+
debug_0: entity work.core_debug
+
generic map (
LOG_LENGTH => LOG_LENGTH
)
ext_irq : in std_ulogic;
- terminated_out : out std_logic
+ terminated_out : out std_logic;
+
+ -- for verilator debugging
+ nia_req: out std_ulogic;
+ nia: out std_ulogic_vector(63 downto 0);
+ insn: out std_ulogic_vector(31 downto 0)
);
end core;
bram_addr : out std_logic_vector(log2ceil(MEMORY_SIZE) - 3- 1 downto 0);
bram_di : out std_logic_vector(63 downto 0);
bram_do : in std_logic_vector(63 downto 0);
- bram_sel : out std_logic_vector(7 downto 0)
+ bram_sel : out std_logic_vector(7 downto 0);
+
+ -- for verilator debugging
+ nia_req: out std_ulogic;
+ nia: out std_ulogic_vector(63 downto 0);
+ insn: out std_ulogic_vector(31 downto 0)
+
);
end entity toplevel;
bram_addr => bram_addr,
bram_di => bram_di,
bram_do => bram_do,
- bram_sel => bram_sel
+ bram_sel => bram_sel,
+ nia_req => nia_req,
+ nia => nia,
+ insn => insn
);
end architecture behaviour;
spi_flash_sdat_i : in std_ulogic_vector(SPI_FLASH_DLINES-1 downto 0) := (others => '1');
-- DRAM controller signals
- alt_reset : in std_ulogic := '0'
+ alt_reset : in std_ulogic := '0';
+
+ -- for verilator debugging
+ nia_req: out std_ulogic;
+ nia: out std_ulogic_vector(63 downto 0);
+ insn: out std_ulogic_vector(31 downto 0)
);
end entity soc;
dmi_wr : in std_ulogic;
dmi_ack : out std_ulogic;
ext_irq : in std_ulogic;
- terminated_out : out std_logic
+ terminated_out : out std_logic;
+ -- for verilator debugging
+ nia_req: out std_ulogic;
+ nia: out std_ulogic_vector(63 downto 0);
+ insn: out std_ulogic_vector(31 downto 0)
);
end component;
begin
dmi_wr => dmi_wr,
dmi_ack => dmi_core_ack,
dmi_req => dmi_core_req,
- ext_irq => core_ext_irq
+ ext_irq => core_ext_irq,
+ nia_req => nia_req,
+ nia => nia,
+ insn => insn
);
end generate;
dmi_wr => dmi_wr,
dmi_ack => dmi_core_ack,
dmi_req => dmi_core_req,
- ext_irq => core_ext_irq
+ ext_irq => core_ext_irq,
+ nia_req => nia_req,
+ nia => nia,
+ insn => insn
);
end generate;
+
-- Wishbone bus master arbiter & mux
wb_masters_out <= (0 => wishbone_dcore_out,
1 => wishbone_icore_out,
top->uart0_rxd = uart_rx();
#ifdef BRAM_DEBUG
+ if (top->nia_req) {
+ fprintf(dump, "pc %8x insn %8x\n", top->nia, top->insn);
+ }
if (top->bram_we) {
- fprintf(dump, "bram wr addr %08x dout %16lx sel %x ",
+ fprintf(dump, " " \
+ "wr @ %08x do %16lx sel %02x ",
top->bram_addr, top->bram_di, top->bram_sel);
ascii_dump((unsigned char*)&top->bram_di, 8, dump);
fflush(dump);
}
// read on one clock delay
if (top->bram_re) {
- fprintf(dump, "bram rd addr %08x din %16lx sel %x ",
+ fprintf(dump, " " \
+ "rd @ %08x di %16lx sel %02x ",
top->bram_addr, bram_do, top->bram_sel);
ascii_dump((unsigned char*)&bram_do, 8, dump);
fflush(dump);