Idea: Propeddle with the P1V and a 6502 Softcore
6581
Posts: 132
Hi,
I stumbled upon the Propeddle Project from jacgoudsmit and maybe it would be cool to port it to pure
FPGA? Buffers, 128K RAM, P1V, 6502 (T65 Core) and Octal D Flipflop can all be done in the FPGA (e.g.
on the BeMicroCVs Cyclone V).
@jacgoudsmith: What do you think?
I stumbled upon the Propeddle Project from jacgoudsmit and maybe it would be cool to port it to pure
FPGA? Buffers, 128K RAM, P1V, 6502 (T65 Core) and Octal D Flipflop can all be done in the FPGA (e.g.
on the BeMicroCVs Cyclone V).
@jacgoudsmith: What do you think?
Comments
I cannot find a Propeddle schematic in readable format (pdf...) - so I don't know in details how are they connected i it.
Here you go: https://github.com/jacgoudsmit/Propeddle/blob/master/Hardware/Kicad/Plot/Schematic.pdf?raw=true
A unquie concept that opens up a world of possibilities! It begs the question,
what other processes can be masked on the FPGA?
on the FPGA? Just a thought..........:)
Of course I've thought about this but let's think about this for a minute.
First of all, with the P1V code, the Cyclone 5 that's on the BeMicro CV is almost full. Adding a soft-core 6502 to the P1V certainly wouldn't fit in the FPGA. You would need a bigger FPGA such as the on on the DE2-115.
On the Propeddle, the Propeller is intended as an easy-to-program emulator for the peripherals that would normally be in a 6502 computer. Because of the 8 cogs and the large amount of available software in OBEX, it's relatively easy to emulate an Apple 1 and it should be pretty easy to emulate simple 6502 systems such as KIM-1, SYM, PET-2001, OSI etc, or to create your own 6502 system using Spin or PASM or C or C++. For many hobbyists, this makes it possible to put the kit together and make it do something useful. But the Propeller can "only" do 8 things at once, at a speed that's relatively slow because everything has to happen sequentially with PASM instructions. The Apple 1 emulator uses 4 cogs and it has almost not hardware that's (emulated to be) directly connected to the 6502.
An FPGA can do a much better job of emulating hardware, including complicated things such as video. The big advantage of an FPGA is that it basically does everything at the same time, just like normal digital electronics.
So, if you want to emulate a 6502 system with all its peripherals, it makes much more sense to just put the 6502 softcore in the FPGA and emulate the peripherals with Verilog directly. It will take a lot less resources than emulating a Propeller and a 6502 but of course not everyone knows Verilog.
And of course this has been done before: on the 6502.org forums and website, there are several people who used an FPGA to emulate old systems and implement new systems.
===Jac
I agree with that, but I was thinking about a 6 core P1V as it seems to give enough space for the 6502 and the "glue logic".
By the way - I ported this to the BeMicro and currently working on some 6502/6510 code + MOS6581, so we have a stand-alone
sid player: https://git.no-route.org/syso/bemicro-cv-multicomp
Having a soft 6502 core will enable a POKEY/SID players which can play not only SID dumps but real sid files.
Then, of course, SD and Basic.
I was Atari 8-bit user so all my work is inspired by this machine.The pallette I made for my "mode 2" is Atari 8-bit like. The difference is - this is 448x280 @ 256 colors instead 320x200 @ 2 colors. Or... 1792x1120 @ 4 colors. With switching pallette banks and sprites added it can make a new level of retrocomputing.
And.. adding a 6502 core to the system may enable Atari 8-bit software to run...
Do you already have your code at Git? If not, would be cool if you could maintain it at GitHub (or if you want something
different, I can set it up at my GitLab server)
A testbench is here:
run it from a script like:
The path thing is needed in case some dll breaks iverilog, who knows which one ... I love dll hell
===Jac
We want a new retrocomputer
About resources, I'll check it tomorrow. Maybe my code can help to make your driver run.
@pki: It actually works,
If it would be possible to attach this to the 6502 address/data bus (without propeller) and just read and write
to it using the OSI BASICs PEEK and POKE - i think that would be ideal to start with. I have to see how I implement
something like SYS on the OSI BASIC. Work in progess https://git.no-route.org/syso/bemicro-cv-multicomp-6502/tree/master/ROMS/6502
(you might also want to look into subdirectories, pik33)
This is a driver which can do 3 things: initialize the card, read a sector, write a sector.
To read a sector you have to set the sector number, strobe the read and wait for ready, then get 128 longs from the buffer.
To write a sector you have to fill the write buffer, then strobe the write and wait for ready.
I used this driver with Nios II/e, accessing it with some parallel ports. Then I found open source fat32 driver written in c. It needed only attaching 3 functions: sector read, sector write and initialize. So, I wrote these 3 functions and it worked with fat32 formatted sdhc. I hope the driver can be compiled with prop gcc in xmm mode and then executed from de2-115 sram. Or maybe sdram, if I managed to attach it to my system.
My retrocomputer vga thing is now near the 1.0 state. Today I managed to add the sprite machine to it. So I have all the retrocomputer should have: a lot of different graphisc modes, from 1792x1120x4 colors to 448x280x256 colors, horizontal scroll register, display list, 4 pallette banks and some (now 4, but adding more is simply ctrl-c,ctrl-v thing) 32x32 sprites with scalable x and y zoom. This is all the Atari 8-bit and C64 have, except the resolutions are more recent.
I think it may be possible to add a 6502 with 64 k ram made from fpga ram blocks. Then this ram can be accessed by p1v, so if the 6502 makes some work, for example, drive a SID/POKEY/AY chip, the Propeller can fetch this and in this example, make a sound using SIDCog/AYcog/POKEY emulator.
I apologize if my remark was interpreted that way; I didn't intend to be rude.
Using the on-board SD card reader on the BeMicro CV and other boards would be extremely useful and would be something I'm interested in, too (especially because there's no useful EEPROM). But accessing the SD card and booting from it is a feature that's not going to be specific to my Propeddle project. It would have been better to start a new thread about it, rather than add it as follow-up here, so that others (who may not be interested in the Propeddle project) might see it. So I was basically wondering why it was posted here.
Incidentally, I am considering adding an SD card reader for mass storage to the Propeddle project, but it will be connected to some Propeller pins so it can use a driver from OBEX to access it (no Verilog or FPGA Propeller needed); however, unless there's such a thing as an I2C-based SD card reader, it'll have to share pins with the 6502 so it will require a chip to enable or disable it while the system is running normally. You heard it here first :-)
I'm seeing some great ideas, and I wish I had more time to look into it. Never mind me folks, carry on! :-)
===Jac
This of course works, I published an audio player here, but it is not as fast as a hardware driver can be. Modern SD can use 50 MHz SPI clock whiile the Propeller can read @ 5 Mbps.
And something else: the coprocessor. There are some operation which are LE expensive, for example division. The div/mod thing needs 2500 LEs. So let there be some addresses where the propeller can put the data and then get the result. I will add this to my sram/vga driver.