MMU description » History » Version 21
Taya Sergeeva, 02/11/2013 05:37 PM
1 | 1 | Taya Sergeeva | h1. MMU description |
---|---|---|---|
2 | |||
3 | 3 | Taya Sergeeva | Documentation with examples |
4 | 2 | Taya Sergeeva | |
5 | 6 | Taya Sergeeva | The MMU grammar is in ru.ispras.microtesk.translator.mmu.grammar folder. It contains Lexer, Parser and TreeWalker files. These files can be built by build.xml file (microtesk++/build.xml). The files generated (MMULexer.java, MMUParser.java, MMUTreeWalker.java) are in microtesk++.gen.ru.ispras.microtesk.translator.mmu.grammar folder. |
6 | 1 | Taya Sergeeva | |
7 | 8 | Taya Sergeeva | The folder ru.ispras.microtesk.translator.mmu.ir. contains the inner representation of the MMU hierarchy of one buffer. |
8 | 6 | Taya Sergeeva | MMU translator is in the ru.ispras.microtesk.translator.mmu.translator folder. After grammar files being generated the file ''BufferExample'' can be loaded to this translator. |
9 | |||
10 | 19 | Taya Sergeeva | Files in ru.ispras.microtesk.model.api.mmu folder contains different policies of cache. Folder ru.ispras.microtesk.model.api.mmu.buffer contains the model of MMU - the files which describe Buffer, Set, Line, Address expressions. |
11 | 1 | Taya Sergeeva | |
12 | 19 | Taya Sergeeva | For instance, this is an example of the buffer below: |
13 | |||
14 | 10 | Alexander Kamkin | <pre> |
15 | 2 | Taya Sergeeva | address PA |
16 | { |
||
17 | width = 40 |
||
18 | } |
||
19 | |||
20 | buffer L1 |
||
21 | { |
||
22 | sets = 4 |
||
23 | lines = 128 |
||
24 | line = (tag:30 data:256) |
||
25 | index(addr:PA) = addr<9**8> |
||
26 | match(addr:PA) = line.tag == addr<39**10> |
||
27 | policy = lru |
||
28 | 10 | Alexander Kamkin | } |
29 | 1 | Taya Sergeeva | </pre> |
30 | |||
31 | |||
32 | _Description of each constructor_ in the buffer example is below: |
||
33 | 19 | Taya Sergeeva | |
34 | h3. ''address'' |
||
35 | |||
36 | <pre> |
||
37 | gives the width of the field occupied in bytes; |
||
38 | ''address'' has a name; ''PA''(Physical Address) in our case; it also can be virtual (VA); |
||
39 | </pre> |
||
40 | |||
41 | 21 | Taya Sergeeva | h3. ''buffer'' |
42 | |||
43 | <pre> |
||
44 | has a name, ''L1'' in pur example; it can have names ''L2'' and ''TLB'' also; |
||
45 | ''buffer'' can be described by different parameters, such sets, lines, index, match, policy, and so on, which number is infixed; |
||
46 | </pre> |
||
47 | 1 | Taya Sergeeva | |
48 | 15 | Taya Sergeeva | h3. ''set'' |
49 | 16 | Taya Sergeeva | |
50 | 15 | Taya Sergeeva | <pre> |
51 | 1 | Taya Sergeeva | is an associativity of a buffer; it returns the number of lines in a one set; |
52 | 15 | Taya Sergeeva | </pre> |
53 | 1 | Taya Sergeeva | |
54 | 15 | Taya Sergeeva | h3. ''lines'' |
55 | 17 | Taya Sergeeva | |
56 | 15 | Taya Sergeeva | <pre> |
57 | 1 | Taya Sergeeva | is the number of lines in a given buffer; |
58 | 15 | Taya Sergeeva | </pre> |
59 | 13 | Taya Sergeeva | |
60 | 15 | Taya Sergeeva | h3. ''line'' |
61 | 17 | Taya Sergeeva | |
62 | 15 | Taya Sergeeva | <pre> |
63 | 1 | Taya Sergeeva | designates the specific line in which the necessary data will be looking for; |
64 | ''line'' includes its own parameters in the braces: ''tag'' and ''data'', each of them has an appropriate width of the fields kept in bytes; |
||
65 | in our example ''line'' has only two parameters, but in general case it can include more; |
||
66 | 15 | Taya Sergeeva | </pre> |
67 | 14 | Taya Sergeeva | |
68 | 15 | Taya Sergeeva | h3. ''index'' |
69 | 17 | Taya Sergeeva | |
70 | 15 | Taya Sergeeva | <pre> |
71 | 1 | Taya Sergeeva | returns the initial and the final points of the field kept in bytes; they are marked in a three-cornered brackets, after ''addr''; |
72 | 14 | Taya Sergeeva | ''index'' depends on an ''address'', which is ''physical'' (PA) in our case; the type of an address is set in the braces after ''index''; |
73 | 15 | Taya Sergeeva | </pre> |
74 | 1 | Taya Sergeeva | |
75 | 15 | Taya Sergeeva | h3. ''match'' |
76 | 17 | Taya Sergeeva | |
77 | 1 | Taya Sergeeva | <pre> |
78 | 16 | Taya Sergeeva | returns ''true'' or ''false'' depending on if the data required is in the given line or not; |
79 | it returns ''true'' if there is a ''hit'' in the line, and returns ''false'' otherwise; |
||
80 | 14 | Taya Sergeeva | ''match'' description contains the the initial and the final points of the address field in the triangle brackets after ''addr''; |
81 | 1 | Taya Sergeeva | as ''index'' in the round braces ''match'' also has the type of the address used; ''PA'' in our case; |
82 | 15 | Taya Sergeeva | </pre> |
83 | 13 | Taya Sergeeva | |
84 | 15 | Taya Sergeeva | h3. ''policy'' |
85 | 17 | Taya Sergeeva | |
86 | 15 | Taya Sergeeva | <pre> |
87 | 20 | Taya Sergeeva | sets a policy which will be applied to our buffer, ''lru'' (Least Recently Used) in our example; |
88 | policy also can be ''plru'' (Pseudo LRU) and ''fifo'' (First Input First Out). |
||
89 | 15 | Taya Sergeeva | </pre> |