 |
Cerata
A library to generate structural hardware designs
|
15 #include "cerata/vhdl/resolve.h"
20 #include <unordered_map>
22 #include "cerata/logging.h"
23 #include "cerata/type.h"
24 #include "cerata/graph.h"
25 #include "cerata/edge.h"
26 #include "cerata/vhdl/vhdl_types.h"
27 #include "cerata/vhdl/vhdl.h"
31 static int ResolvePorts(Component *comp, Instance *inst,
NodeMap *rebinding) {
33 auto ports = inst->GetAll<Port>();
34 for (
const auto &
port : ports) {
35 if (
port->type()->meta.count(meta::NO_INSERT_SIGNAL) == 0) {
39 CERATA_LOG(DEBUG,
"Skipping signal insertion for port " +
port->name());
52 static int ResolvePortArrays(Component *comp, Instance *inst,
NodeMap *rebinding) {
58 for (
const auto &pa : inst->GetAll<PortArray>()) {
59 if (pa->type()->meta.count(meta::NO_INSERT_SIGNAL) == 0) {
63 CERATA_LOG(DEBUG,
"Skipping signal insertion for port " + pa->name());
73 for (
const auto &inst : children) {
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.
std::vector< Instance * > children() const
Returns all Instance graphs from this Component.
SignalArray * AttachSignalArrayToNodeArray(Component *comp, NodeArray *array, NodeMap *rebinding)
Attach a SignalArray to a Node, redirecting all edges through the new SignalArray.
NodeMap * inst_to_comp_map()
Return the component node to instance node mapping.
static Component * SignalizePorts(Component *comp)
Transforms the component, inserting signals for every instance port.
std::shared_ptr< Port > port(const std::string &name, const std::shared_ptr< Type > &type, Term::Dir dir, const std::shared_ptr< ClockDomain > &domain)
Make a new port with some name, type and direction.
Contains everything related to the VHDL back-end.