Open itsmevjnk opened 1 week ago
Thanks for notifying this. I'm fixing the test generator. I may port it to C and use my Z80 core to generate the tests. The cycles are wrong in several aspects, such as the ones you mentioned.
Corrections to these tests will be made soon.
BTW, we do not currently check "cycles"
in the validation workflow.
(crossposted from here)
While using the generated Z80 tests for testing my Z80 emulator, I discovered a couple of discrepancies in the timings of certain instructions tested in the generated cases in comparison to floooh's Z80 netlist simulator analysis:
LD (IX+d)/(IY+d),n
floooh's writeup states that the offset computation cycles are overlaid on the
n
value read cycle, with the latter immediately following thed
offset read cycle:However, the generated tests expect the
n
read cycle to be performed at the end of the offset computation cycle; in other words, the extra clock cycles above are moved to betweend
andn
loading cycles:EX (SP),HL/IX/IY
In floooh's writeup, this instruction essentially pops a 16-bit value off the stack into
WZ
, then pushesHL
(orIX
/IY
) onto the stack before setting it toWZ
, creating an "SP+0
read ->SP+1
read ->SP+1
write ->SP+0
write" address sequence (note theAB
column on the second half-cycle of the first memory read/write cycles):Whereas the generated tests expect an "
SP+0
read ->SP+1
read ->SP+0
write ->SP+1
write" sequence instead:RLD
/RRD
In floooh's analysis there's a full 4 extra clock cycles between the memory read and write cycles:
However, in the generated tests, the memory write is preceded by only 1 extra clock cycle, with the remaining 3 occurring after it: