| 102 | | |
| 103 | | == 2. Generic MMU architecture == |
| | 102 | == 2. MMU/processor interface == |
| | 103 | |
| | 104 | In order to be used withthe various (32 bits) processor cores available in the SoCLib library, the TSAR generic MMU respects the following processor/MMU interface: |
| | 105 | |
| | 106 | === 2.1 Instruction MMU interface === |
| | 107 | |
| | 108 | The Instruction MMU interface is defined by the following signals : |
| | 109 | |
| | 110 | {{{ |
| | 111 | struct InstructionRequest { |
| | 112 | bool valid; |
| | 113 | uint30_t addr; |
| | 114 | enum ExecMode mode; |
| | 115 | }; |
| | 116 | struct InstructionResponse { |
| | 117 | bool valid; |
| | 118 | bool error; |
| | 119 | uint32_t instruction; |
| | 120 | }; |
| | 121 | }}} |
| | 122 | |
| | 123 | The addr virtual address is a 32 bits word adress. It is coded on 30 bits. |
| | 124 | |
| | 125 | The possible values for the Execution Mode are defined below : |
| | 126 | |
| | 127 | || ExecMode || Value || |
| | 128 | || || || |
| | 129 | || Hyper || *1 || |
| | 130 | || Kernel || 00 || |
| | 131 | || User || 10 || |
| | 132 | |
| | 133 | === 2.2 Data MMU interface === |
| | 134 | |
| | 135 | The Data MMU interface is defined by the following signals : |
| | 136 | |
| | 137 | {{{ |
| | 138 | struct DataRequest { |
| | 139 | bool valid; |
| | 140 | uint30_t addr; |
| | 141 | uint32_t wdata; |
| | 142 | enum DataOperationType type; |
| | 143 | uint4_t be; |
| | 144 | enum ExecMode mode; |
| | 145 | }; |
| | 146 | struct DataResponse { |
| | 147 | bool valid; |
| | 148 | bool error; |
| | 149 | uint32_t rdata; |
| | 150 | }; |
| | 151 | }}} |
| | 152 | |
| | 153 | The addr virtual address is a 32 bits word adress. It is coded on 30 bits. |
| | 154 | |
| | 155 | The wdata field is only significant for be-masked bytes: |
| | 156 | |
| | 157 | * wdata[7:0] is at ![addr], masked by be[0] |
| | 158 | * wdata[15:8] is at [addr+1], masked by be[1] |
| | 159 | * wdata[23:16] is at [addr+2], masked by be[2] |
| | 160 | * wdata[31:24] is at [addr+3], masked by be[3] |
| | 161 | |
| | 162 | The possible values for the execution mode are the same as for the instructions. |
| | 163 | |
| | 164 | The possible values for the OperationType field are defined below : |
| | 165 | |
| | 166 | || Data.OperationType || R X L S Z || semantic || |
| | 167 | || || || |
| | 168 | || DATA_READ || 1 0 0 0 0 || load 32 bits from memory address space || |
| | 169 | || DATA_WRITE || 0 0 0 0 0 || store 32 bits to memory adress space || |
| | 170 | || DATA_LL || 1 0 1 0 0 || load 32 bits from memory address space with reservation || |
| | 171 | || DATA_SC || 0 0 1 0 0 || conditionnal store 32 bits to memory address space || |
| | 172 | || XTN_READ || 1 1 0 0 0 || load 32 bits from MMU register || |
| | 173 | || XTN_WRITE || 0 1 0 0 0 || store 32 bits to MMU register || |
| | 174 | || DATA_LLRST || 0 0 0 0 1 || reset a previous LL reservation || |
| | 175 | || DATA_SYNC || 0 0 0 1 0 || execute all pending write requests || |
| | 176 | |
| | 177 | Note : Instruction request & data requests are independent : the processor can issue simultaneous |
| | 178 | data & instruction requests that have different execution modes. |
| | 179 | |
| | 180 | In case of access to an eXTerNal register (XTN_READ or XTN_WRITE) the MMU register is identified by the Data.Address field. |
| | 181 | (see section 3). |
| | 182 | |
| | 183 | == 3. MMU architecture == |