| | 1 | = Tables types = |
| | 2 | |
| | 3 | Mapping table creates 5 types of tables: |
| | 4 | |
| | 5 | * Commands routing table, indexed by addresses, yielding target port number; |
| | 6 | * Commands locality table, indexed by addresses, yielding boolean whether an address is local or not; |
| | 7 | * Response routing table, indexed by source ID, yielding initiator port number; |
| | 8 | * Response routing table, indexed by source ID, yielding boolean whether an index is local or not; |
| | 9 | * Cacheability table, indexed by address, yielding whether allowed to cache or not. |
| | 10 | |
| | 11 | When the mapping table is created, it gets 4 informations: |
| | 12 | * Address size (in bits) |
| | 13 | * Address routing table fields sizes (in bits, from the MSBs) |
| | 14 | * Index routing table fields sizes (in bits, from MSB of indexes) |
| | 15 | * Cacheability mask |
| | 16 | |
| | 17 | When the mapping table is created, segments are registered with the `.add()` method. This |
| | 18 | does nothing except registering segments. Nothing is verified until actual tables are created. |
| | 19 | |
| | 20 | We'll suppose we create a MappingTable with the following code: |
| | 21 | {{{ |
| | 22 | MappingTable obj(32, IntTab(8, 4), IntTab(4, 4), 0x00300000 ); |
| | 23 | }}} |
| | 24 | |
| | 25 | |
| | 26 | = Variable tables = |
| | 27 | |
| | 28 | The two routing table types are unique for each interconnect. The interconnect hierarchy can be seen |
| | 29 | as a tree. Each interconnect in tree has an unique ID, which is an IntTab. The root interconnect is |
| | 30 | has the empty `IntTab()` ID, if there are local interconnects, they are numbered `IntTab(n)` where `n` |
| | 31 | is the local cluster ID. This ID '''must''' be the same as the targets and initiator ports it is connected |
| | 32 | to on the global interconnect. |
| | 33 | |
| | 34 | [[Image(routing.png)]] |
| | 35 | |
| | 36 | In this figure, the command routing table is different is `lc0`, `lc1` and `vgmn`. |
| | 37 | |
| | 38 | = Command tables = |
| | 39 | |
| | 40 | Routing tables can only use a part of the address to do their job. In the example |
| | 41 | above, `vgmn` is the global interconnect and uses Most-significant-bits of the addresses; |
| | 42 | `lc0` and `lc1` use the same bits (but on different tables), just after the MSBs used by |
| | 43 | `vgmn`: |
| | 44 | |
| | 45 | An address and its decoding fields, if we suppose we created the Mapping Table as before, |
| | 46 | we have a 32-bit address: |
| | 47 | |
| | 48 | || width:|| 8 || 4 || (the rest) || |
| | 49 | || bits: || 31 — 24 ||23 — 20 || 19 — 0 || |
| | 50 | || field:|| vgmn || lc0 & lc1 || rest of address || |
| | 51 | |
| | 52 | == Creating the routing tables == |
| | 53 | |
| | 54 | When code calls `getRoutingTable( index )` on a `MappingTable`, `MappingTable` scans the list of |
| | 55 | registered segments and filters all the segments ''under'' `index`. |
| | 56 | |
| | 57 | Let's say we have the following segments: |
| | 58 | |
| | 59 | || Name || Address || Size || Target || Cacheable || |
| | 60 | || seg0 || 0x12000000 || 0x00100000 || (0, 0) || False || |
| | 61 | || seg1 || 0x12100000 || 0x00100000 || (0, 1) || True || |
| | 62 | || seg2 || 0x14000000 || 0x00100000 || (1, 0) || False || |
| | 63 | || seg3 || 0x14100000 || 0x00100000 || (1, 1) || True || |
| | 64 | || seg4 || 0x14200000 || 0x00080000 || (1, 1) || True || |
| | 65 | |
| | 66 | When calling `getRoutingTable( IntTab(1) )`, the resulting routing table |
| | 67 | will only contain information about `seg2`, `seg3` and `seg4`, which targets `(1, …)`. |
| | 68 | As the 8 first bits of address are assumed already decoded, the table only decodes the next 4 bits: |
| | 69 | |
| | 70 | || Input (bits 23-20) || Target value || |
| | 71 | || 0 || 0 (seg2) || |
| | 72 | || 1 || 1 (seg3) || |
| | 73 | || 2 || 1 (seg4) || |
| | 74 | || 3 .. 0xf || unknown || |
| | 75 | |
| | 76 | == Incoherences == |
| | 77 | |
| | 78 | If routing table creation encounters an impossible configuration, it raises an exception. |
| | 79 | Let's suppose we add the following segment: |
| | 80 | |
| | 81 | || Name || Address || Size || Target || Cacheable || |
| | 82 | || seg5 || 0x20280000 || 0x00080000 || (1, 2) || False || |
| | 83 | |
| | 84 | Routing table should now be (even if bits 31—24 are 0x20): |
| | 85 | |
| | 86 | || Address (bits 23-20) || Target value || |
| | 87 | || 0 || 0 (seg2) || |
| | 88 | || 1 || 1 (seg3) || |
| | 89 | || 2 || 1 or 2 (seg4 & seg5) || |
| | 90 | || 3 .. 0xf || unknown || |
| | 91 | |
| | 92 | == Creating the locality tables == |
| | 93 | |
| | 94 | TODO |
| | 95 | |
| | 96 | = Response tables = |
| | 97 | |
| | 98 | == Response Routing table == |
| | 99 | |
| | 100 | The response tables are quite the same as the command ones, except bits used in decoding the |
| | 101 | source ID field are equal to the result. |
| | 102 | |
| | 103 | `getIdRoutingTable( IntTab(1) )` yields: |
| | 104 | |
| | 105 | || Srcid (bits 7-4) || Target value || |
| | 106 | || 0 || 0 || |
| | 107 | || 1 || 1 || |
| | 108 | || 2 || 2 || |
| | 109 | || ... || ... || |
| | 110 | || 0xf || 0xf || |
| | 111 | |
| | 112 | = Cacheability Table = |
| | 113 | |
| | 114 | Cacheability tables are a built the same way, but bits used for decoding are selected through mask |
| | 115 | passed at construction: |
| | 116 | * take all segments |
| | 117 | * extract cacheability value |
| | 118 | * set the cacheability attribute for the value |
| | 119 | |
| | 120 | We use a cacheability mask of 0x00300000. |
| | 121 | |
| | 122 | || Name || Address || Cacheability value || Shortened value || Cacheablility || |
| | 123 | || seg0 || 0x12000000 || 0x00000000 || 0 || False || |
| | 124 | || seg1 || 0x12100000 || 0x00100000 || 1 || True || |
| | 125 | || seg2 || 0x14000000 || 0x00000000 || 0 || False || |
| | 126 | || seg3 || 0x14100000 || 0x00100000 || 1 || True || |
| | 127 | || seg4 || 0x14200000 || 0x00200000 || 2 || True || |
| | 128 | |
| | 129 | We can deduct the following table: |
| | 130 | |
| | 131 | || Shortened value || Cacheability || |
| | 132 | || 0 || False || |
| | 133 | || 1 || True || |
| | 134 | || 2 || True || |
| | 135 | || 3 || unknown || |
| | 136 | |
| | 137 | == Incoherences == |
| | 138 | |
| | 139 | Again, if we encounter an incoherent value, exception will be raised; let's suppose we add |
| | 140 | the following segment: |
| | 141 | |
| | 142 | || Name || Address || Size || Target || Cacheable || |
| | 143 | || seg5 || 0x20280000 || 0x00080000 || (1, 2) || False || |
| | 144 | |
| | 145 | Its entry is |
| | 146 | |
| | 147 | || Name || Address || Cacheability value || Shortened value || Cacheablility || |
| | 148 | || seg5 || 0x20280000 || 0x00200000 || 2 || False || |
| | 149 | |
| | 150 | Now the table becomes: |
| | 151 | |
| | 152 | || Shortened value || Cacheability || |
| | 153 | || 0 || False || |
| | 154 | || 1 || True || |
| | 155 | || 2 || True & False || |
| | 156 | || 3 || unknown || |
| | 157 | |
| | 158 | This must not happen |