Skip to content

Commit 21917c4

Browse files
committed
fix blifexplorer not creating directory for simulation
1 parent e734d46 commit 21917c4

File tree

8 files changed

+11
-88
lines changed

8 files changed

+11
-88
lines changed

ODIN_II/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
regression_test/runs
2-
OUTPUT/*
2+
OUTPUT/*
3+
temp

blifexplorer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
OUTPUT

blifexplorer/src/container.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -973,21 +973,6 @@ void Container::showSimulationStep(int cycle)
973973
//actSimStep = (simOffset+1)%64;
974974
}
975975

976-
/*---------------------------------------------------------------------------------------------
977-
* (function: setEdge)
978-
*-------------------------------------------------------------------------------------------*/
979-
void Container::setEdge(int i)
980-
{
981-
if(odinStarted)
982-
{
983-
myOdin->setEdge(i);
984-
}
985-
else
986-
{
987-
std::cout << "unable to set edge since odin has not been started";
988-
}
989-
}
990-
991976
/*---------------------------------------------------------------------------------------------
992977
* (function: getConnectionBetween)
993978
*-------------------------------------------------------------------------------------------*/

blifexplorer/src/container.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class Container
5353
int getActSimStep();
5454
int startSimulator();
5555
void showSimulationStep(int cycle);
56-
void setEdge(int i);
5756
int simulateNextWave();
5857
void resetAllHighlights();
5958
void showActivity();

blifexplorer/src/mainwindow.cpp

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -469,25 +469,6 @@ void MainWindow::createToolBox()
469469
":/images/next.png"), 2, 0);
470470

471471

472-
//add edge control for the simulation
473-
edgeRadioLayout = new QVBoxLayout;
474-
QGroupBox* groupBox = new QGroupBox(tr("Show Edge"));
475-
QRadioButton* radFall = new QRadioButton(tr("F"));
476-
QRadioButton* radRise = new QRadioButton(tr("R"));
477-
QRadioButton* radFallRise = new QRadioButton(tr("RF"));
478-
radFallRise->setChecked(true);
479-
edgeRadioLayout->addWidget(radFall);
480-
edgeRadioLayout->addWidget(radRise);
481-
edgeRadioLayout->addWidget(radFallRise);
482-
groupBox->setLayout(edgeRadioLayout);
483-
simulationLayout->addWidget(groupBox,3,0);
484-
connect(radFall, SIGNAL(toggled(bool)),
485-
this, SLOT(setEdgeFall(bool)));
486-
connect(radRise, SIGNAL(toggled(bool)),
487-
this, SLOT(setEdgeRise(bool)));
488-
connect(radFallRise, SIGNAL(toggled(bool)),
489-
this, SLOT(setEdgeFallRise(bool)));
490-
491472
QLabel* legend = new QLabel();
492473
QSize size(100,100);
493474
QPixmap* pixmap = new QPixmap(size);
@@ -1308,33 +1289,6 @@ QWidget * MainWindow::createPowerCellWidget(const QString &text, const QString &
13081289
return widget;
13091290
}
13101291

1311-
/*---------------------------------------------------------------------------------------------
1312-
* (function: setEdgeFall)
1313-
*-------------------------------------------------------------------------------------------*/
1314-
void MainWindow::setEdgeFall(bool val){
1315-
if(val){
1316-
myContainer->setEdge(1);
1317-
}
1318-
}
1319-
1320-
/*---------------------------------------------------------------------------------------------
1321-
* (function: setEdgeRise)
1322-
*-------------------------------------------------------------------------------------------*/
1323-
void MainWindow::setEdgeRise(bool val){
1324-
if(val){
1325-
myContainer->setEdge(0);
1326-
}
1327-
}
1328-
1329-
/*---------------------------------------------------------------------------------------------
1330-
* (function: setEdgeFallRise)
1331-
*-------------------------------------------------------------------------------------------*/
1332-
void MainWindow::setEdgeFallRise(bool val){
1333-
if(val){
1334-
myContainer->setEdge(-1);
1335-
}
1336-
}
1337-
13381292
void MainWindow::activityCycleCountChangedChanged(int number)
13391293
{
13401294
activityBase = number;

blifexplorer/src/mainwindow.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ private slots:
9393
void showRelevantGraph();
9494
void expandCollapse();
9595

96-
void setEdgeFall(bool);
97-
void setEdgeRise(bool);
98-
void setEdgeFallRise(bool);
99-
10096
private:
10197
void createToolBox();
10298
void createActions();
@@ -178,7 +174,6 @@ private slots:
178174

179175
QGridLayout *simStatLayout;
180176
QLabel* simstatLabel;
181-
QVBoxLayout* edgeRadioLayout;
182177

183178
Container* myContainer;
184179

blifexplorer/src/odininterface.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ OTHER DEALINGS IN THE SOFTWARE.
2525
#include "odin_ii.h"
2626
#include "vtr_memory.h"
2727
#include "vtr_util.h"
28+
#include <QDir>
2829

2930

3031
OdinInterface::OdinInterface()
3132
{
3233
fprintf(stderr,"Creating Odin II object\n");
3334
wave = 0;
34-
edge_output = "";
3535
blifexplorer_netlist = NULL;
3636
arg_list = NULL;
3737
arg_len = 0;
@@ -42,21 +42,23 @@ OdinInterface::OdinInterface()
4242
*-------------------------------------------------------------------------------------------*/
4343
int OdinInterface::startOdin()
4444
{
45+
std::string simulation_directory = "OUTPUT";
46+
QString dir_name(simulation_directory.c_str());
47+
QDir dir(dir_name);
48+
if (!dir.exists())
49+
dir.mkpath(dir_name);
50+
4551
/* pass arguments here to odin */
4652
std::vector<std::string> arguments =
4753
{
4854
"../ODIN_II/odin_ii", // pass the odin location relative to blifexplorer
4955
"--interractive_simulation", // prevent odin from freeing valuable information
5056
"-r", "7", // set simulation seed
51-
"-sim_dir", "./OUTPUT/", // set simulation directory
57+
"-sim_dir", std::string(simulation_directory + "/"), // set simulation directory
5258
"-g", "10000", // set number of test vector
5359
"-b", OdinInterface::myFilename.trimmed().toLocal8Bit().data() // pass the blif file
5460
};
5561

56-
// pass the edge type
57-
if ( OdinInterface::edge_output != "" )
58-
arguments.insert(arguments.end(), OdinInterface::edge_output);
59-
6062
/* converting into format digestible by odin */
6163
arg_list = (char**)malloc(arguments.size()*sizeof(char*));
6264
arg_len = arguments.size();
@@ -173,16 +175,4 @@ int OdinInterface::getOutputValue(nnode_t* node, int outPin, int actstep)
173175
return get_pin_value(node->output_pins[outPin],actstep);
174176
}
175177

176-
/*---------------------------------------------------------------------------------------------
177-
* (function: setEdge)
178-
*-------------------------------------------------------------------------------------------*/
179-
void OdinInterface::setEdge(int i ){
180-
if(i==-1)
181-
OdinInterface::edge_output = "-E";
182-
else if(i==0)
183-
OdinInterface::edge_output = "-R";
184-
else
185-
OdinInterface::edge_output = "";
186-
}
187-
188178

blifexplorer/src/odininterface.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,13 @@ class OdinInterface
5353
int simulateNextWave();
5454
void endSimulation();
5555
int getOutputValue(nnode_t* node, int pin, int actstep);
56-
void setEdge(int i);
5756
netlist_t *blifexplorer_netlist;
5857

5958
private:
6059
QHash<QString, nnode_t *> nodehash;
6160
QQueue<nnode_t *> nodequeue;
6261
QString myFilename;
6362
sim_data_t *sim_data;
64-
std::string edge_output;
6563
char **arg_list;
6664
int arg_len;
6765
int wave;

0 commit comments

Comments
 (0)