Add mapped address output and test

This commit is contained in:
Byron Lathi
2023-10-18 08:54:23 -07:00
parent 35d4ea968e
commit 69e443d223
2 changed files with 21 additions and 0 deletions

View File

@@ -13,12 +13,20 @@ logic [15:0] mm [16];
logic [31:0] we;
// TODO These have basically the same name.
logic [15:0] mm_sel;
logic [15:0] selected_mm;
always_comb begin
we = (i_we << i_cpu_addr[4:0]);
mm_sel = (1 << i_cpu_addr[4:1]);
o_data = mm_sel[8*i_cpu_addr[0] +: 8];
selected_mm = mm[i_cpu_addr[15:12]];
o_mapped_addr = {selected_mm[12:0], i_cpu_addr[11:0]};
end
always_ff @(negedge i_clk or posedge i_reset) begin