OpenCores

POP instruction doesn't update SP properly

Back to bugtracker overview.

Information:
Type :: BUG
Status :: CLOSED
Assigned to :: nobody

Description:
Simulation of instructions POP HL and POP BC shows that SP is incremented only once. The issue seems to be caused by this code, located at line #643 of NextZ80CPU.v

REG_WSEL = {1'b0, FETCH[5:4], 1'bx};

In other instructions, bit 0 of REG_WSEL is used to select hi or low order byte of the destination register depending on the stage cycle of the instruction. Changing that line with this:

REG_WSEL = {1'b0, FETCH[5:4], ~STAGE[0]};

fixed the issue for me.

Comments:

Rodriguez Jodar, Miguel Angel May 17, 2018
The bug manifested after I changed all "x" by "0" in the code.
Dumitrache, Nicolae May 14, 2018
You may replace the 'x' with '0' or '1',or use the "Post-Translate" simulation.

Post a comment:
Login to post comments!

Back to bugtracker overview.

© copyright 1999-2019 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.