Diamond 201 User Guide
Diamond 201 User Guide
User Guide
August 2012
Copyright
Copyright © 2012 Lattice Semiconductor Corporation.
Trademarks
Lattice Semiconductor Corporation, L Lattice Semiconductor Corporation (logo), L
(stylized), L (design), Lattice (design), LSC, CleanClock, Custom Movile Device,
DiePlus, E2CMOS, Extreme Performance, FlashBAK, FlexiClock, flexiFLASH,
flexiMAC, flexiPCS, FreedomChip, GAL, GDX, Generic Array Logic, HDL Explorer,
iCE Dice, iCE40, iCE65, iCEblink, iCEcable, iCEchip, iCEcube, iCEcube2, iCEman,
iCEprog, iCEsab, iCEsocket, IPexpress, ISP, ispATE, ispClock, ispDOWNLOAD,
ispGAL, ispGDS, ispGDX, ispGDX2, ispGDXV, ispGENERATOR, ispJTAG, ispLEVER,
ispLeverCORE, ispLSI, ispMACH, ispPAC, ispTRACY, ispTURBO, ispVIRTUAL
MACHINE, ispVM, ispXP, ispXPGA, ispXPLD, Lattice Diamond, LatticeCORE,
LatticeEC, LatticeECP, LatticeECP-DSP, LatticeECP2, LatticeECP2M, LatticeECP3,
LatticeECP4, LatticeMico, LatticeMico8, LatticeMico32, LatticeSC, LatticeSCM,
LatticeXP, LatticeXP2, MACH, MachXO, MachXO2, MACO, mobileFPGA, ORCA,
PAC, PAC-Designer, PAL, Performance Analyst, Platform Manager, ProcessorPM,
PURESPEED, Reveal, SiliconBlue, Silicon Forest, Speedlocked, Speed Locking,
SuperBIG, SuperCOOL, SuperFAST, SuperWIDE, sysCLOCK, sysCONFIG, sysDSP,
sysHSI, sysI/O, sysMEM, The Simple Machine for Complex Design, TraceID,
TransFR, UltraMOS, and specific product designations are either registered
trademarks or trademarks of Lattice Semiconductor Corporation or its subsidiaries in
the United States and/or other countries. ISP, Bringing the Best Together, and More of
the Best are service marks of Lattice Semiconductor Corporation.
Other product names used in this publication are for identification purposes only and
may be trademarks of their respective companies.
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 SEMICONDUCTOR
CORPORATION (LSC) 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 LSC 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.
Chapter 1 Introduction 1
Lattice Diamond Overview 1
User Guide Organization 2
Start Page 26
File List 26
Process 27
Hierarchy 28
Module Library 31
Dictionary 33
Reports 34
Tool Views 35
Tcl Console 37
Output 37
Error and Warning 37
Common Tasks 38
Controlling Views 38
Grouping Tabs 39
Managing Layouts 39
Cross-Probing Between Views 43
Simulation Flow 70
I/O Assistant Flow 73
Summary of Changes from ispLEVER 75
Index 143
Introduction
A fast Timing Analysis loop, ECO Editor, and Programmer provide new
capabilities in the integrated framework. The cross-probing feature and the
new shared memory architecture ensure fast performance and better memory
utilization.
Other parts of the book provide greater detail and practical usage information.
The chapter “Working with Projects” on page 45 shows how to set up project
implementations and strategies. “Working with Tools and Views” on page 77
describes the many tool views available.
Getting Started
This chapter explains how to run Lattice Diamond and open or create a
project. It includes instructions for importing a project from ispLEVER and
explains key differences between Lattice Diamond and ispLEVER.
For more information about project fundamentals, see the chapters “Design
Environment Fundamentals” on page 15 and “Working with Projects” on
page 45.
Prerequisites
It is assumed you have already installed the Lattice Diamond software and
product license. See the Lattice Diamond Installation Notice for complete
information on product installation.
Note
If you are using Windows 7, you can use the “pin” command from the Start menu to
place a Lattice Diamond shortcut on the Start menu or the Taskbar.
Do not use the “pin” command that is available from the Taskbar while Diamond is
running. If you do so, the shortcut will fail when you try to use it to launch Diamond.
You can open the New Project Wizard using one of the following
methods:
On the Start Page, select New in the Project pane.
From the File menu, choose New > Project
Several example project design files are included in Lattice Diamond. The
following example procedure shows how to create a new project using the
“mixedcounter” example.
Click Browse to open the Browse for Folder dialog box. Navigate to the
Lattice Diamond examples directory and select the mixedcounter folder, as
shown:
Enter a Project Name. Notice that the implementation is given the same name
by default, but this is not required. For this example, we will leave them the
same, naming both the project and the initial implementation “Test.”
From this dialog box, you can add Verilog or VHDL source files, EDIF netlist
files, LPF constraint files, schematic, debug and analysis files or any other
project files. Diamond takes the source files and places them into the correct
folders for the new project.
Click Add Source to open a file browser in the project example location.
Open the “source” folder, select all Verilog and VHDL files, and click Open to
add the files to the project.
Figure 7: Source
This process of browsing and adding source files can be done as many times
as needed before going to the next step.
In this step you can select the target device, performance grade, package
type, operating conditions and part name. For our example, we will use the
default settings.
At this step or any other step in the process, you can click the Back button to
review or change your selections.
Click Finish. The newly created project is now created and open.
Select the File List tab under the left pane, to view the Test project file list.
Select the Process tab, to see the design flow processes and status.
You can use the Options dialog box to increase the number of projects that
are shown in the Recent Projects list and to automatically load the previous
project at startup. Choose Tools > Options to open the dialog box. To
increase the number of recent projects listed, select General from the
Environment section, and then enter a number for “Maximum items shown in
Recent items list.” To automatically open the previous project during startup,
select Startup from the Environment section, and then choose Open
Previous Project from the “At Lattice Diamond startup” menu.
The file browser applies a *.syn file filter to help you find ispLEVER
project files. The ispLEVER project is converted to a Lattice Diamond
project.
Next Steps
After you have a project opened in Lattice Diamond, you can go sequentially
through the rest of this user guide to learn how to work with the entire design
environment, or you can go directly to any topics of interest.
The chapters “Design Environment Fundamentals” on page 15 and
“Lattice Diamond Design Flow” on page 61 provide explanations of key
concepts.
Design Environment
Fundamentals
Overview
Understanding some of the fundamental concepts behind the Lattice
Diamond framework technology will increase your proficiency with the tool
and allow you to quickly come up to speed on its use.
The process flow is managed at a system level with run management controls
and reporting. Context-sensitive views ensure that you only see the data that
is available for the current state in the process flow.
Note
You can run multiple instances of Lattice Diamond, by loading Lattice Diamond
multiple times. This enables you to run different Diamond projects at the same time.
However, you must not load the same project in more than one Lattice Diamond
software, as this can cause conflicts in the software.
You can also run Diamond remotely. Refer to the Lattice Diamond Installation Notice
for more information.
Project-Based Environment
A project in Lattice Diamond consists of HDL source files, EDIF netlist files,
synthesis constraint files, LPF constraint files, Reveal debug files, script files
for simulation, analysis files for power calculation and timing analysis, and
programming files. It also includes settings for the targeted device and the
different tools. The project data is organized into implementations, which
define the project structural elements, and strategies, which are collections of
tool settings.
The items in bold are active. You must have one active implementation, and
the implementation must have one active strategy. Optional items, such as
Reveal hardware debugger files, can be set active or inactive. This differs
from ispLEVER, where the existence of Reveal debugger files means that
debug is active.
design with primarily Verilog files but an EDIF netlist for one module, you will
create a new implementation using the Verilog and EDIF source files. It will be
the same project and design, but with a different set of modular blocks.
Similarly, if you want to try different implementation tool options, you can
create a new strategy with the new option values.
You manage these multiple implementations and strategies for your project by
setting them as active. There can only be one active implementation with its
one active strategy at a time.
Process Flow
The Process View provides a system-level overview of the FPGA design flow.
Each major step in the design process is shown, along with an icon that
indicates its status. In the Map and Place & Route sections you can select
optional subtasks to be run every time. These selections are saved on a
project basis. In the Export Files portion, you can select the models or files
that you want to be exported with the Export Files process. For example, if
Bitstream File is checked, it will be generated and exported; if it is not
checked, it will not be generated and exported.
Shared Memory
Lattice Diamond uses a shared memory architecture. All tool and data views
are looking at the same design data at any point in time. This means that
when you change a data element in one view of your design, all other views
will see the change, whether they are active or not.
When project data has been changed but not yet saved, an asterisk * is
displayed in the title tab of the view.
Notice that the asterisks indicating changed data will appear in all views
referencing the changed data.
For example, Figure 17 shows that the Process flow has been completed
through Map Design but not through Place & Route Design. Therefore,
Spreadsheet View shows no pin assignments.
After Place & Route Design has been completed, Spreadsheet View displays
the pin assignments.
When you see a “Loading Data” message, it means that a process has been
completed and that the shared memory is being updated with new data.
All tool views are dynamically updated when new data becomes available.
This means that when you rerun an earlier process while a view is open and
displaying data, the view will remain open but dimmed because its data is no
longer available.
Cross-Probing
Cross-probing is a feature found in most tool views. Cross-probing allows
common data elements to be viewed in multiple tool views.
To see how this works, select a pin or signal in one view and right-click it.
Select Show In to see a list of cross-probing views for the selected element.
For example, Figure 21 shows a tab group consisting of Floorplan View and
Physical View. A signal is selected in Physical View.
When you right-click the selected signal in Physical View and choose Show
In > Floorplan View, the same selected signal is highlighted on the Floorplan
View layout.
This chapter describes the user interface features, controls and basic
operation. Each major element of the interface is explained. The last section
in the chapter describes common user interface tasks.
Overview
The Diamond Lattice user interface (UI) provides a comprehensive, integrated
tool environment. The UI is very flexible and configurable, enabling you to
store layout preferences.
This chapter will take you through the operation of the main elements of the
UI, but you should also explore the controls at your own pace. Figure 23
shows the Lattice Diamond main window in the default state.
The toolbars are organized into functional sets. The display of each toolbar is
controlled in the View > Toolbars menu and also by right-clicking in the Menu
and Toolbar area. Each toolbar can be repositioned by dragging and dropping
it to a new location.
Project Views
In the middle of the main window on the left side is the Project View area. This
is where the overall project and process flow is displayed and controlled.
Tabs at the bottom of the Project View allow you to select between the
following views:
File List – shows the files in the project organized by implementations and
strategies. This is not a hierarchical listing of the design.
Process – shows the overall process flow and status for each step
Module library – library of modules in the active implementation of the
design
Dictionary – alphabetical listing of all design elements
Hierarchy – hierarchical design representation
The File List and Process views are displayed by default. The Module library,
Dictionary and Hierarchy views are displayed only when selected or when the
Generate Hierarchy function has been run and project data is available for
these views to display.
Multiple tools can be displayed at the same time. The Window toolbar
includes controls for grouping the tool views as well as integrating all tool
views back into the main window.
Each tool view is specific to its tool and can contain additional toolbars and
multiple panes or windows controlled by additional tabs. The chapter
“Working with Tools and Views” on page 77 provides more details about each
tool and view.
Tabs at the bottom of this area allow you to select between Tcl Console,
Output, Error, Warning and Find Results. Tool output is automatically sent to
the Output tab, and Errors and Warnings are automatically sent to their
respective tabs.
Status Information
At the very bottom of the main window is status information. The information
shown depends on the position of the mouse pointer, current memory usage,
and whether unsaved preference changes are in memory. For more
information on memory usage see “Advanced Topics” on page 129.
Basic UI Controls
The Lattice Diamond environment is based on modern industry standard user
interface concepts. The menus, toolbars, and mouse pointer all behave in
familiar ways. You can resize any of the window panes, drag and drop
elements, right-click a design element to see available actions, and hold the
mouse pointer over an object to view the tooltip.
Each of the Project and Tool views as well as the Outputs and Tcl Console
items can be detached from the main window and operated as independent
windows. Simply click the detach button in the upper-right corner.
After a view or item has been detached from the main window it can be
reattached by one of two methods:
For Project views, Outputs and the Tcl Console, double-click inside the
window title bar, and the window will be re-attached to the main window.
For Diamond Tool views, single-click the attach button in the upper-
right corner, and the window will be re-attached to the main window.
Start Page
The Start Page contains selections for opening projects, hyperlinks to product
documentation, and software status and upgrade information. The Start Page
appears in the Tool View area by default when Lattice Diamond is first
launched.
The Start Page can be closed, opened, detached and attached (using the
attach button).
File List
The File List is a project view that shows the files in the project, including
implementations and strategies. It is not a hierarchical listing of the design,
but rather a list of all the design source, configuration and control files that
make up the project.
At the top level in the File List is the project name. Directly below the project
name is the target device, followed by the strategies, and then the
implementations. There must be one active implementation, and it must have
one active strategy. Active elements are indicated in bold.
You can right-click any file or item in the File List to access a pop-up menu of
currently available actions for that item. The pop-up menu contents vary,
depending on the type of item selected.
The File List view can be closed, opened, detached, and attached (using the
double-click method).
Process
The Process View is a project view that displays the high-level process flow
for the project.
The icons to the left of each step indicate the process status and are defined
as follows:
You can right-click any step in the Process view to access a pop-up menu of
currently available actions for that item.
The Process view can be selected, closed, opened, detached, and attached
(using the double-click method).
Hierarchy
The Hierarchy View is a project view that displays the design hierarchy. This
view is automatically displayed when the Generate Hierarchy function is
selected. Along with the Module library and Dictionary views, the Hierarchy
View is not displayed by default. To display the hierarchy, choose View >
Show Views > Hierarchy or right-click in the menu and toolbar area and
choose Hierarchy from the pop-up menu.
The Hierarchy View remains empty until the hierarchy for the design has been
generated. Click the Generate Hierarchy button on the toolbar, or choose
it from the Design menu to generate the hierarchy and populate the Hierarchy
View with data. In addition to displaying the HDL Diagram, generating the
hierarchy causes the Hierarchy, Module Library and Dictionary views to be
displayed.
Right-click any of the objects in the Hierarchy View to see its type and name
as well as the available actions.
When you hold the mouse pointer over an item in the list, a tooltip description
for that item is displayed.
After synthesis, the Hierarchy View displays the calculated resource utilization
data, such as LUT4, registers, IO registers. Device resources that would be
consumed are shown to the right of each module. The first number in each
column is the number of that resource that would be used by that module
and all of its submodules. The second number, in parentheses, is the number
of that resource that would be used by just that module, not including any of
its submodules.
The numbers are updated after the synthesis and map stages of the
implementation process.
The Hierarchy View can be selected, closed, opened, detached, and attached
(through the double-click method).
Module Library
The Module Library View is a project view that displays the modules in the
design. This view is automatically displayed when the Generate Hierarchy
function is selected.
Along with the Hierarchy and Dictionary views, the Module Library View is not
displayed by default. To display the module library, choose View > Show
Views > Module library or right-click in the menu and toolbar area and
choose Module library from the pop-up menu.
The Module Library View remains empty until the hierarchy for the design has
been generated. Click the Generate Hierarchy button on the toolbar, or
choose it from the Design menu to generate the hierarchy and populate the
Module Library View with data. In addition to displaying the HDL Diagram
view, generating the hierarchy causes the Hierarchy, Module Library and
Dictionary project views to be displayed.
Right-click any of the objects in the Module Library View to see its type and
name as well as the possible actions.
The Module Library View can be selected, closed, opened, detached, and
attached (through the double-click method).
Dictionary
The Dictionary View is a project view that displays all of the data elements in
the design. This view is automatically displayed when the Generate Hierarchy
function is selected. Along with the Hierarchy and Module library views, the
Dictionary view is not displayed by default. To display the dictionary, choose
View > Show Views > Dictionary or right-click in the menu and toolbar area
and choose Dictionary from the pop-up menu.
The Dictionary view remains empty until the hierarchy for the design has been
generated. Click the Generate Hierarchy button on the toolbar, or choose
it from the Design menu to generate the hierarchy and populate the Dictionary
View with data. In addition to displaying the HDL Diagram, generating the
hierarchy causes the Hierarchy, Module Library, and Dictionary views to be
displayed.
The “Use Regular Expression” option at the top of the view enables you to
filter the Dictionary list. After you select this option, type a regular expression
in the text box, and press Enter. The Dictionary list will then display only those
items that match the parameters.
Right-click any of the objects in the Dictionary view to see its type and name
as well as the possible actions.
The Dictionary view can be selected, closed, opened, detached, and attached
(through the double-click method).
Reports
The Reports View provides a centralized reporting mechanism in the Tools
view area. The Reports View is automatically displayed and updated when
processes are run.
The Design Summary pane on the left provides hyperlinks to the Project
Summary and to report information for each step of the design process flow.
The right pane displays the report for the selected step.
Right-click a report in the Design Summary list to access the Find in Text
command. Selecting this command opens a text search area at the bottom of
the Report View.
The Report View can be selected, closed, opened, detached, and attached
(through the attach icon method).
Tool Views
The Tool View area of the UI displays the active tools. For example, Figure 45
shows the Tool view area with the Reports, Spreadsheet View, Netlist View
and HDL Diagram displayed:
When multiple tools are active, their display can be controlled with the tab
group functions in the Window toolbar. See “Common Tasks” on page 38 for
more information on tab group functions.
Each tool view is specific to its tool and can contain additional toolbars,
multiple panes, or multiple windows controlled by additional tabs. See
“Working with Tools and Views” on page 77 for descriptions of each tool and
view, plus details on controlling their display.
You will notice an asterisk “*” in the tool view tab title when there has been a
change to the shared memory.
The Tool views can be selected, closed, opened, detached, and attached
(through the attach icon method).
Tcl Console
The Tcl Console is an integrated console for Tcl scripting. You can enter Tcl
commands in the console to control all of the functionality of Lattice Diamond.
Use the Tcl help command (help) to display a listing of the groups of Lattice
Diamond extended Tcl commands.
The Tcl Console can be selected, closed, opened, detached, and attached
(through the double-click method).
Output
The Output View is a read-only area where tool output is displayed.
The Output view can be selected, closed, opened, detached, and attached
(through the double-click method).
process runs. Error and warning information is not cleared with each new run
of a process. You can clear this information manually from the view by right-
clicking inside the view and choosing Clear from the pop-up menu.
The Error and Warning views can be selected, closed, opened, detached, and
attached (through the double-click method).
Common Tasks
The Lattice Diamond UI controls many tools and processes. The following
sections describe some of the more commonly performed tasks.
Controlling Views
All of the views in Lattice Diamond are controlled in a similar manner, even
the information they contain varies widely. Here are some of the most
common operations:
Open – Use the View > Show Views menu selections or right-click in the
menu or toolbar areas to select a view from the pop-up menu.
Select – If a view is already open you can select its tab to bring it to the
front.
Close – Click the x in the upper right corner of the view, or right-click in the
menu or toolbar area and select the view from the pop-up menu to clear
the check mark.
Detach – Click the detach button in the upper right corner of the view
Attach – Use one of the two following methods:
For project views, Output and the Tcl Console, double-click in the
window title bar, and the window will be attached back into the main UI
window.
For tool views, click the attach button , and the window will be
attached back into the main UI window.
Move – Click and hold a view’s tab, and then drag and drop the view to a
different position within the open views
Grouping Tabs
The tab grouping controls are in the window toolbar.
You can also drag and drop the tabs to change the position of the open views.
Figure 52 shows the display after selecting Switch Tab Group Position.
Managing Layouts
Diamond’s layout management utilities allow you to load a predefined layout
of views and to create your own customized layouts. Predefined and
customized layouts enable you to get to work immediately on a specific task,
such as analyzing your source code or setting design constraints.
You cannot modify or delete any of the predefined layouts from the Manage
Layout dialog box. However, you can load one of the predefined layouts into
Diamond’s main window, modify it by opening and closing or detaching views,
and then save the arrangement as a customized layout.
the “Analyze RTL” predefined layout, Power Calculator will remain open and
in its detached position.
You can use the Manage Layout dialog box to delete a customized layout,
and you can open the Modify dialog box to make minor changes. The Modify
dialog box enables you to change the name of the customized layout and to
select or clear the “Launch view when loaded” option. However, it does not
allow you to add or delete tool views.
Using the “Launch view when loaded” Option The “Launch view when
loaded” option will cause all of the layout’s tool views to open when you load
the customized layout. This gives you quick access to the tools and is very
useful for layouts that include only a few tool views. For more complex
layouts, this option can cause a long delay while each tool view gets loaded
with the layout. If your customized layout includes a lot of tool views, you
should clear this option.
If the customized layout is not set to “Launch view when loaded,” the Load
Layout command will not open any of the layout’s tool views. For these types
of layouts, first open the layout’s tool views that you need to work with, and
then choose the Load Layout command. The tool views will be arranged
according to the customized layout. You can later open any or all of the
remaining tool views that are part of the customized layout and choose the
Load Layout command again. These tool views will also be arranged
according to the layout.
layout, you should leave the “Launch view when loaded” option cleared to
avoid a long wait as the layout is loaded.
Overview
A project is the top organizational element in the Lattice Diamond design
environment. Projects consist of design, constraint, configuration and analysis
files. There is only one project open at a time, and a single project can include
multiple design structures and tool settings.
You can create, open, or import a project from the Start Page. See the chapter
“Getting Started” on page 3 for instructions on creating a new project.
The File List view shows a project and its main elements.
The Project menu commands enable you examine the project properties,
change the target device, set the synthesis tool, show the active strategy tool
settings and set the top level design unit.
Implementations
An implementation is the structure of a design and can be thought of as what
is in the design. For example, one implementation might use inferred memory
while another implementation uses instantiated memory. Implementations
also define the constraint and analysis parameters for a project.
Notice that you have the option to “Copy source to implementation directory.”
If this option is selected, the source files will be copied from the existing
implementation to the new implementation, and you will be working with
different source files in the two implementations. If you want the two
implementations to share the same source files and stay in sync, make sure
that this option is not selected.
To make an implementation active, right-click its name in the File List and
choose Set as Active Implementation.
Input Files
Input files are the design source files for the project. Input files can be any
combination of Verilog, VHDL, and EDIF files.
Right-click an input file name to open a pop-up menu of possible actions for
that file.
You can use the “Include for” commands to specify that a source file be
included for both synthesis and simulation, synthesis only, or simulation only.
An implementation can have multiple .lpf files, but only one can be active at a
time.
Debug Files
The files in the Debug folder are project files for the Reveal Inserter. They are
used to insert hardware debug into your design. There can be multiple debug
files, and one or none can be set as active. To insert hardware debug into
your design, right-click a debug file name and choose Set as Active Debug
File from the pop-up menu. The debug file name becomes bold, indicating
that it is active.
Script Files
The Script Files folder contains the scripts that are generated by the
Simulation Wizard. After you run the Simulation Wizard, the steps are stored
in a simulation project file (.spf), which can be used to control the launching of
the simulator.
Analysis Files
The Analysis Files folder contains Power Calculator files (.pcf) and Timing
Preference files (.tpf). The folder can contain multiple analysis files, and one
or none can be set as active. The active or non-active status of an analysis file
affects the behavior of the associated tool view.
Programming Files
Programming files (.xcf) are configuration scan chain files used by the
Diamond Programmer for programming devices in a JTAG daisy chain. The
.xcf file contains information about each device, the data files targeted, and
the operations to be performed.
An implementation can have multiple .xcf files, but only one can be active at a
time.The file must be set active by the user.
Strategies
Strategies are collections of all the implementation-related tool settings in one
convenient location. Strategies can be thought of as recipes for how the
design will be implemented. An implementation defines what is in the design,
and a strategy defines how that design will be run. There can be many
strategies, but only one can be active at a time. There must be one active
strategy for each implementation.
To create a new strategy from an existing one, right-click the existing strategy
and choose Clone <strategy name> Strategy. Set the new strategy’s ID and
file name.
To make a strategy active, right-click the strategy name and choose Set as
Active Strategy.
Strategies are design data independent and can be exported and used in
multiple projects.
Area
The Area strategy is a predefined strategy for area optimization. Its purpose is
to minimize the total logic gates used while enabling the tight packing option
available in Map. It is commonly used for low-density devices such as
MachXO.
Applying this strategy to large and dense designs might cause difficulties in
the place and route process, such as longer time or incomplete routing.
I/O Assistant
The I/O Assistant strategy is a predefined strategy that is useful for I/O
design. It helps you select a legal device pinout and produce LOCATE and
IOBUF preferences for optimal I/O placement.
The benefit is that you will get results in I/O placement information early on,
without having a complete design or any long runtimes after finishing place
and route. However, applying this strategy to your design might take extra
runtime, because it executes logic synthesis, translation, map, and I/O
placement process.
If you use the I/O Assistant strategy for your project, the generated .ncd file
will be incomplete. Running the Export Files > Bitstream File process or the
Export Files > JEDEC File process will fail. If you want to implement a
complete design, you will need to choose another strategy and rerun all
processes again. See “Lattice Diamond Design Flow” on page 61 for more
information.
Quick
The Quick strategy is a predefined strategy for doing an initial quick run. This
strategy uses very low effort level in placement and routing to get results with
minimum run time. If your design is small and your target frequencies are low,
this is a good strategy to try. Even if your design is large, you might want to
start with this strategy to get a first look at place-and-route results and to tune
your preference file with minimum runtime.
The Quick strategy will give you results in the least possible time. However,
the quality of these results in terms of achieved frequency will probably be
low, and large or dense designs might not complete routing.
Timing
The Timing strategy is a predefined strategy for timing optimization. Its
purpose is to achieve timing closure. The Timing strategy uses very high effort
level in placement and routing. Use this strategy if you are trying to reach the
maximum frequency on your design. If you cannot meet your timing
requirements with this strategy, you can clone it and create a customized
strategy with refined settings for your design. This strategy might increase
your place-and-route run time compared to the Quick and Area strategies.
User-Defined
You can define your own customized strategy by cloning and modifying any
existing strategy. You can start from either a predefined or a customized
strategy.
Common Tasks
Working with projects includes many tasks: creating the project, editing
design files, modifying tool settings, trying different implementations and
strategies, saving your data.
Creating a Project
See “Creating a New Project” on page 5 in the “Getting Started” chapter for
step-by-step instructions.
In the Project Properties dialog box, select Value next to Top-Level Unit and
select the desired top level from the list.
Editing Files
You can open any of the files for editing by double-clicking or by right-clicking
and choosing Open or Open with.
Overview
The FPGA implementation design flow in Lattice Diamond provides extensive
what-if analysis capabilities for your design. The design flow is displayed in
the Process view.
Synthesize Design This process runs the selected synthesis tool (Synplify
Pro is the default) in batch mode to synthesize your HDL design.
Translate Design This process converts the EDIF file output from synthesis
to NGD format. If the design utilizes Lattice NGO netlist files, such as
generated Lattice IP, the netlist will also be read into the design.
Map Design This process maps the design to the target FPGA and
produces a mapped Native Circuit Description (.ncd) design file. Map Design
converts a design’s logical components into placeable components.
The Map Design process also generates timing analysis and simulation files
when you have selected them before running Map Design:
Map Trace – creates a post-map timing report file (.tw1) that helps
determine where timing constraints will not be met. This report can be
viewed in Report View. In post-map timing analysis, Trace determines
component delays and uses estimated routing delays. The estimation
method used is based on the setting for "Route Estimation Algorithm" in
the Map Trace section of the active strategy. This can be used to detect
severe timing issues, such as deep levels of logic, without incurring the
runtime of PAR.
Verilog Simulation File – generates a Verilog netlist of the mapped design
that is back annotated with estimated timing information. This generated
_map_vo.vo file enables you to run a simulation of your design.
back annotates the mapped design with estimated timing information so
that you can run a simulation of your design. The back annotated design
is a Verilog netlist.
VHDL Simulation File – generates a VHDL netlist of the routed design that
is back annotated with estimated timing information. This generated
_map_vho.vho file enables you to run a simulation of your design.
The timing analysis and simulation files can also be generated separately by
double-clicking each one.
Place & Route Design This process takes a mapped physical .ncd design
file and places and routes the design. The output is an .ncd file that can be
processed by the design implementation tools.
The Place & Route Design process also generates timing and SSO analysis
files when you have selected them before running Place & Route Design:
Place & Route Trace – creates a timing report (.twr) that enables you to
verify timing. This report can be viewed in Report View. In post-route
timing analysis, Trace analyzes path delays and reports where these
occur in the design.
I/O Timing Analysis – runs I/O timing analysis and generates an I/O
Timing Report that can be viewed in Report VIew. The report is an
analysis of inputs and outputs across all potential silicon to help ensure
that the board design is compatible; it shows the constraints to which the
board design will need to adhere.
For each input port in the design, this report shows the worst case setup
and hold time requirements. For each output port, it shows the worst case
min/max clock-to-out delay. The computation is performed over all
performance grades available for the device and at the voltage and
temperature specified in the preference file. I/O timing analysis also
automatically determines the clocks and their associated data ports.
Export Files This process generates the IBIS, simulation, and programming
files that you have selected for export:
IBIS Model – generates a design-specific I/O Buffer Information
Specification model file (.ibs). IBIS models provide a standardized way of
representing the electrical characteristics of a digital IC’s pins (input,
output, and I/O buffers).
Verilog Simulation File – generates a Verilog netlist of the routed design
that is back annotated with timing information. This generated .vo file
enables you to run a timing simulation of your design.
VHDL Simulation File – generates a VHDL netlist of the routed design that
is back annotated with timing information. This generated .vho file enables
you to run a timing simulation of your design.
JEDEC File – generates a JEDEC file for programming the device.
JEDEC is the industry standard for PLD formats. In the Lattice Diamond
software, JEDEC refers to the fuse map of your design for the selected
device. This option is applicable only to non-volatile FPGAs such as
LatticeXP, LatticeXP2, MachXO and MachXO2.
Bitstream File – generates a configuration bitstream (bit images) file,
which contains all of the design’s configuration information that defines
the internal logic and interconnections of the FPGA, as well as device-
specific information from other files. This option is applicable only to
volatile SRAM-based FPGAs, such as LatticeECP/2/M, LatticeECP3,
LatticeSC/M.
PROM File – generates an output file in one of several programmable
read-only memory (PROM) file formats. This option is applicable only to
volatile SRAM-based FPGAs, such as LatticeECP/2/M, LatticeECP3,
LatticeSC/M
The files for export can also be generated separately by double-clicking each
one.
Running Processes
For each step in the process flow you can perform the following actions:
Run – runs the process, if it has not yet been run
Rerun – reruns a process that has already been run
Rerun All – reruns all processes from the start to the selected process
The state of each process step is indicated with an icon to the left of the
process:
The Reports View displays detailed information about the process results,
including the last process run. In the Tool Reports section, it shows the results
of SSO analysis that has been set up in Spreadsheet View. It also reports the
results of hierarchy generation and Best Known Methods (BKM) analysis. The
Generate Hierarchy and Run BKM Check commands are available from the
Design menu.
You might want to try different implementations of a design using the same
tool strategy, or try running the exact same implementation with different
strategies to see which scenario will best meet your project goals. Each
To try the same implementation with different strategies you will need to
create a new implementation/strategy combination. Right-click the project
name in the File List and choose Add > New Implementation. In the dialog
box, the Add Source selection allows you to use source from an existing
implementation. The Default Strategy selection allows you to choose from the
currently defined strategies.
If you want to use the exact same source for the new and the existing
implementations, make sure that the “Copy source to implementation
directory” option is not selected. This will ensure that your source is kept in
sync between the two implementations.
Run Management
Use the Run Manager to run different implementations. Each implementation
will use its active strategy. Choose Tools > Run Manager or click the Run
Manager button on the toolbar.-
The Run Manager runs the entire process flow for each selected
implementation. If you are running multiple implementations on a multicore
system, the run manager will distribute them so that they are executed in
parallel.
You can use the run Manager list to set an implementation as active. Right-
click the implementation/strategy pair and choose Set as Active.
Best Known Methods (BKM) are design guidelines that are used to analyze
your design. BKM includes the following design checks:
Connectivity – checks the pin connectivity of instances throughout the
design
Synthesis – checks for violations of the Sunburst Design coding styles, as
well as other potential synthesis problems
Structural Fan-Out – checks for maximum structural fan-out violations
Coding Styles – colors modules based on their line count, colors pins and
ports based on their width, validates module names, and also performs
big-endian or little-endian checks on all ports
To run BKM checks, choose Design > Run BKM Check from the menu or
click the button on the toolbar. If you want to automatically run these
checks whenever a design is loaded, choose Design > Auto Run BKM
Check.
While running a BKM check, errors and warnings are listed in the Output
panel. The BKM checks also color-highlight design elements in the graphical
and textual views when they have associated BKM violations.
If you selected SDC Files, open the file in the Source Editor to add the
constraints. If you selected LDC Constraint Files, the LDC Editor will open
displaying the spreadsheet and three tabs for creating and editing synthesis
constraints.
For detailed information about setting SDC constraints, see Applying Lattice
Synthesis Engine Constraints and the Constraints Reference Guide in the
Lattice Diamond online Help.
Simulation Flow
The simulation flow in Diamond 1.3 or later has been enhanced to support
source files that can be set in the File List view to be used for the following
purposes:
Simulation & Synthesis (default)
Simulation only
Synthesis only
The Simulation Wizard has been enhanced to support these changes. The
Simulation Wizard will automatically include any files that have been set for
simulation only or for both simulation and synthesis. The user can select the
top of the design for simulation independent of the implementation design top.
This allows easy support for testbench files, which are normally at the top of
the design for simulation but not included for implementation. The
implementation wizard will export the design top to the simulator, along with
source files, and set the correct top for the SDF file if running timing
simulation.
The File List view shows an implementation’s input files for simulation. This is
a listing of source files and does not show design hierarchy.
After you add a module, use the Include For menu to specify how the module
file is to be used in the design.
When you are ready to simulate, you can export the design using the
Simulation Wizard. Choose Tools > Simulation Wizard or click the
Simulation Wizard button on the toolbar .The wizard will lead you through
a series of steps: selecting a simulation project name and location, specifying
the simulator to use (if you have more than one installed), selecting the
process stage to use (from RTL to Post-Route Gate-Level + Timing), and
selecting the language (VHDL or Verilog) and source files. You can also run
the simulation directly from the wizard.
After you have set up the simulator project and specified the implementation
stage and source files to be included, the Simulation Wizard parses the HDL
and test bench. The last step is to specify the simulation top module.
In some designs, the compile order of the HDL files passed to the simulator
might result in compilation warnings. In most cases, these compilation
warnings can be safely ignored. The warnings can be eliminated in one of two
ways:
The correct compilation order for the HDL files can be set in the File List
view. After the correct order for the files is set manually, the files will be
sent to the simulator, which will eliminate any compilation warnings.
The correct compilation order for the HDL files can be set in the
Simulation Wizard during the "Add and Reorder" step. After the correct
order for the files is set manually, the files will be sent to the simulator,
which will eliminate any compilation warnings.
The I/O Assistant strategy helps you select a legal device pinout and produce
LOCATE and IOBUF preferences for optimal I/O placement. The only design
content required to validate an I/O plan is an HDL model of the I/O ports.
Details of the internal logic can be treated as a black box. The primary output
of the I/O Assistant flow is a validated placement of I/O signals that can be
back annotated to the logical preference file.
The I/O Assistant strategy is a read-only predefined set of properties for the
design flow. The following sequential steps are typical for the I/O Assistant
design flow:
1. Create a top-level module in HDL that describes all of the ports in the
design. You can do so manually or use the I/O modules generated by
IPexpress.
2. Make the I/O Assistant strategy active for your project. From the
Strategies folder in the File list pane, right-click I/O Assistant and choose
Set as Active Strategy.
3. Synthesize your HDL as you would normally.
If you are using Synplify Pro, Lattice Diamond will automatically pass the
required attributes and header files for I/O Assistant flow when you run the
Translate Design process. It will also automatically pass the required
attributes and header files if you are using the integrated Lattice
Constraint Engine (LSE) for a MachXO, MachXO2, or Platform Manager
design.
If you are running synthesis in stand-alone mode, you will need to include
these attributes and header library files in the source code before
synthesis. See the synthesis tool documentation for more information.
4. Constrain your design to add banking location preferences, I/O types, I/O
ordering, and minor customizations. You can set these preferences using
Spreadsheet View or you can do this manually.
To set the preferences in Spreadsheet View, choose Tools >
Spreadsheet View and edit the I/Os.
To set I/O preferences manually, double-click the name of the project’s
logical preference file (.lpf) from the Constraints folder in the File List
view.
When implementing DDR interfaces, it is recommended that you generate
the required DDR modules using IPExpress along with the port
definitions. This will enable the tool to check for any DDR-related rules
that are being violated.
5. Run the Place & Route Design process.
The process maps and places the I/Os based on the preferences, the I/O
Assistant strategy, and the architectural resources. The output is a pad
report (.pad) to guide future placement and a placed and routed native
circuit description .ncd that contains only I/Os.
6. Examine the I/O Placement results by doing one or more of the following:
From the Process Reports folder in the Reports window, select
Signal/Pad to open the PAD Specification File and examine the
pinout.
Choose Tools > Package View, and then choose View > Display IO
Placement to view the pin assignments on the layout to cite areas for
minor customization.
To view the results of timing constraints:
Run the Place & Route Trace process and open the Place & Route
Trace report from the Reports window.
Run the I/O Timing Analysis process and open the I/O Timing Report
from the Reports window.
7. Make any needed adjustments to the I/O preferences, as you did in
Step 4.
8. Rerun Place & Route Design.
9. Repeat steps 5 through 7 as necessary to achieve your I/O placement
objectives.
10. From Package View, choose Design > Backannotate Assignments to
copy the I/O preferences to the logical preference file, and then choose
File > Save.
I/O placement preferences are written to the end of the .lpf file and will
take precedence over any existing preferences that may conflict with
them.
11. Create a new strategy or add an existing one. Set the strategy as the
active one, and take your design through the regular flow.
Chapter 7
This chapter covers the tools and views controlled from the Lattice Diamond
framework. Tool descriptions are included and common tasks are described.
Overview
The Lattice Diamond design environment streamlines the implementation
process for FPGAs by combining the tool control and data views into one
common location. Two main features of this design environment make it easy
to keep track of unsaved changes in your design and examine data objects in
different view.
Shared Memory
Lattice Diamond uses shared memory that is accessed by all tools and views.
As soon as design data has been changed, an asterisk * appears in the tab
title of the open views, notifying you that unsaved changes are in memory.
Cross Probing
Shared design data in Lattice Diamond enables you to select a data object in
one view and display it in other views. This cross-probing capability is
especially useful for displaying the physical location of a component or net
after it has been implemented.
Start Page
The Start Page is displayed by default when you run Lattice Diamond. The
three panes within the Start Page enable you to open projects, read product
documentation, and view the software version and updates. You can modify
startup behavior by choosing Tools > Options.
The Start Page gives you quick access to recent projects and to product
documentation. It can be opened, closed, detached and attached (using the
icon method).
Reports
The Reports View provides one central location for all project and tool report
information. It is displayed by default when a project is open.
The Design Summary pane of the Reports View is organized into Project,
Process Reports, Analysis Reports, and Tool Reports. The different file icons
indicate whether a report has been completed (green check mark), has never
been generated (blank note paper), or is out of date (orange question mark).
Select any item to see its report.
The Reports View is the primary, central view for all process report
information. It can be opened, closed, detached and attached (using the icon
method).
Preference Preview
Preference Preview shows the design’s logical preferences as they exist in
shared memory, which includes unsaved preferences as well as those in the
logical preference file (.lpf). When you first open Lattice Diamond, Preference
Preview shows the contents of the active .lpf file. As you use preference views
such as Spreadsheet View and Package View to add or modify constraints,
Preference Preview reflects those changes. What you see in Preference
Preview will be reflected in the .lpf file when you use the Save command.
Tools
The entire FPGA implementation process tool set is contained in Lattice
Diamond. You can run a tool by selecting it from the Tools menu or toolbar.
Spreadsheet View
Spreadsheet View provides an interactive spreadsheet format for viewing and
assigning design constraints. Its collection of preference sheets enables you
to assign preferences such as PERIOD, FREQUENCY, I/O timing, and
LOCATE to optimize placement and routing. Preferences can also be set for
SSO Analysis and clock jitter.
The Port and Pin Assignments sheets allow you to view I/Os by signal or pin
attributes and use the Assign Pins or Assign Signals functions to make
assignments. Custom columns are also available on the Port and Pin
Assignments sheet. Custom columns enable you to add your own
information, such as notes for specific signals or pins or design data for third-
party tools. You can create an unlimited number of custom columns, and you
can include the column when you export to a Lattice CSV file or a Pin Layout
File. Right-click any column heading to add a custom column.
As soon as the target device has been specified, Spreadsheet View enables
you to set global preferences. After synthesis and translation, it allows you to
explore other devices of the same family for possible pin migration, as
explained in “Pin Migration” on page 132.
After synthesis and translation, all of the preference sheets become available
for editing.
Port Assignments
The Port Assignments sheet provides a signal list of the design and shows
any pin assignments that have been made. It enables you to assign or edit pin
locations and other attributes by entering them directly on the spreadsheet. It
also enables you to assign pins in the Assign Pins dialog box by right-clicking
selected signals and selecting Assign Pins from the pop-up menu.
Pin Assignments
The Pin Assignments sheet provides a pin list of the device and shows the
signal assignments that have been made. It enables you to edit signal
assignments or assign new signals by right-clicking selected pins and
selecting Assign Signals from the pop-up menu.
Clock Resource
The Clock Resource sheet enables you to apply a clock domain to the
device's primary or secondary clock or prohibit the use of primary and
secondary clock resources to route the net. For LatticeECP2 devices, it
enables you to use edge clock resources. For LatticeECP3 devices, it enables
you to assign a secondary clock to a clock REGION that has already been
defined.
Route Priority
The Route Priority sheet enables you to set the PRIORITIZE preference,
which assigns a weighted importance to a net or bus. To set this preference,
drag the desired nets from Netlist View to the Route Priority sheet. You can
then select a priority value for each net. Values range from 0 to 100.
Cell Mapping
The Cell Mapping sheet enables you to set the USE DIN and USE DOUT cell
preferences for flip-flops in your design. The PIO Register column allows you
to set the register to True or False. The True setting moves registers into the
I/Os. The False setting moves registers out of the I/Os. To set these
preferences, drag the desired registers from Netlist View to the Cell Mapping
sheet.
Global Preferences
The Global Preferences sheet enables you to set preferences that affect the
entire design, such as junction temperature and voltage; BLOCK preferences
applied to all paths of a particular type; and USERCODE. Also included in the
Global sheet are sysCONFIG preferences for FPGA devices that support the
sysCONFIG configuration port.
Timing Preferences
The Timing Preferences sheet displays all timing preferences that have been
set in the design, including BLOCK preferences for specific nets,
FREQUENCY, PERIOD, INPUT_SETUP, CLOCK_TO_OUT, MULTICYCLE,
and MAXDELAY. You can create a new timing preference by double-clicking
the preference name, which opens the dialog box. To modify an existing
timing preference, double-click the preference name, edit the information in
the dialog box, and click the Update button.
Group
The Group sheet displays any groups that have been created and enables
you to define a new cell, port, or ASIC group or create a new universal group
(UGROUP). Double-click the group type to open the dialog box and create a
new group preference. To modify an existing group preference, double-click
the group name, edit the information in the group dialog box, and click the
Update button.
Misc Preferences
The Miscellaneous sheet enables you to define REGIONs, assign Vref
locations, and reserve resources by setting a PROHIBIT preference. To set a
new miscellaneous preference, double-click the preference type to open the
dialog box. To modify an existing miscellaneous preference, double-click the
preference name, edit the information in the dialog box, and click the Update
button.
Package View
Package View shows the pin layout of the target device and displays the
assignments of signals to device pins. Package View interacts with Netlist
View for assigning pins, enabling you to drag selected signals to the desired
locations on the pin layout to establish LOCATE preferences. Each pin that is
assigned with a LOCATE preference is color-coded to indicate the port
direction of the related signal port. Package View allows you to edit these
assignments, and it allows you to reserve sites on the layout that you want to
exclude from placement and routing.
After synthesis and translation, Package View allows you to explore other
devices of the same family for possible pin migration, as explained in “Pin
Migration” on page 132.
As you move your mouse pointer over the layout, pin descriptions and
locations are displayed in tooltips and in the status bar. The View > Show
Differential Pairs command displays fly wires between differential pin pairs
and identifies the positive differential pins.
To filter the display of banks and pin types, click the Pin Display Selection
button on the toolbar. The Pin Display Selection dialog box allows you to
clear the selections of banks and pin types so that only those that you want to
view are displayed.
Package View is available as soon as the target device has been specified.
Device View
Device View provides a categorized index of device resources based on the
target device. Statistics cover System PIOs, User PIOs, PFUs, PFFs, sysDSP
blocks, sysMEM blocks, IOLOGIC, PLL/DLLs, and other embedded ASIC
blocks. Device View enables you to use the Prohibit command to reserve
sites that you want to exclude from placement and routing.
From Device View, you can cross probe selected resources to their sites in
Package View, Floorplan View, and Physical View.
Device View is available as soon as the target device has been specified.
Netlist View
Netlist View displays the design elements of the post-synthesis native generic
database (NGD) netlist. The NGD is a binary speed-optimized data structure
that is used by the system to browse the logical netlist.
Netlist View organizes the netlist by ports, instances, and nets, and it provides
a toolbar button and design tree view for each of these categories to make it
easier to create timing or location preferences.
Each design tree view is equipped with utilities for filtering the list and
searching for elements.
From Netlist View, you can drag selected signals to Package View to assign
them, drag selected nets to Spreadsheet View’s Route Priority sheet to
prioritize them, and drag registers to the Cell Mapping sheet to specify
registers for flip-flops. You can use the right-click menu to set timing
preferences for selected nets and to create logical groups from selected
instances.
NCD View
NCD View provides a categorized index of synthesized design resources and
consumption based on the target device and the in-memory native circuit
description (NCD) database. Statistics cover System PIOs, User PIOs, PFUs,
PFFs, sysDSP blocks, sysMEM blocks, IOLOGIC, PLL/DLLs, and other
embedded ASIC blocks.
NCD View is organized by nets and instances and provides a toolbar button
and design tree view for each of these categories.
Each design tree view is equipped with utilities for filtering the list and
searching for elements.
From NCD View, you can create a new UGROUP preference from selected
instances. You can also access schematic or tabular detailed views for
selected instances.
IPexpress
IPexpress is a collection of functional modules that can be used to generate
Verilog or VHDL source for use in your design. Modules are functional blocks
of design that can be reused wherever that function is needed. They are
optimized for Lattice device architectures and can be customized. Use these
modules to speed your design work and to get the most effective results.
Choose Tools > IPexpress to see the full list of available modules.
Reveal Inserter
Reveal Inserter allows you to add debug information to your design to allow
hardware debugging using Reveal Analyzer. Reveal Inserter enables you to
select the design signals to use for tracing, triggering, and clocking. Reveal
Inserter will automatically generate the debug core(s), and insert it into a
modified design with the necessary debug connections and signals. Reveal
Inserter supports VHDL, Verilog, and EDIF sources. Mixed-HDL designs are
represented by the synthesis EDIF netlist. After the design has been modified
for debug, it is mapped, placed and routed with the normal design flow in
Lattice Diamond.
The File List Debug file folder contains the debug files for Reveal Inserter.
Figure 100: File List View with Reveal Debug Project File
One or none of the debug files can be active at a time. If no debug file is
active, hardware debug will not be inserted into the design when it is
implemented.
If multiple debug files exist and no debug file is set as active, a dialog box
will enable you to select one of the inactive debug files.
If no debug files exist, Reveal Inserter will use a default configuration.
The sections of Reveal Inserter include Trace Signal Setup and Trigger Signal
setup views.
See the Reveal User Guide for more information on setting up debug
information with Reveal Inserter.
After you have your debug set up, choose Debug > Insert Debug or click the
Insert Debug button on the vertical toolbar to insert debug into your
design. This will set the current debug file as active.
When the design is fully implemented and programmed, you can run Reveal
Analyzer to debug your design.
Reveal Analyzer
After you generate the bitstream or JEDEC file, you can use Reveal Analyzer
to debug your FPGA circuitry. Reveal Analyzer gives you access to internal
nodes inside the device so that you can observe their behavior. It enables you
to set and change various values and combinations of trigger signals. After
the specified trigger condition is reached, the data values of the trace signals
are saved in the trace buffer. After the data is captured, it is transferred from
the FPGA through the JTAG ports to the PC.
To launch Reveal Analyzer, choose Tools > Reveal Analyzer or click the
Reveal Analyzer button on the toolbar. The Reveal Analyzer Startup
Wizard allows you to use an existing Reveal Analyzer file or create a new
one.
The Reveal Analyzer view consists of a Trigger Setup view and a Waveform
view. In the Trigger Setup view are areas displaying the Trigger Unit, Trigger
Expression, Trigger Options and Trigger Position. Also in this view are
controls to select which core to use to enable for triggering the analyzer.
When you choose Run, the analyzer connects to the hardware, configures
the debug logic, and waits for the trigger conditions. Once triggered, the data
is uploaded to the analyzer. The Run command also switches the display to
the Waveform view.
The Waveform view has controls for running, zooming and window controls in
the menu and toolbar areas.
The Data column in the view shows the data for the active cursor. The Reveal
Analyzer supports multiple cursors which can be added, removed and
position changed within the waveform. Selecting the cursor and dragging it
will produce a rubber band effect which can be used for measuring time
intervals.
See the Reveal User Guide for more information on using Reveal Analyzer.
Floorplan View
Floorplan View provides a large-component layout of your design. It displays
user constraints from the logical preference file (.lpf) and placement and
routing information. All connections are displayed as fly-lines.
Floorplan View allows you to create REGIONs and bounding boxes for
UGROUPs and specify the types of components and connections to be
displayed. As you move your mouse pointer over the floorplan layout, details
are displayed in tooltips and in the status bar:
the number of resources for each UGROUP and REGION
the number of utilized slices for each PLC component
the name and location of each component, port, net, and site
If your design uses the incremental design flow, Floorplan View will display
partitions that are included in the design and allow you to edit them. For more
information, refer to “Using Incremental Design Flow” in the Diamond online
Help.
Floorplan View is available as soon as the target device has been specified.
Physical View
Physical View provides a read-only detailed layout of your design that
includes switch boxes and physical wire connections. Routed connections are
displayed as Manhattan-style lines, and unrouted connections are displayed
as fly-lines.
As you move your mouse pointer slowly over the layout, the name and
location of each REGION, group, component, port, net, and site are displayed
as tooltips and also appear in the status bar. The tooltips and status bar also
display the group name for components that are members of a group.
The Physical View toolbar allows you to select the types of elements that will
be displayed on the layout, including components, empty sites, switch boxes,
switches, pin wires, routes, and timing paths.
If your design uses the incremental design flow, Physical View will display
partitions that are included in the design. For more information, refer to “Using
Incremental Design Flow” in the Diamond online Help.
Multiple Logic Block Views can be opened at one time, up to the maximum
that has been set in the Tool > Options dialog box for Physical View.
The File List view of your project contains the Timing Analysis preference files
(.tpf) in the Analysis folder. One or none of the .tpf files can be active.
The sections in Timing Analysis View display the trace settings from your
active strategy and the preferences from the active .tpf or .lpf file. If you have
selected the “Check Unconstrained Paths” option in the active strategy, you
will see “Unconstrained Paths” listed in the Preferences pane. This allows you
to examine the Start Point and End Point of these paths. Timing Analysis View
also provides views of the path table, detailed path tables, schematic path and
report.
The Timing Analysis vertical toolbar on the left contains the following controls:
Export – exports the timing paths to a cvs file.
Settings – allows you to change settings for a timing analysis run. To
change the settings permanently, you must edit the trace settings of the
active strategy.
Change Timing Preferences – displays the Timing Preferences tab of the
Spreadsheet view. This is a graphical view of the .tpf file.
Fit All Columns – sizes each column of the Detailed Path Table to fit the
information displayed.
View All Columns – sizes all columns of the Detailed Path Table to fit
inside the window.
Path Table – displays or hides the path table.
Report: setup – displays or hides the Report:Setup tab.
Schematic Path view – displays or hides the Schematic Path View tab.
Detailed Path Tables – displays or hides the Detailed Path Tables tab.
Update – when this button is visible and rotating, indicates a preference
has been changed. When clicked, it recalculates timing.
LDC Editor
The Lattice Design Constraints (LDC) Editor is a synthesis constraint tool for
use with the Lattice Synthesis Engine. Currently, the Lattice Synthesis Engine
and LDC Editor support the MachXO, MachXO2, and Platform Manager
device families. The LDC Editor uses a spreadsheet style user interface that
enables you to quickly create and edit Synopsys Design Constraints and save
them to a Lattice Design Constraint file (.ldc). You can create several .ldc files
and select one of them to serve as the active synthesis constraint file for the
current implementation.
After you have selected the Lattice Synthesis Engine (LSE) as the synthesis
tool, the LDC Editor will open automatically each time you create or open an
.ldc file. You also have the option of viewing and editing .ldc files in the Source
Editor. The LDC Editor includes individual tabs for Clocks, Inputs/Outputs,
and Delay Paths. Each sheet enables you to define synthesis constraints by
double-clicking a cell and selecting or typing a value.
Clocks The Clocks tab allows you to define an alias to be associated with
an existing clock port or net from the source file. Double-click the Source cell
to select an existing clock port or net, and then enter an alias for the clock in
the Clock Name cell. Enter a clock period in nanoseconds.
Delay Paths The Delay Paths tab allows you to define a Multicycle path,
specify a Max_Delay for a timing path, and identify a False path that is to be
excluded from timing analysis. Double-click the Delay Type cell to select the
type of delay, and then specify the path information, delay, and cycles as
appropriate.
For detailed information about setting SDC constraints, see Applying Lattice
Synthesis Engine Constraints and the Constraints Reference Guide in the
Lattice Diamond online Help.
Power Calculator
Power Calculator estimates the power dissipation for your design. It uses
parameters such as voltage, temperature, process variations, air flow, heat
sink, resource utilization, activity and frequency to calculate the device power
consumption. It reports both static and dynamic power consumption.
Power Calculator files (.pcf) are managed in the Analysis Files folder of the
File List.
When Power Calculator is launched, the .pcf file it uses will depend on the
following conditions:
If an active .pcf file exists, it will be used. An inactive .pcf file will be used if
it is the only one available.
If an active or inactive .pcf file in the File List Analysis Files folder is
double-clicked, it will be used.
When Power Calculator opens, it displays the Power Summary page, which
enables you to change the targeted device, operating conditions, voltage, and
other basic parameters. Updated estimates of power consumption are then
displayed based on these changes. Tabs for other pages, including Logic
Block, I/O, I/O Term, Block RAM, Graph, and Report, are arranged across the
top. The number and types of these pages will depend on the target device.
First, set the standby, shut-off, and power guard options that you want to
allow, using the appropriate Power Calculator pages. Afterwards, return to the
Power Summary page, click the Power Control button to open the Power
Option Controller, and select the elements to be turned off during low-power
operation.
The Power Option Controller includes the following dynamic bank options for
MachXO2 devices:
Disable InRd – turns off the referenced and differential input buffers for a
selected bank.
Disable LVDSO – turns off the LVDS output buffer for a selected bank.
Enable PG – enables Power Guard for the selected bank.
Diamond > Accessories > Power Calculator. The Startup Wizard enables
you to create a new Power Calculator project, based on a selected device or a
processed design, or to open an existing Power Calculator project file (.pcf).
ECO Editor
The Engineering Change Order (ECO) Editor enables you to safely make
changes to an implemented design without having to rerun the entire process
flow. Choose Tools > ECO Editor or click the ECO Editor button on the
toolbar.
ECOs are requests for small changes to be made to your design after it has
been placed and routed. The changes are directly written into the native
circuit description database file (.ncd) without requiring that you go through
the entire design implementation process.
ECOs are usually intended to correct errors found in the hardware model
during debugging. They are also used to facilitate changes that had to be
made to the design specification because of problems encountered when
other FPGAs or components of the PC board design were integrated.
The ECO Editor includes windows for editing I/O settings, PLL settings, and
memory initialization values. It also provides a Change Log window for you to
track changes between the modified .ncd file and the post-PAR .ncd file.
Note
After you edit your post-PAR, routed .ncd file, your functional simulation and
timing simulation will no longer match.
For more information see Applying Engineering Change Orders in the Lattice
Diamond online documentation.
Programmer
After you have placed and routed the design and generated the JEDEC or
bitstream file, you can use Diamond’s integrated Programmer to program the
target device. Choose Tools > Programmer. Programmer detects the cable
type, scans the device chain, creates the XCF file, and downloads the data
file to the device.
Features include:
Scan chain and display chain contents (.xcf file)
Download data files to devices
Create/modify/display .xcf file
Generate files based on the .xcf file (Tcl/command line only)
The main view displays the devices in the current Programmer project
resulting from the Scan action, or from manual creation in a table.
Additional columns are available, but are hidden by default. The columns are
Device Vendor, Device Full Name, and Device Description.
Each row has a column enabling the device. Devices where the enable option
is not selected will not be programmed. They will effectively be treated as a
bypass operation. This allows one .xcf file to be used whether programming
all devices in a scan chain or just a single device.
Each row has a column for the device status. The status indicates whether the
operation performed was successful or not. This field is also used for read
back operations to display what is read back if the data to display is short. For
larger data sets that are read back, a dialog box is displayed.
Programmer can also be used as a stand-alone tool. From the Windows Start
menu, choose Programs > Lattice Diamond > Accessories > Diamond
Programmer.
For more information about programming a device with Programmer, see the
“Programming the FPGA” section of the Lattice Diamond online Help.
Deployment Tool
Deployment Tool is a stand-alone tool available from the Diamond
Accessories. The Deployment Tool enables you to convert data files to other
formats and use the data files to generate other data file formats. A four-step
wizard helps you create a new deployment and select the deployment type,
input file type, and output file type.
For more information about using the Deployment Tool, see the “Deploying
the Design with the Deployment Tool” in the Lattice Diamond online Help.
Partition Manager
Partition Manager is available for designs that use the incremental design
flow, which is supported for LatticeECP2M and LatticeECP3 device families.
Partition Manager allows you to view and edit the partitions that are included
in your incremental design project. You can edit a partition's preservation data
level, reimplementation effort, anchor, and bounding box. A partition that is
assigned an anchor and bounding box can be cross-probed to Floorplan View
and Physical View to view the partition on the device layout.
For more information about Partition Manager and incremental design, refer
to “Using Incremental Design Flow” in the Diamond online Help.
Run Manager
Run Manager runs the processes for the different implementation/strategy
combinations. Choose Tools > Run Manager or click the Run Manager
button on the toolbar.
Run Manager takes the design through the entire process flow for each
selected implementation. If you are running on a multicore system, Run
Manager will distribute the iterations so that they are executed in parallel. The
options “Maximum number of implementation processes in run manager” and
“Maximum number of multi-par processes in run manager” are available in the
Environment > General section of the Tool Options dialog box. Choose
Tools > Options to access it. These options enable you to set the maximum
number of processes to run in parallel. Generally, the maximum number of
processes should be the same as the number of cores in your processor; but
if the strategy is using the “Multi-Tasking Node List” option for Place & Route
Design, this number should be set to one.
You can use the Run Manager list to set an implementation as active. Right-
click the implementation/strategy pair and choose Set as Active.
See the “Managing Projects” section of the Lattice Diamond online Help for
more information about using implementations, strategies, and Run Manager.
You can also run Synplify Pro in interactive mode. Choose Tools > Synplify
Pro for Lattice or click the Synplify Pro button on the toolbar.
For more information, see the Synplify Pro User Guide, which is available
from the Lattice Diamond Start Page or the Synplify Pro Help menu.
See “Simulation Flow” on page 70 for more information about simulating your
design. See “Simulation Wizard” on page 117 for information about creating a
simulation project to run in Active-HDL.
Simulation Wizard
The Simulation Wizard enables you to create a simulation project for your
design. To open Simulation Wizard, choose Tools > Simulation Wizard or
click the Simulation Wizard button on the toolbar. The wizard leads you
through a series of steps that include selecting a simulation project name and
location, specifying the simulator to use (if you have more than one installed),
selecting the process stage to use (from RTL to Post-Route Gate-Level +
Timing), specifying the language (VHDL or Verilog), and selecting the source
files. You can optionally run the simulation directly from the wizard.
Common Tasks
Lattice Diamond gathers the many FPGA implementation tools into one
central design environment. This gives you common controls for active tools,
and it provides shared data between views.
You can detach as many tool views as desired. The Window menu keeps
track of all open tool views and allows you to reintegrate one or all of them
with the main window or detach one of them. Those that are already
integrated are displayed with a check mark.
You can also use the Integrate All Tools button on the toolbar to dock all
detached views back into the main window.
The Split Tab Group button separates the currently active tool into a
separate tab group. Having two separate tab groups enables you to work with
two tool views side-by-side. This is especially useful for dragging and
dropping to make preference assignments; for example, dragging a port from
Netlist View to Package View to assign it to a pin or dragging nets to the
Route Priority preference sheet to prioritize them.
Having two separate tab groups is also useful for examining the same data
element in two different views, such as the Floorplan and Physical View
layouts.
You can move an active tool view from one tab group to another by dragging
and dropping it, or you can use the Move to Another Tab Group button on
the toolbar.
To switch the positions of the two tab groups, click the Switch Tab Group
Position button on the toolbar.
To merge the split tab group back into the main group, click the Merge Tab
Group button on the toolbar.
Displaying Tooltips
When you place the cursor over a graphical element in a tool view, a tooltip
appears with information on the element. The same information displayed in
the tooltip will also be displayed temporarily in the status bar on the lower left
of the main window.
Tcl Scripting
This chapter describes the Tcl scripting capabilities in Lattice Diamond. The
internal TCL Console and external TCL Console are described as well as
some of the extended Tcl commands for Lattice Diamond control.
Overview
Tool Command Language (Tcl) is a scripting language used for controlling
software tools and automating tool control and testing. It is very useful for
controlling batch operation of processes. The Lattice Diamond design
environment includes an interactive Tcl Console and extended Lattice
Diamond Tcl commands.
Tcl Console
You can view the integrated Tcl Console by selecting its tab at the bottom of
the Lattice Diamond main window. You can enter “help” at the Tcl prompt to
see the major groups of Tcl commands for Lattice Diamond.
The integrated Tcl Console can be opened, closed, detached and attached
(using the double-click method).
Select this Tcl Console to run the external Tcl shell. You can enter “help” at the
prompt to see the major groups of Tcl commands for Lattice Diamond. Help
on individual commands is available both in the online Help and from the
“help” command within the console. The console’s help command can be
used to get the top level help, help for a particular dictionary, or help for an
individual command.
See “Tcl Scripts” on page 133 for more information on writing Tcl scripts.
Commands
Every function available in the user interface is available to you as part of the
extended Tcl commands for Lattice Diamond. You can create scripts to run
design flow processes and manage project data as well as perform all
standard Tcl operations.
The help command (help) is very useful for getting listings of available
commands and their syntax.
> help
The following sections show the help command and output for each major
grouping of the Lattice Diamond extended Tcl commands. You can use the
help command (help) for more information on each specific group or
command. See “Tcl Scripts” on page 133 for more information on writing Tcl
scripts.
Project Manager
> help prj
NCD
> help ncd
NGD
> hlp ngd
HDL Explorer
> help hle
Reveal Inserter
> help rvl
Reveal Analyzer
> help rva
Power Calculator
> help pwc
Programmer
> help pgr
Programmer extended Tcl commands
For more information on a specific command, type help command-name:
pgr_project Programmer project commands
pgr_program Programmer program commands
The DOS script assumes that the default directory installation is used for the
Lattice Diamond software. If the software is installed into a different directory,
the script will need to be modified.
Like the DOS script, the bash script assumes that the default directory
installation is used for the Lattice Diamond software. If the software is
installed into a different directory, the script will need to be modified.
As in the previous examples, the Linux example assumes that the default
directory installation is used for the Lattice Diamond software. If the software
is installed into a different directory, the script will need to be modified.
Advanced Topics
There is one shared database that contains the device, design, and
preference information in system memory.
External tools referenced from within Lattice Diamond, such as those for
synthesis and simulation, use their own memory in addition to what is used by
Lattice Diamond.
When you launch the first tool view that accesses shared memory, it will take
longer than the launch of subsequent views.
Memory Usage
The main window of the UI displays a memory usage figure in the lower right
corner.
This indicates the current memory usage for the Lattice Diamond
environment, including all open tools.
If you have open tool views that will be affected by clearing the tool memory, a
confirmation dialog box will open to give you the opportunity to cancel the
memory clear.
The Options dialog box is organized into functional folders. You can use the
context-sensitive help button in the upper right to view information about
each parameter in a folder. Click the context-sensitive help button, and then
click the item of interest.
The tool view folders include customizable display properties such as color
and font.
Pin Migration
The “Incompatible Pins” dialog box helps you migrate pin assignments to a
different device of the same family and package. This information enables you
to save your current pinout while you explore other devices.
The “Incompatible Pins” dialog box is available from the View menu in
Spreadsheet View or Package View after the Translate Design process. After
selecting one or more devices for possible pin migration, you can view the
incompatible pins in Package View and in the Pin Assignments sheet of
Spreadsheet View.
Tcl Scripts
The Diamond Extended Tcl language enables you to create customized
scripts for tasks that you perform often in Lattice Diamond. Automating these
operations through Tcl scripts not only saves time, but also provides a uniform
approach to design. This is especially useful when you try to find an optimal
solution using numerous design implementations.
5. Navigate to your script file and use the text editing tool of your choice to
make any necessary changes, such as deleting extraneous lines or
invalid arguments.
In most cases, you will need to edit the script you saved and take out any
invalid arguments or any commands that cannot be performed in the Lattice
Diamond environment due to a conflict or exception. You will need to revisit
this step later if, after running your script, you experience any run errors due
to syntax errors or technology exceptions.
To run a Tcl script that opens a project, runs processes and closes the
project:
1. Open Lattice Diamond but do not open your project. If your project is
open, choose File > Close Project.
2. In the Diamond main window, click the Tcl Console tab at the bottom to
open the console.
3. If there are previously issued commands in the console, type reset in the
console command line to refresh your session and clear out all previous
commands.
reset
4. Run the source command using the absolute file name and path to your
script.
source C:/lscc/diamond/1.4/examples/edif_counter/myscript2
The sample Tcl script opens the project, runs the flow through Place &
Route, and closes the project.
If there are errors in the script, you will see the errors in red in the Tcl Console
after you attempt to run it. You will then need to return to your script and edit it
as needed.
Project Archiving
A Diamond project archive is a single compressed file (.zip) of your project.
The project archive can contain all of the files in your project directory, or it
can be limited to source-related files. When you use the File > Archive
Project command, the dialog box provides the option to “Archive all files
under the Project directory.” When you select this option, the entire project is
archived. When you clear this option, only the project’s source-related files,
including strategies, are archived. Many of these source-related files must be
archived in order to achieve the same bitstream results for a fully
implemented design.
Whichever archiving method you select, if your project contains source files
stored outside the project folder, the remote files will be compressed under
the remote_files subdirectory in the archive; for example:
<project_name>/remote_files/sources
<project_name>remote_files/strategies
Appendix A “File Descriptions” on page 137 provides lists of the file types
used in Diamond, including those generated during design implementation.
The Archive column indicates the files that must be archived in order to
achieve the same bitstream results.
File Descriptions
The following tables describe many of the files that are used in Lattice
Diamond, including files generated by the implementation processes. A check
mark in the Archive column indicates that a file of this particular type, when
used in implementing the design, must be included in the project’s archive in
order to create the same bitstream results.
.edf Default EDIF source file generated by Used in design translation to create the .ngd
Precision netlist.
.edn Default EDIF source file generated by Used in design translation to create the .ngd
Synplify netlist.
.ldf Diamond Project file Used for managing and implementing all project
files in Diamond.
.lib Schematic symbol library Used for adding symbols to a schematic source
file.
.lpf Diamond project logical preference file Stores logical constraints for developing and
implementing the design.
.lsdc SDC constraints file for Lattice Used for specifying design-specific constraints.
Synthesis Engine (LSE)
.mem Memory Generator source file Specifies the initial contents for the memory
modules in your design. Required for creating
ROM and optional for creating RAM modules.
.ngo Native Generic Object (NGO) netlist Used as an alternative to HDL for creating a
format black-box module.
.pcf Power Calculator project file Stores power analysis results from information
extracted from the design project.
.rva Reveal Analyzer file Defines the Reveal Analyzer project and
contains data about the display of signals in
Waveform View.
.rvl Reveal Inserter debug file Defines the Reveal project and its modules,
identifies the trace and trigger signals, and
stores the trace and trigger options.
.spf Simulation project file, a script file Used for running the simulator for your project
produced by the Simulation Wizard from Diamond.
.sym Symbol Editor source file Used for creating symbols or primitive elements
that represent an independent schematic
module.
.tpf Timing Analysis Preference file Used for obtaining quick analysis of timing
preferences.
.vhd VHDL source file VHDL description of the circuit structure and
function.
.wdl Waveform Editor source file Used for creating test stimulus files for
simulation.
.xcf Configuration chain file Used for programming devices in a JTAG daisy
chain.
Module Files
%instName.lpc Module parameter configuration Stores the user configurations for the
file module.
%instName_tmpl.vhd VHDL module template file A template for instantiating the generated
module. This file can be copied into a
user VHDL file.
tb_%instName_tmpl.vhd VHDL module testbench file A simple VHDL testbench for the
generated module. Can be edited to add
more vectors, which will be overwritten
during module generation.
IP Files
%instName.lpc IP parameter configuration file Used for re-creating or modifying the core
in the IPexpress tool.
%instName_bb.v Verilog IP black box file Provides the Verilog synthesis black box
for the IP core and defines the port list.
.bgn Bitstream generation report file Reports results of a bit generation (bitgen) run
and displays information on options that were
set.
.edi SynplifyPro EDIF output file Netlist file generated by Diamond. The file
extension must be changed to .edf or .edn in
order to import it into a project.
.ibs Post-Route I/O buffer information Used for analyzing signal integrity and
specification file (IBIS) electromagnetic compatibility (EMC) on
printed circuit boards
.ior Post-PAR I/O Timing Analysis file For each input data port, reports setup and
hold time requirements and min/max clock-to-
out delay for each output port.
_mapvho.sdf Post-map SDF simulation file for VHDL Used for post-map functional simulation.
_mapvho.vho Post-map simulation file for VHDL Used for post-map functional simulation.
_mapvo.sdf Post-map SDF simulation file for Verilog Used for post-map functional simulation.
_mapvo.vo Post-map simulation file for Verilog Used for post-map functional simulation.
.ncd Post-route native circuit description netlist Includes placement and routing information.
file
.ngd Native generic description file produced Used by Map to map logical elements to
by the ngdbuild translation process. physical elements in the native circuit
description file (.ncd).
.ngo Native generic object file generated by Used as input to ngdbuild, which converts the
the edif2ngo translation process. .ngo to an .ngd file.
Contains logical descriptions of the
design’s components and hierarchy
.pad Post-Route PAD report file Lists all programmable I/O cells used in the
design and their associated primary pins.
.par Post-Route Place & Route report file Summarizes information from all iterations
and shows the steps taken to achieve a
placement and routing solution.
.prf Physical preference file produced by the Used as an input file to placement, routing
Map Design process. and TRACE.
.sso Post-PAR SSO analysis file Reports the noise caused by simultaneously
switching outputs.
_vho.sdf Post-Route SDF simulation file for VHDL Used for timing simulation.
_vo.sdf Post-Route SDF simulation file for Verilog Used for timing simulation.
.icf Incremental Compilation Database File Contains design partition placement and
compilation strategy directives for incremental
design flow.
T
tab groups 35, 39
merge 39