New 6502 core
New 6502 core
Hallo allemaal,
I created a new 6502 core. It is part of my core for the Godil. I scrapped all the Godil parts except the 49 MHz clock. http://www.baltissen.org/zip/rb65-10.zip contains two VHDL's and a common test bench. The 'd' version creates a double clock out of PHI0 which enables me to execute some opcodes much faster then an original 6502. The 's' version uses the original clock.
A FPGA can be so fast that the data has gone from its data bus within seconds while some IC's require the data to be present for 10-20 ns. This is done by creating a shifted PHI0, PHI_i called, that is used to control the output of the data bus.
What are the biggest differences with the well known T65:
- a drawback: mine is almost twice as big.
- my VHDL can be read and understood by any person familiar with a 6502 but not with VHDL.
- every opcode is described
- I don't support illegal opcodes but once I know how they act, I can add them in an instance (try that in T65 !)
- I can replace KILL opcodes by my own ones with the same ease.
Questions and comment is welcome!
I created a new 6502 core. It is part of my core for the Godil. I scrapped all the Godil parts except the 49 MHz clock. http://www.baltissen.org/zip/rb65-10.zip contains two VHDL's and a common test bench. The 'd' version creates a double clock out of PHI0 which enables me to execute some opcodes much faster then an original 6502. The 's' version uses the original clock.
A FPGA can be so fast that the data has gone from its data bus within seconds while some IC's require the data to be present for 10-20 ns. This is done by creating a shifted PHI0, PHI_i called, that is used to control the output of the data bus.
What are the biggest differences with the well known T65:
- a drawback: mine is almost twice as big.
- my VHDL can be read and understood by any person familiar with a 6502 but not with VHDL.
- every opcode is described
- I don't support illegal opcodes but once I know how they act, I can add them in an instance (try that in T65 !)
- I can replace KILL opcodes by my own ones with the same ease.
Questions and comment is welcome!
Code: Select all
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: www.baltissen.org
excellent! I'll take a look too. I still need to get a resynth of T65 to compare to retromaster's recent 6502 core as well.
I wonder if the fast clock-to-Q of the databus is the cause of some of the problems we had interfacing FPGA to existing systems.
Would you be happy to add a license to the files? (MIT-style if you really don't care much, or LGPL if you want to ensure the source stays open) As you may know, just declaring something to be in the public domain, or saying nothing, can get in the way of redistribution.
Cheers
Ed
I wonder if the fast clock-to-Q of the databus is the cause of some of the problems we had interfacing FPGA to existing systems.
Would you be happy to add a license to the files? (MIT-style if you really don't care much, or LGPL if you want to ensure the source stays open) As you may know, just declaring something to be in the public domain, or saying nothing, can get in the way of redistribution.
Cheers
Ed
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
Hallo allemaal,
Everything that can be downloaded from my site and is announced in public can be considered as freeware: http://www.baltissen.org/newhtm/copyrights.htm , third dot.
The VHDL has been tested in my Godil on my emulator. This emulator is 486SX-25 laptop on a dockingstation that holds an 96 I/O-lines ISA card. The laptop emulates a board with RAM and ROM and generates PHI0 at about 300 bytes/sec. Gideon Zweijtzer, the creator of the 1541Ultimate, www.1541ultimarte.net , hasn't seen anything why my VHDL shouldn't run at 1 MHz or higher. The only point of attention would be the timing of my "double clock" signal at higher frequencies.
The correctness is tested using a self written ROM. My question regarding the behaviour of PHP was the result of this test: my VHDL completed the test while Gideon's VHDL created an error. I only have to hope that so far my test program covers all possible issues. And to be honnest, it just occurs to me that I haven't tested IRQ and NMI :( But as I have no problems with BRK, I expect no problems with them as well.
I only just checked the timing: my VHDL completed the test in 7001 uS, Gideon's VHDL in 7010 uS and T65 in 7013 uS. So it seems I'm a bit too fast. Which is a bit funny because I had to extend quite some opcodes with a dummy cycle to stay cycle exact.
My future plans:
- replacing the 6502 of my VIC-20 with the Godil
- replacing the 6510 of my C64 with the Godil
- replacing the 8088 of an old IBM XT with the Godil :) Still using the 6502 core of course !!!
In case of the IBM I first program a fixed MMU that maps 8 KB of ROM, 4 KB of Video memory, 1 KB of I/O and RAM some where into the 64 KB range of the 6502. Next step is to add an extra address register plus opcodes similar/equal to the 65816.
Interesting for the C64 and C128 owners: parallel to the above I want to use the results of creating a 65816 to turn the Ultimate into a SuperCPU. I'm also thinhing about turning the Ultimate into a CP/M module. In the first place just a stand-alone, but faster Z80, like the original C64 module. But later I want to turn it into a complete computer where the C64/128 only acts as a terminal. Just like the Acorn BBC and the Z80 Second Processor.
Nice ideas, but not having won the Jackpot yet, lack of time prevents me to give you a time table.
Everything that can be downloaded from my site and is announced in public can be considered as freeware: http://www.baltissen.org/newhtm/copyrights.htm , third dot.
The VHDL has been tested in my Godil on my emulator. This emulator is 486SX-25 laptop on a dockingstation that holds an 96 I/O-lines ISA card. The laptop emulates a board with RAM and ROM and generates PHI0 at about 300 bytes/sec. Gideon Zweijtzer, the creator of the 1541Ultimate, www.1541ultimarte.net , hasn't seen anything why my VHDL shouldn't run at 1 MHz or higher. The only point of attention would be the timing of my "double clock" signal at higher frequencies.
The correctness is tested using a self written ROM. My question regarding the behaviour of PHP was the result of this test: my VHDL completed the test while Gideon's VHDL created an error. I only have to hope that so far my test program covers all possible issues. And to be honnest, it just occurs to me that I haven't tested IRQ and NMI :( But as I have no problems with BRK, I expect no problems with them as well.
I only just checked the timing: my VHDL completed the test in 7001 uS, Gideon's VHDL in 7010 uS and T65 in 7013 uS. So it seems I'm a bit too fast. Which is a bit funny because I had to extend quite some opcodes with a dummy cycle to stay cycle exact.
My future plans:
- replacing the 6502 of my VIC-20 with the Godil
- replacing the 6510 of my C64 with the Godil
- replacing the 8088 of an old IBM XT with the Godil :) Still using the 6502 core of course !!!
In case of the IBM I first program a fixed MMU that maps 8 KB of ROM, 4 KB of Video memory, 1 KB of I/O and RAM some where into the 64 KB range of the 6502. Next step is to add an extra address register plus opcodes similar/equal to the 65816.
Interesting for the C64 and C128 owners: parallel to the above I want to use the results of creating a 65816 to turn the Ultimate into a SuperCPU. I'm also thinhing about turning the Ultimate into a CP/M module. In the first place just a stand-alone, but faster Z80, like the original C64 module. But later I want to turn it into a complete computer where the C64/128 only acts as a terminal. Just like the Acorn BBC and the Z80 Second Processor.
Nice ideas, but not having won the Jackpot yet, lack of time prevents me to give you a time table.
Code: Select all
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: www.baltissen.org
Code: Select all
D : inout std_logic_vector(7 downto 0);
OwenS wrote:
FPGAs really don't like bidirectional signals.
EDIT: I just found out that I forgot to implement the RDY signal in my VHDL. But don't worry, I'll update it soon enough.
Last edited by Ruud on Thu Oct 14, 2010 6:21 pm, edited 1 time in total.
Code: Select all
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: www.baltissen.org
BigEd wrote:
Please would you release your ROM?
Last edited by Ruud on Fri Oct 15, 2010 5:29 am, edited 2 times in total.
Code: Select all
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: www.baltissen.org
BigEd wrote:
Have you withdrawn your zip archive?
As an extra:http://www.baltissen.org/zip/rb65-11.zip. This one contains a newer ASM, VHDL and the start of the VHDL for the 65816.
Have fun!
Code: Select all
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: www.baltissen.org
BigEd wrote:
Thanks! (Judging by line-count, the '816 will turn out to be something like twice as complex as the 6502.
Code: Select all
AND $xx
1: read address byte
2: read data and process it
AND $xxxx
1: read address byte
2: read address byte
3: read data and process itCode: Select all
AND $xxxx / $xx
1: read address byte; if $xx then goto 3
2: read address byte
3: read data and process itAn other idea is to drop the CASE statement and to use someting like "if (Opcode(3 downto 0) = "0001") then ...".
To be continued....
Code: Select all
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: www.baltissen.org
Ruud wrote:
To be continued....
Again, to be continued....
Code: Select all
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: www.baltissen.org