PulseRain Reindeer FRV2100 User manual

858-877-3485 |850-408-9550 | info@pulserain.com
PulseRain Reindeer (FRV2100)
RISC-V Soft CPU
Quick Start Guide
--Validated with
Lattice MachXO3D
Breakout Board
Jul, 2020
Doc# QSG-0962-0127, Rev 0.9.2
Copyright © 2020
PulseRain Technology, LLC.
858-877-3485 858-408-9550
https://www.pulserain.com

Table of Contents
1 Introduction .............................................................................................................1
1.1 System Overview ...........................................................................................................................1
1.2 Supply of Power.............................................................................................................................2
1.3 Programming Cable and USB /UART Cable....................................................................................2
1.4 Lattice Diamond Software .............................................................................................................2
2 GitHub Repository....................................................................................................2
3 Program the Breakout Board...................................................................................2
4 Prepare the Breakout Board for UART.....................................................................3
5 Using Arduino IDE .................................................................................................... 7
5.1 Install Arduino IDE .........................................................................................................................7
5.2 Setup Arduino IDE..........................................................................................................................8
5.3 Write Sketches.............................................................................................................................10
6 Build the FPGA Image from RTL Code....................................................................13
7 Generate Memory Init File.....................................................................................14

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 1of 14
1Introduction
1.1 System Overview
Figure 1-1 System Overview
PulseRain Reindeer (FRV2100) is a soft CPU of Von Neumann architecture. It supports RISC-V RV32I[M]
instruction set, and features a 2 x 2 pipeline. It strives to make a balance between speed and area, and offers
a flexible choice for soft CPU across all FPGA platforms.
And at this point, it has also been successfully ported to the Lattice MachXO3D Breakout Board (“Breakout
Board” for the rest of the document), with the following configurations:
•RV32I processor core, Von Neumann Architecture
•32KB Block RAM for code and data
•1 UART
•32 bit GPIO for both input and output
As shown in Figure 1-1, to further facilitate the software development for RSIC-V, an Arduino board support
package has been provided on GitHub for the Breakout Board, with which the software developers can write
code for RISC-V directly in Arduino IDE.
And the following components can also be found on the Breakout Board, as illustrated in Figure 1-1.
•A Lattice LCMXO3D-9400HC FPGA
•8 LEDs
•1 Reset Button
•Connectors for FPGA IO ports
•FTDI 2232H for USB connection
Lattice MachXO3D
Breakout Board
USB
PulseRain Reindeer
RISC-V Soft MCU
MachXO3D
LCMXO3D – 9400HC
FTDI 2232H
DIP-SW
Diamond Software
and
Arduino IDE
GITHUB
https://github.com/PulseRain/Arduino_RISCV_IDE
LED
MPSSE
UART
Reset
Button

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 2of 14
1.2 Supply of Power
The Breakout Board can be powered a Mini-USB cable.
1.3 Programming Cable and USB /UART Cable
As indicated in Figure 1-1, the Mini-USB cable also serves as both a programming cable and a USB/UART
cable.
1.4 Lattice Diamond Software
The Lattice Diamond software is needed to compile the RTL code and program the FPGA. The Lattice Diamond
can be found at
https://www.latticesemi.com/Products/DesignSoftwareAndIP/FPGAandLDS/LatticeDiamond
And users can also request a free license for this software from Lattice website.
2GitHub Repository
The complete code of PulseRain Reindeer (FRV2100) for MachXO3D Breakout Board can be found on GitHub
at
https://github.com/PulseRain/Reindeer_MachXO3D
To check out (clone) the repository, run the following commands under Cygwin on Windows:
$ git clone https://github.com/PulseRain/Reindeer_MachXO3D.git
$ cd Reindeer_MachXO3D
$ git submodule update --init --recursive
3Program the Breakout Board
The repository above has a pre-built FPGA image for PulseRain Reindeer(FRV2100) MCU. To program the
Breakout Board with this image, do the following:
1. Connect the Breakout Board to PC through a Mini-USB Cable.
2. Launch Diamond Programmer,
Set the Device to be LCMXO3D-9400HC
Set Operation to be FLASH Erase, Program, Verify
As shown in Figure 3-1, point the File Name to
Reindeer_MachXO3D\build\lattice\MachXO3D_Breakout\breakout\MachXO3D_breakout_a.jed,

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 3of 14
Figure 3-1 Diamond Programmer
The FPGA image above contains PulseRain Reindeer(FRV2100) RISC-V core, and it will light up the led in a
rotating fashion. Please set DIP-SW 1 and 2 for LED pattern, and set DIP-SW 3 and 4 for LED refreshing rate.
4Prepare the Breakout Board for UART
The RISC-V core needs a UART for programming and communication. The MachXO3D Breakout board carries
a FTDI FT2232H chip, with 2 channels. Channel A is used for FPGA programming. And Channel B can be used
as a UART for RISC-V.
However, to enable the UART, some extra work has to be done:
1. For the Breakout Board (Rev A), the resistors R14 and R14 are DNI on the board. They should be installed
(0 Ohm or simply connect with bard solder), as shown below in Figure 4-1:

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 4of 14
Figure 4-1 Lattice MachXO3D Breakout Board (Rev A)
2. The EEPROM for the FT2232H needs to be reconfigured. To do that, please install the FT_PROG utility
from Future Technology Devices International Ltd.
3. Launch FT_PROG utility, press F5 to scan the devices, set Hardware Specific/Port B/Hardwareto be RS232
UART, as illustrated below in Figure 4-2:

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 5of 14
Figure 4-2 FTDI FT_PROG Utility
4. Press Ctrl+P to program the FT2232H on the Breakout Board.
5. Open Windows Device Manager, right click "Universal Serial Bus controller / USB Serial Converter B",
then choose Properties, as shown below in Figure 4-3.

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 7of 14
7. Unplug and re-plug the Mini-USB Cable. If everything goes ok, you should be able to find a new COM
port in Windows Device Manager, as shown in Figure 4-5.
Figure 4-5 USB Serial Port in Windows Device Manager
5Using Arduino IDE
5.1 Install Arduino IDE
PulseRain Reindeer(FRV2100) RISC-V MCU can be developed and programmed through Arduino IDE. On
Windows 10, the Arduino IDE can be installed as an App directly from Windows App store. Otherwise, the
Windows installer for Arduino IDE can be found at Arduino Website:
https://www.arduino.cc/en/Main/Software

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 8of 14
5.2 Setup Arduino IDE
After the Arduino IDE is installed, launch it and click the menu File / Preferences, as shown in Figure 5-1:
Figure 5-1 Arduino IDE, Preferences Menu
1) The File / Preferences menu will bring out a dialog like the one shown in Figure 5-2. Please set the
"Additional Boards Managers URL" to
https://raw.githubusercontent.com/PulseRain/Arduino_RISCV_IDE/master/package_pulserain.com_index.json
(If this input box is not empty, use semicolon to separate multiple URLs.) And click OK to close the
dialogue.

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 10 of 14
3) The "Boards Manager" will bring out a dialogue like the one shown in Figure 5-4. Type in "Reindeer"
in the search box to find the board support package for the MachXO3D Breakout Board. Click "Install"
to download and install the board support package.
Figure 5-4 Arduino IDE, Boards Support Package for Lattice MachXO3D Breakout Board
5.3 Write Sketches
Just like Arduino, you need to select the correct COM port and Board Name before you can start writing
sketches.
To select the COM port in Arduino IDE, click the menu Tool / Port, as shown in Figure 5-5. The COM port
for the Breakout Board is usually the one that has the biggest index number, but not always. If you have
trouble determining which COM port corresponds to the Breakout Board, you can always open the device
manager to check, as illustrated in Figure 4-5.

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 11 of 14
Figure 5-5 Arduino IDE, Select COM port
To select the board name as "MachXO3D Breakout", click the menu Tool / Board. If the previous steps
were done right, you should see the name "MachXO3D Breakout” in PulseRain RISC-V (Reindeer), as
illustrated in Figure 5-6.
Figure 5-6 Arduino IDE, Select MachXO3D Breakout
Now you can start to write some sketches, you can open the demo Sketch provided in the GitHub
repository Reindeer_MachXO3D/sketch/breakout_demo.

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 12 of 14
After opening the demo Sketch in Arduino IDE, you can type in "ctrl-U" (or menu Sketch/Upload) to
compile and upload the sketch to the Breakout Board. And it is also recommended to turn on the option
of "Show Verbose Output" in Preferences Dialogue (Menu File / Preferences), as illustrated in Figure 5-7.
In this way, the path of the .hex file can be located through the verbose output.
Also, you can type in “Ctrl-Shift-M” (or menu Tools / Serial Monitor), as illustrated in Figure 5-8, to see
the output of the COM port (Please set baud rate to 115, 200)
Figure 5-7 Turn on Verbose Option
Figure 5-8 Arduino IDE, COM Port output

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 13 of 14
6Build the FPGA Image from RTL Code
To build the FPGA image from RTL, launch Lattice Diamond software, and open the project under
Reindeer_MachXO3D\build\lattice\MachXO3D_Breakout\MachXO3D.ldf
If every goes ok, the screen should look like the one in Figure 6-1
Figure 6-1 Lattice Diamond, Project
And please choose the process tab, right click the Export Files, and then click Rerun All, as show below in
Figure 6-2.

PulseRain Reindeer(FRV2100) for Lattice MachXO3D –Quick Start Guide
Page 14 of 14
Figure 6-2 Lattice Diamond, Rerun All
After the build is complete, the newly generated bit stream file and JEDEC file can be found in
Reindeer_MachXO3D\build\lattice\MachXO3D_Breakout\breakout
•MachXO3D_breakout.bit
•MachXO3D_breakout_a.jed
7Generate Memory Init File
There are 4 memory init files in Reindeer_MachXO3D\build\lattice\MachXO3D_Breakout\breakout
•mem_init_0.mem
•mem_init_1.mem
•mem_init_2.mem
•mem_init_3.mem
They contain the power-on software image for the MCU. To replace the default software image, users can
use the script in Reindeer_MachXO3D\build\scripts\gen_mem.cmd
This script needs one parameter for the software’s image in hex format. And for Arduino, the path to the
hex file can be found in Arduino message window if verbose option is turned on (Figure 5-7).
To generate the new memory init files, open the command prompt, enter the script folder path, and run
something like: (The path should be copied/pasted from Arduino message window.)
gen_mem.cmd C:\Users\pulse\AppData\Local\Temp\arduino_build_32247\sketch_jul24a.ino.hex
Table of contents
Popular Computer Hardware manuals by other brands

4gon
4gon RouterBOARD 411R quick start guide

Renesas
Renesas RH850/F1 Series user manual

Intech
Intech CS8078 user manual

Texas Instruments
Texas Instruments tideP-0095 Reference design

Congatec
Congatec COM Express conga-TCA7 user guide

Elenco Electronics
Elenco Electronics K-16 Assembly and instruction manual