-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsimple_bootloader.cairo
40 lines (33 loc) · 1.43 KB
/
simple_bootloader.cairo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
%builtins output pedersen range_check bitwise
from bootloader.recursive.run_simple_bootloader import run_simple_bootloader
from common.cairo_builtins import HashBuiltin
from common.registers import get_fp_and_pc
func main{output_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr, bitwise_ptr}() {
%{
from bootloader.objects import SimpleBootloaderInput
simple_bootloader_input = SimpleBootloaderInput.Schema().load(program_input)
%}
// Execute tasks.
run_simple_bootloader();
%{
# Dump fact topologies to a json file.
from bootloader.utils import (
configure_fact_topologies,
write_to_fact_topologies_file,
)
# The task-related output is prefixed by a single word that contains the number of tasks.
tasks_output_start = output_builtin.base + 1
if not simple_bootloader_input.single_page:
# Configure the memory pages in the output builtin, based on fact_topologies.
configure_fact_topologies(
fact_topologies=fact_topologies, output_start=tasks_output_start,
output_builtin=output_builtin,
)
if simple_bootloader_input.fact_topologies_path is not None:
write_to_fact_topologies_file(
fact_topologies_path=simple_bootloader_input.fact_topologies_path,
fact_topologies=fact_topologies,
)
%}
return ();
}