Bit#(n) is a polymorphic data type which defines a type containing n bits. This may be the most familiar data type to Verilog users. Bit#(n) Usage
ExamplesBit#(32) a; // like 'reg [31:] a' Bit#(1) b; // like 'reg a' bit c; // same as Bit#(1) c Data Type Conversion FunctionsBluespec provides a set of functions to convert a type between Bit#(n) and other types. During type checking, the compiler resolves these functions to a particular type instance. If you have excessive type conversion in your design, it usually indicates a poor choice of the basic object types in the design, and you may want to review your type choices. These conversion utilities do not incur logic overhead. |
Learning BSV > Data Types >