You're reading an pre-release version of this documentation.
For the latest stable release version, please have a look at master.

Data types

The language provides 5 base types, and 2 composite types that can be used.

../../_images/types.svg

In addition to the base types, Spinal has support under development for:

Additionally, if you want to assign a don’t care value to some hardware, for instance, to provide a default value, you can use the assignDontCare API to do so.

val myBits  = Bits(8 bits)
myBits.assignDontCare() // Will assign all the bits to 'x'

Finally, a special type is available for checking equality between a BitVector and a bit constant pattern that contains holes defined like a bitmask (bit positions not to be compared by the equality expression).

Here is an example to show how you can achieve this (note the use of ‘M’ prefix) :

val myBits  = Bits(8 bits)
val itMatch = myBits === M"00--10--" // - for don't care value