R-SPU MIRR Compiler ยท Phase 2 Step 2.2 ยท Module: neonatal_respirator
examples/neonatal_respirator.mirr โ
compiled with cargo run -- --compile --json examples/neonatal_respirator.mirr.
This page shows what the MIRR Temporal Guard Compiler actually produces for that module.
| Guard Name | Strategy | Condition | Delay | Input Signal | Output Signal |
|---|---|---|---|---|---|
| sustained_pressure_drop | Counter | when airway_pressure < 50 | 1 000 cycles | airway_pressure | sustained_pressure_drop_out |
N = 1000 > 16 โ Counter-comparator. An 11-bit counter increments while
airway_pressure < 50 is sustained; the comparator fires when
the count reaches 1000, asserting the output to trigger emergency_clamp.
| Signal Name | Type | Kind |
|---|---|---|
| sustained_pressure_drop_counter | Unsigned(11) | Counter register |
| sustained_pressure_drop_cmp | Bool | Comparator output |
| sustained_pressure_drop_out | Bool | Logic gate (final output) |
| Name | Direction | Type |
|---|---|---|
| respirator_enable | in | bool |
| airway_pressure | in | u16 |
| clamp_valve | out | bool |
--json emits){
"guards": [
{
"Counter": {
"name": "sustained_pressure_drop",
"input_signal": "airway_pressure",
"output_signal": "sustained_pressure_drop_out",
"counter_signal": "sustained_pressure_drop_counter",
"comparator_signal": "sustained_pressure_drop_cmp",
"target_count": 1000,
"condition_kind": {
"Comparison": {
"signal": "airway_pressure",
"op": "Lt",
"value": {
"Integer": 50
}
}
}
}
}
],
"signals": [
{
"name": "sustained_pressure_drop_counter",
"ty": { "Unsigned": 11 },
"kind": "Counter",
"source": null
},
{
"name": "sustained_pressure_drop_cmp",
"ty": "Bool",
"kind": "Comparator",
"source": null
},
{
"name": "sustained_pressure_drop_out",
"ty": "Bool",
"kind": "LogicGate",
"source": null
}
],
"statistics": {
"shift_registers_used": 0,
"counters_used": 1,
"logic_gates_used": 1,
"max_delay_cycles": 1000,
"total_signals": 3,
"compilation_time_us": null
}
}
--dot emits)Run these commands from the project root to produce the real output:
cargo run -- --compile --json examples/neonatal_respirator.mirr cargo run -- --compile --dot examples/neonatal_respirator.mirr
MIRR Temporal Guard Compiler ยท Phase 2 Step 2.2 ยท MIRR-PHASE2-001 rev 1.2 ยท 98 tests passing ยท 0 clippy warnings