YosysHQ / picorv32

PicoRV32 - A Size-Optimized RISC-V CPU
ISC License
3.08k stars 748 forks source link

JAL instruction not working as expected #245

Open mnasser431998 opened 1 year ago

mnasser431998 commented 1 year ago

Hello Everyone,

I wish you all happiness and good health.

I was executing some assembly instructions on the picoRV32 and when I called the main function using the JAL instruction, it skipped an instruction.

  74:   00000f13            li  t5,0
  78:   00000f93            li  t6,0
  7c:   40000113            li  sp,1024
  80:   008000ef            jal ra,88 <main>
  84:   00100073            ebreak

00000088 <main>:
  88:   400007b7            lui a5,0x40000   <----------- should start executing from here
  8c:   01b00713            li  a4,27             <---------- However, it started from here
  90:   00e7a023            sw  a4,0(a5) # 40000000 <MEM_SIZE+0x3ffffc00>
  94:   00000793            li  a5,0
  98:   0180006f            j   b0 <main+0x28>

image v_files_hex_files.zip firmware.zip