miden_air/trace/chiplets/kernel_rom.rs
1use super::Felt;
2
3// CONSTANTS
4// ================================================================================================
5
6/// Number of columns needed to record an execution trace of the kernel ROM chiplet.
7pub const TRACE_WIDTH: usize = 5;
8
9// --- OPERATION SELECTORS ------------------------------------------------------------------------
10
11// All kernel ROM bus labels encode the chiplet selector [1, 1, 1, 1, 0], appended with the internal
12// selector `s_first` which indicates whether the chiplet should respond to an `init` or `call`
13// request. The value of the flag is derived following the usual convention, i.e.,
14// adding one to the big-endian representation of the full selector.
15
16/// Specifies a kernel procedure call operation to access a procedure in the kernel ROM.
17///
18/// The label is constructed as follows:
19/// - Chiplet selector: [1, 1, 1, 1, 0]
20/// - s_first value: 0
21/// - Combined selector: [1, 1, 1, 1, 0 | 0]
22/// - Reverse bits and add 1 to get final label value: [0 | 0, 1, 1, 1, 1] + 1 = 16
23pub const KERNEL_PROC_CALL_LABEL: Felt = Felt::new(0b001111 + 1);
24
25/// Specified the label of the kernel ROM initialization request by the verifier.
26///
27/// The label is constructed as follows:
28/// - Chiplet selector: [1, 1, 1, 1, 0]
29/// - s_first value: 1
30/// - Combined selector: [1, 1, 1, 1, 0 | 1]
31/// - Reverse bits and add 1 to get final label value: [1 | 0, 1, 1, 1, 1] + 1 = 48
32pub const KERNEL_PROC_INIT_LABEL: Felt = Felt::new(0b101111 + 1);