Computer Laboratory

Course material 2010–11

P35: Tool Set-Up Info

These tools are provided for you to use but also please feel free to use any other computers or tools that you have to hand (such as a free copy of Modelsim on your own laptop or a version of SystemC that you have compiled for yourself).

Verilog or VHDL Modelsim

Setup (using bash):

   export PATH=$PATH:/usr/groups/ecad/mentor/modelsim/modelsimSE6.5c/modeltech/bin
   export LM_LICENSE_FILE=/usr/groups/ecad/licenses/mentor-license.dat

Documentation : See /usr/groups/ecad/mentor/modelsim/modelsimSE6.5c/modeltech/docs

The following should run something:

        rm -rf simple_lib; vlib simple_lib
        echo "module TEST(); initial \$display(\"Hello World\"); endmodule"  > test.v
        echo "run -all;exit" >
        vmap simple_lib simple_lib
        vlog -work simple_lib test.v
        vsim -c simple_lib.TEST -do "" 

The above works by first deleting any old library, then creating a new one, called simple_lib and then creating a component called TEST and putting in the library and then reading it out and running it.

For those interested in using modelsim extensively, you should learn how to open the GUI and view the waveforms, otherwise just use Verilog's $display statement for simple output.

For VHDL: Use vcom instead of vlog if you prefer to use VHDL.

     vcom -work simple_lib ...vhdl

For SystemC

Setup (using bash):

  export SYSCDIR=/usr/groups/han/clteach/systemc/systemc-2.2.0
  export ARCH=x86_64

You can use one of the pre-built SystemC distributions I have provided or download and compile your own from The ARCH variable must match the machine you are running on. If this variable is not already set for you then use the linux 'arch' command to find out how to set it. I have made two or more binary versions of SystemC but we can add others.

The first, get-you-started example is here:

If you unzip this and type 'make' it should run something.

Note: this filesystem is automounted and it cannot initially be seen until you 'cd' to it or open the 'file:/usr/groups/han/clteach' url in firefox, or similar.

Note: please understand the operation of the following gcc flags:

    -c             (generate a .o file but do not link)
    -I/some/where  (look for #included files in /some/where)             
    -lxxx          (look for libxxx.a and include for linking)
    -L/some/where  (look in /some/where for -l includes)


Verilog change dump files (.vcd) can be generated using SystemC or Modelsim. They may be viewed with the gtkwave program.

Open Risc 1K reference btlm system

You can copy the material you need from DJG's working copy or you can check out from CVS and build your own.

If you copy DJG's working copy, make sure you also copy the CVS folder from each folder in to your tree and then you can still do a CVS update to get updates. However, you may need to manually edit the Root file in each CVS folder so that it refers to if you do not have the computer laboratory file system mounted (i.e. you are on a private laptop).

To make your own copy use

  $ mkdir mycopy; cd mycopy
  $ cp -ra /usr/groups/han/clteach/orpsoc/setup mycopy
  $ cp -ra /usr/groups/han/clteach/orpsoc/sw mycopy
  $ cp -ra /usr/groups/han/clteach/orpsoc/btlm-ref-design mycopy
  $ ... and so on - you will need some more most likely

To check out from CVS use (-d only needs mentioning the first time)

  $ mkdir mycopy; cd mycopy
  $ cvs -d /usr/groups/han/cvs checkout orpsoc/sw
  $ ... and so on - you will need some more most likely

If ssh is working from a remote machine then please change the argument to -d to '' and over-the-network opreation is enabled. You must change crsid to your user id, or leave it out if the user id is the same on both sides.

The '.setup' file sets up useful environment variables.

The main folder to start with is btlm-ref-design and this should run the hello and mixbug ELF binaries generated in the adjacent 'sw' folder.

Collaborative Work

Please check you have write access to /usr/groups/acs-projectwork/year1011/p35/

© David Greaves 2011.