CS220: Introduction to Computer Organization

Running Bluespec System Verilog (BSV)
Amey Karkare August 2011

Contents
1 SETUP 2 CHECKING THE SETUP 3 LICENSING 3.1 Starting the license server . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 RUNNING BSV TOOLS 5 COMMON ERRORS 6 About the Document 1 1 2 2 3 4 5

1

SETUP

The Bluespec package is installed on all systems in the ground floor lab of CSE dept. The package is installed in /opt, so you have to add the following lines to your .bashrc file (assuming you use the default bash shell): export export export export BLUESPEC_HOME=/opt/Bluespec-2011.06.D BLUESPECDIR=${BLUESPEC_HOME}lib PATH=$PATH:${BLUESPEC_HOME}/bin LM_LICENSE_FILE=27000@cse6.cse.iitk.ac.in

1

The license server will be accessible only from the IITK network.) to access the tool.out Comparing result of Bluespec Simulation Some simulator specific difference expected diff mkFibOne. Because our designs are going to be small.out.bsv Verilog file created: mkFibOne.expected smoke_test. follow these steps: 2 . We have total 10 licenses for Bluespec tools. then user should see the following output: -------------------------------------------------------------Checking Verilog generation bsc -verilog -keep-fires -cross-info -no-inline-reg FibOne.1 Starting the license server If there is problem with checking out the licenses. You can use remote login (ssh. putty etc. Remember that we have got the licenses for free for academic purpose only.cse.iitk.in.v Checking Verilog simulation bsc -vsim iverilog -e mkFibOne -o mkFibOne_v mkFibOne.out Bluespec installation looks OK -------------------------------------------------------------- 3 LICENSING The license server for running bluespec tools on IITK servers is: 27000@cse6. at most 10 people can run the tool simulataneously. 3.v Verilog binary file created: mkFibOne_v . You will have to use machines in the ground floor lab in the CSE department to use the Bluespec tools. Any usage beyond the coursework will require explicit permissions from Bluespec company.06. this will be sufficient for the purpose of the course.2 CHECKING THE SETUP The steps to check proper installation is : # Copy Smoke test to home directory cp -r /opt/Bluespec-2011./mkFibOne_v > smoke_test.ac.D/training/BSV/lab/ssmoke_test/ ~ cd ~/smoke_test && make smoke_test If everything is fine. This means.

ask someone who has login on cse6 to do it. or the -g flag at compile time.in is down. For this course. 4 RUNNING BSV TOOLS Consult the user guide located at ${BLUESPEC_HOME}/doc/user-guide. 2./lic_manager.bsv When compiling to code generation a module must be specified.ac. with the error message you are getting. multiple modules can be specified for code generation at the same time. From the command line. Some common flages are: -g module -u -sim -verilog -e module -o name generate code for module (requires -sim or -verilog) check and recompile packages that are not up to date compile BSV generating Bluesim object compile BSV generating Verilog file top-level module for simulation name of generated executable Use bsc -help to list all flags.bsv 3 .bsv where Foo. For example: bsc -verilog -g mkFoo -g mkBaz Foo.pdf to use bluespec tools.. Do the following: cd /users/faculty/karkare/BlueSpec/flexlm/iitk .sh start 3. use: bsc -verilog Foo. The rest of this section is borrowed from the user-guide.1. To compile through code generation. Once cse6 is up.iitk. using either the synthesize attribute in the BSV code. If it is down. A BSV source file is compiled with a command like this: bsc [options] Foo. In case you do not have login on cse6. the compile stops after the type checking phase. we will be generating Verilog code only. If this does not solve the issue. please mail karkare@cse. you must provide a flag indicating whether the target is Bluesim (-sim) or Verilog (-verilog). to compile to code generation for Verilog. goto the next step. and describes the compilation process in brief.bsv is the top file in the design. You should be able to check out the licenses now. Login to cse6 with you username and password. ask some system administrator to boot it. If no flags are provided. Check if cse6.. For example.

expected interface type Reason: The name of interface does not start with uppercase letter. $finish. Please contribute to this list. with a small design/testcase that shows the problem. They may not work for some similar problem of yours. In this case. When linking you must specify the top-level module with the -e flag. • Unexpected identifier ‘‘divIfc’’.. • Either an Action/ActionValue statement was used in a module block or else a module instantiation was used in an Action/ActionValue block. and suggest possible fixes. the fixes suggested here are just guidelines. please mail me the detailed description of the problem. I will keep updating the list as I come across errors. line 24.endrule block. but used its method foo twice. Further. If you find fix for some problem that most of your friends are facing.foo 32’d128 32’d64’ at "Top.foo’ needs more than 1 ports for the following uses: ‘xyz. let me know the problem and the fix. For example. use ‘‘DivIfc’’. Possible Fix: Enclose the actions inside rule .foo 32’d128 32’d0’ at "Top. Reason: An Action/ActionValue method ($display. I have enumerated some of the commong mistakes made by the BSV users. 4 .. column 12 ‘xyz.. some user defined method) is used outside rule . You must also specify the back end with either the -sim or -verilog flag. Possible Fix: Remove (*synthesize*) directive. This list is by no means exhaustive. The name following the flag must be the name of a BSV module and only one module can be specified. column 12 Reason: Probably you have used (*synthesize*) directive for module xyz. Possible Fix: Uppercase the interface name. OR create more instances of xyz. to link for Verilog: bsc -verilog -e mkFoo We use iverilog Verilog simulator for simulating the generated design.endrule. I will add it to the list. 5 COMMON ERRORS In this section.bsv".Linking requires a second call to the bsc compiler. line 24.bsv". and then instantiated it only once. • ‘xyz.. In such case.

6 About the Document August 2011 Initial Draft 5 .