MIRR Temporal Netlist Viewer — Neonatal Respirator

# 🛡️ MIRR Temporal Netlist Viewer

R-SPU MIRR Compiler · Phase 2 Step 2.2 · Module: neonatal_respirator

Source file: `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.

## Resource Statistics

1
Guards
0
Shift Registers
1
Counter
3
Generated Signals
1 000
Max Delay (cycles)
11
Counter Width (bits)

## Compiled Guards

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

## Hardware Pipeline — Counter Strategy

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`.

airway_pressure
in u16
→
sustained_pressure_drop_counter
u11 counter
→
sustained_pressure_drop_cmp
bool comparator (== 1000)
→
sustained_pressure_drop_out
bool output

## Generated Signals

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)

## Module Signals (from MIRR source)

Name | Direction | Type
--- | --- | ---
respirator_enable | in | bool
airway_pressure | in | u16
clamp_valve | out | bool

▶ Raw JSON netlist (what `--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
      }
    }

▶ Graphviz DOT output (what `--dot` emits)
digraph TemporalNetlist { rankdir=LR; node [shape=box]; "sustained_pressure_drop_counter" [shape=diamond label="sustained_pressure_drop_counter\nUnsigned(11)"]; "sustained_pressure_drop_cmp" [shape=ellipse label="sustained_pressure_drop_cmp\nBool"]; "sustained_pressure_drop_out" [shape=box label="sustained_pressure_drop_out\nBool"]; subgraph cluster_sustained_pressure_drop { label="Counter: sustained_pressure_drop\nwhen airway_pressure < 50\nfor 1000 cycles"; "airway_pressure" -> "sustained_pressure_drop_counter"; "sustained_pressure_drop_counter" -> "sustained_pressure_drop_cmp"; "sustained_pressure_drop_cmp" -> "sustained_pressure_drop_out"; } }

## Regenerate from CLI

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