(Added brief intro) |
(→Architecture: Added on_tick()) |
||
| Line 20: | Line 20: | ||
* <code>arch_get_input($scratch_space: [Int], test: Int) Int</code> | * <code>arch_get_input($scratch_space: [Int], test: Int) Int</code> | ||
* <code>on_reset($scratch_space: [Int], test: Int)</code> | * <code>on_reset($scratch_space: [Int], test: Int)</code> | ||
** Optional | |||
* <code>on_tick($scratch_space: [Int], tick: Int, inputs: [Int], outputs: [Int]) TestResult</code> | |||
** Optional | ** Optional | ||
Revision as of 10:08, 23 July 2025
Each level folder contains a test.si file which has all the code for verifying level solutions. Written in Simplex.
A list of functions that can be used in test.si.
Functions
Component & Sequential
User defined functions for Component & Sequential type levels.
check_output($scratch_space: [Int], tick: Int, inputs: [Int], outputs: [Int]) TestResultget_input($scratch_space: [Int], tick: Int, $inputs: [Int])on_reset($scratch_space: [Int], test: Int)- Optional
Architecture
User defined functions for Architecture type levels.
arch_check_output($scratch_space: [Int], test: Int, input: Int, output: Int) TestResultarch_get_input($scratch_space: [Int], test: Int) Inton_reset($scratch_space: [Int], test: Int)- Optional
on_tick($scratch_space: [Int], tick: Int, inputs: [Int], outputs: [Int]) TestResult- Optional
Callable
The test framework defines these function which may be used in test.si for any type of level.
add_keyboard_value(value: Int)front_panel_push(value: U8)get_assembler_register_count() Intget_assembler_width() Intget_component_count() Intget_console_offset() Intget_counter_value() Intget_delay_score() Intget_gate_score() Intget_last_time() Intget_latency_ram_is_busy() Boolget_level_memory(custom_string: String) Intget_probe_value() Intget_probe_width() Intget_program_address() Intget_ram_size() Intget_ram_value(address: Int) Intget_register_value(index: Int) Intget_tick() Inthas_console_component() Boolhas_counter_component() Boolhas_front_panel() Boolhas_keyboard_component() Boolhas_ram() Boolhas_time_component() Boolset_custom_input_text(input: String)set_error(input: String)ui_set_color(id: String, size: Int)ui_set_hidden(id: String, value: Bool)ui_set_image_name(id: String, text: Stringui_set_position(id: String, x: Int, y: Int)ui_set_size(id: String, size: Int)ui_set_text(id: String, text: String
