Skip to main content

emit_testbench

Function emit_testbench 

Source
pub fn emit_testbench(
    c: &Candidate,
    ops: usize,
    max_cycles: u64,
    max_idle: u64,
) -> String
Expand description

A testbench that resets the harness for five cycles and runs it until ops results are folded. It prints QOR first cycles <n> when the first result is folded, QOR mid ops <n> cycles <n> at half the run, and QOR ops <n> misr <hex> cycles <n> at the end; an unknown MISR bit prints QOR X op <n> and stops. Two watchdogs end a run that cannot finish: max_cycles in all (QOR TIMEOUT ops <n>), and max_idle cycles without a folded result (QOR TIMEOUT idle <max_idle> cycles ops <n> cycle <n>), which refuses a candidate that has stopped answering long before the whole budget would.