Skip to content

Commit

Permalink
Replace AOI cells with AO
Browse files Browse the repository at this point in the history
I explained here why: furrtek/DMG-CPU-Inside#77
  • Loading branch information
msinger committed Nov 24, 2021
1 parent 8dd5c24 commit 26adbf4
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 21 deletions.
3 changes: 1 addition & 2 deletions p13_channel1.sv
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ module channel1(
assign #T_INV cara = !cyto;
assign #T_AND cowe = cyto && duwo;
assign #T_OR boto = cowe || net03;
// TODO: Cells look like other AOI cells, but this only works when they are AO:
assign #T_AO hesu = (ff12_d3 && hoko) || (!hoko && nff12_d3);
assign #T_AO heto = (ff12_d3 && hemy) || (!hemy && nff12_d3);
assign #T_AO hyto = (ff12_d3 && hafo) || (!hafo && nff12_d3);
Expand Down Expand Up @@ -169,7 +168,7 @@ module channel1(
assign #T_NOR cava = !(nff11_d6 || ff11_d7);
assign #T_NOR cevu = !(ff11_d6 || nff11_d7);
assign #T_NOR caxo = !(nff11_d6 || nff11_d7);
assign #T_AOI duna = !((enek && coso) || (ezoz && cava) || (dape && cevu) || (codo && caxo));
assign #T_AO duna = (enek && coso) || (ezoz && cava) || (dape && cevu) || (codo && caxo);
assign ch1_bit = duna;

logic atuv, boje, buso, kala;
Expand Down
3 changes: 1 addition & 2 deletions p15_channel2.sv
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ module channel2(
assign #T_INV bodo = !caza;
assign #T_NOR cama = !(cemo || nbuta);
assign #T_INV doca = !cama;
// TODO: Cells look like other AOI cells, but this only works when they are AO:
assign #T_AO fopy = (fomy && ff17_d3) || (!fomy && nff17_d3);
assign #T_AO etup = (fete && ff17_d3) || (!fete && nff17_d3);
assign #T_AO faru = (feno && ff17_d3) || (!feno && nff17_d3);
Expand Down Expand Up @@ -130,7 +129,7 @@ module channel2(
assign #T_NOR dyta = !(nff16_d6 || ff16_d7);
assign #T_NOR doju = !(ff16_d6 || nff16_d7);
assign #T_NOR dove = !(nff16_d6 || nff16_d7);
assign #T_AOI exes = !((egog && domo) || (dymu && dyta) || (dyve && doju) || (dare && dove));
assign #T_AO exes = (egog && domo) || (dymu && dyta) || (dyve && doju) || (dare && dove);
assign elox_q = elox;
assign dory_q = dory;
assign akyd_nq = !akyd;
Expand Down
6 changes: 3 additions & 3 deletions p18_channel3.sv
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ module channel3(
assign #T_NOR goka = !(nff1c_d6 || ff1c_d5);
assign #T_NOR gemy = !(nff1c_d6 || nff1c_d5);
assign #T_NOR gege = !(ff1c_d6 || nff1c_d5);
assign #T_AOI ezag = !((wave_play_d[0] && gege) || (wave_play_d[1] && goka) || (wave_play_d[2] && gemy));
assign #T_AOI evug = !((wave_play_d[1] && gege) || (wave_play_d[2] && goka) || (wave_play_d[3] && gemy));
assign #T_AOI doky = !((gege && wave_play_d[2]) || (wave_play_d[3] && gemy));
assign #T_AO ezag = (wave_play_d[0] && gege) || (wave_play_d[1] && goka) || (wave_play_d[2] && gemy);
assign #T_AO evug = (wave_play_d[1] && gege) || (wave_play_d[2] && goka) || (wave_play_d[3] && gemy);
assign #T_AO doky = (gege && wave_play_d[2]) || (wave_play_d[3] && gemy);
assign #T_AND dore = wave_play_d[3] && gege;
assign #T_AND bary = ch3_active && ezag;
assign #T_AND byka = ch3_active && evug;
Expand Down
18 changes: 9 additions & 9 deletions p20_channel4.sv
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ module channel4(
assign #T_NOR etar = !(ff22_d6 || nff22_d5 || ff22_d4);
assign #T_NOR ever = !(ff22_d6 || ff22_d5 || nff22_d4);
assign #T_NOR etov = !(ff22_d6 || ff22_d5 || ff22_d4);
assign #T_AOI etyr = !((esep && dudu) || (dere && etat) || (dota && fura) ||
(erut && etar) || (dete && ever) || (dose && etov));
assign #T_AOI elyx = !((demo && emof) || (doke && elar) || (dale && dudu) || (dure && etat));
assign #T_AOI dary = !((epor && fura) || (ezef && etar) || (deko && ever) || (cexo && etov));
assign #T_AO etyr = (esep && dudu) || (dere && etat) || (dota && fura) ||
(erut && etar) || (dete && ever) || (dose && etov);
assign #T_AO elyx = (demo && emof) || (doke && elar) || (dale && dudu) || (dure && etat);
assign #T_AO dary = (epor && fura) || (ezef && etar) || (deko && ever) || (cexo && etov);
assign #T_OR eryf = dary || elyx;
assign #T_MUX feme = ff22_d7 ? etyr : eryf;
assign #T_MUX ezul = dyry ? feme : lfsr_out;
Expand Down Expand Up @@ -83,10 +83,10 @@ module channel4(
tffd tffd_fyro(elaf, ch4_restart, ff21_d7, fyro);
nor_srlatch latch_erox(fyno, enur, erox,);
assign #T_OR felo = ch4_eg_tick || ch4_eg_disable || erox;
assign #T_AOI fole = !((felo && ff21_d3) || (felo && nff21_d3));
assign #T_AOI etef = !((feko && ff21_d3) || (!feko && nff21_d3));
assign #T_AOI edyf = !((faty && ff21_d3) || (!faty && nff21_d3));
assign #T_AOI elaf = !((feru && ff21_d3) || (!feru && nff21_d3));
assign #T_AO fole = (felo && ff21_d3) || (felo && nff21_d3);
assign #T_AO etef = (feko && ff21_d3) || (!feko && nff21_d3);
assign #T_AO edyf = (faty && ff21_d3) || (!faty && nff21_d3);
assign #T_AO elaf = (feru && ff21_d3) || (!feru && nff21_d3);
assign #T_AND akof = feko && ch4_bit;
assign #T_AND byzy = faty && ch4_bit;
assign #T_AND apyr = feru && ch4_bit;
Expand Down Expand Up @@ -177,7 +177,7 @@ module channel4(
assign #T_OR gepo = ch4_restart || apu_reset;
assign #T_INV goge = !gepo;
assign #T_INV jyja = !ch4_lfsr_clk1;
assign #T_AOI kavu = !((joto && ff22_d3) || (nff22_d3 && juxe));
assign #T_AO kavu = (joto && ff22_d3) || (nff22_d3 && juxe);
assign #T_NAND game = !(gena && hezu);
assign #T_XNOR hura = hyro == hezu;
assign rst_ff23_d7 = guzy;
Expand Down
2 changes: 1 addition & 1 deletion p21_video_control.sv
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module video_control(
assign #T_INV vypu = !tolu;
assign #T_AND sepa = cpu_wr2 && ff41;
assign #T_INV ryve = !sepa;
assign #T_AOI suko = !((rugu && ropo) || (refe && int_oam) || (rufo && int_vbl) || (roxe && int_hbl));
assign #T_AO suko = (rugu && ropo) || (refe && int_oam) || (rufo && int_vbl) || (roxe && int_hbl);
assign #T_INV tuva = !suko;
assign #T_INV voty = !tuva;
assign #T_OR wego = tofu || voga;
Expand Down
4 changes: 2 additions & 2 deletions p24_lcd_control.sv
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module lcd_control(
assign #T_INV umob = !nff04_d0;
assign #T_INV usec = !nff04_d1;
assign #T_INV kedy = !ff40_d7;
assign #T_AOI kahe = !((ff40_d7 && kasa) || (kedy && umob));
assign #T_AOI kupa = !((ff40_d7 && kebo) || (kedy && usec));
assign #T_AO kahe = (ff40_d7 && kasa) || (kedy && umob);
assign #T_AO kupa = (ff40_d7 && kebo) || (kedy && usec);
assign #T_INV kymo = !kahe;
assign #T_INV kofo = !kupa;
assign pin_cpl = kymo;
Expand Down
2 changes: 1 addition & 1 deletion p28_oam.sv
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module oam(
assign #T_NAND bota = !(bofe && saro && cpu_rd2);
assign #T_INV xupa = !wuje;
assign #T_INV xuca = !waru;
assign #T_AOI apag = !((xupa && amab) || (ajuj && adah));
assign #T_AO apag = (xupa && amab) || (ajuj && adah);
assign #T_AND asyt = ajep && xuja && bota;
assign #T_INV azul = !apag;
assign #T_INV bode = !asyt;
Expand Down
2 changes: 1 addition & 1 deletion p29_sprite_control.sv
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ module sprite_control(
assign #T_TRI abem = !abon ? !xuqu : 'z;
assign #T_TRI dyso = !abon ? !0 : 'z;
assign #T_INV fufo = !ff40_d2;
assign #T_AOI gejy = !((!xuso && fufo) || (ff40_d2 && wago));
assign #T_AO gejy = (!xuso && fufo) || (ff40_d2 && wago);
assign #T_TRI famu = !abon ? !gejy : 'z;
assign d[1] = xele;
assign d[2] = ypon;
Expand Down

0 comments on commit 26adbf4

Please sign in to comment.