Skip to content

Example Lattice

Antti Lukats edited this page Nov 11, 2018 · 21 revisions

This example implementation uses picorv32 core as "example cpu/soc" - this implementation does not pass all requirements but can be used as getting started design. Initial testing before porting was done with Vivado

Simulation with Xilinx Vivado

\picorv32\scripts\quartus\system.v was taken as TOP level, then picosoc.v was renamed to early_picosoc.v to make Vivado to include the verilog files in correct order. There is a problem currently that using manual compile order disables RTL modules in Block Design.

LED connected to mem address bit 11, only minimal change in the system.v file was needed.

RV32I Compliance test "I-ADD-01" is executing in simulator, we can see that picorv32 passes the test, the LED will settle down at high level. During the executing we see RAM access activity on the LED.

Testing with Xilinx FPGA

First try - LED is off? Are clock and reset correct? Adding VIO and ILA.

Clock is running and external Reset from the board is high! And when toggling the reset to picorv32 from VIO it runs the compliance test in FPGA and the LED is lit!

Vivado synthesis did infer correct RAM and loaded the content using verilog $readmem as well.

Porting to Radiant

Taking the exact same verilog files that worked with Vivado in simulation and with real hardware to Lattice Radiant.

The early_picosoc.v renaming trick works here too, using manual compile order is not needed.

Inferring EBR RAM with memory seem to work, up to 8KByte size.

TODO Memory map should be split into RAM with init code (EBR) and RAM (noinit)

Then it would be possible to define EBR RAM in vendor neutral verilog and use $readmem to load the RISCV code.

RAM should be implemented using SPRAM primitives ?

TODO check if inference works for SPRAM (it should actually).

Testing on MDP Board

Using U3 FPGA C - this has most connections to usable on board peripherals.

Label Net Pin
OSC_CLK B3
LED1 SPARE_C1 B1
LED2 SPARE_C2 F2
SW6 SPARE_C3 C3
SW7 SPARE_C4

Simulation and Debug

Simulation with Aldec Simulator works both on RTL as gatelevel.

Attempt to debug with Reveal gets as far as:

ERROR - ERROR: core0 incorrect pattern readout.

Clone this wiki locally