Piotro
11/15/2023, 8:44 PMTim Edwards
11/15/2023, 9:15 PMwb_rst_i
can go undefined; maybe if the external RESETB
pin became undefined, since it directly drives that signal.
You may want to check in caravel --> caravel_core --> caravel_clocking
. The wb_rst_i
comes from resetb_sync
which itself comes from resetb_async
which is derived from three individual resets porb
, resetb
, and ext_reset
. Did any of those three become undefined? (resetb
corresponds to the RESETB pin. porb
is a power-on-reset, and ext_reset
is a manual reset from the housekeeping SPI.)Piotro
11/15/2023, 9:33 PMPiotro
11/15/2023, 9:33 PMTholin
11/15/2023, 9:33 PMTholin
11/15/2023, 9:33 PMPiotro
11/15/2023, 9:34 PMTholin
11/15/2023, 9:34 PMTholin
11/15/2023, 9:34 PMdelay(4000000);
with a while(1);
, as long as the dead code is not optimized away by the compiler as a result.Piotro
11/15/2023, 9:35 PMPiotro
11/15/2023, 9:35 PMTholin
11/15/2023, 9:37 PMwhile(1);
, but that doesn't stop the processor from attempting to prefetch from that jump-to-self instruction the infinite loop compiles into. This introduces undefined states into the mgmt controller, either by directly reading them, or because 32'h00000000 is an illegal opcode in RISC-V.Tholin
11/15/2023, 9:37 PMTholin
11/15/2023, 9:38 PMTim Edwards
11/15/2023, 9:38 PMTholin
11/15/2023, 9:38 PMTim Edwards
11/15/2023, 9:38 PMPiotro
11/15/2023, 9:40 PMPiotro
11/15/2023, 9:41 PMTim Edwards
11/15/2023, 9:41 PMPiotro
11/15/2023, 9:43 PMor because 32'h00000000 is an illegal opcode in RISC-V.Would it work in that case? Maybe appending
unimp
opcode would be better?Piotro
11/15/2023, 9:44 PMTholin
11/15/2023, 9:45 PMTholin
11/15/2023, 9:45 PMTim Edwards
11/15/2023, 9:46 PMspiflash.v
line 107 and following, I think changing
// 16 MB (128Mb) Flash
reg [7:0] memory [0:16*1024*1024-1];
initial begin
$display("Memory 5 bytes = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",
memory[1048576], memory[1048577], memory[1048578],
memory[1048579], memory[1048580]);
to
// 16 MB (128Mb) Flash
reg [7:0] memory [0:16*1024*1024-1];
integer i;
initial begin
for (i=0; i < 16*1024*1024; i=i+1)
memory[i] = 0;
$display("Memory 5 bytes = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",
memory[1048576], memory[1048577], memory[1048578],
memory[1048579], memory[1048580]);
should fix the problem in a more permanent manner.Tim Edwards
11/15/2023, 9:48 PMPiotro
11/15/2023, 9:53 PMTim Edwards
11/15/2023, 10:02 PMi=i+4
followed by memory[i] = ... ; memory[i+1] = ...; ...; memory[i+3] = ...
; then I'm not entirely sure about byte order, but assuming I can just copy the first instruction from the start section, it is probably
for (i=0; i < 16*1024*1024; i=i+4) begin
memory[i] = 8'h6f;
memory[i+1] = 0;
memory[i+2] = 0;
memory[i+3] = 8'h0b;
end
But I admit this is starting to feel like stabbing around in the dark.Piotro
11/15/2023, 10:10 PMmemory[i] = 8'h13;
memory[i+1] = 0;
memory[i+2] = 0;
memory[i+3] = 8'h00;
and
memory[i] = 8'h13;
memory[i+1] = 0;
memory[i+2] = 0;
memory[i+3] = 8'h13;
Piotro
11/15/2023, 10:11 PMPiotro
11/15/2023, 10:18 PMcaravel/
spiflash.v instead of mgmt_core_wrapper
oneTim Edwards
11/15/2023, 10:21 PMPiotro
11/15/2023, 10:25 PMPiotro
11/15/2023, 10:25 PMTim Edwards
11/15/2023, 10:26 PMmgmt_core_wrapper
repository, of course. : )Piotro
11/15/2023, 10:27 PMPiotro
11/15/2023, 10:27 PMTim Edwards
11/15/2023, 11:01 PMcaravel_mgmt_soc_litex
repository and the equivalent GF repository in the hopes that nobody else will waste time trying to track down this particular non-issue.