Course pages 2015–16
Advanced Computer Design
This walk-through is for the Bluespec tools installed on Computer Laboratory machines. See the bottom of this page for information on using the tools on the MCS Linux machines that are managed by Computing Service.
- Bluespec documentation:
see: /usr/groups/ecad/bluespec/current/doc/BSV/ - reference.pdf - BSV_ref_card.pdf - Bluespec by Example bookAlso see the official [http://sites.google.com/a/bluespec.com/learning-bluespec/ Bluespec Wiki]
- Initialise paths to the tools:
- If you like to use xemacs to edit your code then you might like to add the following to your
~/.xemacs/init.elto get syntax highlighting, etc.
(setq load-path (cons (expand-file-name "/usr/groups/ecad/bluespec/current/util/emacs") load-path))
- If you prefer emacs to edit your code then you might like to add the following to your
~/.emacs.d/init.elto get syntax highlighting, etc.
(setq load-path (cons (expand-file-name "/usr/groups/ecad/bluespec/current/util/emacs") load-path)) (autoload 'bsv-mode "bsv-mode" "BSV mode" t ) (setq auto-mode-alist (cons '("\\.bsv\\'" . bsv-mode) auto-mode-alist))
- Create your first Bluespec program in a new directory and call it HelloWorld.bsv (note the case):
module mkHelloWorld(Empty); Reg#(UInt#(4)) counter <- mkReg(10); rule loop (counter!=0); counter <= counter-1; $display("%05t: Hello World - loop counter = %d",$time,counter); endrule rule mark_ending (counter==0); $display("The End at time %05t",$time); $finish(); endrule endmodule
- Create yourself a makefile using Bluespec's script:
makemakefile HelloWorld.bsv mkHelloWorldN.B. type "makemakefile" to see the options for this script.
- Run the simulation using:
- You might also like to try some Fibonacci function generation examples: FibSimple
Bluespec on MCS Linux machines
On MCS Linux (not Windows machines), Bluespec is installed in:
To initialise environment variables including extending your PATH so that you can use the tools, enter the following at the command line:
I hope that at this point you can follow the instructions, above but instead of looking in /usr/groups/ecad look in $CLTEACH/swm11.
I'll aim to put a copy of the ACS examples, etc., in $CLTEACH/swm11/ACS-ACD
You can get remote access, e.g. using ssh (secure shell) logging into linux.pwf.cam.ac.uk