mirror of
https://gitlab.com/brendanhaines/cpu.git
synced 2024-11-09 21:14:57 -07:00
add trailing NOP instructions so non-initialized memory doesn't cause issues
This commit is contained in:
parent
9ff977c1be
commit
07d317eb6e
|
@ -32,10 +32,10 @@ wire [31:0] mem_inst_idx = mem_inst_addr >> 2;
|
|||
wire [31:0] mem_inst_data = mem_inst_idx < MEM_LENGTH ? mem[mem_inst_idx] : INST_NOP;
|
||||
|
||||
initial begin: mem_init
|
||||
integer i;
|
||||
for (i=0; i<MEM_LENGTH; i=i+1) begin
|
||||
mem[i] = INST_NOP;
|
||||
end
|
||||
// integer i;
|
||||
// for (i=0; i<MEM_LENGTH; i=i+1) begin
|
||||
// mem[i] = INST_NOP;
|
||||
// end
|
||||
$readmemh("text.hex", mem);
|
||||
end
|
||||
|
||||
|
|
|
@ -361,6 +361,12 @@ fail:
|
|||
test_jalr:
|
||||
addi x2, x0, 0x12 # x2 = 0x12
|
||||
jalr x0, x1, 0 # return
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
|
||||
.data
|
||||
|
|
Loading…
Reference in New Issue
Block a user