OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [monitor/] [monitor/] [common/] [mmu.h] - Blame information for rev 155

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 59 hellwig
/*
2
 * mmu.h -- memory and TLB access
3
 */
4
 
5
 
6
#ifndef _MMU_H_
7
#define _MMU_H_
8
 
9
 
10
#define TLB_SHFT        5               /* log2 of number of TLB entries */
11
#define TLB_SIZE        (1 << TLB_SHFT) /* total number of TLB entries */
12
#define TLB_MASK        (TLB_SIZE - 1)  /* mask for number of TLB entries */
13
#define TLB_FIXED       4               /* number of fixed TLB entries */
14
 
15
#define TLB_WRITE       (1 << 1)        /* write bit in EntryLo */
16
#define TLB_VALID       (1 << 0)        /* valid bit in EntryLo */
17
 
18
 
19
typedef struct {
20
  Word page;            /* 20 high-order bits of virtual address */
21
  Word frame;           /* 20 high-order bits of physical address */
22
  Bool write;           /* must be true to allow writing to the page */
23
  Bool valid;           /* must be true for the entry to be valid */
24
} TLB_Entry;
25
 
26
 
27
Word mmuReadWord(Word vAddr);
28
Half mmuReadHalf(Word vAddr);
29
Byte mmuReadByte(Word vAddr);
30
void mmuWriteWord(Word vAddr, Word data);
31
void mmuWriteHalf(Word vAddr, Half data);
32
void mmuWriteByte(Word vAddr, Byte data);
33
 
34
Word mmuGetIndex(void);
35
void mmuSetIndex(Word value);
36
Word mmuGetEntryHi(void);
37
void mmuSetEntryHi(Word value);
38
Word mmuGetEntryLo(void);
39 84 hellwig
void mmuSetEntryLo(Word value);
40
Word mmuGetBadAddr(void);
41
void mmuSetBadAddr(Word value);
42 59 hellwig
 
43
TLB_Entry mmuGetTLB(int index);
44
void mmuSetTLB(int index, TLB_Entry tlbEntry);
45
 
46
 
47
#endif /* _MMU_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.