Howdy everyone, this topic is just informative to whomever comes across it. It is currently June 2023, there IS a way to program current production CPLD's with a modern version of Linux. Below is my journey, and Ed helped push me to the final solution. Thank you again Ed!
After looking around the internet, I found that Xilinx software was made for Linux (primarily), not Windows (necessarily). So that has been my target the entire time. They have many CPLD's such as the XC9500 series that are both cheap and available on Mouser.com. They likewise come in a package that you can still SMD hand-solder. The way to program for them is using the Xilinx ISE 14.7 software. The JTAG programmer I bought was the Xilinx Platform Cable USB. It uses USB on the PC side of things, and a JTAG connector to link to the chips. I think I spent about $50 on it, I bought mine from Amazon and it shipped to my house after 3 weeks or so. Sometimes the programmer also has a "II" after it, but I haven't found that make a difference really. Mine is NOT the "IV" version though.
It was super easy to get the software from the Xilinx website. You have to register your email with them, and when you are installing I think you need to log in for license stuff(?). Every time I start the ISE program though it continues to pester me for licenses but doesn't do anything about it. I don't remember many problems when installing it on Linux, I am sure the typical Linux issues will come up from time to time. I remember changing a #!/bin/sh to #!/bin/bash once, but nothing drastic. I think I also have to continually "source settings64.sh", because I do that every time before running "ise". I made a script to do it all for me, you might have different results.
The cable driver installation will fail during the ISE installation. I was told that this would happen regardless, so I let it go, and started looking for ways to install the drivers manually. I found some solutions that seemed like they would work, but in the end it would not. The main problem is that newer Linux kernels do not include some basic things that these older cable drivers relied on. Likewise, there is need of "windrvr6" which is just impossible to install on a modern Linux computer. I tried MANY different ways, and have found nothing suitable through Xilinx themselves. Through all of my journey I might have found a way to 'install the drivers' just without "windrvr6", so the dedicated programming software, called Impact, would not program the CPLD's simply because of that one missing driver.
None the less, eventually I was indirectly pointed to the solution by Ed. What you need to do is:
Code: Select all
sudo apt-get install xc3sprog
I tried getting it to work on the Raspberry Pi to eliminate the need for the Xilinx JTAG programmer, but because WiringPi is not supported in the newer OS's, that flavor of xc3sprog is just not going to work. Instead, install it directly onto your Linux desktop, and use the official Xilinx JTAG programmer, and it works beautifully! All you need to do is:
Code: Select all
xc3sprog -c xpc MyProgram.jed
Lastly, a bit of advice on the ISE 14.7 software. I started trying to use the 'schematics' side of things, but was quickly disappointed. It is *nothing* like KiCad. So instead I started learning Verilog. It is a C-based programming language that I found to be VERY helpful. I am still fairly new to it all, but I was able to adjust things very quickly. There is also a "Constraints" file you need have to create pin number assignments. Each pin needs a line like:
Code: Select all
NET clock LOC = P2 ;
Overall, the experience has been difficult to reach, but so satisfying in the end!
Here is a bit of other things I have learned:
So what does Xilinx offer now-a-days? The Vivado Design Suite is currently being used, it's free, but it is only for very recent FPGA's, particularly Artix7, Zynq7, and Spartan7 (might be others). Anything older is NOT supported by Vivado at all, no matter if it's the 2014 version or the 2021 version. Mouser has some of these laying around, and I tried to attempt to program for the XC7S6-1CSGA225C which is relatively cheap.
Since I have the programmer now and infinite hard drive space I decided to give it whirl anyways. There's Youtube videos on how to install Vivado and get it running. I had no complications at all using Linux, because it seems built for Linux. I also installed the LabTools which I will get to later. Programming in Vivado wasn't too hard using Verilog, but the Constraints are just crazy! After much trial and error, I got only "critical warnings" instead of errors finally.
After creating the bitstream file (used for programming these modern FPGA chips), open up the Hardware Manager from LabTools. Now, I didn't have an XC7S6 on me, so I cannot actually program anything. BUT, I had LabTools open with my programmer attached to the XC9500 earlier, and it certainly detected it. I couldn't *program* it unfortunately, but I could tell that my programmer was actually detected by the software program.
Conclusions:
- Xilinx ISE 14.7 will indeed install and run on modern versions of Linux. It will NOT program the CPLD's or FPGA's, but it will generate the .jed or .bit files you need.
- Use 'xc3sprog' to program your devices. Using the official Xilinx Platform Cable USB JTAG programmer is still recommended.
- It seems that Xilinx is *really* only supporting "Series 7" FPGA's at this point. But, the are continuing to produce these 'older' CPLD's regardless, and that's good enough for me.
I hope this short guide was helpful to you. The reason I'm posting this in so much detail is because I really wanted to do this for a while, and I also had a lot of confusion and trouble along the way. I am not a Windows user, and I didn't want to rely on chips that were no longer supplied by mainline distributors like Mouser. I guess the time and effort eventually paid off. Hopefully it will be easier for you now
Thank you for reading!
Chad
Edit: Adding Pictures, with code. I'm currently testing it with the Arduino, sorry it's not directly 6502 right now. The Arduino is able to send a clock signal to the CPLD. The CPLD then flip-flops the value, blinking it's own light, and then sending the value back to the Arduino. The Arduino then turns it's own light according to what it receives from the CPLD. Conclusion: The CPLD can receive, compute, and send back data!