SPDX-License-Identifier: GPL-3.0-or-later trireg-keepers.patch: lets lvd2's AY-3-8910 model (ay-3-8910_reverse_engineered cf8d14d, rtl/ay_model.v) run under Icarus Verilog, which has no trireg. Each of the model's six trireg nets becomes a plain wire with a weak keeper on it (ay_tb_keeper, defined in ../ay_tb.v), which holds the same charge: a strong driver wins and the keeper follows; with every driver released the keeper's value is the net's. Nothing else is touched. It is the output of ay8910-python's validation/icarus_port.py (MIT, alewman) on the pinned file, kept as a patch so the build needs no script from an MIT repository. Applied by ../build.sh to a copy (build/ay_model_icarus.v); the fetched tree stays as published. It carries the model's context lines, so it is GPL-3.0-or-later like the model. patch skips this preamble. --- a/rtl/ay_model.v +++ b/rtl/ay_model.v @@ -139,7 +139,7 @@ wire _sel_r16, _sel_r17; //wire [7:0] b; - trireg [7:0] b; + wire [7:0] b; ay_tb_keeper #(.W((7) - (0) + 1)) keep_b (b); wire [7:0] r7_b; // tone/noise enable @@ -1083,8 +1083,8 @@ output reg q_up, // upper and lower (on schematics) outputs output reg q_dn // ); - trireg up_store; // modelled passgates that feed NAND inputs of main gates - trireg dn_store; // + wire up_store; ay_tb_keeper #(.W(1)) keep_up_store (up_store); // modelled passgates that feed NAND inputs of main gates + wire dn_store; ay_tb_keeper #(.W(1)) keep_dn_store (dn_store); // wire int_up_rst; @@ -1118,7 +1118,7 @@ output wire [WIDTH-1:0] _q ); - trireg [WIDTH-1:0] inwire; + wire [WIDTH-1:0] inwire; ay_tb_keeper #(.W((WIDTH-1) - (0) + 1)) keep_inwire (inwire); assign inwire = load ? d : {WIDTH{1'bZ}}; @@ -1247,8 +1247,8 @@ wire [WIDTH-1:0] shin; - trireg [WIDTH-1:0] l1; - trireg [WIDTH-1:0] l2; + wire [WIDTH-1:0] l1; ay_tb_keeper #(.W((WIDTH-1) - (0) + 1)) keep_l1 (l1); + wire [WIDTH-1:0] l2; ay_tb_keeper #(.W((WIDTH-1) - (0) + 1)) keep_l2 (l2); // shift in