 |
Cerata
A library to generate structural hardware designs
|
24 #include "cerata/utils.h"
25 #include "cerata/node.h"
26 #include "cerata/array.h"
27 #include "cerata/pool.h"
77 std::shared_ptr<Edge>
Connect(
Node *dst,
const std::shared_ptr<Node> &src);
85 std::shared_ptr<Edge>
Connect(
const std::shared_ptr<Node> &dst,
Node *src);
93 std::shared_ptr<Edge>
Connect(
const std::shared_ptr<Node> &dst,
const std::shared_ptr<Node> &src);
101 std::shared_ptr<Edge>
Connect(
Node *dst, std::string str);
106 std::shared_ptr<Edge>
operator<<=(
Node *dst,
const std::shared_ptr<Node> &src);
108 std::shared_ptr<Edge>
operator<<=(
const std::shared_ptr<Node> &dst,
const std::shared_ptr<Node> &src);
110 std::shared_ptr<Edge>
operator<<=(
const std::shared_ptr<Node> &dst,
Node *src);
std::vector< Edge * > GetAllEdges(const Graph &graph)
Obtain all edges in a graph.
std::shared_ptr< Edge > operator<<=(Node *dst, const std::shared_ptr< Node > &src)
Create an edge, connecting the src node to the dst node.
An array of signal nodes.
Node * dst() const
Return the destination node.
Node * src() const
Return the source node.
A graph representing a hardware structure.
Contains every Cerata class, function, etc...
Signal * AttachSignalToNode(Component *comp, NormalNode *node, NodeMap *rebinding, std::string name)
Attach a Signal to a Node, redirecting all edges through the new Signal.
std::unordered_map< const Node *, Node * > NodeMap
A mapping from one object to another object, used in e.g. type generic rebinding.
static std::shared_ptr< Edge > Make(const std::string &name, Node *dst, Node *src)
Shorthand to get a smart pointer to an edge.
std::string name() const
Return the name of the object.
A directed edge between two nodes.
A single-input, multiple-outputs node.
Convenience structure for anything that is named. Names are case-sensitive.
Node * dst_
Destination node.
SignalArray * AttachSignalArrayToNodeArray(Component *comp, NodeArray *array, NodeMap *rebinding)
Attach a SignalArray to a Node, redirecting all edges through the new SignalArray.
Edge(std::string name, Node *dst, Node *src)
Construct a new edge.
std::optional< Node * > GetOtherNode(const Node &node) const
Get the node opposite to the other edge node.
std::shared_ptr< Edge > Connect(Node *dst, Node *src)
Connect two nodes, returns the corresponding edge.