|
std::shared_ptr< PortArray > | port_array (const std::string &name, const std::shared_ptr< Type > &type, const std::shared_ptr< Node > &size, Port::Dir dir=Port::Dir::IN, const std::shared_ptr< ClockDomain > &domain=default_domain()) |
| Get a smart pointer to a new ArrayPort.
|
|
std::shared_ptr< PortArray > | port_array (const std::shared_ptr< Port > &base_node, const std::shared_ptr< Node > &size) |
| Get a smart pointer to a new ArrayPort with a base type other than the default Port.
|
|
std::shared_ptr< SignalArray > | signal_array (const std::string &name, const std::shared_ptr< Type > &type, const std::shared_ptr< Node > &size, const std::shared_ptr< ClockDomain > &domain=default_domain()) |
| Construct a new node array and return a shared pointer to it. More...
|
|
std::shared_ptr< ClockDomain > | default_domain () |
| Return a static default clock domain.
|
|
std::optional< std::shared_ptr< ClockDomain > > | GetDomain (const Node &node) |
| Return the clock domain of a node, if it is a synchronous node.
|
|
std::shared_ptr< Edge > | Connect (Node *dst, Node *src) |
| Connect two nodes, returns the corresponding edge. More...
|
|
std::shared_ptr< Edge > | operator<<= (Node *dst, const std::shared_ptr< Node > &src) |
| Create an edge, connecting the src node to the dst node.
|
|
std::shared_ptr< Edge > | operator<<= (const std::shared_ptr< Node > &dst, const std::shared_ptr< Node > &src) |
| Create an edge, connecting the src node to the dst node.
|
|
std::shared_ptr< Edge > | operator<<= (const std::shared_ptr< Node > &dst, Node *src) |
| Create an edge, connecting the src node to the dst node.
|
|
std::vector< Edge * > | GetAllEdges (const Graph &graph) |
| Obtain all edges in a graph.
|
|
std::shared_ptr< Edge > | Connect (Node *dst, const std::shared_ptr< Node > &src) |
| Connect two nodes, returns the corresponding edge. More...
|
|
std::shared_ptr< Edge > | Connect (const std::shared_ptr< Node > &dst, Node *src) |
| Connect two nodes, returns the corresponding edge. More...
|
|
std::shared_ptr< Edge > | Connect (const std::shared_ptr< Node > &dst, const std::shared_ptr< Node > &src) |
| Connect two nodes, returns the corresponding edge. More...
|
|
Signal * | AttachSignalToNode (Component *comp, NormalNode *node, NodeMap *rebinding, std::string name="") |
| Attach a Signal to a Node, redirecting all edges through the new Signal. More...
|
|
SignalArray * | AttachSignalArrayToNodeArray (Component *comp, NodeArray *array, NodeMap *rebinding) |
| Attach a SignalArray to a Node, redirecting all edges through the new SignalArray. More...
|
|
std::shared_ptr< Edge > | Connect (Node *dst, std::string str) |
| Connect a string literal to another node. More...
|
|
std::string | ToString (Expression::Op operation) |
| Human-readable expression operator.
|
|
bool | operator< (const FlatType &a, const FlatType &b) |
| Compares two FlatTypes first by name, then by nesting level. Useful for sorting.
|
|
void | FlattenRecord (std::vector< FlatType > *list, const Record *record, const std::optional< FlatType > &parent, bool invert) |
| Flatten a Record.
|
|
void | Flatten (std::vector< FlatType > *list, Type *type, const std::optional< FlatType > &parent, const std::string &name, bool invert, bool sep=true) |
| Flatten any Type.
|
|
std::vector< FlatType > | Flatten (Type *type) |
| Flatten and return a list of FlatTypes.
|
|
std::string | ToString (std::vector< FlatType > flat_type_list) |
| Convert a list of FlatTypes to a human-readable string.
|
|
bool | ContainsFlatType (const std::vector< FlatType > &flat_types_list, const Type *type) |
| Return true if some Type is contained in a list of FlatTypes, false otherwise.
|
|
int64_t | IndexOfFlatType (const std::vector< FlatType > &flat_types_list, const Type *type) |
| Return the index of some Type in a list of FlatTypes.
|
|
void | FlattenStream (std::vector< FlatType > *list, const Stream *stream, const std::optional< FlatType > &parent, bool invert) |
| Flatten a Stream.
|
|
std::shared_ptr< Component > | component (std::string name, const std::vector< std::shared_ptr< Object >> &nodes, ComponentPool *component_pool=default_component_pool()) |
| Construct a Component with initial nodes.
|
|
std::shared_ptr< Component > | component (std::string name, ComponentPool *component_pool=default_component_pool()) |
| Construct an empty Component with only a name.
|
|
template<typename T > |
T | RawValueOf (const Literal &node) |
| Obtain the raw value of a literal node. More...
|
|
template<> |
bool | RawValueOf (const Literal &node) |
| Template specialization for RawValueOf<bool> More...
|
|
template<typename T > |
Literal::StorageType | StorageTypeOf () |
| Obtain the Literal::StorageType enum value of a C++ type T.
|
|
template<> |
Literal::StorageType | StorageTypeOf< bool > () |
| Template specialization for StorageTypeOf<bool>
|
|
template<> |
Literal::StorageType | StorageTypeOf< int64_t > () |
| Template specialization for StorageTypeOf<int>
|
|
template<> |
Literal::StorageType | StorageTypeOf< uint64_t > () |
| Template specialization for StorageTypeOf<int>
|
|
template<> |
Literal::StorageType | StorageTypeOf< std::string > () |
| Template specialization for StorageTypeOf<std::string>
|
|
Logger & | logger () |
| Return the global Cerata logger.
|
|
void | ImplicitlyRebindNodes (Graph *dst, const std::vector< Node * > &nodes, NodeMap *rebinding) |
| Make sure that the NodeMap contains all nodes to be rebound onto the destination graph.
|
|
std::string | ToString (Node::NodeID id) |
| Convert a Node ID to a human-readable string.
|
|
void | GetObjectReferences (const Object &obj, std::vector< Object * > *out) |
| Get any sub-objects that are used by an object, e.g. type generic nodes or array size nodes. More...
|
|
std::shared_ptr< Parameter > | parameter (const std::string &name, const std::shared_ptr< Type > &type, std::shared_ptr< Literal > default_value=nullptr) |
| Create a new parameter. More...
|
|
std::shared_ptr< Parameter > | parameter (const std::string &name, int default_value) |
| Create a new integer-type parameter.
|
|
std::shared_ptr< Parameter > | parameter (const std::string &name, bool default_value) |
| Create a new boolean-type parameter.
|
|
std::shared_ptr< Parameter > | parameter (const std::string &name, std::string default_value) |
| Create a new string-type parameter.
|
|
std::shared_ptr< Parameter > | parameter (const std::string &name) |
| Create a new integer-type parameter with default value 0.
|
|
TypePool * | default_type_pool () |
| Return a global default TypePool.
|
|
ComponentPool * | default_component_pool () |
| Return a global default component pool.
|
|
NodePool * | default_node_pool () |
| Return a global default node pool that can store nodes without being owned by a graph.
|
|
Literal * | rintl (int64_t i) |
| Obtain a raw pointer to an integer literal from the default node pool.
|
|
std::shared_ptr< Literal > | intl (int64_t i) |
| Obtain a shared pointer to an integer literal from the default node pool.
|
|
Literal * | rstrl (std::string str) |
| Obtain a raw pointer to a string literal from the default node pool.
|
|
std::shared_ptr< Literal > | strl (std::string str) |
| Obtain a shared pointer to a string literal from the default node pool.
|
|
std::shared_ptr< Literal > | booll (bool value) |
| Return a literal node representing a Boolean.
|
|
std::shared_ptr< Port > | port (const std::string &name, const std::shared_ptr< Type > &type, Term::Dir dir, const std::shared_ptr< ClockDomain > &domain=default_domain()) |
| Make a new port with some name, type and direction.
|
|
std::shared_ptr< Port > | port (const std::shared_ptr< Type > &type, Term::Dir dir, const std::shared_ptr< ClockDomain > &domain=default_domain()) |
| Make a new port. The name will be derived from the name of the type.
|
|
std::shared_ptr< Signal > | signal (const std::string &name, const std::shared_ptr< Type > &type, const std::shared_ptr< ClockDomain > &domain=default_domain()) |
| Create a new Signal and return a smart pointer to it.
|
|
std::shared_ptr< Signal > | signal (const std::shared_ptr< Type > &type, const std::shared_ptr< ClockDomain > &domain=default_domain()) |
| Create a new Signal and return a smart pointer to it. The Signal name is derived from the Type name.
|
|
std::shared_ptr< Stream > | stream (const std::string &name, const std::string &element_name, const std::shared_ptr< Type > &element_type, const std::vector< std::shared_ptr< Field >> &control={field(Stream::valid()), field(Stream::ready()) ->Reverse()}) |
| Construct a new Stream type and return a shared pointer to it. More...
|
|
std::shared_ptr< Stream > | stream (const std::string &element_name, const std::shared_ptr< Type > &element_type) |
| Construct a new Stream type with valid/ready bit control fields, named after the elements. More...
|
|
std::shared_ptr< Stream > | stream (const std::shared_ptr< Type > &element_type) |
| Construct a new Stream type with valid/ready bit control fields, named after the element type. More...
|
|
void | GetAllGraphs (Graph *top_graph, std::vector< Graph * > *graphs_out, bool include_components=false) |
| Get all potential child graphs of a graph. More...
|
|
void | GetAllObjects (Component *top_component, std::vector< Object * > *objects_out, bool include_instances=false) |
| Get all objects from a component. More...
|
|
void | GetAllTypes (Component *top_component, std::vector< Type * > *types_out, bool include_instances=false) |
| Get all types used in a component, including nested types. More...
|
|
std::shared_ptr< Type > | vector (const std::string &name, const std::shared_ptr< Node > &width) |
| Create a new vector type, and return a shared pointer to it.
|
|
std::shared_ptr< Type > | vector (const std::shared_ptr< Node > &width) |
| Create a new vector type, and return a shared pointer to it.
|
|
std::shared_ptr< Type > | vector (unsigned int width) |
| Create a new vector type with an integer literal as width.
|
|
std::shared_ptr< Type > | vector (std::string name, unsigned int width) |
| Create a new vector type with an integer literal as width and a custom name.
|
|
std::shared_ptr< Type > | bit (const std::string &name="bit") |
| Return a static bit type.
|
|
std::shared_ptr< Type > | boolean () |
| Return a static boolean type.
|
|
std::shared_ptr< Type > | integer () |
| Return a static integer type.
|
|
std::shared_ptr< Type > | string () |
| Return a static string type.
|
|
std::shared_ptr< Field > | field (const std::string &name, const std::shared_ptr< Type > &type, bool reverse=false, bool sep=true) |
| Create a new RecordField, and return a shared pointer to it.
|
|
std::shared_ptr< Field > | field (const std::shared_ptr< Type > &type, bool reverse=false, bool sep=true) |
| Create a new RecordField, and return a shared pointer to it. The name will be taken from the type.
|
|
std::shared_ptr< Field > | NoSep (std::shared_ptr< Field > field) |
| Convenience function to disable the separator for a record field.
|
|
std::shared_ptr< Record > | record (const std::string &name, const std::vector< std::shared_ptr< Field >> &fields) |
| Create a new Record type, and return a shared pointer to it. More...
|
|
std::shared_ptr< Record > | record (const std::string &name) |
| Create a new, empty Record type, and return a shared pointer to it. More...
|
|
std::shared_ptr< Record > | record (const std::vector< std::shared_ptr< Field >> &fields) |
| Create a new, anonymous Record type, and return a shared pointer to it. More...
|
|
std::shared_ptr< Record > | record (const std::initializer_list< std::shared_ptr< Field >> &fields) |
| Create a new, anonymous Record type, and return a shared pointer to it. More...
|
|
std::string | ToUpper (std::string str) |
| Convert string to upper-case.
|
|
std::string | ToLower (std::string str) |
| Convert string to lower-case.
|
|
std::string | ToString (const std::unordered_map< std::string, std::string > &meta) |
| Return a human-readable representation of an unordered map of string key-value pairs.
|
|
void | CreateDir (const std::string &dir_name) |
| Create a directory.
|
|
bool | FileExists (const std::string &name) |
| Check if file exists.
|
|
std::string | version () |
| Return library version.
|
|
template<typename T > |
bool | Contains (const std::vector< std::shared_ptr< T >> &list, const std::shared_ptr< T > &item) |
| Return true if vector contains item, false otherwise.
|
|
template<typename T > |
bool | Contains (const std::vector< std::weak_ptr< T >> &list, const std::weak_ptr< T > &item) |
| Return true if vector contains item, false otherwise.
|
|
template<typename T > |
bool | Contains (const std::vector< T * > &list, T *item) |
| Return true if vector contains item, false otherwise.
|
|
template<typename T > |
void | Append (std::vector< T > *list_a, const std::vector< T > &list_b) |
| Append list b to list a.
|
|
template<typename T > |
std::vector< T > | Merge (std::initializer_list< std::vector< T >> lists) |
| Merge a list of vectors into one vector.
|
|
template<typename T , typename U > |
std::vector< T > | Merge (std::initializer_list< std::unordered_map< T, U >> lists) |
| Merge a list of unordered maps into one unordered map.
|
|
template<typename T > |
bool | Remove (std::vector< std::shared_ptr< T >> *list, const std::shared_ptr< T > &item) |
| Remove an item from a vector, returning false if it was not in the vector, true otherwise. More...
|
|
template<typename T > |
std::vector< T * > | ToRawPointers (const std::vector< std::shared_ptr< T >> &list) |
| Convert a list of shared pointers to raw pointers. More...
|
|
template<typename T > |
std::vector< T * > | ToRawPointers (const std::vector< std::unique_ptr< T >> &list) |
| Convert a list of unique pointers to raw pointers. More...
|
|
template<typename T , typename U > |
std::vector< T * > | As (const std::vector< U * > &vec) |
| Cast a vector of pointers to some other type. More...
|
|
template<typename T > |
std::vector< T > | Unique (const std::vector< T > &vec) |
| Return a copy of a vector without any duplicates.
|
|
template<typename T > |
void | FilterDuplicates (std::vector< T > *vec) |
| Filter duplicate entries from a vector.
|
|
template<typename T > |
std::string | ToString () |
| Return a human-readable string from a type. More...
|
|