Getting Started with x86 » History » Version 8
Alexander Kamkin, 04/06/2017 04:10 PM
1 | 8 | Alexander Kamkin | h1. Getting Started with the x86 (8086) Demo |
---|---|---|---|
2 | 1 | Mikhail Chupilko | |
3 | {{toc}} |
||
4 | |||
5 | h2. Prerequisite |
||
6 | |||
7 | 5 | Alexander Kamkin | MicroTESK should be installed (see [[Installation Guide]]). |
8 | 1 | Mikhail Chupilko | |
9 | 8 | Alexander Kamkin | h2. Overview of the x86 Demo Specifications |
10 | 1 | Mikhail Chupilko | |
11 | 8 | Alexander Kamkin | Specifications of the x86 instruction set architecture can be found in @$MICROTESK_HOME/arch/demo/x86/model@. |
12 | 1 | Mikhail Chupilko | |
13 | 8 | Alexander Kamkin | Each instruction is described in nML (see [[nML Language Reference]]) by means of the following constructs (register move instruction is taken as an example): |
14 | |||
15 | ## Its declaration |
||
16 | <pre>op mov_r1616 (dst: GPR16, src: GPR16)</pre> |
||
17 | ## Its assembly representation |
||
18 | <pre>syntax = format("mov %s, %s", dst.syntax, src.syntax)</pre> |
||
19 | ## Its binary coding |
||
20 | <pre>image = format("1000101111%s%s", dst.image, src.image)</pre> |
||
21 | 1 | Mikhail Chupilko | ## Its semantics |
22 | <pre> |
||
23 | action = { |
||
24 | dst = src; |
||
25 | instr_size = instr_size + 2; |
||
26 | } |
||
27 | </pre> |
||
28 | |||
29 | 8 | Alexander Kamkin | To compile the model, run the following command: |
30 | <pre>$MICROTESK_HOME/bin/compile.sh x86.nml</pre> |
||
31 | 1 | Mikhail Chupilko | |
32 | h2. Overview of x86 Test Templates |
||
33 | |||
34 | Test templates for the x86 model can be found into @$MICROTESK_HOME/arch/demo/x86/templates@. |
||
35 | |||
36 | As by now, it contains six demonstration templates: |
||
37 | # @block.rb@ to show usage of the instruction blocks |
||
38 | # @block_random.rb@ to show creation of the randomized instruction sequences using block constructs |
||
39 | # @euclid.rb@ to show MicroTESK simulating the execution of a test program to predict the resulting state of the PE under test |
||
40 | # @random.rb@ to show generation of the randomized test cases by using biased values, intervals, arrays and distributions |
||
41 | # @random_immediate.rb@ to show generation of random immediate values |
||
42 | # @random_registers.rb@ to show dependent instructions with random registers |
||
43 | |||
44 | To run template processing use the following command: |
||
45 | <pre>$MICROTESK_HOME/bin/generate.sh x86 block.rb --code-file-prefix block --code-file-extension -v</pre> |
||
46 | When the processing is finished, files with the resulting assembly code can be found in @$MICROTESK_HOME@ |
||
47 | |||
48 | For more information, see MicroTESK wiki: http://forge.ispras.ru/projects/microtesk/wiki/Template_Description_Language |