method Bit#(1) mtip_int;
method Bit#(`DATA) mtime;
`endif
- `ifdef PLIC method ActionValue#(Tuple2#(Bool,Bool)) intrpt_note; `endif
+ `ifdef PLIC method ActionValue#(SlowTuple2#(Bool,Bool)) intrpt_note;
+ `endif
interface IOCellSide iocell_side; // mandatory interface
`ifdef PLIC
{1}
endinterface
/*================================*/
- function Tuple2#(Bool, Bit#(TLog#(Num_Slow_Slaves)))
+ function SlowTuple2#(Bool, Bit#(TLog#(Num_Slow_Slaves)))
fn_address_mapping (Bit#(`ADDR) addr);
`ifdef CLINT
if(addr>=`ClintBase && addr<=`ClintEnd)
import Connectable::*;
import Clocks::*;
/*========================== */
+{10}
/*=== Project imports === */
import ConcatReg::*;
import AXI4_Types::*;
{1}
endinterface
+function FastTuple2 #(Bool, Bit#(TLog#(Num_Slaves)))
+ fn_addr_to_slave_num (Bit#(`PADDR) addr);
+
+ if(addr>=`SDRAMMemBase && addr<=`SDRAMMemEnd)
+ return tuple2(True,fromInteger(valueOf(Sdram_slave_num)));
+ else if(addr>=`DebugBase && addr<=`DebugEnd)
+ return tuple2(True,fromInteger(valueOf(Debug_slave_num)));
+ `ifdef SDRAM
+ else if(addr>=`SDRAMCfgBase && addr<=`SDRAMCfgEnd )
+ return tuple2(True,fromInteger(valueOf(Sdram_cfg_slave_num)));
+ `endif
+ `ifdef BOOTROM
+ else if(addr>=`BootRomBase && addr<=`BootRomEnd)
+ return tuple2(True,fromInteger(valueOf(BootRom_slave_num)));
+ `endif
+ `ifdef DMA
+ else if(addr>=`DMABase && addr<=`DMAEnd)
+ return tuple2(True,fromInteger(valueOf(Dma_slave_num)));
+ `endif
+ `ifdef VME
+ else if(addr>=`VMEBase && addr<=`VMEEnd)
+ return tuple2(True,fromInteger(valueOf(VME_slave_num)));
+ `endif
+ `ifdef TCMemory
+ else if(addr>=`TCMBase && addr<=`TCMEnd)
+ return tuple2(True,fromInteger(valueOf(TCM_slave_num)));
+ `endif
+ else
+{11}
+ return tuple2(False,?);
+endfunction
+
+
(*synthesize*)
module mkSoc #(Bit#(`VADDR) reset_vector,
Clock slow_clock, Reset slow_reset, Clock uart_clock,
ret.append(self.data[name].slowifdecl().format(i, name))
return '\n'.join(list(filter(None, ret)))
+ def axi_fastmem_def(self, *args):
+ return self._axi_reg_def(0x50000000, *args)
+
def axi_reg_def(self, *args):
+ return self._axi_reg_def(0x00011100, *args)
+
+ def _axi_reg_def(self, start, *args):
ret = []
- start = 0x00011100 # start of AXI peripherals address
for (name, count) in self.ifacecount:
for i in range(count):
if self.is_on_fastbus(name, i):
imports = ifaces.slowimport()
ifdecl = ifaces.fastifdecl()
#ifaces.slowifdeclmux() + '\n' + ifaces.extifdecl()
- regdef = ifaces.axi_reg_def()
+ regdef = ifaces.axi_fastmem_def()
slavedecl = ifaces.axi_fastslave_idx()
mastdecl = ifaces.axi_master_idx()
fnaddrmap = ifaces.axi_addr_map()
bsv_file.write(soct.format(imports, ifdecl, mkfast,
slavedecl, mastdecl, mkcon,
inst, dma, num_dmachannels,
- pincon,
+ pincon, regdef, fnaddrmap,
))