source: trunk/platforms/tsar_generic_xbar/scripts/hard_params.py @ 1023

Last change on this file since 1023 was 1023, checked in by meunier, 9 years ago
  • Update the scripts to use a common file hard_params.py in both gen_arch_info and gen_hdd
  • Adding the P_WIDTH parameter in the topcell
File size: 1.9 KB
Line 
1
2RAM_TGTID = 0
3XCU_TGTID = 1
4DMA_TGTID = 2
5TTY_TGTID = 3
6IOC_TGTID = 4
7NIC_TGTID = 5
8ROM_TGTID = 6
9CMA_TGTID = 7
10SIM_TGTID = 8
11FBF_TGTID = 9
12
13DMA_SIZE = 0X00001000
14XCU_SIZE = 0X00001000
15TTY_SIZE = 0X00001000
16IOC_SIZE = 0X00001000
17NIC_SIZE = 0x00080000
18ROM_SIZE = 0x00100000
19CMA_SIZE = 0x00004000
20SIM_SIZE = 0X00001000
21FBF_SIZE = 0X00200000
22
23RAM_BASE = 0x0
24RAM_MAX_TOTAL_SIZE = 0x10000000
25RAM_MAX_CLUST_SIZE = 0x10000000
26
27
28NB_DMA_CHANNELS = 1
29NB_CMA_CHANNELS = 0
30NB_TTY_CHANNELS = 4
31NB_IOC_CHANNELS = 1
32TTY_CHANNEL_SIZE = 0X00000010
33
34FBF_X_SIZE = 1024
35FBF_Y_SIZE = 1024
36
37
38P_WIDTH = 4
39
40ADDR_WIDTH = 32
41BOOT_ADDR = 0xbfc00000
42
43OUTPUT_IRQ_PER_PROC = 4
44
45
46def get_x_io(x_width, y_width):
47    return BOOT_ADDR >> (ADDR_WIDTH - x_width)
48
49def get_y_io(x_width, y_width):
50    return (BOOT_ADDR >> (ADDR_WIDTH - x_width - y_width)) & ((1 << y_width) - 1)
51
52
53def replicated_periph_base_addr(x_width, y_width, tgtid):
54    demi_cluster_inc = (1 << (ADDR_WIDTH - 1)) >> (x_width + y_width)
55    return demi_cluster_inc + (tgtid << 19)
56
57def replicated_periph_addr(x, y, x_width, y_width, base_addr):
58    cid = x * (1 << y_width) + y
59    demi_cluster_inc = (1 << (ADDR_WIDTH - 1)) >> (x_width + y_width)
60    return demi_cluster_inc * 2 * cid + base_addr
61
62
63
64def periph_addr(x_width, y_width, tgtid):
65    demi_cluster_inc = (1 << (ADDR_WIDTH - 1)) >> (x_width + y_width)
66
67    x_io = get_x_io(x_width, y_width)
68    y_io = get_y_io(x_width, y_width)
69    cluster_io_id = x_io * (1 << y_width) + y_io
70    cluster_io_offset = cluster_io_id * demi_cluster_inc * 2
71    return demi_cluster_inc + cluster_io_offset + (tgtid << 19)
72
73
74def ram_size(x_width, y_width):
75    return min(RAM_MAX_TOTAL_SIZE >> (x_width + y_width), RAM_MAX_CLUST_SIZE) 
76
77
78def ram_addr(x, y, x_width, y_width):
79    cid = x * (1 << y_width) + y
80    demi_cluster_inc = (1 << (ADDR_WIDTH - 1)) >> (x_width + y_width)
81    return demi_cluster_inc * 2 * cid + RAM_BASE
82
Note: See TracBrowser for help on using the repository browser.