Monday, March 21, 2011

Running a system level simulation of OpenSPARCT1 with ModelSIM

Running a system level simulation of OpenSPARCT1 with ModelSIM

Simulation of the opensparc is very important if you are going to understand its inner details. System level Simulation steps are given in the Design and verification guide chapter 6.7. The flow is to compile the libraries requried for simulation in ModelSIM and let the simulation scripts provided by the sparc people take care of simulating the system. Two sets of libraries are to be compiled. One for the ISE and the other for the EDK in the same order. The system requirements are

ModelSIM SE/PE v6.5 is required to simulate
XPS - 10.1.03 is required-
If you have xilinx 10.1 to update it to 10.1.03
1. open xps
2. help -> about
3. If version is 10.1
4. help -> xilinx update
5. if version is 10.1.03 then you are allset
RAM > 1.5 GB

Compiling the libraries for modelsim in ISE
source xilinx env variables
source modelsim env variables

1. open a new project in ISE
2. Choose the device and language parameters for the new project.
3. In the processes window click on the design utilities to unfold the options
4. Right click compiler HDL Simulation libraries
5. Choose properties and
language : verilog
compiled directory : no need to change default value (environment variables must be properly set)
Simulation path : ~/location to ModelSIM/modeltech/linux (since mine is a linux system. use win32 in windows system. automatically detected)
6. Open ~/location to modelsim/modelsim.ini and set "resoultion = ps" (chage write permissions if needed)

ERROR: unable to parse initialization file. Check if the
       file modelsim.ini is present in the current directory
       with read/write permissions
SOLUTION: Right click on the "design utilites" in the process window, choose properties,
 in properties, select language : verilog

First need to compile ISE libraries followed by compilation of edk libraries

Compiling libraries for ModelSIM in EDK
1. Make sure all the libraries for ISE are compiled
2. From the previous library compilation for ISE, you would have specified a "compiled directory" where all the libraries for ISE will be compiled. The default location is ~/*location to Xilinx*/*ver*/ISE/verilog/mti_se and ~/*location to Xilinx*/*ver*/ISE/vhdl/mti_se. Copy all folders inside these folders to ~/*location to modelsim*/modeltech/
3. open modelsim.
4. In the library window rightclick -> new -> library
5. Create -> a map to existing library
   Library name -> unisim
   Library path ~/*location to modelsim/modeltech/unisim
6. Do this for libraries unisim, simprim, XilinxCoreLib, unisims_ver, simprims_ver, XilinxCoreLib_ver
7. Open a new terminal (if reqd source modelsim and xilix xps env variables)
8. Type the following command :
compedklib -X ~/ModelSIM/modeltech/ -o ~/location_wer_u_want_them_compiled

Setting up simulation
after compiling libraries in EDK, open XPS
1. click on edit -> preferences
2. Make the EDK LIbrary point to the location where you compiled the EDK libraries
3. Make Xilinx library point to where you compiled the ISE libraries.
4. change the write permissions for /design/sys/edk/system.mhs and system.xmp to writable by user
   cd ~/OpenSPARCT1/design/sys/edk/
   chmod u+w system.xmp system.mhs
5. Open the Design and Verification guide (OpenSPARCT1/doc/OpenSPARCT1_DVguide)
6. Follow the instructions given in chapter 6.7

COMPXLIB is a tool for compiling xilinx HDL based simulation libraries with tools provided by the simulation vendors.
The libraries are compiled and put in
/home/location to Xilinx/10.1/ISE/verilog (or) vhdl

How do I compile simulation models for the EDK 10.1 design tools?

1. First make sure that "compxlib" has been run. The example below compiles all of the UniSim and SimPrim models:
compxlib -s mti_se -f virtex -l vhdl -o ~/test/xsim10libs

2. Now run "compedklib":
compedklib -X ~/test/xsim10libs -o ~/test/xsim6libs/edk_nd_libs

the compxlib runs fine but got the following errors in running the comedklib.

error while loading shared libraries: cannot open shared object file: No such file or directory
in the LD_LIBRARY_PATH environment variable include ~/location to xilinx/ISE/lib/lin
LD_LIBRARY_PATH = ~/path to edk/EDK/lib/lin:~/path to ise/ISE/lib/lin

/home/abishek/opt/Xilinx/10.1/ISE/bin/lin/unwrapped/xilperl: error while loading
shared libraries: cannot open shared object file: No such file or
ERROR:MDT - Running child process return failure status: 127!

in synaptic package manager searched for Berkeley DB Database Library Version 4.1. Got version 4.4 installed it.
create a symbolic link /usr/lib/ to /usr/lib/
sudo ln -s

Development system reference guide from xilinx

Abishek Ramdas
NYU Poly

1 comment: