OpenCores

cpu65c02_tc - R65C02 Processor Soft Core with accurate timing

Issue List
JMP page crossing bug #8
Closed hoglet opened this issue over 6 years ago
hoglet commented over 6 years ago

Hi Jens,

Are you still interested in bug reports for the 65C02 True Cycle core?

Here is bug 1 of 3:

When a JMP instruction straddles a page boundary, e.g.

10FE 4C 03 00 JMP 0003

The third byte is fetched from the wrong page. So in the above example, it would be fetched from 0x1000 rather than 0x1100.

This bug causes Acorn Tube Elite to crash when F6 is pressed. It also causes the call command in BBC Basic IV to crash. It is not picked up by the Dorman tests.

I can provide a GHDL simulation of this.

I believe this is the fix: https://github.com/hoglet67/CoPro6502/commit/d283556ab75efa09f14a1da53514b1fb34b6aa26

It simulates correctly, and resolves the above issues on Tube Elite and BBC Basic. The Dormann tests still pass.

Many thanks for your excellent core!

Dave (hoglet on 6502.org and stardot.org.uk)

fpga_is_funny commented over 6 years ago

Hi Dave

I'm still interessted. Thanks a lot for your reports! Since late 2013's there were too few users and drastic changes in opencores's version management. I shifted my workload to other things...;-).

-> 10FE 4C 03 00 JMP 0003 Little effort to fix it. This bug have its origin from an early misinterpretion of 6502/R65C02 differencies. So the testbenches "test all instruction codes on all possible memory locations" gives a PASSED. Will be fixed in upcoming new version (v1.5 internal version management)

GENERAL NOTE: There exist a RC (Release Candidate AUG-2013) of the cpu_r65c02_tc which was never uploaded to "opencores" and includes some more important bug fixes (high effort to adopt the new version management introduced by "opencores" in 2013 to my local project management):

Revision 1.5 RC 2013/08/01 13:57:00 jens

  • Optimation of recource utilization (ALU)
  • Change Block name to lower case
  • Bug Fix CMP (IND) - wrongly decoded as function AND
  • Bug Fix BRK should clear decimal flag in P Reg
  • Bug Fix JMP (ABS,X) - Low Address outputted twice - no High Address
  • Bug Fix Unknown Ops - Used always 1b2c NOP ($EA) - new NOPs created
  • Bug Fix DECIMAL ADC and SBC (all op codes - "C" flag was computed wrong)
  • Bug Fix INC/DEC ABS,X - N/Z flag wrongly computed
  • Bug Fix RTI - should increment stack pointer
  • Bug Fix "E" & "B" flags (Bits 5 & 4) - should be always "1" in P Reg. Change "RES", "RTI", "IRQ" & "NMI" substates.
  • Bug Fix ADC and SBC (all sub codes - "Overflow" flag was computed wrong)
  • Bug Fix RMB, SMB Bug - Bit position decoded wrong
fpga_is_funny commented about 6 years ago

Hi Dave and all

The RC v1.5 WAS uploaded to opencores repository correctly at 02-AUG-2013. The public history of the core is valid.

hoglet commented about 6 years ago

Hi Jens,

Sorry, I only just noticed your replies here.

I am using the following version: Revision 1.5 RC 2013/07/31 11:53:00 jens

https://github.com/hoglet67/CoPro6502/blob/master/src/CPU65C02/r65c02_tc.vhd

So I'm pretty sure I have all these fixes, otherwise I would have seen a lot more issues.

Dave

fpga_is_funny closed this about 6 years ago

Assignee
No one
Labels
Request