Opcode | Action | Flags | Description |
---|---|---|---|
XFILL Rx,Ry | FPGA[address] ← fill data | Fills Memory in the PMP space. Rx is the start address. Ry is used for two functions. The lower 24 bits specifies how many 32 bit words to write, starting at Rx, and the upper 8 bits specifies the value to fill with. i.e. XFILL R0,R1 This will fill | |
RFILL Rx,Ry | FPGA[address] ← fill data | This instruction, combined with RSET below, can be used to fill memory in FPGA space with either patterned data (i.e. all FF’s, all 00’s, etc) or randomish data that is similar patterns found on uninitialized SRAM chips. It has several options for a high degree of flexibility. Rx is the start address of data to write, and Ry is the length. Rx and Ry both should be word aligned, and this is enforced by clearing the bottom two bits of each value before use. i.e. data can only be written in 4 byte chunks, starting at a 32 bit word aligned address. See RSET for how the settings work. | |
RSET #rriiddss | rr - 8 bit value for rounds. (default is 3) RFILL.rounds ← rr (default value is 3) | RSET is used to control how the RFILL instruction works. RSET is the RFILL SETtings instruction. Density — the density of bit flips. Span — the length of the runs of 0's and 1's before alternating. Typically, uninitialized SRAM is in contiguous blocks of 00's and FF's with random bit flips, so this sets the span of each block of 00 or FF data. The length of the block is 2^n, so a value of 6 will give 64 byte blocks of 00's and FF's. Setting it to a large value (i.e. 30) will make the block so large it will never alternate. Inversion — Rounds — how many times the density operation is performed. The default values: For a straight FF fill: | |
TEST Rx,Ry | Z ← 1 If Rx == Ry | ZC | Tests two text strings. Rx holds the "master" string and Ry holds the "test" string. Attempting to test past the end of RAM will result in the compare stopping and neither flag will be set. |
ERR Rx, Ry | Rx ← error number | Puts the current error number into Rx and the PC where the error occurred into Ry.
| |
EXIT 0 | Exits the VM. When a file is successfully loaded or processed, EXIT 0 will be the final instruction executed. | ||
EXIT 1 | Exits the VM. EXIT 1 is a failure. If there was an error for some reason (bad header, etc) then | ||
UIVISIBLE Rx,Ry | A | Z | Checks or sets the state of a UI element's visibility. This allows UI elements to be turned on and off by the chip32 code, in case they may or may not be needed. An example would be dip switch settings. Some things might only need 4, others 8. This instruction allows the number of dip switches to be changed so only relevant ones are displayed. Rx is the UI element to test or set, and Ry is what happens. If Ry is 0 or 1, the desired element is turned off or on (respectively). If a value of 2 is used (or any other value, please keep it at 2 for future expansion), the status of the UI element's visibility is returned in the Z flag. Z will be set if it's visible and clear if it isn't. |
GETTIME Rx,Ry | Ry ← TimeData[Rx] | Gets data from the real-time clock, depending on the value of Rx. 0: UNIX time into integer. | |
CORE Rx | FPGA ← core bitstream | Causes the core number to be loaded as specified in the json file. When this instruction is executed, it will load the core. If the core is already loaded, this instruction will effectively be skipped. CORE R0 - loads core 0 | |
HOST Rx,Ry | Performs a host operation. Rx contains the command, and Ry is an optional parameter. The currently supported values are:
After Chip32 finishes loading slots and any additional setup, the program MUST call |