- Timestamp:
- Oct 21, 2015, 11:48:40 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar/scripts/gen_hard_config.py
r1012 r1023 1 1 2 3 exec(file("hard_params.py")) 2 4 3 5 4 6 def hard_config(x, y, x_width, y_width, p, hard_config, protocol): 7 8 x_io = get_x_io(x_width, y_width) 9 y_io = get_y_io(x_width, y_width) 5 10 6 ram_tgtid = 0 7 xcu_tgtid = 1 8 dma_tgtid = 2 9 tty_tgtid = 3 10 ioc_tgtid = 4 11 nic_tgtid = 5 12 rom_tgtid = 6 13 cma_tgtid = 7 14 sim_tgtid = 8 15 fbf_tgtid = 9 16 17 nb_dma_channels = 1 18 nb_cma_channels = 0 19 nb_tty_channels = 4 20 nb_ioc_channels = 1 21 22 fbf_x_size = 1024 23 fbf_y_size = 1024 24 25 seg_rom_base = 0xbfc00000 26 seg_rom_size = 0x00100000 27 28 cluster_inc = 0x80000000 / (x * y) * 2 29 cluster_io_id = seg_rom_base >> (32 - x_width - y_width) 30 cluster_io_inc = cluster_io_id * cluster_inc 31 ram_max_size = 0x40000000 / (x * y) # 1 Go Max 32 33 seg_ram_base = 0x00000000 34 seg_ram_size = min(0x10000000, ram_max_size) 35 36 seg_xcu_base = (cluster_inc >> 1) + (xcu_tgtid << 19) 37 seg_xcu_size = 0x00001000 # 4Ko 38 39 seg_dma_base = (cluster_inc >> 1) + (dma_tgtid << 19) 40 seg_dma_size = 0x00001000 * nb_dma_channels 41 42 def periph_address(tgtid): 43 return (cluster_inc >> 1) + cluster_io_inc + (tgtid << 19) 44 45 seg_ioc_base = periph_address(ioc_tgtid); 46 seg_ioc_size = 0x00001000 47 48 seg_tty_base = periph_address(tty_tgtid) 49 seg_tty_size = 0x00001000 50 51 seg_fbf_base = periph_address(fbf_tgtid) 52 seg_fbf_size = fbf_x_size * fbf_y_size * 2 53 54 seg_nic_base = periph_address(nic_tgtid) 55 seg_nic_size = 0x00080000 56 57 seg_cma_base = periph_address(cma_tgtid) 58 seg_cma_size = 0x00004000 * nb_cma_channels 59 60 seg_sim_base = periph_address(sim_tgtid) 61 seg_sim_size = 0x00001000 11 seg_rom_base = BOOT_ADDR 12 seg_rom_size = ROM_SIZE 13 14 seg_ram_base = RAM_BASE 15 seg_ram_size = ram_size(x_width, y_width) 16 17 seg_xcu_base = replicated_periph_base_addr(x_width, y_width, XCU_TGTID) 18 seg_xcu_size = XCU_SIZE 19 20 seg_dma_base = replicated_periph_base_addr(x_width, y_width, DMA_TGTID) 21 seg_dma_size = DMA_SIZE * NB_DMA_CHANNELS 22 23 seg_ioc_base = periph_addr(x_width, y_width, IOC_TGTID); 24 seg_ioc_size = IOC_SIZE 25 26 seg_tty_base = periph_addr(x_width, y_width, TTY_TGTID) 27 seg_tty_size = TTY_SIZE 28 29 seg_fbf_base = periph_addr(x_width, y_width, FBF_TGTID) 30 seg_fbf_size = FBF_X_SIZE * FBF_Y_SIZE * 2 31 32 seg_nic_base = periph_addr(x_width, y_width, NIC_TGTID) 33 seg_nic_size = NIC_SIZE 34 35 seg_cma_base = periph_addr(x_width, y_width, CMA_TGTID) 36 seg_cma_size = CMA_SIZE * NB_CMA_CHANNELS 37 38 seg_sim_base = periph_addr(x_width, y_width, SIM_TGTID) 39 seg_sim_size = SIM_SIZE 62 40 63 41 header = ''' … … 65 43 #define _HARD_CONFIG_H_ 66 44 67 /* Generated from run_simus.py */45 /* Generated from gen_hard_config.py */ 68 46 69 47 /* General platform parameters */ … … 74 52 #define Y_WIDTH %(y_width)d 75 53 #define P_WIDTH 4 76 #define X_IO 077 #define Y_IO 054 #define X_IO %(x_io)d 55 #define Y_IO %(y_io)d 78 56 #define NB_PROCS_MAX %(proc_per_clus)d 79 57 #define IRQ_PER_PROCESSOR 4 … … 169 147 170 148 ''' % dict(x_size = x, y_size = y, x_width = x_width, y_width = y_width, 149 x_io = x_io, 150 y_io = y_io, 171 151 proc_per_clus = p, 172 nb_tty_channels = nb_tty_channels,173 nb_ioc_channels = nb_ioc_channels,174 nb_cma_channels = nb_cma_channels,175 nb_dma_channels = nb_dma_channels,176 fbf_x_size = fbf_x_size, fbf_y_size = fbf_y_size,177 ram_tgtid = ram_tgtid,178 xcu_tgtid = xcu_tgtid,179 dma_tgtid = dma_tgtid,180 tty_tgtid = tty_tgtid,181 ioc_tgtid = ioc_tgtid,182 nic_tgtid = nic_tgtid,183 rom_tgtid = rom_tgtid,184 cma_tgtid = cma_tgtid,185 sim_tgtid = sim_tgtid,186 fbf_tgtid = fbf_tgtid,152 nb_tty_channels = NB_TTY_CHANNELS, 153 nb_ioc_channels = NB_IOC_CHANNELS, 154 nb_cma_channels = NB_CMA_CHANNELS, 155 nb_dma_channels = NB_DMA_CHANNELS, 156 fbf_x_size = FBF_X_SIZE, fbf_y_size = FBF_Y_SIZE, 157 ram_tgtid = RAM_TGTID, 158 xcu_tgtid = XCU_TGTID, 159 dma_tgtid = DMA_TGTID, 160 tty_tgtid = TTY_TGTID, 161 ioc_tgtid = IOC_TGTID, 162 nic_tgtid = NIC_TGTID, 163 rom_tgtid = ROM_TGTID, 164 cma_tgtid = CMA_TGTID, 165 sim_tgtid = SIM_TGTID, 166 fbf_tgtid = FBF_TGTID, 187 167 seg_ram_base = seg_ram_base, 188 168 seg_ram_size = seg_ram_size,
Note: See TracChangeset
for help on using the changeset viewer.