27-11-2010, 10:33 AM
The Elevator Lab
This lab will lead you through slightly more advanced topics of the Bluespec System Verilog language and the usage of the Bluespec compiler, Bluesim simulator and the Bluespec development workstation. In each part you will find a description of the actual code you will have to generate and how to use and invoke each of the previously mentioned tools.
Note 1: The directory $BLUESPECDIR/../doc/BSV contains very useful documentation that includes the Language Reference Guide, User Guide, Known Problems and Solutions and Style Guide among others.
In the BLUESPECDIR/../training/BSV/examples directory you will find some useful examples for future reference.
The full set of training materials, documentation, and examples can be accessed from the file $BLUESPECDIR/index.html.
Note 2: you might want to run simulations of the generated Verilog code using your favorite Verilog simulator.
bsc e <topName> vsim
<simulator> <verilogFile>
You provide the name of the simulator after the vsim option. Currently the natively supported simulors are: vcs, vcsi, ncverilog, modelsim, cver, iverilog, and veriwell.
In this lab we will focus in the CABIN SYSTEM, which comprises the CABIN CONTROL module and the KEYBOARD CONTROL module, grayed parts in the figure. The CABIN SYSTEM interfaces to the external NEXTFLOOR CONTROL, MOTOR, KEYBOARD and SENSORS modules which will be actually part of out testbenches.
CABIN SYSTEM Interfaces explanation: KEYBOARD
interface:
• pressedButtons is a bus whose width is the number of floors in the building. Each line in the bus indicates if the correspondent button has been pressed in the cabin's keyboard. Each bit in the button bus is sticky, i.e. once is set, it will remain in this state until it is reset by the corresponding resetButtons signal.
• resetButtons is a bus whose width is the number of floors in the building. Each line in the bus indicates if the correspondent button has to be reset in the cabin's keyboard
CABIN
CONTROL to KEYBOARD CONTROL interface
• reachedFloor is a bus that indicates the reached floor. Its width is the minimum needed to index all the floors in the building. This signal is used by the KEYBOARD CONTROL to generate the resetButtons signal
For more information about this article,please follow the link:
http://bluespecforum/download.php?id=25