add mux, demux, rom
This commit is contained in:
@@ -64,6 +64,61 @@ enum GateFuncs {
|
||||
GateFunc_DFF32,
|
||||
GateFunc_DFF48,
|
||||
GateFunc_DFF64,
|
||||
GateFunc_Mux1,
|
||||
GateFunc_Mux2,
|
||||
GateFunc_Mux3,
|
||||
GateFunc_Mux4,
|
||||
GateFunc_Mux5,
|
||||
GateFunc_Mux6,
|
||||
GateFunc_Mux7,
|
||||
GateFunc_Mux8,
|
||||
GateFunc_Demux1,
|
||||
GateFunc_Demux2,
|
||||
GateFunc_Demux3,
|
||||
GateFunc_Demux4,
|
||||
GateFunc_Demux5,
|
||||
GateFunc_Demux6,
|
||||
GateFunc_Demux7,
|
||||
GateFunc_Demux8,
|
||||
GateFunc_Rom4x1,
|
||||
GateFunc_Rom4x4,
|
||||
GateFunc_Rom4x8,
|
||||
GateFunc_Rom6x1,
|
||||
GateFunc_Rom6x4,
|
||||
GateFunc_Rom6x8,
|
||||
GateFunc_Rom6x16,
|
||||
GateFunc_Rom6x32,
|
||||
GateFunc_Rom6x48,
|
||||
GateFunc_Rom6x64,
|
||||
GateFunc_Rom8x1,
|
||||
GateFunc_Rom8x4,
|
||||
GateFunc_Rom8x8,
|
||||
GateFunc_Rom8x16,
|
||||
GateFunc_Rom8x32,
|
||||
GateFunc_Rom8x48,
|
||||
GateFunc_Rom8x64,
|
||||
GateFunc_Rom9x1,
|
||||
GateFunc_Rom9x4,
|
||||
GateFunc_Rom9x8,
|
||||
GateFunc_Rom9x16,
|
||||
GateFunc_Rom9x32,
|
||||
GateFunc_Rom9x48,
|
||||
GateFunc_Rom9x64,
|
||||
GateFunc_Rom10x8,
|
||||
GateFunc_Rom10x16,
|
||||
GateFunc_Rom10x32,
|
||||
GateFunc_Rom10x48,
|
||||
GateFunc_Rom10x64,
|
||||
GateFunc_Rom11x8,
|
||||
GateFunc_Rom11x16,
|
||||
GateFunc_Rom11x32,
|
||||
GateFunc_Rom11x48,
|
||||
GateFunc_Rom11x64,
|
||||
GateFunc_Rom12x8,
|
||||
GateFunc_Rom12x16,
|
||||
GateFunc_Rom12x32,
|
||||
GateFunc_Rom12x48,
|
||||
GateFunc_Rom12x64,
|
||||
};
|
||||
|
||||
GATEFUNC(Diode) { setport(2, getport(1)); }
|
||||
@@ -128,6 +183,61 @@ 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(Mux1) { if(getport(4)) { setport(5, getport(getword(1, 1)+2)); } else { setport(5, 0); } }
|
||||
GATEFUNC(Mux2) { if(getport(7)) { setport(8, getport(getword(2, 1)+3)); } else { setport(8, 0); } }
|
||||
GATEFUNC(Mux3) { if(getport(12)) { setport(13, getport(getword(3, 1)+4)); } else { setport(13, 0); } }
|
||||
GATEFUNC(Mux4) { if(getport(21)) { setport(22, getport(getword(4, 1)+5)); } else { setport(22, 0); } }
|
||||
GATEFUNC(Mux5) { if(getport(38)) { setport(39, getport(getword(5, 1)+6)); } else { setport(39, 0); } }
|
||||
GATEFUNC(Mux6) { if(getport(71)) { setport(72, getport(getword(6, 1)+7)); } else { setport(72, 0); } }
|
||||
GATEFUNC(Mux7) { if(getport(136)) { setport(137, getport(getword(7, 1)+8)); } else { setport(137, 0); } }
|
||||
GATEFUNC(Mux8) { if(getport(265)) { setport(266, getport(getword(8, 1)+9)); } else { setport(266, 0); } }
|
||||
GATEFUNC(Demux1) { int pa = getdata(0); if(getport(4)) { int a = getword(1, 1) + 2; if(pa != a) { if(pa) { setport(pa, 0); } setport(a, 1); setdata(0, a); } } else { if(pa) { setport(pa, 0); setdata(0, 0); } } }
|
||||
GATEFUNC(Demux2) { int pa = getdata(0); if(getport(7)) { int a = getword(2, 1) + 3; if(pa != a) { if(pa) { setport(pa, 0); } setport(a, 1); setdata(0, a); } } else { if(pa) { setport(pa, 0); setdata(0, 0); } } }
|
||||
GATEFUNC(Demux3) { int pa = getdata(0); if(getport(12)) { int a = getword(3, 1) + 4; if(pa != a) { if(pa) { setport(pa, 0); } setport(a, 1); setdata(0, a); } } else { if(pa) { setport(pa, 0); setdata(0, 0); } } }
|
||||
GATEFUNC(Demux4) { int pa = getdata(0); if(getport(21)) { int a = getword(4, 1) + 5; if(pa != a) { if(pa) { setport(pa, 0); } setport(a, 1); setdata(0, a); } } else { if(pa) { setport(pa, 0); setdata(0, 0); } } }
|
||||
GATEFUNC(Demux5) { int pa = getdata(0); if(getport(38)) { int a = getword(5, 1) + 6; if(pa != a) { if(pa) { setport(pa, 0); } setport(a, 1); setdata(0, a); } } else { if(pa) { setport(pa, 0); setdata(0, 0); } } }
|
||||
GATEFUNC(Demux6) { int pa = getdata(0); if(getport(71)) { int a = getword(6, 1) + 7; if(pa != a) { if(pa) { setport(pa, 0); } setport(a, 1); setdata(0, a); } } else { if(pa) { setport(pa, 0); setdata(0, 0); } } }
|
||||
GATEFUNC(Demux7) { int pa = getdata(0); if(getport(136)) { int a = getword(7, 1) + 8; if(pa != a) { if(pa) { setport(pa, 0); } setport(a, 1); setdata(0, a); } } else { if(pa) { setport(pa, 0); setdata(0, 0); } } }
|
||||
GATEFUNC(Demux8) { int pa = getdata(0); if(getport(265)) { int a = getword(8, 1) + 9; if(pa != a) { if(pa) { setport(pa, 0); } setport(a, 1); setdata(0, a); } } else { if(pa) { setport(pa, 0); setdata(0, 0); } } }
|
||||
GATEFUNC(Rom4x1) { if(getport(6)) { int a = getword(4, 1); for(int i=0; i<1; i++) { setport(5+i, getdata(a + i*16)); } } else { clearword(1, 5); } }
|
||||
GATEFUNC(Rom4x4) { if(getport(9)) { int a = getword(4, 1); for(int i=0; i<4; i++) { setport(5+i, getdata(a + i*16)); } } else { clearword(4, 5); } }
|
||||
GATEFUNC(Rom4x8) { if(getport(13)) { int a = getword(4, 1); for(int i=0; i<8; i++) { setport(5+i, getdata(a + i*16)); } } else { clearword(8, 5); } }
|
||||
GATEFUNC(Rom6x1) { if(getport(8)) { int a = getword(6, 1); for(int i=0; i<1; i++) { setport(7+i, getdata(a + i*64)); } } else { clearword(1, 7); } }
|
||||
GATEFUNC(Rom6x4) { if(getport(11)) { int a = getword(6, 1); for(int i=0; i<4; i++) { setport(7+i, getdata(a + i*64)); } } else { clearword(4, 7); } }
|
||||
GATEFUNC(Rom6x8) { if(getport(15)) { int a = getword(6, 1); for(int i=0; i<8; i++) { setport(7+i, getdata(a + i*64)); } } else { clearword(8, 7); } }
|
||||
GATEFUNC(Rom6x16) { if(getport(23)) { int a = getword(6, 1); for(int i=0; i<16; i++) { setport(7+i, getdata(a + i*64)); } } else { clearword(16, 7); } }
|
||||
GATEFUNC(Rom6x32) { if(getport(39)) { int a = getword(6, 1); for(int i=0; i<32; i++) { setport(7+i, getdata(a + i*64)); } } else { clearword(32, 7); } }
|
||||
GATEFUNC(Rom6x48) { if(getport(55)) { int a = getword(6, 1); for(int i=0; i<48; i++) { setport(7+i, getdata(a + i*64)); } } else { clearword(48, 7); } }
|
||||
GATEFUNC(Rom6x64) { if(getport(71)) { int a = getword(6, 1); for(int i=0; i<64; i++) { setport(7+i, getdata(a + i*64)); } } else { clearword(64, 7); } }
|
||||
GATEFUNC(Rom8x1) { if(getport(10)) { int a = getword(8, 1); for(int i=0; i<1; i++) { setport(9+i, getdata(a + i*256)); } } else { clearword(1, 9); } }
|
||||
GATEFUNC(Rom8x4) { if(getport(13)) { int a = getword(8, 1); for(int i=0; i<4; i++) { setport(9+i, getdata(a + i*256)); } } else { clearword(4, 9); } }
|
||||
GATEFUNC(Rom8x8) { if(getport(17)) { int a = getword(8, 1); for(int i=0; i<8; i++) { setport(9+i, getdata(a + i*256)); } } else { clearword(8, 9); } }
|
||||
GATEFUNC(Rom8x16) { if(getport(25)) { int a = getword(8, 1); for(int i=0; i<16; i++) { setport(9+i, getdata(a + i*256)); } } else { clearword(16, 9); } }
|
||||
GATEFUNC(Rom8x32) { if(getport(41)) { int a = getword(8, 1); for(int i=0; i<32; i++) { setport(9+i, getdata(a + i*256)); } } else { clearword(32, 9); } }
|
||||
GATEFUNC(Rom8x48) { if(getport(57)) { int a = getword(8, 1); for(int i=0; i<48; i++) { setport(9+i, getdata(a + i*256)); } } else { clearword(48, 9); } }
|
||||
GATEFUNC(Rom8x64) { if(getport(73)) { int a = getword(8, 1); for(int i=0; i<64; i++) { setport(9+i, getdata(a + i*256)); } } else { clearword(64, 9); } }
|
||||
GATEFUNC(Rom9x1) { if(getport(11)) { int a = getword(9, 1); for(int i=0; i<1; i++) { setport(10+i, getdata(a + i*512)); } } else { clearword(1, 10); } }
|
||||
GATEFUNC(Rom9x4) { if(getport(14)) { int a = getword(9, 1); for(int i=0; i<4; i++) { setport(10+i, getdata(a + i*512)); } } else { clearword(4, 10); } }
|
||||
GATEFUNC(Rom9x8) { if(getport(18)) { int a = getword(9, 1); for(int i=0; i<8; i++) { setport(10+i, getdata(a + i*512)); } } else { clearword(8, 10); } }
|
||||
GATEFUNC(Rom9x16) { if(getport(26)) { int a = getword(9, 1); for(int i=0; i<16; i++) { setport(10+i, getdata(a + i*512)); } } else { clearword(16, 10); } }
|
||||
GATEFUNC(Rom9x32) { if(getport(42)) { int a = getword(9, 1); for(int i=0; i<32; i++) { setport(10+i, getdata(a + i*512)); } } else { clearword(32, 10); } }
|
||||
GATEFUNC(Rom9x48) { if(getport(58)) { int a = getword(9, 1); for(int i=0; i<48; i++) { setport(10+i, getdata(a + i*512)); } } else { clearword(48, 10); } }
|
||||
GATEFUNC(Rom9x64) { if(getport(74)) { int a = getword(9, 1); for(int i=0; i<64; i++) { setport(10+i, getdata(a + i*512)); } } else { clearword(64, 10); } }
|
||||
GATEFUNC(Rom10x8) { if(getport(19)) { int a = getword(10, 1); for(int i=0; i<8; i++) { setport(11+i, getdata(a + i*1024)); } } else { clearword(8, 11); } }
|
||||
GATEFUNC(Rom10x16) { if(getport(27)) { int a = getword(10, 1); for(int i=0; i<16; i++) { setport(11+i, getdata(a + i*1024)); } } else { clearword(16, 11); } }
|
||||
GATEFUNC(Rom10x32) { if(getport(43)) { int a = getword(10, 1); for(int i=0; i<32; i++) { setport(11+i, getdata(a + i*1024)); } } else { clearword(32, 11); } }
|
||||
GATEFUNC(Rom10x48) { if(getport(59)) { int a = getword(10, 1); for(int i=0; i<48; i++) { setport(11+i, getdata(a + i*1024)); } } else { clearword(48, 11); } }
|
||||
GATEFUNC(Rom10x64) { if(getport(75)) { int a = getword(10, 1); for(int i=0; i<64; i++) { setport(11+i, getdata(a + i*1024)); } } else { clearword(64, 11); } }
|
||||
GATEFUNC(Rom11x8) { if(getport(20)) { int a = getword(11, 1); for(int i=0; i<8; i++) { setport(12+i, getdata(a + i*2048)); } } else { clearword(8, 12); } }
|
||||
GATEFUNC(Rom11x16) { if(getport(28)) { int a = getword(11, 1); for(int i=0; i<16; i++) { setport(12+i, getdata(a + i*2048)); } } else { clearword(16, 12); } }
|
||||
GATEFUNC(Rom11x32) { if(getport(44)) { int a = getword(11, 1); for(int i=0; i<32; i++) { setport(12+i, getdata(a + i*2048)); } } else { clearword(32, 12); } }
|
||||
GATEFUNC(Rom11x48) { if(getport(60)) { int a = getword(11, 1); for(int i=0; i<48; i++) { setport(12+i, getdata(a + i*2048)); } } else { clearword(48, 12); } }
|
||||
GATEFUNC(Rom11x64) { if(getport(76)) { int a = getword(11, 1); for(int i=0; i<64; i++) { setport(12+i, getdata(a + i*2048)); } } else { clearword(64, 12); } }
|
||||
GATEFUNC(Rom12x8) { if(getport(21)) { int a = getword(12, 1); for(int i=0; i<8; i++) { setport(13+i, getdata(a + i*4096)); } } else { clearword(8, 13); } }
|
||||
GATEFUNC(Rom12x16) { if(getport(29)) { int a = getword(12, 1); for(int i=0; i<16; i++) { setport(13+i, getdata(a + i*4096)); } } else { clearword(16, 13); } }
|
||||
GATEFUNC(Rom12x32) { if(getport(45)) { int a = getword(12, 1); for(int i=0; i<32; i++) { setport(13+i, getdata(a + i*4096)); } } else { clearword(32, 13); } }
|
||||
GATEFUNC(Rom12x48) { if(getport(61)) { int a = getword(12, 1); for(int i=0; i<48; i++) { setport(13+i, getdata(a + i*4096)); } } else { clearword(48, 13); } }
|
||||
GATEFUNC(Rom12x64) { if(getport(77)) { int a = getword(12, 1); for(int i=0; i<64; i++) { setport(13+i, getdata(a + i*4096)); } } else { clearword(64, 13); } }
|
||||
|
||||
GateFunc sim_logic_functions[] = {
|
||||
0,
|
||||
@@ -193,5 +303,60 @@ GateFunc sim_logic_functions[] = {
|
||||
GATEFUNCID(DFF32),
|
||||
GATEFUNCID(DFF48),
|
||||
GATEFUNCID(DFF64),
|
||||
GATEFUNCID(Mux1),
|
||||
GATEFUNCID(Mux2),
|
||||
GATEFUNCID(Mux3),
|
||||
GATEFUNCID(Mux4),
|
||||
GATEFUNCID(Mux5),
|
||||
GATEFUNCID(Mux6),
|
||||
GATEFUNCID(Mux7),
|
||||
GATEFUNCID(Mux8),
|
||||
GATEFUNCID(Demux1),
|
||||
GATEFUNCID(Demux2),
|
||||
GATEFUNCID(Demux3),
|
||||
GATEFUNCID(Demux4),
|
||||
GATEFUNCID(Demux5),
|
||||
GATEFUNCID(Demux6),
|
||||
GATEFUNCID(Demux7),
|
||||
GATEFUNCID(Demux8),
|
||||
GATEFUNCID(Rom4x1),
|
||||
GATEFUNCID(Rom4x4),
|
||||
GATEFUNCID(Rom4x8),
|
||||
GATEFUNCID(Rom6x1),
|
||||
GATEFUNCID(Rom6x4),
|
||||
GATEFUNCID(Rom6x8),
|
||||
GATEFUNCID(Rom6x16),
|
||||
GATEFUNCID(Rom6x32),
|
||||
GATEFUNCID(Rom6x48),
|
||||
GATEFUNCID(Rom6x64),
|
||||
GATEFUNCID(Rom8x1),
|
||||
GATEFUNCID(Rom8x4),
|
||||
GATEFUNCID(Rom8x8),
|
||||
GATEFUNCID(Rom8x16),
|
||||
GATEFUNCID(Rom8x32),
|
||||
GATEFUNCID(Rom8x48),
|
||||
GATEFUNCID(Rom8x64),
|
||||
GATEFUNCID(Rom9x1),
|
||||
GATEFUNCID(Rom9x4),
|
||||
GATEFUNCID(Rom9x8),
|
||||
GATEFUNCID(Rom9x16),
|
||||
GATEFUNCID(Rom9x32),
|
||||
GATEFUNCID(Rom9x48),
|
||||
GATEFUNCID(Rom9x64),
|
||||
GATEFUNCID(Rom10x8),
|
||||
GATEFUNCID(Rom10x16),
|
||||
GATEFUNCID(Rom10x32),
|
||||
GATEFUNCID(Rom10x48),
|
||||
GATEFUNCID(Rom10x64),
|
||||
GATEFUNCID(Rom11x8),
|
||||
GATEFUNCID(Rom11x16),
|
||||
GATEFUNCID(Rom11x32),
|
||||
GATEFUNCID(Rom11x48),
|
||||
GATEFUNCID(Rom11x64),
|
||||
GATEFUNCID(Rom12x8),
|
||||
GATEFUNCID(Rom12x16),
|
||||
GATEFUNCID(Rom12x32),
|
||||
GATEFUNCID(Rom12x48),
|
||||
GATEFUNCID(Rom12x64),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user