... | ... | @@ -5,7 +5,7 @@ As mentionned in the readme, the simulator and its environment run in a simple f |
|
|
1. Read and parse the netlist (as provided in the documentation, `netlist.ml`, `netlist_ast.ml`, `lexer.ml`, `parser.ml`)
|
|
|
2. Order the netlist according to the dependencies via a topological sort (`graph.ml`, `scheduler.ml`, see [the scheduler doc](/Functions#scheduler))
|
|
|
3. Simulate the netlist in a sequential fashion (`simulator.ml`, see [the simulator doc](Functions/#simulator))
|
|
|
1. Initialize the memory (currently the ROM cannot be inputted from the user)
|
|
|
1. Initialize the memory (see [Initialization](#initialization) for how ROM is constructed).
|
|
|
The memory is represented by its id. Memory is implemented via hash-tables, see [the corresponding part](#memory).
|
|
|
2. Take the input, see [Input](#input).
|
|
|
3. Make the combinatorial computations for a cycle, see [Computations](#computations).
|
... | ... | @@ -13,6 +13,13 @@ As mentionned in the readme, the simulator and its environment run in a simple f |
|
|
5. Give the output, see [Output](#output).
|
|
|
6. Go back to 2. if there are other steps to simulate.
|
|
|
|
|
|
# Initialization
|
|
|
|
|
|
The ROM is read in the folder defined by the user at the call of the program. By default, it is `./ROM`. The files are called `romid.rom` with `romid` the id of the ROM as indicated in the netlist file. This file, hereby named `id.rom` represents the content of the ROM, in the following fashion :
|
|
|
- One line of the file = one word of the ROM
|
|
|
- One line is a bit-word written in little-endian fashion, no more, no less. Nothing else than a string of 0s and 1s of the correct length will be accepted. Be prepared to be violently yelled at by the simulator at every teeny-weeny ever so slightly badly formatted line in the file. You've been warned.
|
|
|
- The file represents the first addresses of the ROM : it will fill contiguously from the start on, and the end of the file will indicate that the ROM is empty afterwards.
|
|
|
|
|
|
# Memory
|
|
|
|
|
|
There are two kinds of things to memorize during the simulation :
|
... | ... | |