]> AND Private Git Repository - blast.git/blobdiff - ReferenceBlock.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
begun integration of control ifaces
[blast.git] / ReferenceBlock.cpp
index 93f7c41c3f1a40fdb07c970bbbc169540804c681..a0a8220d297e10043a7a4d975999e4676f0419e1 100644 (file)
@@ -68,6 +68,14 @@ void ReferenceBlock::load(QDomElement &elt) throw(Exception) {
   try {
     loadInterfaces(eltInter);
   }
   try {
     loadInterfaces(eltInter);
   }
+  catch(int err) {
+    throw(err);
+  }
+
+  // create interfaces that correspond to a wishbone parameter, if any.
+  try {
+    createInterfaceForParameters();    
+  }
   catch(int err) {
     throw(err);
   }  
   catch(int err) {
     throw(err);
   }  
@@ -265,8 +273,27 @@ void ReferenceBlock::loadInterfaces(QDomElement &elt) throw(Exception) {
   }
 }
 
   }
 }
 
-void ReferenceBlock::parametersValidation(QList<AbstractBlock *> *checkedBlocks, QList<AbstractBlock *> *blocksToConfigure)
-{
+void ReferenceBlock::createInterfaceForParameters() throw(Exception){
+  ReferenceInterface* iface = NULL;
+  foreach(BlockParameter* param, params) {
+    
+    if (param->isWishboneParameter()) {
+      BlockParameterWishbone* p = (BlockParameterWishbone*)param;
+      int orientation = -1;
+      if (p->getWBAccess() == BlockParameter::Read) {
+        iface = new ReferenceInterface(this,p->getName(),p->getType(),p->getWidth(), AbstractInterface::Output, AbstractInterface::Wishbone,1);
+        outputs.append(iface);        
+      }
+      else if (p->getWBAccess() == BlockParameter::Write) {
+        iface = new ReferenceInterface(this,p->getName(),p->getType(),p->getWidth(), AbstractInterface::Input, AbstractInterface::Wishbone,1);
+        inputs.append(iface);                
+      }
+      ReferenceInterface* iface = new ReferenceInterface(this,p->getName(),p->getType(),p->getWidth(), orientation, AbstractInterface::Wishbone,1);
+    }
+  }
+}
+
+void ReferenceBlock::parametersValidation(QList<AbstractBlock *> *checkedBlocks, QList<AbstractBlock *> *blocksToConfigure) {
     return;
 }
 
     return;
 }