Bluespec SystemVerilog


Bluespec SystemVerilog (BSV) is different from Bluespec Haskell (BH). But both are implementations of Bluespec.

Interfaces

Assignment operations

Macros

Define like:

'define <macroname> <macrobody>

and use like:

'<macroname>

(Or is it backtick ??)

Textual replacement, I guess.

SystemVerilog has this as wellʳ.

Include external files

One of the following syntaxes:

'include "filename"
'include <filename>

Methods

Method type Description
Value Can accept values (ie, read in)
Action Can give out values
ActionValue Can read and write values

Tuples

// Type of tuple of 2 Bit values
typedef Tuple2 #(Bit #(1), Bit #(1)) B2;

// A value of B2 type
B2 ab = tuple2(1'b1, 1'b0);

Values of a tuple can also be taken out with pattern matching:

Tuple3#(int, bool, int) ibi = tuple3(0, true, 1);

case (ibi) matches
  {.a, .b, .c} : (b ? a : c)
endcase

Useful functions

Usual functional programming style functions available. Some standard libraries may need to be imported for some of them to be used.

Compiling

Misc

(* synthesize *)
module mkFoo (FooIfc);
...
endmodule
Type Example
Bit#(3) 3'b101
3'h05

Papers: