Closed XIVN1987 closed 5 years ago
I opened 'DEBUGASM' debug option, and then notice that the ready_o signal of memory rised before rdata_o signal, so picorv32 fetched wrong instruction data for address 0
I have fixed this problem, so picorv32 can get right instruction data for address 0, but the instruction at address 0 excutes two times:
------ reset = 1
------ reset = 0
ST_RD: 2 0x00004000
-- 70000
LD_RS1: 2 0x00004000
DECODE: 0x00000000 0x1101 addi
debugasm 00000000 00001101 addi
ST_RD: 2 0x00003fe0
-- 100000
debugasm 00000002 0000ce06 sw
DECODE: 0x00000002 0xce06 sw
LD_RS1: 2 0x00003fe0
LD_RS2: 1 0xxxxxxxxx
-- 150000
LD_RS1: 2 0x00003fe0
DECODE: 0x00000004 0x1101 addi
debugasm 00000004 00001101 addi
ST_RD: 2 0x00003fc0
-- 180000
debugasm 00000006 0000ce06 sw
DECODE: 0x00000006 0xce06 sw
LD_RS1: 2 0x00003fc0
LD_RS2: 1 0xxxxxxxxx
-- 230000
LD_RS1: 2 0x00003fc0
LD_RS2: 8 0xxxxxxxxx
DECODE: 0x00000008 0xcc22 sw
debugasm 00000008 0000cc22 sw
-- 280000
debugasm 0000000a 00001000 addi
DECODE: 0x0000000a 0x1000 addi
LD_RS1: 2 0x00003fc0
ST_RD: 8 0x00003fe0
-- 310000
DECODE: 0x0000000c 0x6789 lui
debugasm 0000000c 00006789 lui
ST_RD: 15 0x00002000
-- 350000
LD_RS1: 15 0x00002000
DECODE: 0x0000000e 0xfd478793 addi
debugasm 0000000e fd478793 addi
ST_RD: 15 0x00001fd4
-- 390000
LD_RS1: 8 0x00003fe0
LD_RS2: 15 0x00001fd4
DECODE: 0x00000012 0xfef42623 sw
debugasm 00000012 fef42623 sw
-- 440000
debugasm 00000016 0000a811 jal
DECODE: 0x00000016 0xa811 jal
ST_RD: 0 0x00000018, BRANCH 0x0000002a
-- 470000
LD_RS1: 0 0x00000000
LD_RS2: 0 0x00000000
DECODE: 0x0000002a 0xfec4 UNKNOWN
Since you do not provide sufficient information to reproduce what you are seeing there is nothing I can do to help.
@cliffordwolf
go to RISCV-pico/sim folder and excute make, then you can reproduce my problem.
thanks a lot.
I found the problem, my mistake.
I set the memory ready_o signal always high, so picorv32 fetched wrong instruction.
my c code:
compiled by riscv-none-embed-gcc, and generate disassembly code:
iverilog debug message:
there is two error:
thanks a lot