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

Private GIT Repository
finalized analysis with clkconvert + started testbench gen.
authorstephane Domas <stephane.domas@univ-fcomte.fr>
Wed, 9 May 2018 16:22:16 +0000 (18:22 +0200)
committerstephane Domas <stephane.domas@univ-fcomte.fr>
Wed, 9 May 2018 16:22:16 +0000 (18:22 +0200)
22 files changed:
AbstractBoxItem.cpp
AbstractBoxItem.h
BlockLibraryWidget.cpp
BoxItem.cpp
ConnectionItem.h
Dispatcher.cpp
FunctionalBlock.cpp
Graph.cpp
Graph.h
GroupBlock.cpp
GroupItem.cpp
GroupScene.cpp
InterfaceItem.cpp
InterfaceItem.h
Makefile-isim [new file with mode: 0644]
Parameters.cpp
SpecialBlock.cpp
StimuliItem.cpp
blast.creator.user
blastconfig.xml
blastconfig.xsd
projectfile.xsd

index 7912813f425f7b7a4d0bbd9d648c189a51092683..0a820554711e7a4aab27f35c9406bdcc01ff04de 100644 (file)
@@ -41,6 +41,7 @@ AbstractBoxItem::AbstractBoxItem(AbstractBlock *_refBlock, Dispatcher *_dispatch
 
   selected = false;
   currentInterface = NULL;
+  visible = true;
   rstClkVisible = false;
   wishboneVisible = false;
 
@@ -71,6 +72,7 @@ AbstractBoxItem::AbstractBoxItem(Dispatcher *_dispatcher, Parameters *_params, i
 
   selected = false;
   currentInterface = NULL;
+  visible = true;
   rstClkVisible = false;
   wishboneVisible = false;
   
index d0965cf4fa729e33990c2d7e6df15ffe170cd146..e028728f05c0af97156de53ebce686d2ca62f7d7 100644 (file)
@@ -57,6 +57,7 @@ public:
   void setRefBlock(AbstractBlock* _refBlock);
   inline void setId(int _id){ id = _id; }
   inline void setSelected(bool _selected) { selected = _selected; }  
+  inline void setVisible(bool state) { visible = state; }
   void setRstClkVisible(bool b);
   void setWishboneVisible(bool b);
   void setDimension(int x, int y);
@@ -77,6 +78,7 @@ public:
   virtual bool isBoxItem();
   virtual bool isGroupItem();
   virtual bool isStimuliItem();
+  inline bool isVisible() { return visible; }
   inline bool isSelected() { return selected; }
   inline bool isRstClkVisible(){ return rstClkVisible;}
   inline bool isWishboneVisible(){ return wishboneVisible;}
@@ -150,6 +152,7 @@ protected:
 
   int lock;
   bool selected;
+  bool visible; //! true if the box is shown
   bool rstClkVisible; //! true if clock/reset interfaces are visible
   bool wishboneVisible; //! true if wishbone interfaces are visible
 
index 32012c552c67f697da54517a5fc7ec097e28ac27..47fd87573c594e9d96bf5c26ed2e956452ea1c53 100644 (file)
@@ -136,7 +136,7 @@ void BlockLibraryWidget::addClicked() {
     cout << "adding block to scene " << v.toInt() << endl;
 
     QHash<QString, int> clkRstToGen;
-    for(int i=1;i<nbClock+nbRst;i++) {
+    for(int i=1;i<=nbClock+nbRst;i++) {
       QLayoutItem* item = layClkRst->itemAtPosition(i,0);
       QLabel* lab = (QLabel *)(item->widget());
       item = layClkRst->itemAtPosition(i,1);
index 783716c76b6b7b367b8a864808f65dc49bce729f..f3bc8eb554ec930df8b72d9a4ec5a58361fb352b 100644 (file)
@@ -207,6 +207,9 @@ BoxItem::~BoxItem() {
 }
 
 void BoxItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
+
+  if (!visible) return;
+
   QPen pen(Qt::black, 3);
   if(selected)
     pen.setColor(Qt::red);
@@ -1064,7 +1067,7 @@ void BoxItem::save(QXmlStreamWriter &writer) {
 
       writer.writeAttribute("id",QString::number(inter->getId()));
       writer.writeAttribute("name",inter->getName());
-      writer.writeAttribute("ref_name",inter->refInter->getName());
+      writer.writeAttribute("ref_name",inter->getReferenceName());
       writer.writeAttribute("orientation",inter->getStrOrientation());
       writer.writeAttribute("position",QString::number(inter->getPositionRatio()));
 
index 13bf8a79f409a4627809288b85014cd1f4ff3386..c4852c8be3dd617730ff3ebe23422fa576fcf3f9 100644 (file)
@@ -66,6 +66,7 @@ public:
   
   // testers
   inline bool isSelected() { return selected; }
+  inline bool isVisible() { return visible; }
   
   // others
   void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
index e1857c326c27322dcbf0a915c0b83bf215916a53..266160b12b4eba2a89824487e44f911c00095eec 100644 (file)
@@ -118,15 +118,16 @@ bool Dispatcher::createConnection(Context context, InterfaceItem *iface1, Interf
     ref2->connectTo(ref1);    
     ok2 = true;
   }
-  if ((ok1 == true) || (ok2 == true)) {
-
-    cout << "trying to create a connection from " << qPrintable(ref1->getOwner()->getName()) << "/" << qPrintable(ref1->getName());
-    cout << " to " << qPrintable(ref2->getOwner()->getName()) << "/" << qPrintable(ref2->getName());
+  if ((ok1 == true) || (ok2 == true)) {    
 
     if (ok1) {
+      cout << "trying to create a connection from " << qPrintable(ref1->getOwner()->getName()) << "/" << qPrintable(ref1->getName());
+      cout << " to " << qPrintable(ref2->getOwner()->getName()) << "/" << qPrintable(ref2->getName());
       iface1->getOwner()->getScene()->createConnectionItem(iface1,iface2, visible);
     }
     else {
+      cout << "trying to create a connection from " << qPrintable(ref2->getOwner()->getName()) << "/" << qPrintable(ref2->getName());
+      cout << " to " << qPrintable(ref1->getOwner()->getName()) << "/" << qPrintable(ref1->getName());
       iface2->getOwner()->getScene()->createConnectionItem(iface2,iface1, visible);
     }
 
@@ -223,10 +224,10 @@ void Dispatcher::generateVHDL(Context context) throw(Exception) {
     make.copy(dest);
   }
 
-  // copying external resources
+  // generate VHDL + copying external resources
   QString dest = params->projectPath;
-  dest += "/src/";
-  try {
+  dest += "/src/";  
+  try {    
     params->getGraph()->generateVHDL(dest);
 
     QList<QString> extResources = params->getGraph()->getExternalResources();
@@ -245,6 +246,17 @@ void Dispatcher::generateVHDL(Context context) throw(Exception) {
   catch(Exception e) {
     throw(e);
   }
+  // generate testbench
+  dest = params->projectPath;
+  dest += "/testbench/";
+  dest += params->projectName;
+  dest += "_tb.vhd";
+  try {
+    params->getGraph()->generateTestbench(params->projectName, dest);
+  }
+  catch(Exception e) {
+    throw(e);
+  }
 
   // creating parameters file
   QString paramName = params->projectPath+"/params-isim.txt";
@@ -273,8 +285,7 @@ void Dispatcher::generateVHDL(Context context) throw(Exception) {
   }
   out << endl;
   out << "VL_SRC := ${XILINX}/verilog/src/glbl.v" << endl << endl;
-  out << "TB_SRC := $(TB_DIR)/read_csv.vhd \\" << endl;
-  out << "\t$(TB_DIR)/$(PROJECT_NAME)_tb.vhd" << endl << endl;
+  out << "TB_SRC := $(TB_DIR)/$(PROJECT_NAME)_tb.vhd" << endl << endl;
   out << "SIMU_EXE := $(PROJECT_NAME)_tb" << endl << endl;
 
   paramFile.close();
@@ -759,13 +770,16 @@ GroupWidget *Dispatcher::createTopScene(Context context, double mainClock){
   cout << "call to " << qPrintable(fctName) << endl;
 #endif
 
-  bool createIfaces = true;
-  if (context == Load) {
-    createIfaces = false;
-  }
+  Graph* graph = NULL;
   // creating the graph and thus, the topgroup
-  Graph* graph = params->initGraph(createIfaces);
-  graph->addClock(mainClock);
+  if (context == Design) {
+    graph = params->initGraph(true);
+    graph->addClock(mainClock);
+  }
+  else if (context == Load) {
+    graph = params->initGraph(false);
+  }
+
   // get the top group
   GroupBlock *topBlock = graph->getTopGroup();
   // creating the top group widget
index 0eb4036a2be16f5ebb59fe2f0dd7bf4f465719ca..89250ec32f2f8c14aa677451d395b7ccf9443596 100644 (file)
@@ -668,6 +668,7 @@ void FunctionalBlock::createInputPattern()  throw(Exception) {
   cout << "call to " << qPrintable(fctName) << endl;\r
 #endif\r
   \r
+  cout << "creating input pattern" << endl;\r
   lengthIP = -1;\r
   foreach(AbstractInterface* iface, getControlInputs()) {\r
 \r
index 808dbda2f18486c8e247651e4290cea3fdebd109..d0c11cc30907263705db2dc8521183dab7d9ea35 100644 (file)
--- a/Graph.cpp
+++ b/Graph.cpp
@@ -46,7 +46,7 @@ GroupBlock* Graph::getGroupBlockByName(QString name) {
 FunctionalBlock* Graph::createFunctionalBlock(GroupBlock* group, ReferenceBlock* ref, bool createIfaces) {
 
   FunctionalBlock* newBlock = NULL;
-  if (ref->getSpecialType() != -1) {
+  if (ref->getSpecialType() != SpecialBlock::NotSpecial) {
     cout << "Graph: create special block from " << qPrintable(ref->getName()) << endl;
     newBlock = new SpecialBlock(this, ref->getSpecialType(), group,ref, createIfaces);
   }
@@ -206,6 +206,18 @@ void Graph::computeOutputPatterns(int nbExec) throw(Exception) {
 }
 
 void Graph::generateVHDL(const QString &path) throw(Exception) {
+  // generating VHDL for stimulis
+  cout << "generating stimulis" << endl;
+  try {
+    foreach(FunctionalBlock* stimuli, stimulis) {
+      stimuli->generateVHDL(path);
+    }
+  }
+  catch(Exception e) {
+    throw(e);
+  }
+  // generating VHDL for top group
+  cout << "generating top group" << endl;
   try {
     topGroup->generateVHDL(path);
   }
@@ -214,6 +226,72 @@ void Graph::generateVHDL(const QString &path) throw(Exception) {
   }
 }
 
+void Graph::generateTestbench(const QString &projectName, const QString &benchFile) throw(Exception) {
+
+
+  QFile vhdlBench(benchFile);
+
+  if (!vhdlBench.open(QIODevice::WriteOnly)) {
+    throw(Exception(VHDLFILE_NOACCESS));
+  }
+
+  cout << "generate testbench" << endl;
+  QTextStream out(&vhdlBench);
+
+  out << "-------------------------------------------------------------------------------" << endl;
+  out << "-- testbench for " << projectName << endl;
+  out << "-------------------------------------------------------------------------------" << endl << endl;
+  out << "-------------------------------------------------------------------------------" << endl;
+  out << "-- clock generator" << endl;
+  out << "-------------------------------------------------------------------------------" << endl << endl;
+
+  out << "library IEEE;" << endl;
+  out << "use IEEE.STD_LOGIC_1164.all;" << endl;
+  out << "use IEEE.numeric_std.all;" << endl;
+  out << "entity clock_gen is" << endl;
+  out << "  generic (" << endl;
+  out << "    Tps : time                          -- high level width : must be < period" << endl;
+  out << "    );" << endl;
+  out << "  port (" << endl;
+  out << "    phase : out std_logic" << endl;
+  out << "    );" << endl;
+  out << "end entity clock_gen;"  << endl<< endl;
+
+  out << "architecture clock_gen_1 of clock_gen is" << endl;
+  out << "  constant period : time := 2*Tps;" << endl;
+  out << "begin" << endl;
+  out << "  clock_process : process" << endl;
+  out << "  begin" << endl;
+  out << "    phase <= '1', '0' after Tps;" << endl;
+  out << "    wait for period;" << endl;
+  out << "  end process clock_process;" << endl;
+  out << "end architecture clock_gen_1;" << endl << endl;
+
+  out << "-------------------------------------------------------------------------------" << endl;
+  out << "-- testbench" << endl;
+  out << "-------------------------------------------------------------------------------" << endl << endl;
+  out << "library IEEE;" << endl;
+  out << "use IEEE.STD_LOGIC_1164.all;" << endl;
+  out << "use IEEE.numeric_std.all;" << endl;
+  out << "entity " << projectName << "_tb is" << endl;
+  out << "end entity " << projectName << "_tb;" << endl << endl;
+  out << "architecture " << projectName << "_tb_1 of " << projectName << "_tb is" << endl << endl;
+
+  out << "  component clock_gen" << endl;
+  out << "    generic (" << endl;
+  out << "      Tps : time" << endl;
+  out << "      );" << endl;
+  out << "    port (" << endl;
+  out << "      phase : out std_logic" << endl;
+  out << "      );" << endl;
+  out << "  end component;" << endl << endl;
+
+  topGroup->generateComponent(out,false);
+
+  vhdlBench.close();
+
+}
+
 QList<QString> Graph::getExternalResources() {
   QList<QString> list = topGroup->getExternalResources();
   return list;
diff --git a/Graph.h b/Graph.h
index d5b15a9ae872d559fa76b46ff0062e04f29ddb9e..bbd7eb2fa4553247a1454d5aa8b5b82a03f6c196 100644 (file)
--- a/Graph.h
+++ b/Graph.h
@@ -65,6 +65,7 @@ public:
   void computeOutputPatterns(int nbExec) throw(Exception);
   
   void generateVHDL(const QString& path) throw(Exception);
+  void generateTestbench(const QString& projectName, const QString& benchFile) throw(Exception);
 
 private:  
   GroupBlock* topGroup;
index 206d8cba6e33e0a7ee799a1f4a6014f4083f1196..d3ff0ed715487de28fae80acf7cfb52e6db27c48 100644 (file)
@@ -200,12 +200,10 @@ void GroupBlock::computeOutputPattern(int nbExec) throw(Exception) {
   while (!fifo.isEmpty()) {
     AbstractBlock* block = fifo.takeFirst();
     
-    if (block->getOutputPatternComputed()) continue; // block has already been processed
-
-    cout << "computing compat and output for " << qPrintable(block->getName()) << endl;
-    
+    if (block->getOutputPatternComputed()) continue; // block has already been processed    
 
     try {
+      cout << "computing compatibility of " << qPrintable(block->getName()) << endl;
       block->checkInputPatternCompatibility();
     }
     catch(Exception e) {      
@@ -214,6 +212,7 @@ void GroupBlock::computeOutputPattern(int nbExec) throw(Exception) {
     }   
     
     try {
+      cout << "computing output of " << qPrintable(block->getName()) << endl;
       block->computeOutputPattern();
     }
     catch(Exception e) {
@@ -230,29 +229,32 @@ void GroupBlock::computeOutputPattern(int nbExec) throw(Exception) {
       ConnectedInterface* conn = (ConnectedInterface*)iface;
       foreach(ConnectedInterface* connTo, conn->getConnectedTo()) {
 
-        AbstractBlock* block1 = connTo->getOwner();
-        cout << "testing if " << qPrintable(block1->getName()) << " has all connected inputs connected to already processed blocks" << endl;
-        bool addIt = true;
-        int maxLevel = 0;
-
-        foreach(AbstractInterface* iface, block1->getControlInputs()) {
-          //cout << qPrintable(iface->getName()) << " of " << qPrintable(iface->getOwner()->getName()) << " connected to " << endl;
-          ConnectedInterface* connFrom = ((ConnectedInterface*)iface)->getConnectedFrom();
-          //cout << qPrintable(connFrom->getName()) << " of " << qPrintable(connFrom->getOwner()->getName()) << endl;
-
-          if ((connFrom != NULL) && (connFrom->getOwner()->getOutputPatternComputed() == false)) {
-            addIt = false;
-            break;
-          }
-          else {
-            if (connFrom->getOwner()->getTraversalLevel() > maxLevel) maxLevel = connFrom->getOwner()->getTraversalLevel();
+        AbstractBlock* blockTo = connTo->getOwner();
+        // do sthg only if blockTo is not this group block
+        if (blockTo != this) {
+          cout << "testing if " << qPrintable(blockTo->getName()) << " has all connected inputs connected to already processed blocks" << endl;
+          bool addIt = true;
+          int maxLevel = 0;
+
+          foreach(AbstractInterface* iface, blockTo->getControlInputs()) {
+            cout << qPrintable(iface->getName()) << "/" << qPrintable(iface->getOwner()->getName()) << " connected from ";
+            ConnectedInterface* connFrom = ((ConnectedInterface*)iface)->getConnectedFrom();
+            cout << qPrintable(connFrom->getName()) << "/" << qPrintable(connFrom->getOwner()->getName()) << endl;
+
+            if ((connFrom != NULL) && (connFrom->getOwner()->getOutputPatternComputed() == false)) {
+              addIt = false;
+              break;
+            }
+            else {
+              if (connFrom->getOwner()->getTraversalLevel() > maxLevel) maxLevel = connFrom->getOwner()->getTraversalLevel();
+            }
           }
-        }
 
-        if (addIt) {
-          cout << "adding " << qPrintable(block1->getName()) << " to the FIFO" << endl;
-          block1->setTraversalLevel(maxLevel+1); // level 0 = first blocks to be evaluated
-          fifo.append(block1);
+          if (addIt) {
+            cout << "adding " << qPrintable(blockTo->getName()) << " to the FIFO" << endl;
+            blockTo->setTraversalLevel(maxLevel+1); // level 0 = first blocks to be evaluated
+            fifo.append(blockTo);
+          }
         }
       }
     }
index 283e6b44187370e56adac0462b672f675cd8148e..d9e74597cdce7f7113ffcf8d80cb4ea861d80894 100644 (file)
@@ -88,6 +88,9 @@ void GroupItem::setParentItem(BoxItem *_parentItem) {
 }
 
 void GroupItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
+
+  if (!visible) return;
+
   if(boxWidth > 0 && boxHeight > 0){
     if(selected)
       painter->setPen(Qt::red);
index 13b6e112b05834328d1fd1c7c7508a12b15fdd86..a50cb5ae97980f6b5aa003d80d99aa7e14dab51c 100644 (file)
@@ -285,7 +285,7 @@ void GroupScene::save(QXmlStreamWriter &writer) {
       clkList += QString::number(d)+",";
     }
     clkList.chop(1);
-    writer.writeAttribute("clkList",clkList);
+    writer.writeAttribute("clklist",clkList);
 
   }
   groupItem->save(writer);
index 02b04ac6aa3db045d593bab291c265bc715b301e..7ee68c628f967731aafc5b4e5f27f961ba89a908 100644 (file)
@@ -4,6 +4,7 @@
 #include "GroupInterface.h"
 #include "FunctionalInterface.h"
 #include "BoxItem.h"
+#include "ReferenceInterface.h"
 
 int InterfaceItem::counter = 0;
 
@@ -45,6 +46,15 @@ QString InterfaceItem::getName() {
   return refInter->getName();
 }
 
+QString InterfaceItem::getReferenceName() {
+  if (!refInter->isFunctionalInterface()) {
+    return "no_refname_for_groupiface";
+  }
+  FunctionalInterface* iface = AI_TO_FUN(refInter);
+  ReferenceInterface* refIface = iface->getReference();
+  return refIface->getName();
+}
+
 void InterfaceItem::updateName(QString name) {  
   QFontMetrics fmName(params->defaultIfaceFont);
   nameWidth = fmName.width(refInter->getName());
index 26f9dd9aff6659a198a8a7f572e2e88308ebc11d..ab91adca49caf83fb6a98c125d2ea2faf3251706 100644 (file)
@@ -31,6 +31,7 @@ public:
   // getters
   inline int getId() { return id; }
   QString getName();
+  QString getReferenceName();
   inline double getPositionRatio() { return positionRatio; }
   inline double getPosition() { return position; }
   inline int getOrientation() { return orientation; }
diff --git a/Makefile-isim b/Makefile-isim
new file mode 100644 (file)
index 0000000..15319a1
--- /dev/null
@@ -0,0 +1,33 @@
+OPT := params-isim.txt
+
+include $(OPT)
+
+ISIM_DIR := isim
+
+ISIM_LIB := work
+
+all : project compile 
+
+project : $(PROJECT_NAME).prj
+
+compile : $(PROJECT_NAME).prj $(VHDL_SRC)
+       tb_name=$$( echo $(TB_SRC) | sed 's,.*/,,' | sed 's,[.].*,,'); \
+       fuse $(ISIM_LIB).$$tb_name $(ISIM_LIB).glbl -prj $(PROJECT_NAME).prj -L unisim -L secureip -timeprecision_vhdl ps -o $(SIMU_EXE)
+
+view :
+       $(SIMU_EXE) -gui -wdb $(SIMU_EXE).wdb
+
+$(PROJECT_NAME).prj :
+       if [ -f $@ ]; then rm $@; fi
+       echo "### VHDL sources"
+       for fich in $(VHDL_SRC); do echo vhdl $(ISIM_LIB) $$fich >> $@; done
+       echo "### verilog sources"
+       for fich in $(VL_SRC); do echo verilog $(ISIM_LIB) $$fich >> $@; done
+       echo "### test bench sources"
+       for fich in $(TB_SRC); do echo vhdl $(ISIM_LIB) $$fich >> $@; done
+
+clean :
+       rm -f *~
+       rm -f $(PROJECT_NAME).prj
+       cd $(SRC_DIR); rm -f *~
+       cd $(TB_DIR); rm -f *~
index 23b798f1a47e54d16bb6a91fad8508b7ba31661b..ecf69d9924142ad9b26d6459b61aa43ce070fec8 100644 (file)
@@ -261,6 +261,64 @@ GroupWidget *Parameters::loadProject(QDomElement root) throw(Exception) {
     }\r
     cout << "project path set to " << qPrintable(projectPath) << endl;\r
   }\r
+\r
+  /**********************************************************\r
+   0 : getting parameters\r
+  ***********************************************************/\r
+  int width = 0;\r
+  int height = 0;\r
+  int lineLength = 0;\r
+  int gapLength = 0;\r
+  QString fontName="";\r
+  int fontSize;\r
+  QString autoConn="";\r
+  QDomNode paramsNode = root.elementsByTagName("parameters").at(0);\r
+\r
+  QDomElement blocksElt = paramsNode.firstChildElement("block_view");\r
+  width = blocksElt.attribute("width","none").toInt(&ok);\r
+  if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
+  height = blocksElt.attribute("height","none").toInt(&ok);\r
+  if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
+  fontName = blocksElt.attribute("font","none");\r
+  if(fontName == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
+  fontSize = blocksElt.attribute("font_size","none").toInt(&ok);\r
+  if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
+  defaultBlockWidth = width;\r
+  defaultBlockHeight = height;\r
+  defaultBlockFontName = fontName;\r
+  defaultBlockFontSize = fontSize;\r
+  defaultBlockFont = QFont(defaultBlockFontName, defaultBlockFontSize);\r
+\r
+  QDomElement ifacesElt = paramsNode.firstChildElement("interface_view");\r
+  lineLength = ifacesElt.attribute("line_length","none").toInt(&ok);\r
+  if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
+  width = ifacesElt.attribute("width","none").toInt(&ok);\r
+  if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
+  height = ifacesElt.attribute("height","none").toInt(&ok);\r
+  if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
+  fontName = ifacesElt.attribute("font","none");\r
+  if(fontName == "none") throw(Exception(PROJECTFILE_CORRUPTED));\r
+  fontSize = ifacesElt.attribute("font_size","none").toInt(&ok);\r
+  if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
+  arrowLineLength = lineLength;\r
+  arrowWidth = width;\r
+  arrowHeight = height;\r
+  defaultIfaceFontName = fontName;\r
+  defaultIfaceFontSize = fontSize;\r
+  defaultIfaceFont = QFont(defaultIfaceFontName, defaultIfaceFontSize);\r
+\r
+  QDomElement connsElt = paramsNode.firstChildElement("connection_view");\r
+  gapLength = connsElt.attribute("gap_length","none").toInt(&ok);\r
+  if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));\r
+  autoConn = connsElt.attribute("auto_conn","none");\r
+  if (autoConn == "false") {\r
+    autoConnMainClk = false;\r
+  }\r
+  else {\r
+    autoConnMainClk = true;\r
+  }\r
+  connGapLength = gapLength;\r
+\r
   /**********************************************************\r
    1 : getting scene and creating associated group widgets\r
   ***********************************************************/\r
@@ -639,7 +697,7 @@ void Parameters::loadBlastConfiguration(QString confFile) throw(Exception) {
   attributeStr = eltInterfaces.attribute("height", "none");\r
   arrowHeight = attributeStr.toInt(&ok);\r
   if (!ok || arrowHeight < 1) throw(Exception(CONFIGFILE_CORRUPTED));\r
-  attributeStr = eltInterfaces.attribute("linelength", "none");\r
+  attributeStr = eltInterfaces.attribute("line_length", "none");\r
   arrowLineLength = attributeStr.toInt(&ok);\r
   if (!ok || arrowLineLength < 1) throw(Exception(CONFIGFILE_CORRUPTED));\r
   attributeStr = eltInterfaces.attribute("font_size", "none");\r
@@ -651,7 +709,7 @@ void Parameters::loadBlastConfiguration(QString confFile) throw(Exception) {
   defaultIfaceFont = QFont(defaultIfaceFontName, defaultIfaceFontSize);\r
 \r
   QDomElement eltConnections = eltInterfaces.nextSiblingElement("connections");\r
-  attributeStr = eltConnections.attribute("gaplength", "none");\r
+  attributeStr = eltConnections.attribute("gap_length", "none");\r
   connGapLength = attributeStr.toInt(&ok);\r
   if (!ok || connGapLength < 1) throw(Exception(CONFIGFILE_CORRUPTED));\r
 }\r
@@ -1157,6 +1215,33 @@ void Parameters::save(QString confFile) {
     writer.writeStartDocument();\r
 \r
     writer.writeStartElement("blast_project");\r
+\r
+    writer.writeStartElement("parameters");\r
+    writer.writeStartElement("block_view");\r
+    writer.writeAttribute("width",QString::number(defaultBlockWidth));\r
+    writer.writeAttribute("height",QString::number(defaultBlockHeight));\r
+    writer.writeAttribute("font",defaultBlockFontName);\r
+    writer.writeAttribute("font_size",QString::number(defaultBlockFontSize));\r
+    writer.writeEndElement();    //</blocks>\r
+    writer.writeStartElement("interface_view");\r
+    writer.writeAttribute("line_length",QString::number(arrowLineLength));\r
+    writer.writeAttribute("width",QString::number(arrowWidth));\r
+    writer.writeAttribute("height",QString::number(arrowHeight));\r
+    writer.writeAttribute("font",defaultIfaceFontName);\r
+    writer.writeAttribute("font_size",QString::number(defaultIfaceFontSize));\r
+    writer.writeEndElement();    //</interfaces>\r
+    writer.writeStartElement("connection_view");\r
+    writer.writeAttribute("gap_length",QString::number(connGapLength));\r
+    if (autoConnMainClk) {\r
+      writer.writeAttribute("auto_conn","true");\r
+    }\r
+    else {\r
+      writer.writeAttribute("auto_conn","false");\r
+    }\r
+    writer.writeEndElement();    //</connections>\r
+\r
+    writer.writeEndElement();    //</parameters>\r
+\r
     writer.writeStartElement("scenes");\r
 \r
     writer.writeAttribute("count",QString::number(dispatcher->getNumberOfScenes()));\r
index be9452ecf2d6f61017f0fd67fd0bbc246326ffb8..29f6d5a1428acff910311be51759b50eeb2f54a5 100644 (file)
@@ -159,6 +159,7 @@ void SpecialBlock::computeOutputPatternClockConvert(int nbExec) throw(Exception)
     connIface->setOutputPattern(pat);\r
     outputPattern.insert(connIface,pat);\r
   }\r
+  setOutputPatternComputed(true);\r
   cout << "output pattern computed" << endl;\r
 }\r
 \r
index 4bc4f31249fc3518cb5ebef894a1932d4a2505ee..861bfc7de238d367f5883daee883f12e65840920 100644 (file)
@@ -740,7 +740,7 @@ void StimuliItem::save(QXmlStreamWriter &writer) {
     
     writer.writeAttribute("id",QString::number(inter->getId()));
     writer.writeAttribute("name",inter->getName());
-    writer.writeAttribute("ref_name",inter->refInter->getName());
+    writer.writeAttribute("ref_name",inter->getReferenceName());
     writer.writeAttribute("orientation",inter->getStrOrientation());
     writer.writeAttribute("position",QString::number(inter->getPositionRatio()));
     
index b5a367859baff44812e706c933b8f303c4859e53..34b82873cb3f0f3bcbc4b64de5bf09d190a9010d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.2.0, 2018-05-07T18:17:25. -->
+<!-- Written by QtCreator 4.2.0, 2018-05-09T18:21:40. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
index 9092eabd57784bca851790098a38deda92acb8a4..26ec97a382dc697dcb8886f94f9d00f9d9ae58eb 100644 (file)
@@ -31,7 +31,7 @@
 
   <defaults>
     <blocks width="175" height="125" font="Helvetica" font_size="14" />
-    <interfaces linelength="10" width="5" height="10" font="Helvetica" font_size="10" />
-    <connections gaplength="20" />
+    <interfaces line_length="10" width="5" height="10" font="Helvetica" font_size="10" />
+    <connections gap_length="20" />
   </defaults>
 </config>
index 6ad294aa6baf8fdb4eb49f3237a9b4dde3cc0d5d..85a678d4fcccbec1b5cf30a53c6d55fba9168e11 100644 (file)
@@ -18,7 +18,7 @@
     </xs:attributeGroup>
 
     <xs:attributeGroup name="interfacesAttrGroup">
-       <xs:attribute ref="linelength" use="required" />
+       <xs:attribute ref="line_length" use="required" />
        <xs:attribute ref="width" use="required" />
        <xs:attribute ref="height" use="required" />
        <xs:attribute ref="font" use="required" />
@@ -86,7 +86,7 @@
        </xs:simpleType>
     </xs:attribute>
 
-    <xs:attribute name="linelength">
+    <xs:attribute name="line_length">
        <xs:simpleType>
            <xs:restriction base="xs:nonNegativeInteger">
                <xs:minInclusive value="1"/>
@@ -95,7 +95,7 @@
        </xs:simpleType>
     </xs:attribute>
 
-    <xs:attribute name="gaplength">
+    <xs:attribute name="gap_length">
        <xs:simpleType>
            <xs:restriction base="xs:nonNegativeInteger">
                <xs:minInclusive value="1"/>
 
     <xs:element name="connections">
        <xs:complexType>
-           <xs:attribute ref="gaplength" use="required"/>
+           <xs:attribute ref="gap_length" use="required"/>
        </xs:complexType>
     </xs:element>
 
index 336d2aca8234bd250d5ba9867985f5ad44649815..819675436fcb6619f3bae5756a25a82e8aaf0ce7 100644 (file)
   <xs:attribute name="context" type="xs:string"/>
   <xs:attribute name="type" type="xs:string"/>
   <xs:attribute name="params" type="xs:string"/>
-  <xs:attribute name="project_path" type="xs:string"/>  
+  <xs:attribute name="project_path" type="xs:string"/>
+
+  <xs:attribute name="font" type="xs:string"/>
+  <xs:attribute name="font_size" type="xs:nonNegativeInteger"/>
+  <xs:attribute name="width" type="xs:nonNegativeInteger"/>
+  <xs:attribute name="height" type="xs:nonNegativeInteger"/>
+  <xs:attribute name="line_length" type="xs:nonNegativeInteger"/>
+  <xs:attribute name="gap_length" type="xs:nonNegativeInteger"/>
+  <xs:attribute name="auto_conn">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+       <xs:enumeration value="true"/>
+       <xs:enumeration value="false"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:attribute>
 
 
   <!-- déclaration des groupes d'éléments -->
 
   <xs:group name="rootElmtGroup">
     <xs:sequence>
+      <xs:element ref="parameters"/>      
       <xs:element ref="scenes"/>
       <xs:element ref="connections"/>
       <xs:element ref="modifiers"/>
 
 
   <!-- déclaration des éléments -->
+  <xs:element name="parameters">
+    <xs:complexType>
+      <xs:sequence>
+       <xs:element ref="block_view" />
+       <xs:element ref="interface_view" />
+       <xs:element ref="connection_view" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="block_view">
+    <xs:complexType>
+      <xs:attribute ref="width"/>
+      <xs:attribute ref="height"/>
+      <xs:attribute ref="font"/>
+      <xs:attribute ref="font_size"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="interface_view">
+    <xs:complexType>
+      <xs:attribute ref="line_length"/>      
+      <xs:attribute ref="width"/>
+      <xs:attribute ref="height"/>
+      <xs:attribute ref="font"/>
+      <xs:attribute ref="font_size"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="connection_view">
+    <xs:complexType>
+      <xs:attribute ref="gap_length"/>      
+      <xs:attribute ref="auto_conn"/>
+    </xs:complexType>
+  </xs:element>
 
   <xs:element name="scenes">
     <xs:complexType>