Skip to content

Commit cf2281b

Browse files
committedFeb 24, 2013
fix compilation with no CFG_DEBUG_ENABLED
Signed-off-by: Michael Walle <michael@walle.cc>
1 parent 57d998d commit cf2281b

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed
 

‎rtl/lm32_cpu.v

+6
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,9 @@ assign dtlb_exception = (dtlb_miss_exception == `TRUE) || (dtlb_fault_exception
18171817
assign privilege_exception = ( (usr == `TRUE)
18181818
&& ( (csr_write_enable_q_x == `TRUE)
18191819
|| (eret_q_x == `TRUE)
1820+
`ifdef CFG_DEBUG_ENABLED
18201821
|| (bret_q_x == `TRUE)
1822+
`endif
18211823
)
18221824
);
18231825
`endif
@@ -1958,9 +1960,13 @@ assign stall_f = (stall_d == `TRUE)
19581960
// wrong in case of a miss, that is one instruction is
19591961
// skipped.
19601962
|| ( (itlbe == `TRUE)
1963+
`ifdef CFG_DEBUG_ENABLED
19611964
&& ( (debug_exception_q_w == `TRUE)
19621965
|| (non_debug_exception_q_w == `TRUE)
19631966
)
1967+
`else
1968+
&& (exception_q_w == `TRUE)
1969+
`endif
19641970
)
19651971
`endif
19661972
;

‎rtl/lm32_include.v

+7-3
Original file line numberDiff line numberDiff line change
@@ -203,18 +203,20 @@
203203
`define LM32_ADDRESS_LSBS_WIDTH 2
204204

205205
// Width and range of a CSR index
206+
`ifdef CFG_MMU_ENABLED
207+
`define LM32_CSR_WIDTH 5
208+
`else
206209
`ifdef CFG_DEBUG_ENABLED
207210
`define LM32_CSR_WIDTH 5
208-
`define LM32_CSR_RNG (`LM32_CSR_WIDTH-1):0
209211
`else
210212
`ifdef CFG_JTAG_ENABLED
211213
`define LM32_CSR_WIDTH 4
212-
`define LM32_CSR_RNG (`LM32_CSR_WIDTH-1):0
213214
`else
214215
`define LM32_CSR_WIDTH 3
215-
`define LM32_CSR_RNG (`LM32_CSR_WIDTH-1):0
216216
`endif
217217
`endif
218+
`endif
219+
`define LM32_CSR_RNG (`LM32_CSR_WIDTH-1):0
218220

219221
// CSR indices
220222
`define LM32_CSR_IE `LM32_CSR_WIDTH'h0
@@ -243,6 +245,8 @@
243245
`define LM32_CSR_WP1 `LM32_CSR_WIDTH'h19
244246
`define LM32_CSR_WP2 `LM32_CSR_WIDTH'h1a
245247
`define LM32_CSR_WP3 `LM32_CSR_WIDTH'h1b
248+
`endif
249+
`ifdef CFG_MMU_ENABLED
246250
`define LM32_CSR_PSW `LM32_CSR_WIDTH'h1d
247251
`define LM32_CSR_TLBVADDR `LM32_CSR_WIDTH'h1e
248252
`define LM32_CSR_TLBPADDR `LM32_CSR_WIDTH'h1f // write only

0 commit comments

Comments
 (0)
Please sign in to comment.