Skip to content

Commit ff5accd

Browse files
authored
Merge pull request #239 from RISC-KC/develop
[Feat] Revised Data Memory, Instruction Memory, Byte Enable logic, Top module to solve z-x signals in waveform
2 parents c133f12 + ef207a0 commit ff5accd

8 files changed

Lines changed: 67262 additions & 65025 deletions

File tree

modules/Byte_Enable_Logic.v

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ module ByteEnableLogic (
117117
register_file_write_data = 32'b0;
118118
data_memory_write_data = 32'b0;
119119
write_mask = 4'b0;
120+
byte_sel = 8'b0;
121+
half_sel = 16'b0;
120122
end
121123
end
122124

modules/Data_Memory.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module DataMemory (
2626
for (i=0; i<1024; i=i+1) begin
2727
memory[i] = 32'b0;
2828
end // $readmemh("./data_init.mem", memory, 13'h1424);
29+
new_word = 32'b0;
2930
end
3031

3132
always @(*) begin

modules/Instruction_Memory.v

Lines changed: 121 additions & 107 deletions
Large diffs are not rendered by default.

modules/RV32I46F_5SP_MMIO.v

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ module RV32I46F5SPMMIO #(
5858
wire [XLEN-1:0] IF_imm;
5959
wire [6:0] IF_opcode;
6060

61+
// ROM bypass signals (MEM stage instruction memory access)
62+
wire [31:0] rom_address;
63+
wire [31:0] rom_read_data;
64+
6165
assign IF_imm = {{20{instruction[31]}}, instruction[7], instruction[30:25], instruction[11:8], 1'b0};
6266
assign IF_opcode = (instruction[6:0]);
6367

@@ -348,6 +352,8 @@ module RV32I46F5SPMMIO #(
348352
.address(MEM_alu_result),
349353
.write_data(data_memory_write_data),
350354
.write_mask(write_mask),
355+
.rom_read_data(rom_read_data),
356+
.rom_address(rom_address),
351357

352358
.read_data(data_memory_read_data)
353359
);
@@ -474,7 +480,9 @@ module RV32I46F5SPMMIO #(
474480

475481
InstructionMemory instruction_memory (
476482
.pc(pc),
477-
.instruction(im_instruction)
483+
.instruction(im_instruction),
484+
.rom_address(rom_address),
485+
.rom_read_data(rom_read_data)
478486
);
479487

480488
MMIO_Interface mmio_interface (

testbenches/results/Data_Memory_result.vvp

Lines changed: 1483 additions & 1481 deletions
Large diffs are not rendered by default.

testbenches/results/RV32I46F_5SP_MMIO_result.vvp

Lines changed: 9504 additions & 8721 deletions
Large diffs are not rendered by default.

testbenches/results/waveforms/Data_Memory_tb_result.vcd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$date
2-
Sat Dec 13 20:29:33 2025
2+
Wed Dec 24 12:20:00 2025
33
$end
44
$version
55
Icarus Verilog
@@ -33,7 +33,7 @@ $end
3333
$dumpvars
3434
b10000000000 .
3535
b10010001101000101011001111000 -
36-
bx ,
36+
b0 ,
3737
b0 +
3838
0*
3939
b1 )

0 commit comments

Comments
 (0)