Radiant Tutorial
Radiant Tutorial
CrossLink-NX (LIFCL)
Trademarks
All Lattice trademarks are as listed at www.latticesemi.com/legal. Synopsys and
Synplify Pro are trademarks of Synopsys, Inc. Aldec and Active-HDL are trademarks
of Aldec, Inc. Modelsim and Questa are trademarks or registered trademarks of
Siemens Industry Software Inc. or its subsidiaries in the United States or other
countries. All other trademarks are the property of their respective owners.
Disclaimers
NO WARRANTIES: THE INFORMATION PROVIDED IN THIS DOCUMENT IS “AS IS”
WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING
WARRANTIES OF ACCURACY, COMPLETENESS, MERCHANTABILITY,
NONINFRINGEMENT OF INTELLECTUAL PROPERTY, OR FITNESS FOR ANY
PARTICULAR PURPOSE. IN NO EVENT WILL LATTICE OR ITS SUPPLIERS BE
LIABLE FOR ANY DAMAGES WHATSOEVER (WHETHER DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL, INCLUDING, WITHOUT
LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR
LOSS OF INFORMATION) ARISING OUT OF THE USE OF OR INABILITY TO USE
THE INFORMATION PROVIDED IN THIS DOCUMENT, EVEN IF LATTICE HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE SOME
JURISDICTIONS PROHIBIT THE EXCLUSION OR LIMITATION OF CERTAIN
LIABILITY, SOME OF THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU.
Bold Items in the user interface that you select or click. Text that you type
into the user interface.
Courier Code examples. Messages, reports, and prompts from the software.
Revision History 49
The Lattice Radiant® software is a complete toolset for designing for Lattice
Semiconductor’s FPGAs. This tutorial leads you through all the basic steps of
designing, implementing, and debugging designs targeted to the Lattice
CrossLink-NX™ (LIFCL) device family.
Note
Some of the screen captures in this tutorial may have been taken from a version of the
Radiant software that differs from the one you are using. There may be slight
differences in the graphical user interface (GUI), but the software functions the same.
You can stop at the end of any task and restart at the beginning of the next
task. See “Close the Radiant Project” on page 47. When you restart the
Radiant software, it shows a Recent Project List. Just click the name of your
project.
Note
This tutorial is made to work on the CrossLink-NX Evaluation Board Rev. B with
either LIFCL-40 8BG400CES2 and LIFCL-40 9BG400CES2 device on the board.
The device number on the board should end with “ES2.”
Earlier CrossLink-NX Evaluation Board Rev. A with device number that end with
“ES” will not work with this tutorial. You will need to use Radiant v2.0SP1 for
CrossLink-NX Evaluation Board Rev. A.
Online Help You can find additional information on any tool used in the
tutorial at any time by choosing Help > Lattice Radiant Software Help or
Help > <tool name>. The Help also provides easy access to many other
information sources.
Sample Design This tutorial comes with a Verilog design that counts up
and down while displaying the values on the demo LEDs of the CrossLink-NX
Evaluation Board. There are also some additional modules so you can fully
exercise the Radiant software’s on-chip debugging abilities: a dual-port RAM
module, a module that uses the MIPI D-PHY interface, and a module that
uses the SGMIICDR interface, are built into CrossLink-NX. The tutorial
includes a simple testbench to run the functional simulation.
Setting up a new project is done through the New Project wizard. The New
Project wizard guides you through the steps of specifying a project name and
location, selecting a target device, and adding existing source files to the new
project. We will walk through each page of the wizard one by one. At the end,
we will introduce the Radiant main window and its parts.
An implementation is one version of your design. You can have more than one
implementation, so that you can experiment with different design approaches.
A project starts with one implementation. You can add more later.
Selecting a Device
In this task we will select a device based on the tutorial requirement. We’ll
specify the FPGA on the CrossLink-NX Evaluation Board.
To select a device:
1. Select the device family: LIFCL (CrossLink-NX).
2. Select the specific device within the family: LIFCL-40.
3. Select the following device options:
Operating Condition: Commercial
Package: CABGA400
Performance Grade: 8_High-Performance_1.0V
Note
For the purpose of this tutorial, we selected Performance Grade: 8_High-
Performance_1.0V, as it matches the LIFCL-40 8BG400CES2 part shown on the
evaluation board in Figure 1. If you are using an evaluation board that has a
different part number, such as LIFCL-40 9BG400CES2, then you should select
Performance Grade: 9_High-Performance_1.0V, or whichever performance
grade is applicable to the evaluation board you are using.
Device information
Select device
4. Click Next.
The Select Synthesis Tool dialog box opens.
Note
If you choose to use Synopsys® Synplify Pro® for Lattice, Netlist Analyzer will not
be available. Synplify Pro has a similar tool, but it is not covered in this tutorial.
2. Click Next.
The Project Information dialog box appears. This dialog box summarizes
the choices you made in the wizard. If you want to change any of them,
click Back.
3. Click Finish.
Several views are added to the Radiant window to give you easy access
to files, tools, and messages from the software. Figure 4 identifies the
views in the default arrangement. On the left is the File List view showing
the files and other components of the project that you just created. On the
right is the Reports view showing a summary of other information about
the project.
4. In the File List view, right-click tb_top.v and choose Include for >
Simulation.
By default all input files are marked for both synthesis and simulation. But
you do not want the testbench when you synthesize the design.
You will see activity in the Output view, at the bottom of the window, as the
Radiant software re-analyzes the design hierarchy. In the File List view,
top.v displayed in bold letters to show that it holds the top module. The
Hierarchy view, which is underneath the File List view, also changes.
Process Toolbar
Controls converting the
design to a bitstream.
File List
Provides easy access to
project components.
Tool Area
Shows the active tools.
Hierarchy
Provides access to the
modules of the design.
Bold Text Notice that some of the items, such as Strategy1 and impl_1, are
written with bold text. You can have multiple components of a given type, but
usually only one can be active. So impl_1 is the active implementation and
Strategy1 is the active strategy for impl_1.
An exception to this rule is in the Input Files, which are the HDL design files.
These are all active. In Input Files, bold text indicates a file with a top module.
The Radiant software automatically analyzes the Input Files for the design
hierarchy, which can be seen in the Hierarchy view. So top.v holds the top
module in impl_1.
Of course, you can also create code outside of the Radiant software and
import the files into your project.
In this task you will use all these tools to add a few modules to finish the
design.
4. Double-click PLL.
The Module/IP Block Wizard opens. (file a CR. PLL Window issue.)
5. For Component name, enter my_pll. Use the default for the “Create in”
location.
6. Click Next.
The wizard changes to a block diagram of the module and a table of
properties and values.
As you can see, there are several ways that you can customize this
module. Each tab provides more options.
Some of the properties are grayed out because they are read-only, such
as a value calculated from the option settings. But usually, a grayed out
property becomes available to change depending on other option settings.
For example, if you change Configuration Mode to Divider, the CLKI:
Divider Value option becomes available.
7. In the General tab, set the following values:
CLKI: Frequency (MHz) (10 - 800): 20
CLKOP: Frequency Desired Value (MHz) (10 - 800): 40
8. Click Calculate.
A box opens with messages. This may take a moment. Check for error
messages.
Note
Most IP do not have a Calculate button.
9. Click Generate.
The Check Generated Result page appears. This may take a moment.
10. Ensure that Insert to project, in the lower-left corner, is selected and click
Finish.
11. Go back to the File List view to see that my_pll/my_pll.ipx has been added
to the list of Input Files. The module comes with a few associated files. In
the Hierarchy view, a my_pll module appears.
3. In the File List view, right-click my_osc.ipx and choose Copy Verilog
Instantiation.
4. Go to Source Editor and paste the code below the comment.
Note
For VHDL, follow a similar process using the Copy VHDL Component and Copy
VHDL Instantiation commands.
5. You need to fill in a name for the instance and signal names for the ports.
See below for the finished instantiation command. Bold is the text that you
enter.
my_osc osc_inst(.hf_out_en_i(1'b1),
.hf_clk_out_o(osc_clk));
6. Click the Save button in the toolbar.
In the Hierarchy view, the my_osc module moves to be under the top
module.
In this tutorial we will just do the RTL simulation. For the other stages, the
process is similar.
For a simulator, this tutorial uses the Mentor® ModelSim® Lattice FPGA
Edition simulator that comes with the Radiant software on Windows.
If you are not using an HDL simulator that is integrated with the Radiant
software, you can skip this task. “Integrated” means that you can run the
simulator from the Radiant software. What is available depends on your
operating system. You can use other simulators outside of the Radiant
software.
If you are not using the ModelSim that comes with the Radiant software, you
need to compile the primitive library. For instructions, open the Radiant Help
and see User Guides > Simulating the Design > Third-Party Simulators.
This tutorial comes with a simple testbench. You will probably create your own
testbenches using your simulator. Simulators usually include tools for creating
testbenches.
You can rerun the simulation by double-clicking the .spf file. The Simulation
Wizard will open with a Skip to End button. Click it to jump to the last page of
the wizard. Then click Finish to start the simulation running.
Once the zoom steps are done, the ModelSim Wave View may look like
Figure 5, depending on the cursor location.
In the Wave view, you see the reset signal activated by the testbench.
This drives the LEDs value to zero. After reset is released, countt starts
counting.
6. The values of countt may not be visible. Click the Zoom In button in the
toolbar until you can see the values.
7. Choose Simulate > Run > Run 100 or click the Run button to see
more of the simulation. The Run toolbar looks like this:
Another 100 ns is added to the waveforms. This is the time you set in the
Runtime Options dialog box. You can change this amount in the box next
to the Run button.
8. Click anywhere to see what the values are at that moment.
The nearest cursor (a vertical yellow line) jumps to where you clicked. The
value column shows all the values at that moment.
You can click on the cursor and drag it to other positions on the time-line.
You can also return to the cursor after scrolling away by clicking the Zoom
In on Active Cursor button.
Warning
Do not click Yes. If you do, the $finish statement in the testbench causes
ModelSim to exit.
If this happens, go to the File List view in the Radiant window and look under the
Script Files folder. Double-click sim_test/sim_test.spf to restart ModelSim.
Since we have a list of the pin numbers from the board’s user guide, typing is
probably the easiest way.
To assign pins:
1. Choose Tools > Device Constraint Editor.
The Device Constraint Editor appears.
2. If you see a yellow bar with a message saying the “Design database in
memory is outdated,” click Reset Database, which is to the right of the
message.
3. Click the Port tab, in the lower-left.
4. In the spreadsheet, right-click on Name and choose Filter > Enable
Filter.
A button for a drop-down menu appears on each column title.
5. Click the drop-down button in the Name column.
A filter list appears.
6. In the Search box, type rstn.
The filter list is reduced to the rstn port.
7. Click OK.
8. The spreadsheet is reduced to the rstn port.
9. Click in the Pin cell and enter G19.
In the Device View, G19 shows a green dot, indicating an input port.
10. Click the drop-down button in the Name column.
11. In the Search box, type leds.
The filter list is reduced to the leds ports.
12. Click OK.
The spreadsheet is reduced to the leds ports.
13. Fill in the Pin cells of the leds ports with the following pins. Start at the top
of the list. After typing the pin number, press the down arrow key to get to
the next cell.
leds[0]: E17
leds[1]: F13
leds[2]: G13
leds[3]: F14
leds[4]: L16
leds[5]: L15
leds[6]: L20
leds[7]: L19
As you enter values, the matching spots in the diagram are filled in with
blue, indicating output ports.
14. Click the drop-down button in the Name column.
15. In the Search box, type direction.
The filter list is reduced to the direction port.
16. Click OK.
The spreadsheet is reduced to the direction port.
17. Fill in the Pin cells as follows.
direction: N14
18. Click the Constraint Preview button.
The Preview dialog box opens showing the constraint commands. See
Figure 6.
Each step also produces a set of reports that describe how the process was
run and the results. If a process fails, its reports are the place to start
troubleshooting.
With a single click you can run any individual process including any preceding
processes that have not been run yet. Click the Run All button to run the
whole sequence. Right-click a process button to get a menu of options for
running the process.
Click the Task Detail View button to select other files to generate while
running the processes. Timing analysis and simulation files are available.
While a process is running, the Run All button changes to the Stop button.
Click the Stop button to stop the processing.
When a process completes, its button shows its success or failure with a
green check mark or a red X .
4. In the toolbar of Physical Designer, click the arrow of the Routing Mode
button and choose IO Mode.
Physical Designer changes to show the I/O of the device.
5. In the list, expand Instances, scroll down to the bottom, and click
rstn_pad.bb_inst.
Physical Designer zooms in to the I/O for rstn: G19, which you set in the
constraint file. The padlock symbol shows the pads that have constraints
on them.
You can do this for any of the instances labeled with “_pad” and for any of
the items in the IOs list.
6. Close Physical Designer.
Estimation mode:
In estimation mode, Power Calculator provides estimates of power
consumption based on the device resources or template that you
provide. This mode enables you to estimate the power consumption
for your design before the design is complete or even started.
Calculation mode:
In calculation mode, Power Calculator calculates power consumption
on the basis of device resources taken from a design’s .udb file or
from an external file such as a value change dump (.vcd) file, after
placement and routing. This mode is intended for accurate calculation
of power consumption, because it is based on the actual device
utilization.
Editing data in white cells, such as voltage, frequency, activity factor, and
thermal data, does not change the mode. Editing data in yellow cells, such
as design data, will change calculation mode to estimation mode.
2. For Process Type in the Device Power Parameters section, choose
Worst.
3. Click Thermal Profile in the Environment section.
The Power Calculator – Thermal Profile dialog box appears.
4. For Board Selection, choose Small Board.
5. Click OK.
After a moment, the new temperature results become available in the
Environment section.
6. Close Power Calculator.
A Confirm dialog box appears.
7. Click Yes.
8. Give the file a name, such as eval_board, and click Save.
In the File List view, a .pcf file appears under Analysis Files.
The Radiant software does this by helping you create a “debug module” and
adding it to your design. The module is a combination of two types of “cores:”
Logic Analyzer monitors selected signals for events that you define. When
these events happen, the values of these and other signals are uploaded
to the Radiant software. You can see the values in a waveform viewer or
save them for other software.
You use Reveal Inserter to specify the signals that the Logic Analyzer core will
use and to set up the trigger units and trigger expressions. But these are only
initial settings. They can be modified in Reveal Analyzer/Controller without
taking the time to process the design and program the FPGA again. Think of
Reveal Inserter as creating capabilities and capacities that you can use with
Reveal Analyzer/Controller.
In your own on-chip debugging, think about all the signals and all the trigger
events that you might want to see, and build as much of that as possible into
the debug module. The limitation, of course, is the FPGA resources,
especially EBR (embedded block RAM) and distributed RAM, that you have
left after installing your design.
Datasets
Provides access to the
cores in the debug module.
Design Tree
Provides access to all
signals in the design.
The name of the signal now appears in bold font in the Design Tree pane.
The name is also labeled with “@C” to show that it is the sample clock
signal.
The Trace Signal Setup tab should now resemble Figure 10.
3. Set up the rest of this trigger expression with the following values:
RAM Type: 1 EBR
Choose the type of RAM to use for the expression. The menu also
shows the amount needed.
Sequence Depth: 2
This cell shows the number of sequences, or units, in the expression.
This cell is read-only.
Max Sequence Depth: 4
If you want to change the expression in Reveal Analyzer, this is the
maximum number of sequences that will be possible.
Max Event Counter: 32
If you want to change the expression in Reveal Analyzer, this is the
maximum number of counts that will be possible.
The Trigger Signal Setup tab should now resemble Figure 11.
The addresses that you see in the Reveal Controller core were assigned by
the Radiant software while processing the design.
Note
Only wire signals can be added to the virtual switch list.
RData: Q[31:0]
4. Make sure that the Enabled check box, in the upper-right corner, is
selected.
You can produce timing analysis reports as part of the synthesize, map, and
place-and-route processes. Before running a process, click the Task Detail
View in the Process Toolbar and select Timing Analysis for that process.
Timing analysis is selected by default, so you already have all three reports.
The reports have similar information shown in the same format. But they are
based on information from each process:
Post-synthesis timing analysis is based on pre-synthesis constraints and
estimates of delays.
Map timing analysis is based on post-synthesis constraints, the actual
types of components, and estimates of the routing delays.
Place-and-route timing analysis is based on post-synthesis constraints,
and the actual components and routing.
All the reports can be read in the Reports tab. The place-and-route timing
analysis can also be viewed in the Timing Analyzer tool. Timing Analyzer
gives you a spreadsheet view that you might find easier to read. Timing
Analyzer also has a search function to help you find different data paths.
Before leaving this task, take a look at the Timing Analyzer tool.
Note
The rest of the tutorial requires the CrossLink-NX Evaluation Board. If you do not have
the board, you can stop the tutorial now. Go to “Close the Radiant Project” on page 47.
7. Click OK.
8. In Programmer, choose Run > Program Device.
A processing bar appears. Programming takes a few moments. In the
Output view, info messages appear. On the board, the blinking lights stop
as the boot-up design is erased.
When the programming is done, “PASS” appears in the Status column.
9. Close Programmer.
A dialog box opens asking if you want to save changes.
10. Click Yes.
9. Click OK.
Reveal Logic Analyzer appears with the LA Trigger tab selected. It
contains the same trigger units and trigger expressions that you set up in
Reveal Inserter.
In the File List view, “eval_board.rva [CLNXtutorial.rvl]” appears under
Debug Files.
Note
Before running Running Logic Analyzer, make sure the dip switch labeled 1 on the
CrossLink-NX Evaluation Board is set to Off, as shown in Figure 15. This is because
the Trigger Unit Value for dir was set to 1 in “Setting Up Trigger Units” on page 31.
Dip Switch
Labeled 1
set to Off
To capture data:
1. Click the Run button in the Reveal Analyzer toolbar.
The Run button changes into the Stop button and the status bar next to
the button shows the progress.
Reveal Analyzer first configures the modules selected for the trigger
event, and then waits for the trigger event to occur. When the trigger event
occurs, the data is uploaded to your computer. The resulting waveforms
appear in the LA Waveform tab. This takes a few moments.
If the trigger is taking too long to occur, you can force an immediate trigger
by clicking the Manual Trigger button. This button is next to the Stop
button. The waveform may show why the trigger event did not happen.
The waveform should resemble Figure 16.
2. Click in the Data cell of countai. When the cell changes to a drop-down
menu, choose Hex.
3. Click the Zoom In button in the toolbar until you can read the values for
countai and so that the waveform is wider than the LA Waveform view.
4. Click anywhere in the waveform.
A red line appears in the waveform. This is the active cursor. The values
in the Data column change to match the trace sample that the active
cursor is at.
5. Scroll away from the trigger cursor and then right-click anywhere in or
under the waveform.
A menu appears with several commands. Some of these commands can
help you move about in the waveform. For example, choose Zoom >
Zoom Trigger to get back to the trigger cursor.
6. Right-click and choose Add Cursor.
A blue line replaces the red active cursor.
This is a user cursor. You can have several of them. Use them to mark
interesting points in the data.
7. Scroll away from the user cursor and then right-click anywhere in or under
the waveform. Choose Go to Cursor > <number>. The number is the
sample index where the cursor is.
The trace samples can be saved three ways. To see the data in:
The LA Waveform view again, save to this or another .rva file. Click the
Save button in the toolbar or choose File > Save <file> As.
Another waveform viewer, such as ModelSim or GTKWave export to a
value change dump file (.vcd). Right-click and choose Export Waveform.
A spreadsheet, export to a text (.txt) file. Right-click and choose Export
Waveform.
You have a choice when setting the virtual switches. You can set up a value
and then apply it, or you can immediately apply changes as you click
individual switches. We’ll try both. The virtual switches and LEDs are shown in
Figure 17.
5. Click Apply. This causes LEDs on the board to blink in the upcount
direction. (This may take a moment.)
6. In the Virtual LED area, click Start Polling. You will see the virtual LEDs
upcounting.
7. Move the Polling Speed slider to increase or decrease the polling speed
of the virtual LEDs.
8. For downcounting, in the Virtual Switch area, type 0xAA in the Data box.
(You can also set the data value by clicking on the individual switches.)
9. Click Apply. This causes LEDs on the board to blink in the downcount
direction. (This may take a moment.)
10. Alternately, you can also use the Direct Mode to see the LEDs change
their direction. Select the Direct Mode box.
The Data, Reset, and Apply controls are grayed out, but you still can click
switches to change the Data value.
In Direct Mode, if you change any of the individual switches it will change
the data value in real time. This affects the LED behavior.
11. In Direct Mode, for example, pull down switch 7. This changes the data
value, and will cause the Virtual LEDs and the LEDs on the board to stop
blinking. Pull switch 7 back up to see the Virtual LEDs and the LEDs on
the board to start blinking.
For this tutorial design, as soon as you set the switches to 0x55 or 0xAA,
the virtual LEDs and the LEDs on the board start to blink.
12. Click Stop Polling. This stops the movement of the virtual LEDs.
Note
You cannot run the Logic Analyzer core while the Controller core is running. The
polling occupies the cable.
Note
This section gives a sample of Reveal Controller Hard IP access capabilities. This
section does not describe all control features of the Hard IP.
But without a board, the tutorial ends here. You can close the project and exit
the Radiant software. You can also disconnect the board.
To gain more skill with the Radiant software, study the online help (Help >
Lattice Radiant Software Help). And begin work on your own project!
Summary of Accomplishments
You have completed the Lattice Radiant Tutorial with CrossLink-NX (LIFCL).
In this tutorial, you have learned how to:
Create a new Radiant software project.
Customize IP using IP Catalog.
Verify functionality with simulation.
Set timing and location assignments.
Process the design.
Analyze power consumption.
Analyze static timing.
Use Reveal Inserter to add on-chip debug logic.
Download a bitstream to an FPGA.
Use Reveal Logic Analyzer to perform logic analysis.
Recommended References
You can find additional information on the subjects covered by this tutorial in:
Radiant Software Help
Radiant Software User Guide
Reveal User Guide for Radiant Software
The following table gives the revision history for this document.
6/9/2021 3.0 Updated for Radiant 3.0. Added support for CrossLink-NX
Evaluation Board, Revision B. Added sections for
programming the FPGA, and setting up and running on-chip
debug.
10/20/2020 2.2 Updated for Radiant 2.2. Rewrote “Verify Functionality with
Simulation” task to use Mentor ModelSim instead of Aldec
Active-HDL.
6/2/2020 2.1 Updated for Radiant 2.1. Added section for PMI and Source
Template. Removed use of CrossLink-NX Evaluation Board
until an updated board is available.
12/17/2019 2.0 Added a link for downloading the design files. Expanded
Task 1 with more information about the main window and the
File List view.