Latticemico32 Tutorial
Latticemico32 Tutorial
May 2014
Copyright
Copyright © 2014 Lattice Semiconductor Corporation.
Trademarks
Lattice Semiconductor Corporation, L Lattice Semiconductor Corporation (logo), L
(stylized), L (design), Lattice (design), LSC, CleanClock, Custom Mobile Device,
DiePlus, E2CMOS, ECP5, 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, MachXO3, MACO, mobileFPGA,
ORCA, PAC, PAC-Designer, PAL, Performance Analyst, Platform Manager,
ProcessorPM, PURESPEED, Reveal, SensorExtender, 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.
ii LatticeMico32 Tutorial
Type Conventions Used in This Document
Convention Meaning or Use
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.
LatticeMico32 Tutorial 1
Introduction 1
Learning Objectives 2
Time to Complete This Tutorial 2
System Requirements 2
Accessing Online Help 3
About the Tutorial Design 3
Tutorial Data Flow 5
LatticeECP3 Versa Evaluation Board 8
Task 1: Create a New Lattice Diamond Project 8
Task 2: Create the Development Microprocessor Platform 11
Create a New MSB Platform 11
Add the Microprocessor Core 16
Add On-Chip and Off-Chip Memory 20
Add the Peripheral Components 23
Specify the Connections Between Master and Slave Ports 26
Assign Component Addresses 29
Assign Interrupt Request Priorities 31
Perform a Design Rule Check 31
Generate the Microprocessor Platform 31
Create a User Top-Level Module 34
Task 3: Create the Software Application Code 37
Create a New C/C++ SPE Project 38
Linker Configuration 40
Build the Project 43
Task 4: Generate the Microprocessor Bitstream 45
Import the MSB Output File 46
Connect the Microprocessor to the FPGA Pins 47
Perform Functional Simulation 49
Perform Timing Simulation 49
Generate the Bitstream 49
LatticeMico32 Tutorial v
CONTENTS
vi LatticeMico32 Tutorial
LatticeMico32 Tutorial
Introduction
This tutorial steps you through the basic process involved in using the
LatticeMico System software to implement a LatticeMico32 32-bit soft
microprocessor and attached components in a Lattice Semiconductor device
for the LatticeECP3 Versa Evaluation Board. LatticeMico System
encompasses three tools: the Mico System Builder (MSB), the C/C++
Software Project Environment (C/C++ SPE), and the Debugger. Together,
they enable you to build an embedded microprocessor system on a single
FPGA device and to write and debug the software that drives it. Such a
microprocessor lowers cost by saving board space and increases
performance by reducing the number of external wires.
The LatticeMico System interface is based on the Eclipse environment, which
is an open-source development and application framework for building
software.
Although you can install LatticeMico System as a stand-alone tool, this tutorial
assumes that you have installed Lattice Diamond before installing LatticeMico
System. After you have created a project in Lattice Diamond, the tutorial
shows you how to use MSB to choose a Lattice Semiconductor 32-bit
microprocessor, attach components to it, and generate a top-level design,
including the microprocessor and the chosen components. Next you will use
Lattice Diamond to synthesize, map, place, and route the design and
generate a bitstream for it. You will then download this bitstream to the FPGA
on the board. The tutorial then changes to the Lattice Software Project
Environment (C/C++ SPE) and shows how to use C/C++ SPE to write and
compile the software application code that exercises the microprocessor and
components. Finally, it shows how to download and debug the code on the
board and deploy it in the SPI Flash chips on to the LatticeECP3 Versa
Evaluation Board.
This tutorial is intended for a new or infrequent user of the LatticeMico System
software and covers only the basic aspects of it. The tutorial assumes that
LatticeMico32 Tutorial 1
LATTICEMICO32 TUTORIAL : Introduction
you have reviewed the LatticeECP3 Versa Evaluation Board User's Guide to
familiarize yourself with the product and to set up your board correctly.
For more detailed information on the LatticeMico System software, see the
sources listed in “Recommended References” on page 84.
Learning Objectives
When you have completed this tutorial, you should be able to do the following:
Use MSB to configure a Lattice Semiconductor 32-bit microprocessor for
your design, select the desired components, and connect the selected
components to the microprocessor with a shared-bus arbitration scheme,
which is the default.
Use The Lattice Software Project Environment to create the C/C++
software application code that drives the microprocessor and
components.
Import the Verilog files, Verilog/VHDL files, or an EDIF file generated by a
synthesis tool.
Import an .lpf file containing the pinout.
Synthesize, map, place, and route the design.
Generate a bitstream of the microprocessor and download it to an FPGA
on the board.
Compile, download, and debug the software application code on the
LatticeECP3 Versa Evaluation Board.
Debug the hardware and software on the board.
System Requirements
You can run this tutorial on Windows or Linux.
Windows
If you will be running this tutorial on Windows on a PC, your system must
meet the following minimum system requirements:
Pentium II PC running at 400 MHz or faster
Microsoft Windows 2000®, Windows XP® Professional, Windows 7, or
Windows Vista®
USB port for use with the LatticeECP3 Versa Evaluation Board
2 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Introduction
See the Lattice Diamond Installation Notice for the current release for
information on installing software on the Windows platform.
Linux
If you will be running this tutorial on Linux on a PC, your system must meet
the following minimum system requirements:
Red Hat Enterprise Linux operating system Version 4.0, 5.0, or 6.0
Lattice Diamond version 1.0
For mixed Verilog/VHDL support: Synopsys® Synplify Pro® 8.9 or Synplify
Pro 8.9.1 for Linux
Linux system with USB port
See the Lattice Diamond Installation Notice for the current release for
information on installing software on the Linux platform.
Hardware
This tutorial requires the following hardware:
A LatticeECP3 Versa Development Kit
USB cable
AC adapter cord
Note
If you want to perform functional simulation for the mixed Verilog/VHDL flow, you must
have access to a simulator that supports mixed-mode Verilog and VHDL simulation.
LatticeMico32 Tutorial 3
LATTICEMICO32 TUTORIAL : Introduction
flash memory, and a timer. After you add these components, you will specify
the connections between the master and slave ports on these components,
as shown in Figure 1.
In this design, the instruction port and the data port of the CPU are the master
ports. All other ports are slave ports. The instruction port will access the
LatticeMico EBR and the LatticeMico SPI flash memory. The data port will
access the LatticeMico EBR, the LatticeMico GPIOs, the LatticeMico SPI
flash memory, the LatticeMico TImer, and the LatticeMico UART.
4 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Introduction
Note
This tutorial does not show you how to debug your software application code on the
instruction set simulator, but it does show you how to debug the design by
downloading the bitstream and the application code to the board.
This tutorial supports both Verilog and mixed Verilog/VHDL design flows in
Diamond for Windows and Linux users. The Windows Verilog design flow for
using LatticeMico System to create an embedded microprocessor and the
software code for it is shown in Figure 2 on page 6. The Windows mixed
Verilog/VHDL design flow is shown in Figure 3 on page 7. The difference
between the two methods is that mixed verilog/VHDL designs have a VHDL
wrapper as an output from MSB. The VHDL wrapper is an input to Synthesis
and Functional Simulation in the Diamond flow.
LatticeMico32 Tutorial 5
LATTICEMICO32 TUTORIAL : Introduction
6 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Introduction
Figure 3: Design Flow for Windows VHDL Users, Using Mixed Verilog/VHDL Design Entry
LatticeMico32 Tutorial 7
LATTICEMICO32 TUTORIAL : LatticeECP3 Versa Evaluation Board
Note
In this tutorial, the directory paths follow the Windows nomenclature. For Linux,
replace the “\” character with the “/” character.
8 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 1: Create a New Lattice Diamond Project
6. In Select Device dialog box, shown in Figure 6 on page 10, make the
following selections:
a. In the Family box, select LatticeECP3.
b. In the Device box, select LFE3-35EA.
c. In the Speed grade box, select 8.
d. In the Package Type box, select FPBGA484.
e. In the Operating Conditions box, select Commercial.
LatticeMico32 Tutorial 9
LATTICEMICO32 TUTORIAL : Task 1: Create a New Lattice Diamond Project
10 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
LatticeMico32 Tutorial 11
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
2. Accept the default location, or click the Browse button to select a different
location. To keep the same workspace for future sessions, select the “Use
this as the default and do not ask again” option.
3. Click OK.
12 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
4. In the upper left-hand corner of the graphical user interface, select MSB, if
it is not already selected, to open the MSB perspective.
5. Choose File > New Platform.
6. In the New Platform Wizard dialog box, make the following selections:
a. In the Platform Name box, enter platform1.
b. In the Directory box, browse to the lm32_tutor directory and click OK:
For Windows: <Diamond_install_path>\examples\lm32_tutor
For Linux: ~/LatticeMico32/lm32_tutor
c. Do one of the following:
If you are generating a platform in Verilog, leave the Create VHDL
Wrapper unselected.
If you are generating a platform in mixed Verilog/VHDL, select only
Create VHDL Wrapper.
d. In the Arbitration scheme box, select Shared Bus (Default) from the
drop-down menu, if it is not already selected.
LatticeMico32 Tutorial 13
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
7. Click Finish.
14 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
Available Editor
Components view
view
LatticeMico32 Tutorial 15
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
End, which displays the end addresses for components with slave
ports. This field is not editable. The value of the end address is
equivalent to the value of the base address plus the value of the size.
Size (Bytes), which displays the number of addresses available for
component access. This field is editable for the LatticeMico EBR and
the LatticeMico asynchronous SRAM controller components only.
Lock, which indicates whether addresses are locked from any
assignments. If you lock a component, its address will not change
when you select Platform Tools > Generate Address.
IRQ, which displays the interrupt priorities of all components that have
interrupt lines connected to the LatticeMico32 microprocessor. The
LatticeMico32 microprocessor can accept up to 32 external interrupt
lines.
Disable, which indicates whether components are temporarily
excluded from the design
Component Help view, which displays information about the component
that you selected in the Available Components view. The Help page
displays the name of the component—for example, “LatticeMico Timer” or
“LatticeMico UART—and gives a brief description of the function of the
component. It also provides a list and explanation of the parameters that
appear in the dialog box when you double-click the component. If you
click the icon next to the component name, you can view a complete
description of the component in a PDF file.
Console view, which displays informational and error messages output by
MSB
Component Attributes view, which displays the name, parameters, and
values of the component selected in the Available Components view or
the Editor view. This view is read-only.
You will be using the default cache setting for this task. Refer to the
LatticeMico32 Processor Reference Manual for more information on caches.
16 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
LatticeMico32 Tutorial 17
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
c. Select the Inline Memory tab. Under the section Data Inline Memory,
select Enabled. If it is not already set as default, type 0x10000000 in
the Base Address text box, as shown in Figure 13 on page 19.
d. Click OK to accept the default settings for the rest of the options.
Information about the microprocessor now appears in the Name,
Wishbone Connection, Base, End, and Size columns of the table in
the Editor view.
18 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
LatticeMico32 Tutorial 19
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
The Wishbone Connection column graphically displays the types of ports and
connections. Black horizontal lines with outbound arrows indicate master
ports, whereas blue horizontal lines with inbound arrows indicate slave ports.
The vertical lines are associated with master ports, and the filled circles
indicate connections between master and slave ports. The illustration shows
that the microprocessor’s slave Debug Port is connected to the master
Instruction Port and Data Port.
Add EBR
The LatticeMico on-chip memory controller is required to download and
execute the software application code.
20 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
Note
You can delete a component from the Editor view by right-clicking the component in
the Editor view and selecting Remove Component from the pop-up menu. If you
cannot remove a component, this command will be unavailable on the menu.
3. Accept the default settings in the dialog box, and click OK.
LatticeMico32 Tutorial 21
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
2. In the Add SPI Flash dialog box, shown in Figure 15 on page 21, do the
following:
22 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
Add GPIO
The first peripheral component that you will add is the LatticeMico GPIO
component, which provides a memory-mapped interface between a
WISHBONE port and general-purpose I/O ports. The I/O ports connect either
to on-chip user logic or to I/O pins that connect to devices external to the
FPGA
For this tutorial, two GPIO block are used: one for controlling the LEDs and
the other for controlling the 14-segment display on the LatticeECP3 Versa
Evaluation Board.
LatticeMico32 Tutorial 23
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
In this tutorial, the timer is used to generate an interrupt for every 100
milliseconds. Depending on this interrupt, the 14-segment count value is
controlled.
24 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
LatticeMico32 Tutorial 25
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
Figure 20: MSB Perspective After Addition of All Components in a Shared-Bus Arbitration Scheme
The following information applies to master and slave ports in the Editor view:
There are two types of ports: master ports and slave ports.
A master port can initiate read and write transactions.
A slave port cannot initiate transactions but can respond to
transactions initiated by a master port if it determines that it is the
targeted component for the initiated transaction.
A master port can be connected to one or more slave ports.
A component can have one or more master ports, one or more slave
ports, or both.
Horizontal lines with outbound arrows sourced from a component port
indicate a master port.
Horizontal lines with inbound arrows targeting a component port indicate a
slave port.
The vertical lines are associated with horizontal lines with outbound
arrows (that is, master ports) to facilitate "connectivity" from a master port
26 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
to a slave port. A circle represents the intersection of the vertical line and
a horizontal line associated with a slave port.
A filled circle indicates a connection between the master port represented
by the vertical line and the slave port represented by the horizontal line
associated with the filled circle.
A hollow circle indicates an absence of connection between the master
port represented by the vertical line and the slave port represented by the
horizontal line associated with the hollow circle. This can be seen in
Figure 20 on page 26, where only the LatticeMico32 microprocessor
Wishbone ports are connected.
The numbers next to the lines representing the master ports are the
priorities in which the master ports can access the slave ports. You can
change the priority of these connections by following the instructions in
the online Help for LatticeMico System.
This tutorial example uses the shared-bus arbitration scheme. For information
about bus arbitration schemes, refer to the LatticeMico32 Software
Developer's User Guide. The master ports are represented by black lines, and
the slave ports are represented by blue lines. Both the instruction and data
ports connect to the LatticeMico EBR and the SPI Flash Controller Data port,
LatticeMico32 Tutorial 27
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
but only the data port connects to the LatticeMico SPI Flash Controller, the
LatticeMico GPIO, and the LatticeMico UART.
28 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
Memory controller, the LatticeMico GPIO, the LatticeMico TImer, and the
LatticeMico SPI Flash Controller Data and control port.
Note
You can only edit the addresses in the Base column in the Editor View. You cannot edit
the addresses in the End column. The value of the end address is equivalent to the
value of the base address plus the value of the size.
You will not assign individual addresses. There are only two addresses that
need to be manually assigned: the Debug Memory and the SPI Flash
Memory.
During the creation of the SPI Flash component, you explicitly assigned an
address (0x04000000) to the SPI flash component data and control port, and
the Inline Data memory. You must lock the parallel flash address so that MSB
will not automatically assign it a new address. You do not want the flash
LatticeMico32 Tutorial 29
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
address to change for this example, because that is where the final software
application code will reside.
Note
Address and size values that appear in italic font in the Editor view cannot be
changed.
Figure 23: MSB Perspective After Assignment of Addresses in a Shared-Bus Arbitration Scheme
30 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
Note
To reassign an interrupt priority for a specific component, go to the IRQ column in the
row for the component, click on the current interrupt priority number, and choose the
new priority number from the drop-down menu. Explicitly assigned interrupt priorities
will not be overridden by the interrupt generator tool. The Lock control does not affect
IRQ assignment; it only prevents auto-assignment of the Base Address.
In the Console view, MSB shows that there are no errors in the platform.
LatticeMico32 Tutorial 31
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
The contents of the platform1.msb file are used by the C/C++ development
tools. The C/C++ source code build process extracts the base address
information and the size of each component and uses the information to build
GNU LD linker files. Each time the Generate function is run, it causes the C/
C++ compiler to consider the C/C++ source code to be out of date. This
means that the source code will be rebuilt from scratch after each Generate
process.
32 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
The MSB perspective now looks like the illustration in Figure 24. The
assigned addresses for the components other than the parallel flash might
differ.
Figure 24: MSB Perspective After Building the Microprocessor Platform in a Shared-Bus
Arbitration Scheme
LatticeMico32 Tutorial 33
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
Note
Figure 26 shows an example platform. The figure does not show the entire directory
and file structure.
34 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
examples
lm32_tutor
spi_flash
timer
gpio
lm32_top
Verilog
peripheral.mk file
device
LatticeMico32 Tutorial 35
LATTICEMICO32 TUTORIAL : Task 2: Create the Development Microprocessor Platform
module platform1_top
(input reset_n,
output SPIFlashCEJ,
output SPIFlashSCK,
output SPIFlashSI,
input SPIFlashSO,
output SPIFlashWPJ,
output [7:0] LEDPIO_OUT,
output [7:0] gpio_7SegsPIO_OUT
);
platform1 platform1_u
(.clk_i (clk_i),
.reset_n (reset_n),
.SPIFlashCEJ (SPIFlashCEJ) ,
.SPIFlashSCK (SPIFlashSCK) ,
.SPIFlashSI (SPIFlashSI) ,
.SPIFlashSO (SPIFlashSO) ,
.SPIFlashWPJ (SPIFlashWPJ) ,
.LEDPIO_OUT (LEDPIO_OUT) ,
.gpio_7SegsPIO_OUT (gpio_7SegsPIO_OUT)
);
endmodule
36 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 3: Create the Software Application Code
C/C++ SPE uses the same LatticeMico System interface as MSB, but it uses
a different perspective called the C/C++ perspective.
C/C++
Projects
view or
Navigator
view Outline
Editor
view
Problems view, Console view, Properties view, Debug view, Tasks view, or Search view
LatticeMico32 Tutorial 37
LATTICEMICO32 TUTORIAL : Task 3: Create the Software Application Code
38 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 3: Create the Software Application Code
Note
Project templates are packaged software application files that are copied to the
new project and provide a starting point for building an application. Some
templates have specific requirements, as described in the description pane. If
these hardware and software requirements are not met, the application built may
not function correctly and may require you to debug the application by using the C/
C++ SPE debug interface. C/C++ SPE enables you to create templates in addition
to those included with the installation.
The New Project dialog box should resemble the figure shown in
Figure 29.
Note
The directory shown in the Location box in the Project Contents field is where the
software project directory will be created. Your user files will be placed in this
directory.
3. Click Finish.
LatticeMico32 Tutorial 39
LATTICEMICO32 TUTORIAL : Task 3: Create the Software Application Code
Now you see the source code in the middle pane of the C/C++ perspective, as
shown in Figure 30.
Linker Configuration
A new C project is almost ready to be compiled and linked. Before you
compile the source code, it is necessary to configure the linker. Every C/C++/
assembly file has, at a minimum, three fundamental sections that need to be
placed.
The compiler splits the source code into an instruction section, a read-only
data section, and a read-write section by default. The first two sections can
be placed in either read-only or read-write memories, while the final section
must be placed in a read-write memory. The C/C++ SPE provides you with an
easy-to-use feature for selecting memories for each region.
40 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 3: Create the Software Application Code
The Properties dialog box enables you to select and change where the linker
places each of the sections.
You can select from the list on the left side of the Properties window to
open one of the following panes:
Info – provides basic project location information.
Builders – provides information on the builder system used for this
managed build project. It is preconfigured to use the LatticeMico
builder system.
C/C++ Build – enables you to select and manage the compiler,
assembler, and linker settings.
C/C++ Indexer – enables you to specify the indexing method for
searches: fast, full, or no indexer.
Platform – provides information on the platform used by this project, in
addition to other information such as the linker section setting.
Project References – enables you to manage other projects
referenced by the current project. Project References cannot be used
for the LatticeMico C/C++ SPE managed build environment.
LatticeMico32 Tutorial 41
LATTICEMICO32 TUTORIAL : Task 3: Create the Software Application Code
Figure 32: Platform Pane of the Properties for LED_Versa Dialog Box
42 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 3: Create the Software Application Code
The compilation process generates the following files, among others, in the
LED_Versa\platform1 directory:
A C header file, DDStructs.h, that describes the device-driver structures
for the applicable devices, in addition to the relevant platform settings,
such as the microprocessor clock frequency
A C source file, DDStructs.c, that describes the component instance
parameters required by the device drivers in appropriate structures
A C source file, DDInit.c, that invokes specified device initialization
routines for putting the relevant instantiated components in a known state
A linker script, linker.ld (in LED_Versa\platform1\Debug), that contains the
location and size of the memory components and the rules for generating
an executable file image, as required by the GNU linker. C/C++ SPE uses
this information to ensure that the program code and data are located at
the correct addresses. Although it is not covered in this tutorial, the
LatticeMico C/C++ SPE enables you to easily specify a custom linker
script to be used in lieu of the generated script for the managed build.
A LatticeMico software executable linked formal file (.elf). The .elf file
contains the Mico instructions, debug information, and information about
the pre-initialized data. This tutorial generates a file called platform1.elf.
These files are included in the directory that C/C++ SPE generates in the
background. The structure of this directory is shown in Figure 33 on page 44.
LatticeMico32 Tutorial 43
LATTICEMICO32 TUTORIAL : Task 3: Create the Software Application Code
The contents of this directory are dynamically generated, and any changes to
them are overwritten from build to build.
Note
Only the most important files are shown in Figure 33.
44 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 4: Generate the Microprocessor Bitstream
Figure 34 shows the automatically generated files in this directory that are
required to build an application. The contents of this directory are generated
dynamically, and any changes to them are not preserved from build to build.
Note
Only the most important files are shown in Figure 34.
LatticeMico32 Tutorial 45
LATTICEMICO32 TUTORIAL : Task 4: Generate the Microprocessor Bitstream
c. In the right pane, click inside the Value cell for “Top-Level Unit” and
select <platform1>_vhd from the drop-down menu.
46 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Connect the Microprocessor to the FPGA Pins
d. Click inside the Value cell for “Verilog Include Search Path,” and then
click the browse button to open the “Verilog Include Search Path”
dialog box.
e. In the dialog box, click the New Search Path button , browse to the
<platform1>\soc directory, and click OK.
f. Click OK to add the path to the Project Properties and close the
“Verilog Include Search Path” dialog box.
g. Click OK to return to the Diamond main window.
For this tutorial, you will import a preconfigured pin preference file into
Diamond. Create a preconfigured pin preference file named “untitled.lpf” as
follows:
1. Copy and paste the contents of Figure 35 on page 48 into a text editor.
2. Name the file untitled.lpf, and save the file in the following directory:
For Windows: <Diamond_install_path>\examples\lm32_tutor
For Linux: ~/LatticeMico/lm32_tutor
LatticeMico32 Tutorial 47
LATTICEMICO32 TUTORIAL : Connect the Microprocessor to the FPGA Pins
#-----------------------------------------------------------------------
---------------------
# LEDs assumes the component instance name is LED & has
# a width of 8
#-----------------------------------------------------------------------
---------------------
LOCATE COMP "LEDPIO_OUT[0]" SITE "U19" ;
LOCATE COMP "LEDPIO_OUT[1]" SITE "U18" ;
LOCATE COMP "LEDPIO_OUT[2]" SITE "AA21" ;
LOCATE COMP "LEDPIO_OUT[3]" SITE "Y20" ;
LOCATE COMP "LEDPIO_OUT[4]" SITE "W19" ;
LOCATE COMP "LEDPIO_OUT[5]" SITE "V19" ;
LOCATE COMP "LEDPIO_OUT[6]" SITE "AA20" ;
LOCATE COMP "LEDPIO_OUT[7]" SITE "AB20" ;
#-----------------------------------------------------------------------
---------------------
# 7 segments assumes the component instance name is gpio_7Segs & has
# a width of 8
#-----------------------------------------------------------------------
---------------------
LOCATE COMP "gpio_7SegsPIO_OUT[0]" SITE "V6" ;
LOCATE COMP "gpio_7SegsPIO_OUT[1]" SITE "U7" ;
LOCATE COMP "gpio_7SegsPIO_OUT[2]" SITE "Y6" ;
LOCATE COMP "gpio_7SegsPIO_OUT[3]" SITE "AA6" ;
LOCATE COMP "gpio_7SegsPIO_OUT[4]" SITE "U8" ;
LOCATE COMP "gpio_7SegsPIO_OUT[5]" SITE "T8" ;
LOCATE COMP "gpio_7SegsPIO_OUT[6]" SITE "AA5" ;
LOCATE COMP "gpio_7SegsPIO_OUT[7]" SITE "AB4" ;
48 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Connect the Microprocessor to the FPGA Pins
LatticeMico32 Tutorial 49
LATTICEMICO32 TUTORIAL : Task 5: Download the Hardware Bitstream to the FPGA
Note
A USB cable is included with the board.
Note
If the Programmer output window displays “Cannot identify detected device on row 1.
Please manually select correct device,” choose LFE3-35EA from the Device column
drop down menu.
6. In the Cable Settings dialog box on the right side of the Programmer
window, do the following:
a. In the Cable box, select HW-USBN-2B (FTDI).
b. In the Port box, choose the only setting available in the drop-down
menu, FTUSB-0.
7. Double-click the Operation column to display the Device Properties dialog
box, as shown in Figure 36, and choose the following settings:
For Access Mode, choose JTAG 1532 Mode from the pull-down
menu.
For Operation, choose Fast Program from the pull-down menu,
50 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 5: Download the Hardware Bitstream to the FPGA
8. Double-click the File Name column. Click to display the Open File
dialog box, and browse to the platform1_platform1.bit file in the following
directory:
For Windows,
<Diamond_install_path>\examples\lm32_tutor\platform1_platform
1.bit
For Linux, ~/LatticeMico/lm32_tutor/platform1_platform1.bit
9. Click Open.
12. Click the Program button on the Programmer toolbar to initiate the
download.
13. Check the Programmer output console to see if the download passed, as
shown in Figure 38. If the programming process succeeded, you will see a
green-shaded PASS in the Programmer Status column.
LatticeMico32 Tutorial 51
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
14. At the end of this process, the FPGA is loaded with the Microprocessor
hardware configuration.
15. In Diamond, choose File > Save platform1.xcf.
16. Exit Diamond by choosing File > Exit.
This task assumes that you have successfully downloaded the platform FPGA
bitstream to the development board in “Task 5: Download the Hardware
Bitstream to the FPGA” on page 50.
If you encounter any problems with the debug session, refer to "Debug
Session Troubleshooting" in the Lattice Software Project Environment online
Help. This troubleshooting topic describes the most common problems
encountered in launching a debug session and the reasons the debugger
sometimes fails to operate.
52 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
LatticeMico32 Tutorial 53
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
54 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
In this dialog box, you specify the project or executable to debug. Since
you selected the project before selecting Run > Debug Configurations,
the boxes are filled in by Eclipse. If these boxes are not populated, follow
these instructions to configure the items in this dialog box:
a. Use the Browse button to select the Eclipse project.
Clicking Browse activates a dialog box that lists the available projects
created or imported in Eclipse.
b. Select LED_Versa.
c. Click the Search Project button to select the executable (.elf) file that
you want to debug.
A project may have multiple executables. Clicking the Search Project
button activates a dialog box that lists the executables built for the project.
If you want to use an executable not built within C/C++ SPE, click the
Browse button to activate a file selection dialog box in which to select the
appropriate .elf-format executable file.
LatticeMico32 Tutorial 55
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
4. Click the Debugger tab of the Debug dialog box, as shown in Figure 42.
Note
If you encounter any problems with the debug session, refer to "Debug Session
Troubleshooting" in the Lattice Software Project Environment online Help. This
troubleshooting topic describes the most common problems encountered in
launching a debug session and the reasons the debugger sometimes fails to
operate.
56 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
When you click the Debug button, the dialog box closes, and C/C++ SPE
attempts to interface to the debug monitor in the LatticeMico32 platform.
Once it has established a connection to the debug monitor it downloads
the LatticeMico executable code to the memories specified by the linker
script. After it has successfully done this, the Confirm Perspective Switch
prompt box containing the following message appears:
This kind of launch is configured to open the Debug
perspective when it suspends. Do you want to open this
perspective now?
6. Select the Remember my decision box, and click the Yes button. Click
Yes in the prompt box.
Note
If you did not previously download the bitstream, a message box with the following
error message may appear:
Check that the target FPGA contains an LM32 CPU with
DEBUG_ENABLED equal to TRUE and that the FPGA has configured
successfully.
Return to “Task 5: Download the Hardware Bitstream to the FPGA” on page 50,
and download the bitstream before proceeding.
Note
Selecting Run > Debug Configurations on a computer running the Windows
operating system might activate the Windows firewall. The Windows Security Alert
dialog box shown in Figure 43 might appear.
LatticeMico32 Tutorial 57
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
C/C++ SPE now switches to the Debug perspective, shown in Figure 44.
The Debug perspective consists of many views, some of which may not
be visible:
Debug view, which displays the function calls made so far. It also
contains application and process information.
Variables view, which displays the variables that are used in the
source code functions
Breakpoints view, which appears when you insert a breakpoint
Source view, which displays the source code when you click on a
thread in the Debug view
Outline view, which displays the functions in the source code
Console view, which displays the output of the debugging session
Tasks view, which is not used
Modules view, which displays the modules of the executable loaded. If
you click on a module, C/C++ SPE displays all the functions that
compose that module.
Registers view, which displays the registers in the CPU. It also shows
the values on the registers at the breakpoints. Values that have
58 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
This shows the processes that are running on the host PC.
Insert Breakpoints
The information in the expanded Debug view under
com.lattice.mdk.debug.mico32debugger contains information about the
executable downloaded to the FPGA and executed by LatticeMico. It shows
that the execution is suspended because of a breakpoint at a line within the
LED7SegsTest.c source file.
1. In the Debug view, click on the statement containing the line main().
This step activates the file in the Source view, located below the Debug
view. A line with green highlighting shows the line at which the
LatticeMico32 microprocessor has been suspended because of a
breakpoint. The breakpoint is at the beginning of your main program, as
configured for this debug launch.
You will now insert a breakpoint to check the software and platform
functionality.
LatticeMico32 Tutorial 59
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
2. In the LED7SegsTest.c file displayed in the Source view, click on the line
beginning with “MicoGPIOCtx_t,” as indicated in Figure 46.
60 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
Note
If the Variables view is not visible, choose Window > Show View > Variables to
make it visible. If the Variables view is inactive—that is, the tab is shown in gray
tones—click on the Variables tab to make it active.
The value of the “leds” variable might be different from that shown in
Figure 48. However, if the value of the “leds” variable shown in Figure 48
is 0x00000000 (or 0) for your view, the platform most likely does not have
a GPIO named LED in the platform. Repeat the tutorial, following the
procedures exactly.
3. In the Debug view, click the green arrow next to the tab title, or choose
Run > Resume.
The Debugger issues a “continue” command to the LatticeMico32
microprocessor, which causes the microprocessor to continue execution
of the downloaded code.
The Console view in the bottom of the C/C++ SPE window should display
the text line shown in Figure 49 on page 61. This text is output by the
LED_Versa application running on LatticeMico, which uses the JTAG
connection to the Debugger for standard input/output communication to
the C/C++ SPE console.
LatticeMico32 Tutorial 61
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
6. Click the line containing the text Thread[0] (Running) to activate the
following two buttons:
A button with two orange bars, , located towards the center of the
debug view title bar, which pauses execution. It inserts an
asynchronous breakpoint similar to a pre-set line breakpoint.
62 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 6: Debug and Execute the Software Application Code on the Development Board
1. Delete the four printf statements from the code to make it similar to the
example shown in Figure 51.
c. Step over the C source line by clicking the icon in the Debug view
or choose Run > Step Over or press the F6 key.
d. Click the green arrow again.
This code is now ready for stand-alone deployment in the parallel flash
memory.
You have now completed the task of downloading and executing the
software application code on the LatticeECP3 Versa Evaluation Board.
LatticeMico32 Tutorial 63
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
In this task, you will prepare the LED_Versa software for deployment to SPI
flash memory and merge the production microprocessor bitstream and
LED_Versa software into one SPI Flash Image, which will be loaded into non-
volatile memory (i.e. SPI Flash memory).
The SPI flash ROM component included in LatticeMico MSB interfaces with
an external SPI flash module. It translates WISHBONE read requests to the
appropriate SPI commands to read data from the external SPI flash module
and presents the read data to the WISHBONE data bus. This process allows
the LatticeMico32 microprocessor and other masters to treat the external SPI
flash module as a plain read-only memory.
The main advantage of SPI flash deployment is that it allows the FPGA
bitstream (or portions of it) and the microprocessor bitstream to co-exist in a
single SPI flash device. However, this is possible only if the FPGA user logic
can access the very same SPI flash device that was used for the FPGA
configuration. SPI flash deployment may impose FPGA requirements, board
layout requirements, or both, which must be considered before you design the
hardware. The LatticeECP3 Versa board can be used for SPI Flash
deployment, since its user logic can also access the configuration SPI flash in
addition to the configuration logic.
In Figure 52, the first data portion is the FPGA bitstream that is used for
configuring the FPGA. The second data portion is the LatticeMico application
64 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
Reset Vector Address (EBA Value) This value is the address from where
the microprocessor starts fetching instructions on removal of reset. It is the
sum of the LatticeMico SPI flash ROM base address assigned in the MSB
perspective and the offset in the SPI flash where the LatticeMico32 boot
application will reside. The offset depends on the FPGA bitstream size.
Offset Alignment in the SPI Flasht The offset in the SPI flash must be
aligned on a word boundary. It should be a multiple of 4 so that the lower two
bits of the resulting EBA value are zero. The LatticeMico SPI flash and the
LatticeMico32 microprocessor do not support aligned accesses, and all
LatticeMico32 instructions are 32 bits, or 4 bytes.
LatticeMico32 Tutorial 65
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
Note
You can no longer use the new LEDTest ELF for debugging and execution purposes
from Lattice C/C++ SPE, since it has been prepared for parallel flash deployment. The
LEDTest ELF must be recreated, as shown in Task 3, for this purpose.
Note
For deployment, you must not use a JTAG UART. If the code uses standard C file
operations, such as printf, scanf, or fopen, your deployed code will not work if it uses a
JTAG UART as a standard I/O device or for file operations. You can use the RS-232
UART for standard I/O operations, for that you need to include the UART platform into
the MSB platform. As this tutorial doesn't uses the standard C file operations, so no
need to worry about setting Stdio Redirection.
66 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
LatticeMico32 Tutorial 67
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
68 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
Figure 55: Main Tab of the Software Deployment Tools Dialog Box
Save Binary Output File As – Selects the output file that will be
generated by this tool. The output file must have a .bit extension. Click the
Browse button to select the directory in which to generate the output file.
LatticeMico32 Tutorial 69
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
70 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
7. Save Binary Output File As - Click the Browse button and browse to the
following location and save it as LEDtest.bit.
For Windows: <Diamond_install_path>\examples\lm32_tutor\LEDtest.bit
For Linux: ~/LatticeMico32/lm32_tutor/LEDtest.bit
8. Click Analyze to confirm that the selected LED_Versa sections are being
deployed to SPI flash memory.
In this tutorial, you deploy all LED_Versa sections to SPI flash memory.
Clicking on Analyze should show that the following sections are
deployed: .boot, .text, .rodata, .data, .bss.
The Software Deployment Tools Configuration dialog box should look like
the example shown in Figure 58.
Figure 58: Main Tab of the Software Deployment Tools Configuration Dialog Box with Use
Diamond Deployment Tool to Deploy Application Enabled
LatticeMico32 Tutorial 71
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
Once the .bit file containing the bootable application binary is ready, you must
program it into the SPI flash. If this application binary must co-exist with the
FPGA bitstream (or a portion of it), it must be merged with the FPGA
bitstream binary.
72 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
LatticeMico32 Tutorial 73
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
This generated file contains the merged FPGA bitstream and the LatticeMico
bootable software application (LED_Versa) in a single SPI flash image file that
Diamond Programmer can now use for programming the SPI flash.
1. You can see the Deployment Generation Status as shown Figure 65 on
page 76.
74 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 7: Setting up the Options to Deploy the Software Code to the SPI Flash Memory
LatticeMico32 Tutorial 75
LATTICEMICO32 TUTORIAL : Task 8: Deploy the SPI Flash Image (Merged With Production Microprocessor Bitstream and Applica-
76 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 8: Deploy the SPI Flash Image (Merged With Production Microprocessor Bitstream and Applica-
LatticeMico32 Tutorial 77
LATTICEMICO32 TUTORIAL : Task 8: Deploy the SPI Flash Image (Merged With Production Microprocessor Bitstream and Applica-
78 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Task 8: Deploy the SPI Flash Image (Merged With Production Microprocessor Bitstream and Applica-
LatticeMico32 Tutorial 79
LATTICEMICO32 TUTORIAL : Task 8: Deploy the SPI Flash Image (Merged With Production Microprocessor Bitstream and Applica-
80 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Summary
Summary
You have finished the LatticeMico32 Tutorial. In this tutorial, you have learned
how to do the following:
LatticeMico32 Tutorial 81
LATTICEMICO32 TUTORIAL : Glossary
Glossary
Following are the terms and concepts that you should understand to use this
tutorial effectively.
breakpoints. Breakpoints are a combination of signal states that are used to
indicate when simulation should stop. Breakpoints enable you to stop the
program at certain points to examine the current state and the test
environment to determine whether the program functions as expected.
C/C++ SPE. C/C++ SPE is an abbreviation for the C/C++ Software Project
Environment, which is an integrated development environment based on
Eclipse for developing, debugging, and deploying C/C++ applications. The
C/C++ SPE tool chain uses a GNU C/C++ tool chain (compiler, assembler,
linker, debugger, and other utilities such as objdump) optimized for the
LatticeMico process. It uses the same graphical user interface as MSB.
CFI. CFI is an abbreviation for Common Flash Interface (CFI) parallel flash
memory, which is an open standard jointly developed by a number of chip
vendors for a type of EEPROM that stores information without requiring a
power source.
.elf file. An .elf file is a file in executable linked format that contains the
software application code written in C/C++ SPE.
82 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Glossary
IRQ. IRQ is an abbreviation for interrupt request, which is the means by which
a hardware component requests computing time from the CPU. There are 16
IRQ assignments (0-15), each representing a different physical (or virtual)
piece of hardware. For example, IRQ0 is reserved for the system timer, while
IRQ1 is reserved for the keyboard. The lower the number, the more critical the
function.
JTAG ports. JTAG ports are pins on an FPGA or ispXPGA device that can
capture data and programming instructions.
.lpf file. The logical preference file (.lpf) is a post-synthesis FPGA constraint
file that stores logical preferences that have been defined in the pre-map
stage and post-map stage. This file is automatically generated when you
create a new project in Lattice Diamond, and it stores logical preferences only.
master port. A master port is a port that can initiate read and write
transactions.
LatticeMico32 Tutorial 83
LATTICEMICO32 TUTORIAL : Recommended References
slave port. A slave port is a port that cannot initiate transactions but can
respond to transactions initiated by a master port if it determines that it is the
targeted component for the initiated transaction.
software application. The software application is the code that runs on the
LatticeMico32 microprocessor to control the components, the bus, and the
memories. The application is written in a high-level language such as C++.
SPI. SPI is an acronym for serial peripheral interface, a core that allows high-
speed synchronous serial data transfers between microprocessors,
microcontrollers, and peripheral devices. It can operate either as a master or
as a slave.
Recommended References
The following reference materials are recommended to supplement this
tutorial:
LatticeMico System online Help. From the LatticeMico Help menu, choose
Help > Help Contents.
LatticeMico32 Hardware Developer User Guide, which explains how to
use the Lattice Mico System Builder to create and configure a hardware
platform for the LatticeMico32 embedded microprocessor
LatticeMico32 Software Developer User Guide, which explains how to use
C/C++ SPE to program the microprocessor, gives examples of the code
used for different parts of the architecture, and describes the processes
occurring in the background
LatticeMico32 Processor Reference Manual, which contains information
on the architecture of the LatticeMico32 microprocessor chip, including
configuration options, pipeline architecture, register architecture, debug
architecture, and details about the instruction set.
84 LatticeMico32 Tutorial
LATTICEMICO32 TUTORIAL : Recommended References
LatticeMico32 Tutorial 85
LATTICEMICO32 TUTORIAL : Recommended References
86 LatticeMico32 Tutorial