Skip to content

Commit

Permalink
WR is always normal. Custom settings to prolong MREQ & IORQ.
Browse files Browse the repository at this point in the history
  • Loading branch information
rejunity committed Jun 6, 2024
1 parent f802101 commit d22bcf7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/ci2406_z80.v
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ module ci2406_z80(
.wr_n (io_out[ 3]),
.rfsh_n (io_out[ 5]),

.early_signals(custom_settings[0])
.early_signals(custom_settings)
);
endmodule

Expand All @@ -286,7 +286,7 @@ module z80 (
output wire halt_n,
output wire busak_n,

input wire early_signals
input wire[1:0] early_signals
);

wire normal_mreq_n;
Expand All @@ -299,10 +299,19 @@ module z80 (
wire early_rd_n;
wire early_wr_n;

assign mreq_n = early_signals ? early_mreq_n : normal_mreq_n;
assign iorq_n = early_signals ? early_iorq_n : normal_iorq_n;
assign rd_n = early_signals ? early_rd_n : normal_rd_n;
assign wr_n = early_signals ? early_wr_n : normal_wr_n;
// assign mreq_n = early_signals ? early_mreq_n : normal_mreq_n;
// assign iorq_n = early_signals ? early_iorq_n : normal_iorq_n;
// assign rd_n = early_signals ? early_rd_n : normal_rd_n;
// assign wr_n = early_signals ? early_wr_n : normal_wr_n;

assign mreq_n = early_signals[1] ?
(rfsh_n ? (early_mreq_n & normal_mreq_n) : early_mreq_n) :
early_signals[0] ? early_mreq_n : normal_mreq_n;

assign iorq_n = early_signals[1] ? (early_iorq_n & normal_iorq_n) :
early_signals[0] ? early_iorq_n : normal_iorq_n;
assign rd_n = early_signals[0] ? early_rd_n : normal_rd_n;
assign wr_n = normal_wr_n;

tv80s #(
.Mode(0), // Z80 mode
Expand Down
1 change: 1 addition & 0 deletions test_chipignite/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ async def test__RESET(dut):
dut._log.info("Test RESET sequence")
dut._log.info("Reset")
dut.io_in.value = 0
dut.custom_settings.value = 0b00 # [long MREQ+IORQ, early RD+MREW+IORQ] WR always normal
dut.rst_n.value = 0
await ClockCycles(dut.clk, 2)
for z80_cycle in range(-4, 2):
Expand Down

0 comments on commit d22bcf7

Please sign in to comment.