etherforth_logo

Loader module

This module receives requests from Interpreter to process a load block. Load blocks are used to compile source code for several nodes at once, including whole application. Loader does so by calling Compiler for each block of source code. Loader can also nest calls to other load blocks. Loader dictionary includes words that reset the target chip, and fill target nodes with ether.

node 302 node 303 node 304 node 202 node 203 loader module floorplan

Description

Loader receives a request to process a load block from Interpreter through an ether message to node 304. The message contains number of the block to be loaded. Node 304 immediately requests node 303 to start parsing this block.

Node 303 requests node 304 to send an ether message to SRAM and get back content of the load block decomposed into 6-bit symbols. It then parses tags found, storing numbers (yellow decimal) on its own stack, and sending yellow words to be found in Loader's dictionary in node 202. Other tags are ignored.

Finding a word in the dictionary leads to its execution either in node 302 or 203. Of particular interest are words code, which calls Compiler and initiates compilation of one source block, and load, which interrupts loading of the current load block, saves its number and pointer indicating up to where the block has already been processed, and starts loading a block whose number has been previously placed on Loader's stack.

When a load block has been fully parsed and no error has been encountered, Loader checks if loading has been requested from another load block, and if so it unnests back to where loading of the previous block has been interrupted. Load process then continues from there. If loading of the block just finished has been requested directly from Interpreter then Loader sends a signal to the Interpreter that loading has been carried out successfully and ends the whole process.

Apart from loading and compiling application blocks, Loader's dictionary also contains words that prepare the target chip for an application. With these words we can reset the target chip, build a SERDES slave in its node 701, and fill all remaining nodes with ether.