+ int i;
+
+ out << "architecture rtl of " << name << " is " << endl << endl;
+
+ // generate the components
+ foreach(AbstractBlock* block, blocks) {
+ try {
+ block->generateComponent(out,false);
+ }
+ catch(Exception e) {
+ throw(e);
+ }
+ }
+
+ out << endl;
+ // generate signals
+ out << " ----------------------------" << endl;
+ out << " SIGNALS" << endl;
+ out << " ----------------------------" << endl << endl;
+
+ out << " -- signals from input ports of " << name << endl;
+ QList<AbstractInterface*> listInputs = getInputs();
+ foreach(AbstractInterface* iface, listInputs) {
+ if ((iface->getPurpose() == AbstractInterface::Data)||(iface->getPurpose() == AbstractInterface::Control)) {
+ ConnectedInterface* connIface = AI_TO_CON(iface);
+ QString prefixName = name+"_"+iface->getName()+"_TO_";
+ foreach(ConnectedInterface* toIface, connIface->getConnectedTo()) {
+ QString sigName = prefixName+toIface->getOwner()->getName()+"_"+toIface->getName();
+ out << " signal " << sigName << " : " << iface->toVHDL(AbstractInterface::Signal,0) << endl;
+ }
+ }
+ }
+ out << endl;
+ foreach(AbstractBlock* block, blocks) {
+ try {
+ out << " -- signals from output ports of " << block->getName() << endl;
+ QList<AbstractInterface*> listOutputs = block->getOutputs();
+ foreach(AbstractInterface* iface, listOutputs) {
+ if ((iface->getPurpose() == AbstractInterface::Data)||(iface->getPurpose() == AbstractInterface::Control)) {
+ ConnectedInterface* connIface = AI_TO_CON(iface);
+ QString prefixName = block->getName()+"_"+iface->getName()+"_TO_";
+ foreach(ConnectedInterface* toIface, connIface->getConnectedTo()) {
+ QString sigName = prefixName+toIface->getOwner()->getName()+"_"+toIface->getName();
+ out << " signal " << sigName << " : " << iface->toVHDL(AbstractInterface::Signal,0) << endl;
+ }
+ }
+ }
+ }
+ catch(Exception e) {
+ throw(e);
+ }
+ out << endl;
+ }
+
+
+ out << "end architecture rtl;" << endl;