Binders¶
Verilisp’s main binding form is let. This behaves as it does in
Lisp, but also accepts additional keyword arguments in each assignment
clause the help code generation.
Example¶
(let ((a 12 :type (unsigned-byte 8) :as :register))
(setq a 34))
defines a let block that bring a variable a into scope in its
body. a is defined to have a type (unsigned-byte 8) (8-bit
unsigned), and will be represented as a register.
Keyword arguments¶
:typetypeSpecifies the Lisp type for the variable. This is closely related to the width: width defines the representation in terms of bits, while type defines the interpretation of those bits.
:widthbitsShortcut for
:type (unsigned-byte *bits*).:asrepresentationSpecifies how the variable is represented. Options include
:registerfor a register,:wirefor wires, and:constantfor constants.
Note
Verilisp also has Representation-specific binders to save entering representations for all variables.