RetroBrew Computers Forum
Discussion forum for the RetroBrew Computers community.

Home » RBC Forums » General Discussion » CPLD: glue only or functional blocks too?
CPLD: glue only or functional blocks too? [message #7419] Fri, 03 April 2020 14:52 Go to next message
mikemac is currently offline  mikemac
Messages: 250
Registered: March 2017
Senior Member
For a design I'm working, I'll need a CPLD (probably a MAX V) for glue logic and a DRAM controller.

The board also needs all of those other desirably I/O devices like UARTs, SPI, etc. I could put discrete ICs on the board for each function or I could implement them in the CPLD as programmable logic. [I know the latter is a slippery slope that leads to doing everything, including the processor, in the CPLD/FPGA.]

As I see it:

The advantages to putting "everything" in the CPLD:

- reduced board space due to fewer chips
- lower cost due to smaller board and fewer BOM items
- design flexibility

The disadvantages seem to be:
- increased complexity of the CPLD logic due to the additional functionality
- less "Retro" aesthetics

What is your opinion on the pros vs cons of a "do all" CPLD?



Mike

[Updated on: Fri, 03 April 2020 15:03]

Report message to a moderator

Re: CPLD: glue only or functional blocks too? [message #7420 is a reply to message #7419] Fri, 03 April 2020 16:06 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Since you are using a modern device already, I would squeeze in as many functions as possible. Unless you are using it as a pathfinder platform to try out different design concepts and then replacing the CPLD with retro technology.
Bill
Re: CPLD: glue only or functional blocks too? [message #7441 is a reply to message #7420] Mon, 06 April 2020 16:35 Go to previous messageGo to next message
wsm is currently offline  wsm
Messages: 232
Registered: February 2017
Location: AB, Canada
Senior Member
I've used CPLDs in several designs and certainly agree with your "Pro's". Another "pro" is that they allow a lot of flexibility in dense PCB layouts when allocating pins, but this can potentially lead to extra logic levels and timing issues.

My approach has been to use them for the inevitable glue logic and also for unique functions such as the DRAM controller which would require a lot of discrete logic. I've also used them for things like SPI, ATA and DMA controllers where standalone chips and/or appropriate speeds were not available. However, I also try to first use an available peripheral chip such as a UART or SCSI controller before designing these functions into a CPLD since it requires a lot less debugging and results in standardized software interfaces.

My experience has been that as speeds increase and a CPLD design gets more inclusive or complex then so do the problems and they can be extremely hard to diagnose. A recent one byte in ~30MB transfer error took me quite a few days to identify, correct and validate a metastability error within a CPLD. Likewise, once a high useage CPLD has been pin locked to a PCB there can be potential timing errors when modifying / adding logic due to logic splitting causing added levels of logic.
Re: CPLD: glue only or functional blocks too? [message #7451 is a reply to message #7441] Tue, 07 April 2020 09:10 Go to previous messageGo to next message
mikemac is currently offline  mikemac
Messages: 250
Registered: March 2017
Senior Member
Good point about the "standardized software interfaces". It's fairly easy to throw in a fixed baud rate UART into the CPLD but implementing one that is 100% compatible with the Linux 16550 driver is a whole different ballgame.

The local FPGA expert once told me one should aim to keep under about 40% usage of the logic gates. Above that and things get increasingly difficult. Sort of like routing PCB, as long as you have lots of spare area and layers, routing isn't too difficult. [Usually!]

A DRAM controller will definitely be in the CPLD as I know of no other "practical" solution. Yes, I've seen it done in a couple of GALs [KISS030 if I remember correctly]. I think I've seen it done in discrete 7400 series chips. But the ease of fixing most of my mistakes makes the CPLD the clear winner for this functionality.




Mike
Re: CPLD: glue only or functional blocks too? [message #7474 is a reply to message #7451] Thu, 09 April 2020 09:03 Go to previous message
wsm is currently offline  wsm
Messages: 232
Registered: February 2017
Location: AB, Canada
Senior Member
I've primarily been using the Xilinx CPLDs. Although I've used 100% of the macrocells in a few designs, I've generally found that 90+% useage on the first pass still allows for expansions and changes without causing significant problems. The bigger restriction I've often encountered is with complex equations and the number of function block inputs.

The Xilinx software allows you to limit the function block inputs and I generally limit it to N-1 or N-2 on the first pass which allows me to add new inputs to the function blocks on a revision. Of course this depends on the complexity of the equations ... it's not an issue if most of them are quite simple with few inputs but large fan-ins for complex equations can restrict the number of useable macrocells and can cause logic splitting, extra timing delays and increased macrocell useage. Without splits, complex equations with large fan-ins can have a speed advantage in CPLDs versus FPGAs.

There's a bit of chicken and egg scenario with the PCB layout, pin assignments and the CPLD fitter. I tend to create dense PCB designs which leads to assigning pins based on ease of PCB routing. However, the fitter is oriented to speed and minimizing logic splits. Sometimes swapping two adjacent pins in different function blocks can make a very significant difference for the fitter in the logic / timing.

CPLDs can be used to build some pretty powerful functions similar to a dedicated I/O processor and having built a working DRAM controller in 7400 logic, I agree that it would be a practical example. However, just like FPGAs you have to be very careful about metastability, especially if there are multiple clock domains. I've learned the hard way that I tend to think in terms of asynchronous logic whereas the electrons in CPLDs and FPGAs are best kept in their expected places with synchronous logic.
Previous Topic: Problems with SD Card on SC130 board and ROMWBW
Next Topic: Anyone here attracted to Magnetic Bubble Memory?


Current Time: Mon Mar 17 04:31:12 PDT 2025

Total time taken to generate the page: 0.00678 seconds