Skip to content

Commit e472898

Browse files
committedOct 24, 2012
Fix compilation with MMU disabled
1 parent 975b9ff commit e472898

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed
 

‎lm32_cpu.v

+2
Original file line numberDiff line numberDiff line change
@@ -2196,9 +2196,11 @@ begin
21962196
`LM32_CSR_JRX: csr_read_data_x = jrx_csr_read_data;
21972197
`endif
21982198
`LM32_CSR_CFG2: csr_read_data_x = cfg2;
2199+
`ifdef `LM32_MMU_ENABLED
21992200
`LM32_CSR_TLB_VADDRESS: csr_read_data_x = load_store_csr_read_data_x;
22002201
`LM32_CSR_TLB_PADDRESS: csr_read_data_x = instruction_csr_read_data_x;
22012202
`LM32_CSR_PSW: csr_read_data_x = lm32_csr_psw_reg;
2203+
`endif
22022204
default: csr_read_data_x = {`LM32_WORD_WIDTH{1'bx}};
22032205
endcase
22042206
end

‎lm32_dcache.v

+16-6
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ reg [`LM32_DC_ADDR_OFFSET_RNG] refill_offset; // Which word in cache l
284284
wire last_refill; // Indicates when on last cycle of cache refill
285285
reg [`LM32_DC_TMEM_ADDR_RNG] flush_set; // Which set is currently being flushed
286286

287+
`ifdef LM32_MMU_ENABLED
287288
wire [addr_dtlb_index_width-1:0] dtlb_data_read_address;
288289
wire [addr_dtlb_index_width-1:0] dtlb_data_write_address;
289290
wire dtlb_data_read_port_enable;
@@ -310,10 +311,11 @@ reg dtlb_miss_q = `FALSE;
310311
reg [`LM32_WORD_RNG] dtlb_miss_addr;
311312
wire dtlb_data_valid;
312313
wire [`LM32_DTLB_LOOKUP_RANGE] dtlb_lookup;
314+
assign kernel_mode = kernel_mode_reg;
315+
`endif
313316

314317
genvar i, j;
315318

316-
assign kernel_mode = kernel_mode_reg;
317319

318320
/////////////////////////////////////////////////////
319321
// Functions
@@ -553,12 +555,17 @@ assign flushing = state[0];
553555
assign check = state[1];
554556
assign refill = state[2];
555557

556-
assign miss = (~(|way_match)) && (load_q_m == `TRUE) && (stall_m == `FALSE) && (~dtlb_miss);
557-
assign stall_request = (check == `FALSE) || (dtlb_state == `LM32_TLB_STATE_FLUSH
558+
assign miss = (~(|way_match)) && (load_q_m == `TRUE) && (stall_m == `FALSE)
559+
`ifdef CFG_MMU_ENABLED
560+
&& (~dtlb_miss)
561+
`endif
562+
;
563+
assign stall_request = (check == `FALSE)
558564
`ifdef CFG_MMU_ENABLED
559-
&& (dtlb_enabled == `TRUE)
565+
|| (dtlb_state == `LM32_TLB_STATE_FLUSH
566+
&& (dtlb_enabled == `TRUE))
560567
`endif
561-
);
568+
;
562569

563570
/////////////////////////////////////////////////////
564571
// Sequential logic
@@ -807,7 +814,10 @@ begin
807814
dtlb_updating <= 0;
808815
dtlb_state <= `LM32_TLB_STATE_CHECK;
809816
end
810-
817+
default:
818+
begin
819+
$display("[ %t ] DTLB TLBVADDRESS stored 0x%08X", $time, csr_write_data);
820+
end
811821
endcase
812822
end
813823
else

‎lm32_icache.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ begin
885885
`LM32_TLB_CTRL_INVALIDATE_ENTRY:
886886
begin
887887
//`ifdef CFG_VERBOSE_DISPLAY_ENABLED
888-
$display("it's an INVALIDATE ENTRY at %t", $time);
888+
$display("[ %t ] ITLB TLBVADDRESS INVALIDATE ENTRY 0x%08X command [vaddr_reg == 0x%08X]", $time, csr_write_data, itlb_update_vaddr_csr_reg);
889889
//`endif
890890
itlb_flushing <= 1;
891891
// itlb_flush_set <= itlb_update_vaddr_csr_reg[`LM32_ITLB_IDX_RNG];

‎lm32_interrupt.v

+5-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,11 @@ begin
266266
else if (csr_write_enable == `TRUE)
267267
begin
268268
// Handle wcsr write
269-
if ((csr == `LM32_CSR_IE) || (csr == `LM32_CSR_PSW))
269+
if ((csr == `LM32_CSR_IE)
270+
`ifdef `LM32_MMU_ENABLED
271+
|| (csr == `LM32_CSR_PSW)
272+
`endif
273+
)
270274
begin
271275
ie <= csr_write_data[0];
272276
eie <= csr_write_data[1];

‎lm32_load_store_unit.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ input kill_x; // Kill instruction in X
172172
input kill_m; // Kill instruction in M stage
173173
input exception_m; // An exception occured in the M stage
174174
input exception_x; // An exception occured in the X stage
175-
input eret_q_x;
176175

177176
`ifdef CFG_MMU_ENABLED
177+
input eret_q_x;
178178
input [`LM32_CSR_RNG] csr; // CSR read/write index
179179
input [`LM32_WORD_RNG] csr_write_data; // Data to write to specified CSR
180180
input csr_write_enable; // CSR write enable

0 commit comments

Comments
 (0)
Please sign in to comment.