URL
https://opencores.org/ocsvn/eco32/eco32/trunk
Subversion Repositories eco32
[/] [eco32/] [trunk/] [doc/] [architecture.OLD] - Rev 180
Go to most recent revision | Compare with Previous | Blame | View Log
Hardware========General-------32 bits virtual addresses30 bits physical addresses32 bits data path width32 bits instruction width32 integer registersbyte addressable, big endian machinePhysical Address Space Utilisation----------------------------------The main memory extends from address 0 to MEMORY_SIZE,which has an upper limit of 512 MB. The ROM is locatedat 0x20000000; its size, ROM_SIZE, is at most 256 MB.The I/O is memory-mapped and located at 0x30000000; itssize is again at most 256 MB. The I/O address space isdivided evenly into 256 devices; each device may occupyup to 1 MB of address space.Machine Data Types------------------word 32 bitshalf 16 bitsbyte 8 bitsPaging------4 KB page sizeTLB---A TLB (translation lookaside buffer) is used to map virtual addresses tophysical ones. The mapping does not apply to addresses with both high-orderbits set; these addresses refer to physical memory and are never mapped bythe TLB. The TLB has 32 entries, each of which can be used to map a virtualpage number to a physical frame number. More than one page can be mapped tothe same physical frame ('aliasing'). It is a severe programming error,however, to have more than one entry for the same virtual page number inthe TLB. The result of a translation under these circumstances is undefined.Whenever an address translation takes place, all entries in the TLB aresearched in parallel ('fully associative memory'). Therefore a given pagenumber need not to be placed into a specific location in the TLB, anylocation will do. If no entry matches the page number, the processor takesan exception (see below).TLB Entries-----------A TLB entry consists of two parts: the key (also called 'input' or 'EntryHi')and the value (also called 'output' or 'EntryLo'). The key consists of theupper 20 bits of the page number of a virtual address; the lower 12 bits arezero and not stored in the entry. The key is used to locate an entry in theTLB during an address translation. The only way to make sure that an entrydoes not match any virtual address is to set both high-order bits of theaddress; such an address is never mapped by the TLB (see above). The valueconsists of the frame address and two flags. The low-order 12 bits of theframe address are always zero; they are not stored in the entry. Furthermore,the two most significant bits are always zero because the physical addressrange is 1 GByte.TLB Registers-------------Four registers allow programming of the TLB and assist in managing addresstranslations of large address spaces in spite of a moderately sized TLB.Index:This register specifies the location in the TLB where the nextwrite-by-index or read-by-index instruction will take place.Furthermore, it will hold the index after a TLB search instruction(see below).EntryHi:This register holds the input part of a TLB entry, either beforewriting it or after reading it. Furthermore, any of the TLB-relatedexceptions (miss, invalid, write) will write the page number inquestion into this register in order to facilitate a rapid insertionof an appropriate mapping for this page into the TLB.EntryLo:This register holds the output part of a TLB entry, either beforewriting it or after reading it.BadAddr:Any of the addres translation exceptions (including the non-TLB relatedones such as illegal addresses, but excluding bus address errors) writethe offending address into this register. The operating system may findthis information useful.TLB Instructions----------------Four instructions are used to program the TLB. All four are privilegedinstructions that will cause an exception if executed in user mode.tbs (translation buffer search):The Index register is loaded with the address of the TLB entry whosecontents match the contents of the EntryHi register. If no TLB entrymatches, the high order bit of the Index register is set.tbwr (translation buffer write random):This instruction loads a pseudo-randomly specified TLB entry with thecontents of the EntryHi and EntryLo registers. A free running countersupplies the pseudo-random index. Entries 0..3 are never written toby this instruction.tbri (translation buffer read index):This instruction loads the EntryHi and EntryLo registers with thecontents of the TLB entry specified by the contents of the Indexregister.tbwi (translation buffer write index):This instruction loads the specified TLB entry with the contents ofthe EntryHi and EntryLo registers. The contents of the Index registerspecify the TLB entry.TLB Function------------Software========C Data Types------------long 32 bitsint 32 bitsshort 16 bitschar 8 bitsPage Tables-----------2 levels of page tables1024 entries per tabletopmost 10 bits of virtual address select an entry in the page directorythis entry points to a page tablenext 10 bits of virtual address select an entry in the page tablethis entry points to a page frameleast significant 12 bits of virtual address select a byte in the page framea single page table occupies exactly one pagetherefore we have 4 bytes per entrya page table entry has the following parts:20 bits physical page frame address
Go to most recent revision | Compare with Previous | Blame | View Log
