Project

General

Profile

Getting Started with x86 » History » Revision 10

Revision 9 (Alexander Kamkin, 04/06/2017 04:18 PM) → Revision 10/87 (Alexander Kamkin, 04/06/2017 04:19 PM)

h1. Getting Started with the x86 (8086) Demo 

 {{toc}} 

 h2. Prerequisite 

 MicroTESK should be installed (see [[Installation Guide]]). 

 h2. Overview of the x86 Demo Specifications 

 Specifications of the x86 instruction set architecture can be found in @$MICROTESK_HOME/arch/demo/x86/model@. 

 Each instruction is described in nML (see [[nML Language Reference]]) by means of the following constructs (register move instruction is taken as an example): 

 ## the signature Its declaration 
 <pre>op mov_r1616 (dst: GPR16, src: GPR16)</pre> 
 ## the Its assembly format representation 
 <pre>syntax = format("mov %s, %s", dst.syntax, src.syntax)</pre> 
 ## the Its binary encoding coding 
 <pre>image = format("1000101111%s%s", dst.image, src.image)</pre> 
 ## the action Its semantics 
 <pre> 
   action = { 
     dst = src; 
     ... 
   } 
 </pre> 

 To compile the model, run the following command: 
 <pre>$MICROTESK_HOME/bin/compile.sh x86.nml</pre> 

 h2. Overview of x86 Test Templates 

 Test templates for the x86 model can be found into @$MICROTESK_HOME/arch/demo/x86/templates@. 

 As by now, it contains six demonstration templates: 
 # @block.rb@ to show usage of the instruction blocks 
 # @block_random.rb@ to show creation of the randomized instruction sequences using block constructs 
 # @euclid.rb@ to show MicroTESK simulating the execution of a test program to predict the resulting state of the PE under test 
 # @random.rb@ to show generation of the randomized test cases by using biased values, intervals, arrays and distributions 
 # @random_immediate.rb@ to show generation of random immediate values 
 # @random_registers.rb@ to show dependent instructions with random registers 

 To run template processing use the following command: 
 <pre>$MICROTESK_HOME/bin/generate.sh x86 block.rb --code-file-prefix block --code-file-extension -v</pre> 
 When the processing is finished, files with the resulting assembly code can be found in @$MICROTESK_HOME@ 

 For more information, see MicroTESK wiki: http://forge.ispras.ru/projects/microtesk/wiki/Template_Description_Language