Skip to content
  • Alexander's avatar
    00c36032
    Add a golden regression suite over the parametric generators · 00c36032
    Alexander authored
    Follows llogic's own testing shape: `file_regression` against inputs in
    `tests/cases/{valid,invalid}` and goldens in `tests/test_translator`, as
    `.v` for the Verilog a circuit translates to and `.err` for the
    diagnostics an invalid one produces.
    
    Most of the valid cases are output of llogic's parametric generators --
    all thirteen of them, across widths and flag combinations -- which
    between them reach far more shapes of bit-vector port, nested module,
    wide gate and deep hierarchy than hand-written cases would. The rest
    cover what no generator emits: the reversible basis, flip-flops,
    constants, part-selects, and module names Verilog reserves.
    
    Reviewing the first generated goldens turned up a real defect, fixed
    here. `emit_module` built a port's `input`/`output` keyword once per
    declaration but appended ` reg` inside the loop over that declaration's
    wires, so in `output q, r` a flip-flop driving `q` left `r` declared
    `reg` as well -- and a continuous assignment to a `reg` is not legal
    Verilog. The keyword is now computed per wire, which is what
    `sequential_clock_collision` pins.
    00c36032
    Add a golden regression suite over the parametric generators
    Alexander authored
    Follows llogic's own testing shape: `file_regression` against inputs in
    `tests/cases/{valid,invalid}` and goldens in `tests/test_translator`, as
    `.v` for the Verilog a circuit translates to and `.err` for the
    diagnostics an invalid one produces.
    
    Most of the valid cases are output of llogic's parametric generators --
    all thirteen of them, across widths and flag combinations -- which
    between them reach far more shapes of bit-vector port, nested module,
    wide gate and deep hierarchy than hand-written cases would. The rest
    cover what no generator emits: the reversible basis, flip-flops,
    constants, part-selects, and module names Verilog reserves.
    
    Reviewing the first generated goldens turned up a real defect, fixed
    here. `emit_module` built a port's `input`/`output` keyword once per
    declaration but appended ` reg` inside the loop over that declaration's
    wires, so in `output q, r` a flip-flop driving `q` left `r` declared
    `reg` as well -- and a continuous assignment to a `reg` is not legal
    Verilog. The keyword is now computed per wire, which is what
    `sequential_clock_collision` pins.
Loading