mirror of
https://gitlab.com/brendanhaines/cpu.git
synced 2024-12-26 11:06:50 -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;
|
wire [31:0] mem_inst_data = mem_inst_idx < MEM_LENGTH ? mem[mem_inst_idx] : INST_NOP;
|
||||||
|
|
||||||
initial begin: mem_init
|
initial begin: mem_init
|
||||||
integer i;
|
// integer i;
|
||||||
for (i=0; i<MEM_LENGTH; i=i+1) begin
|
// for (i=0; i<MEM_LENGTH; i=i+1) begin
|
||||||
mem[i] = INST_NOP;
|
// mem[i] = INST_NOP;
|
||||||
end
|
// end
|
||||||
$readmemh("text.hex", mem);
|
$readmemh("text.hex", mem);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -361,6 +361,12 @@ fail:
|
||||||
test_jalr:
|
test_jalr:
|
||||||
addi x2, x0, 0x12 # x2 = 0x12
|
addi x2, x0, 0x12 # x2 = 0x12
|
||||||
jalr x0, x1, 0 # return
|
jalr x0, x1, 0 # return
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
Loading…
Reference in New Issue
Block a user