Changes between Initial Version and Version 1 of VirtualMemory


Ignore:
Timestamp:
Jun 27, 2009, 2:41:36 PM (15 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • VirtualMemory

    v1 v1  
     1[[outline]]
     2
     3= TSAR virtual memory =
     4
     5The TSAR MMU can be used with any 32 bits, single instruction issue, processor.
     6In order to be independent on the processor core choice, the TLB MISS are handled by an hardwired Finite State Machine (called a Table Walk), without software action. 
     7
     8== 1. Page Table Organisation ==
     9
     10The TSAR virtual memory uses a paged approach. The TSAR architecture defines two page sizes :
     11-       4 Kbytes pages
     12-       2 Mbytes pages
     13The virtual address space size is 4 Gbytes (32 bits virtual addresses).
     14The physical address space is limited to 1 Tbytes (40 bits physical addresses).
     15
     16The page table are build by the operating system, and are stored in memory. They are used for both the VPN (Virtual Page number)  to PPN (Physical Page Number) translation, and for access rights checking.
     17
     18=== 1.1 Two levels structure ===
     19
     20As described below, the Page Table has a hierarchical two levels structure :
     21
     22
     23
     24The general mapping constraints are the following
     25-       All page tables (first & second level) must be aligned : the page table base adress must be a multiple of 8K bytes for a first level page table, and multiple of 4K bytes for a second level page table.
     26-       The page tables can be placed anywhere in the physical address space.
     27-       The PTPR register (located in the generic MMU, and initialised by  the OS at each context switch) contains actually the 26 MSB bits  of the first level page table base address. It must be extended (left-shifted) to 36 bits by the hardware.
     28
     29=== 1.2 Second Level Page Table Entry Format ===
     30
     31Each entry in a second level page table is a 64 bits word containing a 4K bytes page descriptor (Called PTE2) :
     32
     33
     34
     35PPN2    Physical Page Number    Concatened to the page offset to build the 40 bits address
     36V       Valid entry     Valid entry when 1 (set by the OS)
     37T       entry Type      Must be 0 for a PTE2 (set by the OS)
     38L       Local access    Used by the OS for page replacement (set by the hardware)
     39R       Remote access   Used by the OS for page replacement (set by the hardware)
     40C       Cachable        The page is cachable in the L1 cache when 1 (set by the OS)
     41W       Writable        The page is writable when 1 (set by the OS)
     42X       eXecutable      The page can contain instructions when 1 (set by the OS)
     43U       User    The page accessible in user mode when 1 (set by the OS)
     44G       Global  Entry not invalidated in TLB flush when 1 (set by the OS)
     45D       Dirty   The page has been modified when 1 (set by the hardware)
     46
     47
     48The L, R, D bits are used by the operating system to implement the page replacement policy. The D bit is set by the hardware, when a page is written and when it is not already set, using an atomic access (LL/SC).
     49The L & R bits are set by the hardware, when the page is accessed after a TLB miss, and when it is not already set, using an atomic access (LL/SC).
     50
     51=== 1.3 First Level Page Table Entry Format ===
     52
     53Each entry in a first level page table is a 32 bits word containing either a 2M bytes page descriptor (called PTE1), or a second level  page table descriptor (called PTD1) :
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64If the entry is a PTE1, the PPN1 value (19 bits) must be concatened with the page offset (21 bits) to build the 40 bits physical address. The (V, T, L, R, C, W, X, U, G, D) bits have the same meaning as in a PTE2.
     65
     66If the entry is a PTD1, PTBA is the Page Table Base Address. The PTBA value (28 bits) must be left-shifted by 12 bits to define the base address of the level 2 page table. The page table being aligned in memory, the 12 LSB bits of this address have a 0 value.
     67
     68== 2. Generic MMU ==
     69
     70For each TSAR programmable processor, the generic MMU is implemented as an hardware component in the L1 cache controller. As the processor core can issue two simultaneous instruction and data requests, there is actually two separated hardware MMUs for instruction and data. Each MMU contains a TLB (Translation Look-aside Buffer).
     71These TLBs are implemented as set-associative caches containing 64 entries (8 sets of 8 ways). Each TLB contains a mix of 4Kbytes and 2 Mbytes page descriptors.
     72
     73for 4 Kbytes & 4 Mbytes pages.
     74
     75== 3. I/O MMU ==
     76
     77To be defined...
     78