Project

General

Profile

MMU description » History » Version 20

Taya Sergeeva, 02/11/2013 05:35 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
Buffer can be described by different parameters, such sets, lines, index, match, policy, and so on, which number is infixed.
42 1 Taya Sergeeva
43 15 Taya Sergeeva
h3.  ''set'' 
44 16 Taya Sergeeva
45 15 Taya Sergeeva
<pre>
46 1 Taya Sergeeva
  is an associativity of a buffer; it returns the number of lines in a one set;
47 15 Taya Sergeeva
</pre>
48 1 Taya Sergeeva
49 15 Taya Sergeeva
h3.  ''lines''
50 17 Taya Sergeeva
51 15 Taya Sergeeva
<pre>
52 1 Taya Sergeeva
  is the number of lines in a given buffer;
53 15 Taya Sergeeva
</pre>
54 13 Taya Sergeeva
55 15 Taya Sergeeva
h3.  ''line''
56 17 Taya Sergeeva
57 15 Taya Sergeeva
<pre>
58 1 Taya Sergeeva
  designates the specific line in which the necessary data will be looking for; 
59
  ''line'' includes its own parameters in the braces: ''tag'' and ''data'', each of them has an appropriate width of the fields kept in bytes;
60
  in our example ''line'' has only two parameters, but in general case it can include more;
61 15 Taya Sergeeva
</pre>
62 14 Taya Sergeeva
63 15 Taya Sergeeva
h3.  ''index''
64 17 Taya Sergeeva
65 15 Taya Sergeeva
<pre>
66 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'';
67 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''; 
68 15 Taya Sergeeva
</pre>
69 1 Taya Sergeeva
70 15 Taya Sergeeva
h3.  ''match'' 
71 17 Taya Sergeeva
72 1 Taya Sergeeva
<pre>
73 16 Taya Sergeeva
  returns ''true'' or ''false'' depending on if the data required is in the given line or not; 
74
  it returns ''true'' if there is a ''hit'' in the line, and returns ''false'' otherwise;
75 14 Taya Sergeeva
  ''match'' description contains the the initial and the final points of the address field in the triangle brackets after ''addr''; 
76 1 Taya Sergeeva
  as ''index'' in the round braces ''match'' also has the type of the address used; ''PA'' in our case;
77 15 Taya Sergeeva
</pre>
78 13 Taya Sergeeva
79 15 Taya Sergeeva
h3.  ''policy''
80 17 Taya Sergeeva
81 15 Taya Sergeeva
<pre>
82 20 Taya Sergeeva
  sets a policy which will be applied to our buffer, ''lru'' (Least Recently Used) in our example;
83
  policy also can be ''plru'' (Pseudo LRU) and ''fifo'' (First Input First Out).
84 15 Taya Sergeeva
</pre>