When engineers use the ispLEVER software suite to develop designs for FPGAs from Lattice Semiconductor they use a Reveal Inserter tool to place debug cores in their circuitry. "Reveal Inserter shows you all the signals in a design so you can select the ones you want to look at," explained Brian Caslis of Lattice. "Then you select the signals you want to observe, or trace, the signals to use as triggers, and the various trigger conditions. Instead of having to design a debug logic circuit or modify RTL code, you click a button and the software handles the details in the background." Within the debug logic, Reveal hard wires the signals you want to capture, but you can go back and change them from the software and reinsert the debug logic in a design. Users can dynamically change the trigger conditions, however, during a debugging session with the Reveal Analyzer software.
"A complaint with early core-based debug techniques centered on the extra effort it took to build a core, put it in a design, and set it up," said Caslis. "People said, 'Now I want to look at another signal over here.' So they went back to their source code with the debug logic and fiddled with it to modify the original signal and trigger choices. That approach made it difficult to keep track of the many changes. In Reveal, you pop up the screen, change your signals and trigger conditions and click on 'Insert Debug' again." The process appears transparent to users because they do not modify their code in any way and they can turn the debug core on or off.
Adding a debug core does extract a small penalty, but according to Caslis, the key is whether the penalty matters. "A debug core or cores do take up some space," said Caslis, "but the big concern is the amount of RAM storage needed to hold the captured signals. The trace buffer takes up by far the largest amount of logic in a debug core." So, if you have used most of the memory for other functions, you have limited space for debug information. That's a tradeoff engineers should know about right at the start. Debug cores do need memory and the more memory available, the more debug information they can store.
"In some cases, adding a debug core will affect timing and in others it won't," noted Caslis. "The debug logic itself adds only one load to whatever signal you look at. But the logic takes space, and routing can affect timing to a small extent. We’ve seen designs where it does have an impact on timing, but we’ve also seen designs where even though the debug logic has an impact, it doesn’t have enough of an impact to affect performance."
Like other debug logic, the Reveal debug cores offer many types of triggers and trigger conditions. "We have trigger units that compare signals to a value, say a rising edge on signal ADDR and a specific value on an 8-bit counter," said Caslis. "A trigger expression combines trigger units in combinatorial, sequential, and mixed combinatorial/sequential patterns. Each debug core can accommodate as many as 16 trigger expressions that users dynamically enabled or disabled in the Reveal Logic Analyzer software."
When you define the triggering logic you can specify a trigger-out signal and route this signal to an I/O pin for an external logic analyzer or scope. Likewise, you can access an input signal. "Any signal in an FPGA is visible," said Caslis. "It looks like just another signal and you can use it as an input to the debug core."
 This display from the Actel Identify Debugger shows instrumentation code added
(bottom window) to a design. The floating window shows the acquired signals and their waveforms. Courtesy of Actel.
Leave It In or Take It Out?
After you debug a design should you remove the debug cores or leave them in the circuit? It depends. "If designers don't have a strict power and layout budget, often they leave a debug core in the FPGA," noted Altera's Simpson. "They might choose to upgrade the design later on, so it's helpful to still have the debug core available. Also they can use remote debug capabilities to extract information in the field via the JTAG port and the System Console software. We put in a SPI interface to System Console as well, because we’ve seen FPGAs connected to coprocessors that use SPI as a communication channel."
Brad Fross at Xilinx said when customers remove debug cores they have to go back and re-implement the design. "When you probe something inside an FPGA with one of our debug cores, you inherently change the design, add loads to signals, and perhaps change how the place-and-route algorithms handle the design. In other words, you perturb the design."
"Suppose you have a basic functional problem where your logic was just incorrect," continued Fross. "In that case, taking the cores out will not hurt your design. But let’s say you have a timing problem. Often adding the debug core causes the problem to disappear because the FPGA tools moved things around and all of sudden the circuit behaves properly. In that case it behooves you to go back and understand how the timing changed so you can properly constrain your design. Then you can safely remove the debug cores."
If you decide to remove Lattice debug cores it doesn't take much work. After you use the Reveal Inserter to add a debug core, a Reveal .rvl source file appears in the ispLEVER Project Navigator. If you decide to remove debug from your design, you just delete that .rvl file from your source list. "Conversely, if you change the functionality of your source code, the Project Navigator will automatically reinsert the debug cores as long as the .rvl Reveal file exists," said Caslis of Lattice Semiconductor.
|