mirror of
https://github.com/UzixLS/zx-multisound.git
synced 2026-06-15 10:21:33 +03:00
fix gs glitches with contended timings
This commit is contained in:
parent
bd57e87d4f
commit
4fe3fd7606
@ -75,6 +75,12 @@ always @(negedge clk32 or negedge rst_n) begin
|
|||||||
rom_m1_access <= a[15:14] == 2'b00;
|
rom_m1_access <= a[15:14] == 2'b00;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
reg n_rd_wr_delayed, n_rd_wr_delayed1;
|
||||||
|
always @(posedge clk32) begin
|
||||||
|
n_rd_wr_delayed <= n_rd_wr_delayed1;
|
||||||
|
n_rd_wr_delayed1 <= n_wr & n_rd;
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
/* CONFIGURATION */
|
/* CONFIGURATION */
|
||||||
wire ym_ena = cfg[0];
|
wire ym_ena = cfg[0];
|
||||||
@ -221,20 +227,28 @@ wire gs_dac3_wr = gs_dac3_cs && ~n_grd;
|
|||||||
reg gs_flag_cmd, gs_flag_data;
|
reg gs_flag_cmd, gs_flag_data;
|
||||||
wire [7:0] gs_status = {gs_flag_data, 6'b111111, gs_flag_cmd};
|
wire [7:0] gs_status = {gs_flag_data, 6'b111111, gs_flag_cmd};
|
||||||
|
|
||||||
always @(posedge clk32) begin
|
always @(posedge clk32 or negedge rst_n) begin
|
||||||
if ((~n_giorq && n_gm1 && ga[3:0] == 4'h2) || (ioreq_rd && port_b3))
|
if (!rst_n)
|
||||||
gs_flag_data <= 1'b0;
|
gs_flag_data <= 1'b0;
|
||||||
else if ((~n_giorq && n_gm1 && ga[3:0] == 4'h3) || (ioreq_wr && port_b3))
|
else if (~n_iorq && ~n_rd && n_rd_wr_delayed && port_b3)
|
||||||
|
gs_flag_data <= 1'b0;
|
||||||
|
else if (~n_iorq && ~n_wr && n_rd_wr_delayed && port_b3)
|
||||||
|
gs_flag_data <= 1'b1;
|
||||||
|
else if (~n_giorq && n_gm1 && ga[3:0] == 4'h2)
|
||||||
|
gs_flag_data <= 1'b0;
|
||||||
|
else if (~n_giorq && n_gm1 && ga[3:0] == 4'h3)
|
||||||
gs_flag_data <= 1'b1;
|
gs_flag_data <= 1'b1;
|
||||||
else if (~n_giorq && n_gm1 && ga[3:0] == 4'hA)
|
else if (~n_giorq && n_gm1 && ga[3:0] == 4'hA)
|
||||||
gs_flag_data <= ~gs_reg00[0];
|
gs_flag_data <= ~gs_reg00[0];
|
||||||
end
|
end
|
||||||
|
|
||||||
always @(posedge clk32) begin
|
always @(posedge clk32 or negedge rst_n) begin
|
||||||
if (~n_giorq && n_gm1 && ga[3:0] == 4'h5)
|
if (!rst_n)
|
||||||
gs_flag_cmd <= 1'b0;
|
gs_flag_cmd <= 1'b0;
|
||||||
else if (ioreq_wr && port_bb)
|
else if (~n_iorq && ~n_wr && n_rd_wr_delayed && port_bb)
|
||||||
gs_flag_cmd <= 1'b1;
|
gs_flag_cmd <= 1'b1;
|
||||||
|
else if (~n_giorq && n_gm1 && ga[3:0] == 4'h5)
|
||||||
|
gs_flag_cmd <= 1'b0;
|
||||||
else if (~n_giorq && n_gm1 && ga[3:0] == 4'hB)
|
else if (~n_giorq && n_gm1 && ga[3:0] == 4'hB)
|
||||||
gs_flag_cmd <= vol3[5];
|
gs_flag_cmd <= vol3[5];
|
||||||
end
|
end
|
||||||
|
|||||||
BIN
out/cpld.rev.A1.pof
vendored
BIN
out/cpld.rev.A1.pof
vendored
Binary file not shown.
Loading…
Reference in New Issue
Block a user