Bluespec SystemVerilog (BSV) is different from Bluespec Haskell (BH). But both are implementations of Bluespec.
One rule at a time.
Higher abstraction level.
proviso: something related to type classes
Empty
: the (predefined) empty interface<-
<=
=
Define like:
'define <macroname> <macrobody>
and use like:
'<macroname>
(Or is it backtick ??)
Textual replacement, I guess.
SystemVerilog has this as wellʳ.
One of the following syntaxes:
.bsv
extension is apprently needed.'include "filename"
'include <filename>
Method type | Description |
---|---|
Value |
Can accept values (ie, read in) |
Action |
Can give out values |
ActionValue |
Can read and write values |
tuple2
) to 7-tuple (tuple7
) availabletpl_1
(like fst
in sml), tpl_2
(like snd
in sml), …, tpl_7
.Tuple<n>
, constructors are tuple(...)
// 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
Usual functional programming style functions available. Some standard libraries may need to be imported for some of them to be used.
-g
: specify top-level module name-e
: specify top-level when linking-u
: specify dependency packages-show-schedule
: show generated schedule-sched-dot
: generate dot file showing the way rules were scheduled.
-info-dir
to specify directory to which this dot file should be placed.<module>_conflict.dot
<module>_exec.dot
(execution order)<module>_urgency.dot
<module>_combined.dot
<module>_combined_full.dot
?
: 'a special don't care value'((s == 0) ? a : b)
begin
and end
can be used to demarcarte code blocks. Like {
and }
in C..bs
: extension of BSH files (Haskell-like)
Action
: 'an expression intended to act on the state of the circuit'Integer
is unsynthesizable, but is often used for loops because the loop would be unrolled in the elaboration phase anyway.valueOf
and valueof
are equivalent.$finish (0);
to end a simulation instead of letting it loop forever.scan
family of functions applies a function over a list, creating a new List result. The scan function is similar to fold, but the intermediate results are saved and returned in a list, instead of returning just the last result.' ʳ
scanl: (a -> b -> a) -> a -> [b] -> [a]
pack
and unpack
are available if value's type belongs to the Bit
typeclass.
pack
: convert to Bit#()
formunpack
: convert from Bit#()
form-g
flag.
(* synthesize *)module mkFoo (FooIfc);
...endmodule
Type | Example |
---|---|
Bit#(3) | 3'b101 |
3'h05 |
Papers: