[this]
Return type obj for this obj.
[a]
[kind]
Returns an anonymous type of the given kind. Useful to promote to jvm types.
[type expr]
Converts the given expr to the given type. If the expr is immediate, this returns the same thing as (promote type expr). If the expr is a runtime value, this returns an astfrag.
[computation state] [module-name computation state]
[module inputs]
[name type]
[compiled-module cycles]
[path trace]
Writes the trace to the file with the given name (path is a String)
[trace]
Opens the given trace in GTKWave
[compiled-module outputs]
[module cycles]
[n]
Make a new bits type object.
Takes a type and returns the number of bits needed to represent that type
[expr]
Gets the bits representation of its argument. Supports AST frags.
[type bits]
Takes a type and bits, and converts the bits to the given type.
[] [bs] [b1 b2] [b1 b2 more]
[expr low high]
Takes an expr of type bits and returns a subrange of the bits.
= is a very common function. It must be implemented explicitly (rather than using the def-binary-binop function) in order to explicitly check whether they’re both not ASTNodes, and if so to delegate to Clojure’s =. This is because not every object subject to = participates in the piplin typesystem, whereas all numbers do participate, so this isn’t an issue for >, <, <=, >=, etc.
[x] [x y] [x y more]
[] [x] [x y] [x y more]
[] [x] [x y] [x y more]
[x]
not is important to implement ;-)
[sel v1 v2]
[ more]
[pred expr clauses]
[x]
Increments x
[x]
Decrements x
[x]
Returns true if x is 0
[x]
Returns true if x is positive
[x]
Returns true if x is negative
[n]
Makes a new uintm type object with the given number of bits.
[n]
Makes a new sints type object with the given number of bits.
[width' num]
Takes an sints and a longer width and sign-extends the sints.
[i f]
Makes a new sfxpts type object with i
integer bits and f
fractional bits.
[real imag]
Makes a new complex number type with the real part having type real
and the imaginary part having type imag
. real
and imag
must support addition, subtraction, and multiplication.
[complex]
Returns the real part of a complex number.
[complex]
Returns the real part of a complex number.
[type length]
[array write-enable index v] [a we i v more]
[map key val] [map key val kvs]
associate. When applied to a map, returns a new map of the same (hashed/sorted) type, that contains the mapping of key(s) to val(s). When applied to a vector, returns a new vector that contains val at index. Note - index must be <= (count vector).
[map key] [map key not-found]
Returns the value mapped to key, not-found or nil if key not present.
[schema]
Takes a map of keys to types and returns a bundle type with that schema.
[map key val] [map key val kvs]
associate. When applied to a map, returns a new map of the same (hashed/sorted) type, that contains the mapping of key(s) to val(s). When applied to a vector, returns a new vector that contains val at index. Note - index must be <= (count vector).
[m [k ks] f args]
‘Updates’ a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created.
[map key] [map key not-found]
Returns the value mapped to key, not-found or nil if key not present.
[coll more]
Takes a collection of keywords or a map of keywords to bits and returns it as an enum type.
[schema backing-enum]
Takes a map of keywords to types and an optional enum and returns a tagged union type whose keys are elements of the given enum or the default enum of the map’s keys.
[u clauses]
Takes a union u and a clause for each key in the schema. Clauses are of the form:
(:key binding ...)
where :key is the keyword, binding is the form that the value is bound to, and … is an implicit do within a cond-like form.
You can use any destructuring syntax as the binding form.
[v]
Log base 2
[pipinst]
Takes a pipinst and makes it into an AST frag