empty spaces within the file, allowing for greater flexibility. This version is also a
bit more fragile and difficult to understand.
File structure example (version 1, Table 20.3).
Notice that data and code are nonsensical, and are here just for example.
Appendix 2: Practical Introduction and Developer’s Guide
The following part will describe how to use the interpreter library for those who
wish to use it in their projects.
The interpreter library consists of a structure representing a single CPU running
the ERRIC architecture, as well as a number of functions that statelessly operate on
an instance of the function.
This allows the library to be flexible and to support different execution methods,
such as multiprocessor hardware setups. The structure of the library is implemented
in a way that makes easily understanding and use by all kinds of users: for those
who want to simply use the interpreter and for those who want to call individual
functions for specific purposes.
In order to use all of the main features of the emulator, the erric_interpreter.h
header file needs to be included. Files *_operators.h allow the user to call particular functions manually.
Initialization
In order to work with the library, an erric_t structure is required. The creation of
the structure instance can be done in two ways:
1. By the call init_erric(). The function creates the structure with the default
memory size of 65536 words, or
2. By the call init_erric_m(uint32_t _mem_size). The function allows the user
to specify the size of the memory needed.
The memory size is defined only during the creation and is not changeable while
using the library. This was done to make sure that the hardware can be properly
Table 20.3 File structure
Version 1
2 bytes Version + Padding
01 00
4 bytes data start
00 00 00 20
4 bytes data length
00 00 00 02
4 bytes code start
00 00 00 18
4 bytes code length
00 00 00 03
6 bytes ignored
13 37 10 01 DE AD
6 bytes code
AD DC 56 69 F7 B1
2 bytes ignored
00
4 bytes static data
FF F2 FF F4
302
20 ERRIC Machine Code Simulator
Précédent

- 309/315

Suivant