lua-logic/sim/compiled_sim_gates.c
2022-11-14 12:48:05 -06:00

198 lines
7.3 KiB
C

// Auto-generated by gencfuncs.lua
enum GateFuncs {
GateFunc_None,
GateFunc_Diode,
GateFunc_Not,
GateFunc_Enabler1,
GateFunc_Enabler2,
GateFunc_Enabler3,
GateFunc_Enabler4,
GateFunc_Enabler5,
GateFunc_Enabler6,
GateFunc_Enabler7,
GateFunc_Enabler8,
GateFunc_Enabler9,
GateFunc_Enabler10,
GateFunc_Enabler11,
GateFunc_Enabler12,
GateFunc_Enabler13,
GateFunc_Enabler14,
GateFunc_Enabler15,
GateFunc_Enabler16,
GateFunc_Enabler24,
GateFunc_Enabler32,
GateFunc_Enabler48,
GateFunc_Enabler64,
GateFunc_Buffer1,
GateFunc_Buffer2,
GateFunc_Buffer3,
GateFunc_Buffer4,
GateFunc_Buffer5,
GateFunc_Buffer6,
GateFunc_Buffer7,
GateFunc_Buffer8,
GateFunc_Buffer9,
GateFunc_Buffer10,
GateFunc_Buffer11,
GateFunc_Buffer12,
GateFunc_Buffer13,
GateFunc_Buffer14,
GateFunc_Buffer15,
GateFunc_Buffer16,
GateFunc_Buffer24,
GateFunc_Buffer32,
GateFunc_Buffer48,
GateFunc_Buffer64,
GateFunc_DFF1,
GateFunc_DFF2,
GateFunc_DFF3,
GateFunc_DFF4,
GateFunc_DFF5,
GateFunc_DFF6,
GateFunc_DFF7,
GateFunc_DFF8,
GateFunc_DFF9,
GateFunc_DFF10,
GateFunc_DFF11,
GateFunc_DFF12,
GateFunc_DFF13,
GateFunc_DFF14,
GateFunc_DFF15,
GateFunc_DFF16,
GateFunc_DFF24,
GateFunc_DFF32,
GateFunc_DFF48,
GateFunc_DFF64,
};
GATEFUNC(Diode) { setport(2, getport(1)); }
GATEFUNC(Not) { setport(2, !getport(1)); }
GATEFUNC(Enabler1) { if(getport(3)) { copyword(1, 1, 2); } else { clearword(1, 2); } }
GATEFUNC(Enabler2) { if(getport(5)) { copyword(2, 1, 3); } else { clearword(2, 3); } }
GATEFUNC(Enabler3) { if(getport(7)) { copyword(3, 1, 4); } else { clearword(3, 4); } }
GATEFUNC(Enabler4) { if(getport(9)) { copyword(4, 1, 5); } else { clearword(4, 5); } }
GATEFUNC(Enabler5) { if(getport(11)) { copyword(5, 1, 6); } else { clearword(5, 6); } }
GATEFUNC(Enabler6) { if(getport(13)) { copyword(6, 1, 7); } else { clearword(6, 7); } }
GATEFUNC(Enabler7) { if(getport(15)) { copyword(7, 1, 8); } else { clearword(7, 8); } }
GATEFUNC(Enabler8) { if(getport(17)) { copyword(8, 1, 9); } else { clearword(8, 9); } }
GATEFUNC(Enabler9) { if(getport(19)) { copyword(9, 1, 10); } else { clearword(9, 10); } }
GATEFUNC(Enabler10) { if(getport(21)) { copyword(10, 1, 11); } else { clearword(10, 11); } }
GATEFUNC(Enabler11) { if(getport(23)) { copyword(11, 1, 12); } else { clearword(11, 12); } }
GATEFUNC(Enabler12) { if(getport(25)) { copyword(12, 1, 13); } else { clearword(12, 13); } }
GATEFUNC(Enabler13) { if(getport(27)) { copyword(13, 1, 14); } else { clearword(13, 14); } }
GATEFUNC(Enabler14) { if(getport(29)) { copyword(14, 1, 15); } else { clearword(14, 15); } }
GATEFUNC(Enabler15) { if(getport(31)) { copyword(15, 1, 16); } else { clearword(15, 16); } }
GATEFUNC(Enabler16) { if(getport(33)) { copyword(16, 1, 17); } else { clearword(16, 17); } }
GATEFUNC(Enabler24) { if(getport(49)) { copyword(24, 1, 25); } else { clearword(24, 25); } }
GATEFUNC(Enabler32) { if(getport(65)) { copyword(32, 1, 33); } else { clearword(32, 33); } }
GATEFUNC(Enabler48) { if(getport(97)) { copyword(48, 1, 49); } else { clearword(48, 49); } }
GATEFUNC(Enabler64) { if(getport(129)) { copyword(64, 1, 65); } else { clearword(64, 65); } }
GATEFUNC(Buffer1) { if(getport(3)) { copyword(1, 1, 2); } else { clearword(1, 2); } }
GATEFUNC(Buffer2) { if(getport(5)) { copyword(2, 1, 3); } else { clearword(2, 3); } }
GATEFUNC(Buffer3) { if(getport(7)) { copyword(3, 1, 4); } else { clearword(3, 4); } }
GATEFUNC(Buffer4) { if(getport(9)) { copyword(4, 1, 5); } else { clearword(4, 5); } }
GATEFUNC(Buffer5) { if(getport(11)) { copyword(5, 1, 6); } else { clearword(5, 6); } }
GATEFUNC(Buffer6) { if(getport(13)) { copyword(6, 1, 7); } else { clearword(6, 7); } }
GATEFUNC(Buffer7) { if(getport(15)) { copyword(7, 1, 8); } else { clearword(7, 8); } }
GATEFUNC(Buffer8) { if(getport(17)) { copyword(8, 1, 9); } else { clearword(8, 9); } }
GATEFUNC(Buffer9) { if(getport(19)) { copyword(9, 1, 10); } else { clearword(9, 10); } }
GATEFUNC(Buffer10) { if(getport(21)) { copyword(10, 1, 11); } else { clearword(10, 11); } }
GATEFUNC(Buffer11) { if(getport(23)) { copyword(11, 1, 12); } else { clearword(11, 12); } }
GATEFUNC(Buffer12) { if(getport(25)) { copyword(12, 1, 13); } else { clearword(12, 13); } }
GATEFUNC(Buffer13) { if(getport(27)) { copyword(13, 1, 14); } else { clearword(13, 14); } }
GATEFUNC(Buffer14) { if(getport(29)) { copyword(14, 1, 15); } else { clearword(14, 15); } }
GATEFUNC(Buffer15) { if(getport(31)) { copyword(15, 1, 16); } else { clearword(15, 16); } }
GATEFUNC(Buffer16) { if(getport(33)) { copyword(16, 1, 17); } else { clearword(16, 17); } }
GATEFUNC(Buffer24) { if(getport(49)) { copyword(24, 1, 25); } else { clearword(24, 25); } }
GATEFUNC(Buffer32) { if(getport(65)) { copyword(32, 1, 33); } else { clearword(32, 33); } }
GATEFUNC(Buffer48) { if(getport(97)) { copyword(48, 1, 49); } else { clearword(48, 49); } }
GATEFUNC(Buffer64) { if(getport(129)) { copyword(64, 1, 65); } else { clearword(64, 65); } }
GATEFUNC(DFF1) { if(getport(3)) { copyword(1, 1, 2); } }
GATEFUNC(DFF2) { if(getport(5)) { copyword(2, 1, 3); } }
GATEFUNC(DFF3) { if(getport(7)) { copyword(3, 1, 4); } }
GATEFUNC(DFF4) { if(getport(9)) { copyword(4, 1, 5); } }
GATEFUNC(DFF5) { if(getport(11)) { copyword(5, 1, 6); } }
GATEFUNC(DFF6) { if(getport(13)) { copyword(6, 1, 7); } }
GATEFUNC(DFF7) { if(getport(15)) { copyword(7, 1, 8); } }
GATEFUNC(DFF8) { if(getport(17)) { copyword(8, 1, 9); } }
GATEFUNC(DFF9) { if(getport(19)) { copyword(9, 1, 10); } }
GATEFUNC(DFF10) { if(getport(21)) { copyword(10, 1, 11); } }
GATEFUNC(DFF11) { if(getport(23)) { copyword(11, 1, 12); } }
GATEFUNC(DFF12) { if(getport(25)) { copyword(12, 1, 13); } }
GATEFUNC(DFF13) { if(getport(27)) { copyword(13, 1, 14); } }
GATEFUNC(DFF14) { if(getport(29)) { copyword(14, 1, 15); } }
GATEFUNC(DFF15) { if(getport(31)) { copyword(15, 1, 16); } }
GATEFUNC(DFF16) { if(getport(33)) { copyword(16, 1, 17); } }
GATEFUNC(DFF24) { if(getport(49)) { copyword(24, 1, 25); } }
GATEFUNC(DFF32) { if(getport(65)) { copyword(32, 1, 33); } }
GATEFUNC(DFF48) { if(getport(97)) { copyword(48, 1, 49); } }
GATEFUNC(DFF64) { if(getport(129)) { copyword(64, 1, 65); } }
GateFunc sim_logic_functions[] = {
0,
GATEFUNCID(Diode),
GATEFUNCID(Not),
GATEFUNCID(Enabler1),
GATEFUNCID(Enabler2),
GATEFUNCID(Enabler3),
GATEFUNCID(Enabler4),
GATEFUNCID(Enabler5),
GATEFUNCID(Enabler6),
GATEFUNCID(Enabler7),
GATEFUNCID(Enabler8),
GATEFUNCID(Enabler9),
GATEFUNCID(Enabler10),
GATEFUNCID(Enabler11),
GATEFUNCID(Enabler12),
GATEFUNCID(Enabler13),
GATEFUNCID(Enabler14),
GATEFUNCID(Enabler15),
GATEFUNCID(Enabler16),
GATEFUNCID(Enabler24),
GATEFUNCID(Enabler32),
GATEFUNCID(Enabler48),
GATEFUNCID(Enabler64),
GATEFUNCID(Buffer1),
GATEFUNCID(Buffer2),
GATEFUNCID(Buffer3),
GATEFUNCID(Buffer4),
GATEFUNCID(Buffer5),
GATEFUNCID(Buffer6),
GATEFUNCID(Buffer7),
GATEFUNCID(Buffer8),
GATEFUNCID(Buffer9),
GATEFUNCID(Buffer10),
GATEFUNCID(Buffer11),
GATEFUNCID(Buffer12),
GATEFUNCID(Buffer13),
GATEFUNCID(Buffer14),
GATEFUNCID(Buffer15),
GATEFUNCID(Buffer16),
GATEFUNCID(Buffer24),
GATEFUNCID(Buffer32),
GATEFUNCID(Buffer48),
GATEFUNCID(Buffer64),
GATEFUNCID(DFF1),
GATEFUNCID(DFF2),
GATEFUNCID(DFF3),
GATEFUNCID(DFF4),
GATEFUNCID(DFF5),
GATEFUNCID(DFF6),
GATEFUNCID(DFF7),
GATEFUNCID(DFF8),
GATEFUNCID(DFF9),
GATEFUNCID(DFF10),
GATEFUNCID(DFF11),
GATEFUNCID(DFF12),
GATEFUNCID(DFF13),
GATEFUNCID(DFF14),
GATEFUNCID(DFF15),
GATEFUNCID(DFF16),
GATEFUNCID(DFF24),
GATEFUNCID(DFF32),
GATEFUNCID(DFF48),
GATEFUNCID(DFF64),
};