Documentation ¶
Index ¶
- type BitStr
- func (bs BitStr) BitWidth() int64
- func (bs BitStr) CharWidth() int64
- func (bs BitStr) Extend(width int64) BitStr
- func (bs BitStr) IsBin() bool
- func (bs BitStr) IsHex() bool
- func (bs BitStr) IsOctal() bool
- func (bs BitStr) ToBin() BitStr
- func (bs BitStr) Uint64() uint64
- func (bs BitStr) ValueLiteral() string
- type Range
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitStr ¶
type BitStr string
BitStr (bit string) is used for representing init values. BitStr type is needed for 2 reasons:
- To support default value for registers with arbitrary width.
- To support meta logic values supported in Hardware Description Languages.
func MakeBitStr ¶
func (BitStr) CharWidth ¶
CharWidth returns character width of the bit string excluding format specifier and leading and trailing '"'.
func (BitStr) Extend ¶
Extend extends BitStr to given width and returns new BitStr. If the provided width is lesser than the current width it panics. Additional bits are added at the beginning and have value '0'. For example, extending b"1" to width 2 returns b"01".
func (BitStr) Uint64 ¶
Uint64 converts bit string to uint64. If conversion is not possible, for example because of meta values within the bit string, it panics.
func (BitStr) ValueLiteral ¶
ValueLiteral returns the internal value pattern of bit string represented as a string. For example, ValueLiteral for x"AB" returns AB, for b"1100" returns 1100.