Using ORPSoC


2012-03-02Publicerad av Sven-Åke Andersson

Introduction



ORPSoC is intended to be a reference implementation of processors in the OpenRISC family. It provides a smallest-possible reference system, primarily for testing of the processors. It also provides systems intended to be synthesized and programmed on physical hardware. The reference system is the least complex implementation and consists of just enough to test the processor’s functionality. The board-targeted builds typically include many additional peripherals. For more information read the ORPSoC User Guide found in the doc directory of the ORPSoC installation.

Project organization



The ORPSoC project is intended to serve dual purposes. One is to act as a development platform for OpenRISC processors, and as a development platform of OpenRISC-based SoCs targeted at specific hardware. Organising a single project to satisfy these requirements can lead to some overlap and redundancy. The reference implementation based in the root (base directory) of the project contains enough components to create a simple OpenRISC-based SoC. Each board build is intended to implement as fully-featured a system as possible, depending on the targeted hardware. The project is organised in such a way that each board build can use both the reference implementation’s RTL modules and software, as well as its own set of RTL and software. The reference implementation is limited to what is available in the RTL and software directories in the root of the project, and is not technology dependent.

The Atlys board


We will start by finding the Atlys board setup.





 

Before we start


Before we start the design phase we have to make sure the Xilinx Design Suite is installed and that the environment variable XILINX is set.

 


 

Design


The design is made up of a number of Verilog HDL files. They reside in two different directory. One directory that holds all the code that is common to all board designs found here:
 



 

And one board specific design directory as shown in the screenplot of the atlys board directory structure. The syntesis script will pick up all the Verilog design files to build the complete system.



Synthesis 


Synthesis of the board port for the Xilinx technology with the XST synthesis tool can be run in the board’s <syn/xst/run> path with the following command: <make all>
This will create an NGC file in <syn/xst/run> named <orpsoc.ngc>. Hopefully it’s all automated enough so that, as long as the design is simulating as desired, the correct set of RTL will be picked up and synthesized without any need for customising scripts for the tool.

 

 

User constraints file
 


A Xilinx User Constraints File (UCF) is in the board’s <backend/par/bin> path. It is named <atlys.ucf>. It should be edited if any extra I/O or constraints are required.

 

Mappping and place & route



Mapping and place & route of the design can be run from the board’s <backend/par/run> path with the following command: <make orpsoc.ncd>. The makefile used can be found in the <......./boards/xilinx/atlys/backend/par/bin> directory. Here is an excerpt from the makefile showing the backend design flow:

 


 


 

Place & route results



The results from the place & route tool can be found in the logfile <orpsoc.par>:



 
 

Options



To get a list of options that can be set when running the backend flow, run the following command:


make print-config
 



Generate timing report



The trace tool can be used to generate a timing report of the post-place and route design:

make timingreport

 

 

Here is the result:

 

 


We have 1338 timing errors. Before we continue we have to investigate these errors. The timing report result file is called <orpsoc.twr>. Analyzing the this we find the following timing errors.
 





 
Without knowing to much about the design it is hard to figure out what is wrong. Let's setup a simulation environment and analyze what's going on (see next chapter).
 

Generating the bitstream file


The bitstream file is used to configure the FPGA device. The configuration file generation is run from the .../atlys/backend/par/run directory using the command: make orpsoc.bit

 



 

Downloading the bitstream
 

We are going to use the Xilinx configuration tool called iMPACT to configure the SPARTAN-6 FPGA on the Atlys board. The first thing we have to do is connecting our board to the computer we use for our development work using a USB cable.



Then start iMPACT.


l

 

We will create a new iMPACT project.

 


 
 We are going to use JTAG to configure the device.



 
 

The iMPACT tool will connect to the boundary scan chain on the board and identify the FPGA.




 

To add a configuration file we right-click the FPGA icon and select <Assign New Configuration File> and find the configuration file <orpsoc.bit>.



 
 
When double-clicking the Program operation entry the configuration will start. After a few seconds the configuration has finished.