The Prototype Hardware
The project is based on an Altera MAX10 FPGA. The current prototype setup consists of a standard Commodore 64 main-board where the SID chip has been replaced by an FPGA evaluation board (click for details). This eval-board is connected with some glue logic (mainly for level shifting) to the 28-pin SID socket of a Commodore 64 computer. This platform allows me to use the FPGASID directly in the target hardware. So I can do testing with real programs under real-time conditions.
To make the testing of compatibility issues more comfortable I created a PCB that fits into the expansion port of the C64. This PCB carries the original SID. Once plugged into the expansion port, the second SID is controlled in exactly the same way as the FPGASID. The ultimate goal is to make the FPGASID and the original SID behave absolutely identical. To find this out I connected the sound output of the original and the surrogate to the left and right channel of a stereo amplifier. This way each difference in the sound output is clearly audible because any difference will break the "perfect" mono signal.
On the right you see the prototype as on display on the Classic Computing 2015 in Thionville.
FPGASID (left) and original SID (right)
In this closeup you see how the original SID in the expansion slot is supplied with 12V power supply (yellow wire) and the SID's chip-select signal (black wire) as these are not available on the expansion port connector. The red cinch connector feeds the original SID's output signal to the right channel of a Stereo amplifier.
The FPGASID is the bigger PCB left of the modulator box. It resides directly in the SID 28-pin socket. The breadboard underneath is used for mechanical connection and it carries some level shifters to translate the 5V signals of the C64 to the 3.3V logic of the evaluation board. The audio connection of the FPGASID goes through the A/V connector of the C64 to the left channel of the stereo amplifier.
You can listen to such a comparison stereo signal here: TheLastV8. This song was one of the first songs I used to test the FPGASID implementation. In this audio file the left channel is the FPGASID and the right channel is the original SID. In this case both sources match pretty well. Mainly because this tune does not use any filtering. To give you an example how much the filtering differs from the original implementation you can listen to CaerAisling. This song is using a lot of filtering and you can hear that the filters do not match between left (FPGASID) and right (original SID) channel.
Another method of design verification is the Verilog simulation. For FPGAs this is the usual way of doing things. It does not require any hardware. The only thing that is needed is computation time on a fast PC. When a simulation is done, the Verilog code is executed by the simulation engine, rather than on a real FPGA. Since the FPGA is doing everything in parallel and the simulator is a software which is running sequentially, it becomes clear that the execution time of the simulation can become quite long. In our case it takes about one hour to simulate 4 seconds of real time (on an quadcore firstname.lastname@example.orgGHz). But on the other hand there are many advantages of simulation: You can check all internal signals you want in full detail. A thing that would be extremely difficult to do directly on the FPGA.
The Verilog Simulation is showing internal signals in full detail
I did such a simulation just recently when I finalized the new filter implementation and had to find some nasty bugs. The result is an audiofile with the simulated signal from FPGASID on the left channel and the signal generated by the RESID library on the right channel. So basically two different simulation implementations are compared against each other. I took the same song as before: CaerAisling. I would say FPGASID is already quite close to RESID now. Please judge by yourself!
After some extensive debugging in simulation and a major change in the clocking scheme of the FPGA (details here), the resulting sound quality came even closer to the original 6581 SID. Here you find a sample of this achievement, recorded directly from the hardware. Again the same song, FPGASID on the left and the 6581 on the right. I am proud to say that this is the first time I personally have trouble identifying the source, when I don't know what I am listening to: FPGASID or 6581.
After this achievement some intense testing has started with a small number of test persons. The performance of FPGASID is checked against original 6581 devices with some selected test tunes.
One centralelement of these tests is the automated recording of SID tunes. This allows me to do new recordings of the test songs whenever a new FPGA release is ready. This is saving a lot of time. To do this I connected a NetIO board from Pollin to the FPGASID prototype and to the controlling PC. This allows me to control the prototype to play back SID tunes to make recordings on the PC. Details on how this automation is working can be found here.
The NetIO board hooked up to the FPGASID prototype.
The Next Prototype
The FPGASID prototype, based on the Altera evaluation board, has shown that the implementation of a SID replacement is feasible. So the time has come to go the next step now. A step to a new prototype that is no longer based on an evaluation board.
A hardware platform is required that should be much smaller in order to fit into a standard C64 (with the case properly closed of course). And with this new prototype it should be possible to do some field testing performed by early alpha testers. So the handling has to be easy enough for this purpose.
Here you see KiCAD in action.
The development of this new prototype was supported by a second designer. Thomas did the complete PCB routing and helped a lot in reviewing the schematics and making design decisions for the new prototype. Internally we call our new baby the 'FPGASID_proto1'. The schematics and PCB-Layout was entirely done with KiCAD. This program is a very professional EDA tool. Suitable for simple and complex projects. It covers the full range from design entry on schematic level over PCB routing to production data generation. And it's completely free!
The work on the prototype PCB is very advanced now. This allows the rendering of pictures that show, how the end product will finally look like.
The PCB has a size of 48 mm x 31 mm and will fit directly into the SID socket. Some extra wiring will be required to connect signals that are not available on the socket. These connections will be possible without soldering. A JTAG connector is present for debugging and flashing new FPGA code. And last, but not least, three LEDs will
do some nice blinking when a tune is played help debugging complex FPGA bugs.
The PCB has 4 layers and carries a BGA version of the MAX10 FPGA. The finest structures measure only 100 µm and the vias have a hole of only 200 µm diameter. These parameters should make clear, that it's mandatory to produce the board at a high quality PCB maker. Unfortunately this is the point where home-brew technology ends.
Visualization of FPGASID_proto1.
After the first prototype had become real existing hardware, it had to go through extensive testing. So I decided to search for Alpha-Testers who could help me to test the FPGASID. Very soon after placing the announcement on the website, a number of 18 testers had been found to test the total number of 25 devices. We were able to check the operation in various different C64 board revisions and even in more exotic hardware such as the SX64, the C64R a C128 and even on a C16 equipped with a SID card. One highlight was a short test in a MB6582 Synthesizer which showed that the FPGASID is also suitable for this kind of application.
The first Prototype tested
During the hot Alpha phase, the testers reported their observations and bug findings and helped to confirm the bug fixes. During this time five FPGA bitstream releases have been made to fix the reported issues and to improve the handling. This process is not entirely finished yet, but the bug reports have become very seldom now.
Longer discussions among the testers on 'Forum64' have lead to a considerable improvement of the usability. Also questions like as how to break-out the second audio channel could be solved thanks to the very productive input.
A questionnaire that had been sent to the testers helped to collect further interesting information. The testers expressed a high level of satisfaction with the FPGASID: 100% (= all testers!) replied that the compatibility to existing software was very good. Reproduction quality of the original SID sound was rated with the best mark ('very good') by 80% of the Testers and the remaining 20% rated 'average' because they where missing the background noise of the original. Seems nobody was totally disappointed. :-)
With large steps towards production
During the last 3 to 4 years I have spent a lot of my spare time with the FPGASID project. What began as a hobby project for my personal pleasure, turned out to have more in it than I thought: Already the very first time I showed the early prototype on a local retro-computing party, it became clear that many people were highly interested in it. They all said they would really love to own a FPGASID...
At that point I started to think about how to make a real product out of it. I started to focus more into that direction. And now the time has come to make this dream come true!
After longer preparation and evaluation of the various options I decided to look for a partner who could take over the sales and production for me. This partner has been found now:
With joined forces we plan to bring FPGASID to the market early 2018.
Lost in Configuration? ConfiGuru the Configuration Guru!
Configuring the FPGASID turned out to be quite complex. The Register map is quite compressed and it is important to keep track of the current configuration to know in which state which registers are accessible etc.
To ease the task of changing the FPGASID configuration to another mode, I developed the configuration tool "ConfiGuru".
The tool has an easy mode to choose between some basic configuration sets with a simple keystroke as well as an expert mode that allows the configuration of each single tiny bit with a few more keystrokes.
In addition the tool serves for diagnostic purposes and can be used to update the FPGA-firmware.
ConfiGuru runs from FPGASID firmware version 6 onwards on a standard C64. It consists of roughly 8 kBytes assembly code plus another 8k text screen data.
The binary files for firmware updates exceed the maximum size of a 1541 Floppy disk. This means that flashing the firmware from a standard 1541 drive requires a disk change in between or a mass storage device with larger capacity such as the SD2IEC etc.
ConfiGuru will be bundled together with each FPGASID firmware release. This assures that the ConfiGuru version always maps the FPGASID version it was made for. The first release containing ConiGuru is release 6.
More details on the ConfiGuru can be found on this separate page.
It is a tough job to organize the production of a device like the FPGASID!
First the production data needs to be prepared: Gerber files that contain the PCB layout, a BOM (bill of material), position data of all components for automated mounting. Douzends of checks and verification steps are needed until you are really sure that you have not forgotten anything.
And then, when a proper manufacturer has been found, they usually have their own idea about the components that should be used. Either because they have cheaper alternatives on stock or because they do not find a distributor for the one or other component. And finally, it can happen that a component you have planned to use is obsolete and is no longer sold. That happened with the CPLD that the FPGASID uses for the 6502 bus. Luckily there was an almost pin-compatible replacement type that could be used (well, after fixing some nasty power consumption bug of the new part)... .
After I sorted out all these issues, the manufacturer made the first samples for us. But when I received them it turned out that all of them were not functional. Instead of producing SID sound they just blew the fuse of the C64. So I learned that despite all checks at the manufacturer, it can still happen that some components are mis-mounted. In our case it was a 6-pin IC turned by 180 degrees.
I returned the samples to the manufacturer for repair and immediately started to build a test fixture that can be used by the manufacturer to check each device. This is the perfect way to assure that the FPGASIDs are functional. As a nice side effect, this test also included the firmware flashing. So I was saving that step myself. The test is highly automated so the tester did not have too much work with each device. This is also a cost factor of course.
The FPGASID Test fixture
Finally after months of work the big moment has come when you receive the first delivery of FPGASID devices from the production...
A few days after, my family gave me a greetings card to the birth of my new baby :-)