-
9
pages
-
English
-
Documents
Description
HELLO WORLDc Copyright 2005 Bluespec, Inc. All Rights Reserved.December 22, 20051 IntroductionYou have just nished the Bluespec training course, and wish to do your rst design inBluespec. So you are sitting looking at a blank sheet of paper, or a blank computer screen,and wondering what on earth to write. The aim of this tutorial is to get you over this initialhurdle, and start you writing real Bluespec.The rst program which software people traditionally write in a new language is onewhich simply writes “Hello world” on the printer. Let us do the same. This means, ofcourse, that our design is not going to be intended to turn into real hardware: it is merelygoing to produce output from a simulator. In this respect it is like a top-level test program,rather than a hardware device. (We’ll have a design which produces real hardware as ournext example.)2 Version 1A Bluespec design is a collection of packages—but in this simple design there will be only1one package. So we begin by saying that we are writing a package called “FirstAttempt”;and it is good practice to add a comment explaining what it is about. So we write:package FirstAttempt;// My first design in the cool Bluespec languageendpackageThe compiler will object if the name of the package is not the same as the le it is stored in:that is, the package “FirstAttempt” must be stored in the le “ FirstAttempt.bsv”.Type that into the computer, and run the Bluespec compiler on it:bsc FirstAttempt ...
-
Publié par
-
Langue
English