Changes between Version 12 and Version 13 of Component/Mapping Table/Tables Creation
- Timestamp:
- Dec 8, 2011, 6:57:40 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Component/Mapping Table/Tables Creation
v12 v13 3 3 = Tables types = 4 4 5 Mapping table creates 5types of tables:5 From the segments defined in the Mapping table, it is possible to generate 3 types of tables: 6 6 7 7 * Commands routing table, indexed by addresses, yielding target port number; 8 8 * Commands locality table, indexed by addresses, yielding boolean whether an address is local or not; 9 * Response routing table, indexed by source ID, yielding initiator port number;10 * Response routing table, indexed by source ID, yielding boolean whether an index is local or not;11 9 * Cacheability table, indexed by address, yielding whether allowed to cache or not. 12 10 13 When the mapping table is created, it gets 4 informations:11 When the mapping table is created, 4 informations must be defined: 14 12 * Address size (in bits) 15 * Address routing table fields sizes (in bits, from the MSBs)16 * Index routing table fields sizes (in bits, from MSB of indexes)13 * Address routing table fields sizes (in bits, from the VCI ADDRES MSB bits) 14 * Index routing table fields sizes (in bits, from the VCI SRCID) 17 15 * Cacheability mask 18 16 19 When the mapping table is created, segments are registered with the `.add()` method. This 20 does nothing except registering segments.Nothing is verified until actual tables are created.17 Segments are registered with the `.add()` method. 18 Nothing is verified until actual tables are created. 21 19 22 20 We'll suppose we create a MappingTable with the following code: 23 21 {{{ 24 MappingTable obj(32, IntTab(8, 4), IntTab(4, 4), 0x00300000 );22 MappingTable obj(32, IntTab(8, 4), IntTab(4, 3), 0x00300000 ); 25 23 }}} 26 24 25 This define a two levels hierarchical interconnect, where both initiators and targets are grouped 26 in subsystems, called clusters. Therefore, each initiator and each target is identified by two indexes: 27 a cluster_index, and a local_index. 28 29 For a command packet, the first 8 MSB ADDRES bits must be decoded by a global routing table to get the target cluster_index, and the next 4 ADDRESS bits must be decoded by a local routing table to get the target local_index. 30 31 For a response packet, the 4 SRCID MSB bits define directly the initiator cluster_index, and the next 3 SRCID bits 32 define directly the initiator local_index. 27 33 28 34 = Variable tables = 29 35 30 The two routing table types are unique for each interconnect. The interconnect hierarchy can be seen31 as a tree. Each interconnect in tree has an unique ID, which is an IntTab. The root interconnect is 36 The interconnect hierarchy can be seen as a tree. 37 Each interconnect in tree has an unique ID, which is an IntTab. The root interconnect 32 38 has the empty `IntTab()` ID, if there are local interconnects, they are numbered `IntTab(n)` where `n` 33 39 is the local cluster ID. This ID '''must''' be the same as the targets and initiator ports it is connected … … 41 47 42 48 Routing tables can only use a part of the address to do their job. In the example 43 above, `vgmn` is the global interconnect and uses Most-significant-bits of the addresses; 44 `lc0` and `lc1` use the same bits (but on different tables), just after the MSBs used by 45 `vgmn`: 49 above, `vgmn` is the global interconnect and uses the 8 address MSB bits. 50 `lc0` and `lc1` use the 4 next address bits (but the tables content is generally different for lc0 and lc1). 46 51 47 An address and its decoding fields, if we suppose we created the Mapping Table as before, 48 we have a 32-bit address: 49 50 || widths: || 8 || 4 || remaining bits || 51 || bits: || 31 — 24 ||23 — 20 || 19 — 0 || 52 || locality decision for: || lc0, lc1 || || || 53 || routing decision for: || vgmn || lc0, lc1 || || 52 || widths || 8 || 4 || remaining bits || 53 || bits || 31 — 24 ||23 — 20 || 19 — 0 || 54 || locality decision || lc0, lc1 || || || 55 || routing decision || vgmn || lc0, lc1 || || 54 56 55 57 == Creating the routing tables == 56 58 57 59 When code calls `getRoutingTable( index )` on a `MappingTable`, `MappingTable` scans the list of 58 registered segments and filters all the segments ''under'' `index`.60 registered segments and filters all the segments corresponding to index value. 59 61 60 62 Let's say we have the following segments: … … 65 67 || seg2 || 0x14000000 || 0x00100000 || (1, 0) || False || 66 68 || seg3 || 0x14100000 || 0x00100000 || (1, 1) || True || 67 || seg4 || 0x14200000 || 0x00080000 || (1, 1) || True ||69 || seg4 || 0x14200000 || 0x00080000 || (1, 2) || True || 68 70 69 When calling `getRoutingTable( IntTab(1) )`, the resulting routing table70 will only contain information about segments which targets `(1, …)`: `seg2`, `seg3` and `seg4`.71 When calling `getRoutingTable( IntTab(1) )`, the resulting local routing table 72 will only contain information about segments located in cluster 1: `seg2`, `seg3` and `seg4`. 71 73 72 As the 8 first bits of address are assumed already decoded, the table only decodes the next 4 bits: 74 As the 8 first bits of address are assumed already decoded to select cluster 1, 75 the local table only decodes the next 4 address bits: 73 76 74 77 || Input (bits 23-20) || Target ID || 75 || 0 || 0 (seg2) || 76 || 1 || 1 (seg3) || 77 || 2 || 1 (seg4) || 78 || 3 .. 0xf || unknown || 78 || 0000 || 0 (seg2) || 79 || 0001 || 1 (seg3) || 80 || 0010 || 2 (seg4) || 81 || 0011 || Don't Care || 82 || 0100 || Don't Care || 83 || ... || Don't Care || 84 || 1111 || Don't Care || 79 85 80 86 == Incoherences == 81 87 82 If routing table creationencounters an impossible configuration, it raises an exception.88 If the routing table creator encounters an impossible configuration, it raises an exception. 83 89 Let's suppose we add the following segment: 84 90 … … 116 122 || 0x15 .. 0xff || Unknown || 117 123 118 = Response tables =119 120 == Response Routing table ==121 122 The response tables are quite the same as the command ones, except bits used in decoding the123 source ID field are equal to the result.124 125 `getIdRoutingTable( IntTab(1) )` yields:126 127 || Srcid (bits 7-4) || Target value ||128 || 0 || 0 ||129 || 1 || 1 ||130 || 2 || 2 ||131 || ... || ... ||132 || 0xf || 0xf ||133 124 134 125 = Cacheability Table = 135 126 136 Cacheability tables are a built the same way, but bits used for decoding are selected through mask 137 passed at construction: 127 Cacheability tables are a built the same way, but bits used for decoding are selected through the 128 cacheability mask: 129 138 130 * take all segments 139 131 * extract masked value 140 132 * set the cacheability attribute for the value 141 133 142 We use a cacheability mask of 0x00300000 .134 We use a cacheability mask of 0x00300000 (bits Address[21:22] 143 135 144 136 || Name || Address || Masked value || Address![21:20] || Cacheablility || … … 149 141 || seg4 || 0x14200000 || 0x00200000 || 10 || True || 150 142 151 We can deduct the followingtable:143 We obtain the following cacheability table: 152 144 153 145 || Address![21:20] || Cacheability || 154 || 0 O|| False ||146 || 00 || False || 155 147 || 01 || True || 156 148 || 10 || True || 157 149 || 11 || Don't Care || 158 150 159 In components' code, Cacheability Tables directlytake an address, select appropriate bits151 Cacheability Tables take an address, select appropriate bits 160 152 and yield the Cacheability boolean. 161 153 162 154 == Incoherences == 163 155 164 Again, if we encounter an incoherent value, exception will be raised; let's suppose we add 165 the following segment: 156 Here again an exception is raised if we encounter an incoherent mapping table. 157 158 Assume we add a new segment seg5: 166 159 167 160 || Name || Address || Size || Target || Cacheable || 168 161 || seg5 || 0x20280000 || 0x00080000 || (1, 2) || False || 169 162 170 Its entry is163 Its cacheability entry should be: 171 164 172 165 || Name || Address || Masked value || Address![21:20] || Cacheablility || 173 || seg5 || 0x20280000 || 0x00200000 || 2|| False ||166 || seg5 || 0x20280000 || 0x00200000 || 10 || False || 174 167 175 Now the table becomes: 168 The cacheability should be True for segment 4, and False for segment 5, which is not possible. 176 169 177 || Shortened value || Cacheability ||178 || 0 || False ||179 || 1 || True ||180 || 2 || True & False ||181 || 3 || unknown ||182 170 183 This must not happen 171