MMU description » History » Version 17
Taya Sergeeva, 02/11/2013 05:22 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 | 5 | Taya Sergeeva | For instance, this is an example of such file below: |
11 | |||
12 | 10 | Alexander Kamkin | <pre> |
13 | 2 | Taya Sergeeva | address PA |
14 | { |
||
15 | width = 40 |
||
16 | } |
||
17 | |||
18 | buffer L1 |
||
19 | { |
||
20 | sets = 4 |
||
21 | lines = 128 |
||
22 | line = (tag:30 data:256) |
||
23 | index(addr:PA) = addr<9**8> |
||
24 | match(addr:PA) = line.tag == addr<39**10> |
||
25 | policy = lru |
||
26 | 1 | Taya Sergeeva | } |
27 | 10 | Alexander Kamkin | </pre> |
28 | 5 | Taya Sergeeva | |
29 | 9 | 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. |
30 | 11 | Taya Sergeeva | |
31 | 12 | Taya Sergeeva | Buffer can be described by different parameters, such sets, lines, index, match, policy, and so on, which number is infixed. |
32 | 13 | Taya Sergeeva | |
33 | 12 | Taya Sergeeva | Description of each constructor in the buffer example is below: |
34 | 1 | Taya Sergeeva | |
35 | 15 | Taya Sergeeva | h3. ''set'' |
36 | 16 | Taya Sergeeva | |
37 | 15 | Taya Sergeeva | <pre> |
38 | 1 | Taya Sergeeva | is an associativity of a buffer; it returns the number of lines in a one set; |
39 | 15 | Taya Sergeeva | </pre> |
40 | 1 | Taya Sergeeva | |
41 | 15 | Taya Sergeeva | h3. ''lines'' |
42 | 17 | Taya Sergeeva | |
43 | 15 | Taya Sergeeva | <pre> |
44 | 1 | Taya Sergeeva | is the number of lines in a given buffer; |
45 | 15 | Taya Sergeeva | </pre> |
46 | 13 | Taya Sergeeva | |
47 | 15 | Taya Sergeeva | h3. ''line'' |
48 | 17 | Taya Sergeeva | |
49 | 15 | Taya Sergeeva | <pre> |
50 | 1 | Taya Sergeeva | designates the specific line in which the necessary data will be looking for; |
51 | ''line'' includes its own parameters in the braces: ''tag'' and ''data'', each of them has an appropriate width of the fields kept in bytes; |
||
52 | in our example ''line'' has only two parameters, but in general case it can include more; |
||
53 | 15 | Taya Sergeeva | </pre> |
54 | 14 | Taya Sergeeva | |
55 | 15 | Taya Sergeeva | h3. ''index'' |
56 | 17 | Taya Sergeeva | |
57 | 15 | Taya Sergeeva | <pre> |
58 | 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''; |
59 | 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''; |
60 | 15 | Taya Sergeeva | </pre> |
61 | 1 | Taya Sergeeva | |
62 | 15 | Taya Sergeeva | h3. ''match'' |
63 | 17 | Taya Sergeeva | |
64 | 1 | Taya Sergeeva | <pre> |
65 | 16 | Taya Sergeeva | returns ''true'' or ''false'' depending on if the data required is in the given line or not; |
66 | it returns ''true'' if there is a ''hit'' in the line, and returns ''false'' otherwise; |
||
67 | 14 | Taya Sergeeva | ''match'' description contains the the initial and the final points of the address field in the triangle brackets after ''addr''; |
68 | 1 | Taya Sergeeva | as ''index'' in the round braces ''match'' also has the type of the address used; ''PA'' in our case; |
69 | 15 | Taya Sergeeva | </pre> |
70 | 13 | Taya Sergeeva | |
71 | 15 | Taya Sergeeva | h3. ''policy'' |
72 | 17 | Taya Sergeeva | |
73 | 15 | Taya Sergeeva | <pre> |
74 | 14 | Taya Sergeeva | sets a policy which will be applied to our buffer in a cache, ''lru'' (Least Recently Used) in our example. |
75 | 15 | Taya Sergeeva | </pre> |