read config mux and output to slow_peripherals.bsv
[pinmux.git] / src / bsv / bsv_lib / slow_tuple2_template.bsv
1 package slow_memory_map;
2 /*===== Project imports =====*/
3 import defined_types::*;
4 `include "instance_defines.bsv"
5 /* ==== define the AXI Addresses ==== */
6 {0}
7
8 /* ==== define the AXI slave numbering ===== */
9 {1}
10
11 /* ==== define the number of slow peripheral irqs ==== */
12
13 function Tuple2#(Bool, Bit#(TLog#(Num_Slow_Slaves)))
14 fn_slow_address_mapping (Bit#(`PADDR) addr);
15 `ifdef CLINT
16 if(addr>=`ClintBase && addr<=`ClintEnd)
17 return tuple2(True,fromInteger(valueOf(CLINT_slave_num)));
18 else
19 `endif
20 `ifdef PLIC
21 if(addr>=`PLICBase && addr<=`PLICEnd)
22 return tuple2(True,fromInteger(valueOf(Plic_slave_num)));
23 else
24 `endif
25 `ifdef AXIEXP
26 if(addr>=`AxiExp1Base && addr<=`AxiExp1End)
27 return tuple2(True,fromInteger(valueOf(AxiExp1_slave_num)));
28 else
29 `endif
30 {2}
31 return tuple2(False,?);
32 endfunction
33
34 endpackage