diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 00000000..f955b122 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,11 @@ +all: + pdflatex manual.tex + pdflatex manual.tex + pdflatex manual.tex +clean: + rm -f manual.pdf + rm -f manual.aux + rm -f manual.dvi + rm -f manual.log + rm -f manual.toc + rm -f *~ diff --git a/doc/manual.tex b/doc/manual.tex index edcef83c..5b25a295 100644 --- a/doc/manual.tex +++ b/doc/manual.tex @@ -118,7 +118,7 @@ \subsection{Downloading and building the simulator} Type \texttt{make} to build the simulator. A note for Windows users: -The above instructions have been tested to work with the newest version of Cygwin. +The above instructions have been tested to work with Cygwin 1.7.18. \subsection{Running a simulation} \label{sec:run_example} @@ -178,8 +178,10 @@ \subsection{Simulation output} \begin{figure} \begin{verbatim} -BEGIN Configuration File -Name: examples/torus88 +BEGIN Configuration File: examples/torus88 + +.... + // Topology topology = torus; k = 8; @@ -187,34 +189,35 @@ \subsection{Simulation output} // Routing routing_function = dim_order; // Flow control -num_vcs = 4; +num_vcs = 2; // Traffic traffic = uniform; injection_rate = 0.15; -END Configuration File -0%================================= -% Average latency = 10.3206 -% Accepted packets = 0.113 at node 38 (avg = 0.149031) -lat(1) = 10.3206; -bins = [ 0 ...999]; -freq = [ 0 0 145 4 550 52 988 137 1439 285 1656 428 1359 417 958 294 453 163 143 - 49 10 7 1 0 .... +END Configuration File: examples/torus88 +Class 0: +Packet latency average = 33.2807 + minimum = 7 + maximum = 73 .... -% Warmed up ...Time used is 3000 cycles +Warmed up ...Time used is 2000 cycles .... -% Draining all recorded packets ... -% Draining remaining packets ... -Time taken is 6030 cycles +Draining all recorded packets ... +Draining remaining packets ... +Time taken is 5104 cycles +====== Overall Traffic Statistics ====== ====== Traffic class 0 ====== -Overall average latency = 10.2897 (1 samples) -Overall average accepted rate = 0.14834 (1 samples) -Overall min accepted rate = 0.129043 (1 samples) -Average hops = 4.99839 (57153 samples) +Packet latency average = 33.6964 (1 samples) + minimum = 7 (1 samples) + maximum = 84 (1 samples) + +.... + +Total run time 1.01837 \end{verbatim} \caption{Simulator output from running the \texttt{examples/torus88} configuration file.} @@ -224,7 +227,9 @@ \subsection{Simulation output} After the warm up periods have passed (default to 3$\times$sample\_period), the simulator prints the ``\texttt{Warmed up}'' message and resets all the simulation statistics. Then, the measurement phase begins and statistics continue to be -reported after each sample period. Once the measurement periods have +reported after each sample period. The measurement phase +typically last for last least 3 sample periods. +Once the measurement periods have passed, all the measurement packets are drained from the network before final latency and throughput numbers are reported. Details of the configuration parameters used to control the length of the @@ -256,39 +261,38 @@ \section{Example} n = 2; // Routing - -routing_function = dim_order; +routing_function = dor; // Flow control - num_vcs = 8; vc_buf_size = 8; - wait_for_tail_credit = 1; // Router architecture - vc_allocator = islip; sw_allocator = islip; alloc_iters = 1; credit_delay = 2; -routing_delay = 1; +routing_delay = 0; vc_alloc_delay = 1; +sw_alloc_delay = 1; input_speedup = 2; output_speedup = 1; internal_speedup = 1.0; + // Traffic +traffic = transpose; +packet_size = 20; -traffic = transpose; -const_flits_per_packet = 20; // Simulation +sim_type = latency; + +injection_rate = 0.005; -sim_type = latency; -injection_rate = 0.01; \end{verbatim} \caption{A typical configuration file (\texttt{examples/mesh88\_lat}) for creating a latency versus offered load curve for a 8-ary 2-mesh @@ -300,83 +304,109 @@ \section{Configuration parameters} \label{sec:config_params} All information used to configure a simulation is passed through a -configuration file as illustrated by the example in -Section~\ref{sec:run_example}. This section lists the existing -configuration parameters --- a user can incorporate additional options -by changing the \texttt{booksim\_config.cpp} file. +configuration file as illustrated by the example in +Section~\ref{sec:run_example}. This section lists the major +configuration parameters for the simulator. Additional description can be found in the +configuration parameter class file \texttt{booksim\_config.cpp}. +A user can incorporate additional options by changing the this file. \subsection{Topologies} \label{sec:topos} -The \texttt{topology} parameter determines the underlying topology of the -network. There is also a set of numerical parameters that describes the size of the networks. +The \texttt{topology} parameter determines the underlying topology of +the network. There is also a set of numerical parameters that +describes the size of the networks. \begin{opt_list}{topoparams} \item[k] Network radix, the number of routers per dimension \item[n] Network dimension -\item[c] Network concentration, the number of nodes sharing a single router. Typically set to 1, >1 only in networks that has concentration (i.e. cmesh) -\item[x] (NoC simulations only) The number of routers in the X dimension. Used to calculate channel latency between routers. -\item[y] (NoC simulations only) The number of routers in the y dimension. Used to calculate channel latency between routers. -\item[xr] (NoC simulations only) For networks that have c>1, the number of nodes in the x direction per router. Used to calculate channel latency between routers. -\item[yr] (NoC simulations only) For networks that have c>1, the number of nodes in the y direction per router. Used to calculate channel latency between routers. -\item[limit] Emulate partially filled networks. Nodes greater or equal to limit does not generate or receive packets during simulation. Though depending on the routing algorithm the routers associated with those nodes may be use to route passing by traffic. +\item[c] Network concentration, the number of nodes sharing a single + router. Typically set to 1, >1 only in networks that has + concentration (i.e. cmesh). +\item[x] (NoC simulations only) The number of routers in the X + dimension. Used to calculate channel latency between routers. +\item[y] (NoC simulations only) The number of routers in the y + dimension. Used to calculate channel latency between routers. +\item[xr] (NoC simulations only) For networks that have c>1, the + number of nodes in the x direction per router. Used to calculate + channel latency between routers. +\item[yr] (NoC simulations only) For networks that have c>1, the + number of nodes in the y direction per router. Used to calculate + channel latency between routers. \end{opt_list} -The channel latency of the network must be configured within the source code of the topology files. All topologies by default have channel latency of 1 cycles. Topologies available in \simname are: +The channel latency of the network must be configured within the +source code of the topology files. All topologies by default have +channel latency of 1 cycles. Topologies available in \simname are: \begin{opt_list}{topologies} \item[fly] A $k$-ary $n$-fly (butterfly) topology. The \texttt{k} parameter determines the network's radix and the \texttt{n} parameter -determines the network's dimension. +determines the network's dimension. Note: a $k$-ary 1-fly is +essentially a single radix-k router, useful for testing. \item[mesh] A $k$-ary $n$-mesh (mesh) topology. The \texttt{k} parameter determines the network's radix and the \texttt{n} parameter determines the network's dimension. -\item[single] A network with a single node, used for testing single -router performance. The number of input and output ports for the node -is determined by the \texttt{in\_ports} and \texttt{out\_ports} parameters, -respectively. \item[torus] A $k$-ary $n$-cube (torus) topology. The \texttt{k} parameter determines the network's radix and the \texttt{n} parameter determines the network's dimension. -\item[cmesh] Concentrated mesh topology is a A $k$-ary $n$-mesh topology with multiple nodes sharing a single router. The \texttt{c} determines the concentration. The cmesh topology has the option that turns on "express channels" as described in by default these channels are turned off. +\item[cmesh] Concentrated mesh topology is a A $k$-ary $n$-mesh + topology with multiple nodes sharing a single router. The \texttt{c} + determines the concentration. The cmesh topology has the option that + turns on "express channels" as described in by default these + channels are turned off. -\item[fat tree] Fat Tree topology with 3 levels. Nodes are routers are arranged in a tree structure but the number of links between levels stays constant. At the bottom \texttt{k} nodes shares a level 0 router. +\item[fat tree] Fat Tree topology with 3 levels. Nodes are routers are + arranged in a tree structure but the number of links between levels + stays constant. At the bottom \texttt{k} nodes shares a level 0 + router. -\item[flattened butterfly] A topology based on the paper "Flattened butterfly: a cost-efficient topology for high-radix networks" ISCA 2007 +\item[flattened butterfly] A topology based on the paper "Flattened + butterfly: a cost-efficient topology for high-radix networks" ISCA + 2007 + +\item[dragonfly] A topology based on the paper ``Technology-driven, + highly-scalable dragonfly topology.'' ISCA 2008 \item[quad tree] A quad tree topology. \item[tree 4] -\item[cmo] Concentrated Multi-dimensional Octagon created by Sang Kyun Kim and Wook-Jin Chung from EE382C several years ago. +\item[anynet] A topology based on an user input file specifying + connectivity of nodes and routers. \end{opt_list} -Both the \texttt{mesh} and \texttt{torus} topologies support the -addition of random link failures with the \texttt{link\_failures} -parameter. The value of \texttt{link\_failures} determines the number -of channels that are randomly removed from the topology and are thus -no longer available for forwarding packets. Moreover, the -randomization for failed channels is controlled by selecting an -integer value for the \texttt{fail\_seed} parameter --- a fixed seed -gives a fixed set of failed channels, independent of other -randomization in the simulation. Also, note that only certain routing -functions support this feature (see Section~\ref{sec:routing_algs}). +%Both the \texttt{mesh} and \texttt{torus} topologies support the +%addition of random link failures with the \texttt{link\_failures} +%parameter. The value of \texttt{link\_failures} determines the number +%of channels that are randomly removed from the topology and are thus +%no longer available for forwarding packets. Moreover, the +%randomization for failed channels is controlled by selecting an +%integer value for the \texttt{fail\_seed} parameter --- a fixed seed +%gives a fixed set of failed channels, independent of other +%randomization in the simulation. Also, note that only certain routing +%functions support this feature (see Section~\ref{sec:routing_algs}). \subsection{Physical sub-networks} \label{sec:physical_subnets} -The \texttt{physical\_subnetworks} parameter defines the number of physical sub-networks present in the network (defaults to one). -All sub-networks receive the same configuration parameters and thus are identical. Traffic sources -maintain an injection queue for each sub-network. The packet generation process is unaffected. It enqueues generated packets into the -proper sub-network queue according to a division function in the traffic manager. At every cycle, flits at the head of each queue attempt to be injected. -Traffic destinations can eject one flit from each sub-network each cycle. +The \texttt{physical\_subnetworks} parameter defines the number of +physical sub-networks present in the network (defaults to one). All +sub-networks receive the same configuration parameters and thus are +identical. Traffic sources maintain an injection queue for each +sub-network. The packet +generation process is unaffected. It enqueues generated packets into +the proper sub-network queue according to a division function in the +traffic manager. At every cycle, flits at the head of each queue +attempt to be injected. Traffic destinations can eject one flit from +each sub-network each cycle. \subsection{Routing algorithms} @@ -384,7 +414,12 @@ \subsection{Routing algorithms} The \texttt{routing\_function} parameter selects a routing algorithm for the topology. Many routing algorithms need multiple virtual -channels for deadlock freedom (VCDF). In addition to \texttt{routefunc.cpp}, some topologies source files include additional routing functions. Also, the simulator code is structured so that additional routing algorithms can be added with minimal changes to the overall simulator (see the \texttt{routefunc.cpp} file in the simulator's source code). +channels for deadlock freedom. In addition to \texttt{routefunc.cpp}, +some topologies source files include additional routing +functions. Also, the simulator code is structured so that additional +routing algorithms can be added with minimal changes to the overall +simulator (see the \texttt{routefunc.cpp} file in the simulator's +source code). \subsection{Flow control} @@ -431,8 +466,8 @@ \subsection{Router organizations} number for this field, so integer speedups should also include a decimal point (e.g. ``2.0''). -\item[output\_delay] The processing delay incurred in the output queue -of a router. +%\item[output\_delay] The processing delay incurred in the output queue +%of a router. \end{opt_list} \subsubsection{The input-queued router} @@ -458,18 +493,25 @@ \subsubsection{The input-queued router} \item[hold\_switch\_for\_packet] -\item[speculative] Enable speculative switch allocation (i.e., allow switch allocation to occur in parallel with VC allocation for header flits). - -\item[filter\_spec\_grants] Determines how speculative grants are masked (\texttt{any\_nonspec\_gnts}: any non-speculative grant inhibits all speculative grants; \texttt{confl\_nonspec\_reqs}: speculative grants are inhibited by conflicting non-speculative requests; \texttt{confl\_nonspec\_gnts}: speculative grants are inhibited by conflicting non-speculative grants). +\item[speculative] Enable speculative switch allocation (i.e., allow + switch allocation to occur in parallel with VC allocation for header + flits). -\item[alloc\_iters] For the \texttt{islip}, \texttt{pim} and \texttt{select} allocators, allocation can be improved by performing multiple iterations of the algorithm; this parameter controls the number of iterations to be performed for both switch and VC allocation. +%\item[filter\_spec\_grants] Determines how speculative grants are masked (\texttt{any\_nonspec\_gnts}: any non-speculative grant inhibits all speculative grants; \texttt{confl\_nonspec\_reqs}: speculative grants are inhibited by conflicting non-speculative requests; \texttt{confl\_nonspec\_gnts}: speculative grants are inhibited by conflicting non-speculative grants). -\item[sw\_allocator] The type of allocator used for switch allocation. -See Section~\ref{sec:alloc} for a list of the possible allocators. +\item[alloc\_iters] For the \texttt{islip}, \texttt{pim} and + \texttt{select} allocators, allocation can be improved by performing + multiple iterations of the algorithm; this parameter controls the + number of iterations to be performed for both switch and VC + allocation. -\item[sw\_alloc\_arb\_type] If the switch allocator is a separable input- or output-first allocator, this parameter selects the type of arbiter to use. +\item[arb\_type] If the VC or switch allocator is a separable + input- or output-first allocator, this parameter selects the type of + arbiter to use. -\item[sw\_alloc\_iters] If the switch allocator is of type \texttt{islip}, \texttt{pim} or \texttt{select}, this parameter controls how many allocation iterations should be performed. This overrides the global \texttt{alloc\_iters} parameter. +\item[sw\_allocator] The type of allocator used for switch + allocation. See Section~\ref{sec:alloc} for a list of the possible + allocators. \item[sw\_alloc\_delay] The delay (in cycles) of switch allocation. @@ -477,10 +519,6 @@ \subsubsection{The input-queued router} allocation. See Section~\ref{sec:alloc} for a list of the possible allocators. -\item[vc\_alloc\_arb\_type] If the VC allocator is a separable input- or output-first allocator, this parameter selects the type of arbiter to use. - -\item[vc\_alloc\_iters] If the VC allocator is of type \texttt{islip}, \texttt{pim} or \texttt{select}, this parameter controls how many allocation iterations should be performed. This overrides the global \texttt{alloc\_iters} parameter. - \item[vc\_alloc\_delay] The delay (in cycles) of virtual-channel allocation. @@ -628,7 +666,7 @@ \subsection{Simulation parameters} \item[print\_activity] At the end of a simulation using iq\_router, print out the activity for buffer, switch, and channel of the network. -\item[viewer\_trace] The simulator will generate very verbose print out of all activity inside the network. This print out should be fed into noc\_viewer for a graphic display of the activity inside the network. Currently not working. +%\item[viewer\_trace] The simulator will generate very verbose print out of all activity inside the network. This print out should be fed into noc\_viewer for a graphic display of the activity inside the network. Currently not working. \item[watch\_file] Specific flits can have their "watch" status turn on. Require input a file which has flit id listed. 1 id per line. diff --git a/src/Makefile b/src/Makefile index 9284c6cd..b0eece92 100644 --- a/src/Makefile +++ b/src/Makefile @@ -27,15 +27,14 @@ # # Makefile # -MOC = /usr/lib/qt4/bin/moc +LEX = flex YACC = bison -y DEFINE = -DEFINE_TEST = -DUSE_GUI INCPATH = -I. -Iarbiters -Iallocators -Irouters -Inetworks -Ipower CPPFLAGS += -Wall $(INCPATH) $(DEFINE) -#CPPFLAGS += -O3 +CPPFLAGS += -O3 CPPFLAGS += -g -LFLAGS += +LFLAGS += OBJDIR := obj @@ -70,14 +69,7 @@ CPP_SRCS = main.cpp \ buffer_monitor.cpp \ workload.cpp -ifeq ($(DEFINE) , $(DEFINE_TEST)) - CPP_SRCS += \ - bgui.cpp\ - moc_bgui.cpp - LFLAGS += -lQtGui -lQtCore -lpthread - INCPATH += -I/usr/include/QtCore -I/usr/include/QtGui -else -endif + LEX_OBJS = ${OBJDIR}/lex.yy.o YACC_OBJS = ${OBJDIR}/y.tab.o @@ -108,10 +100,6 @@ $(PROG): $(OBJS) # rules to compile simulator -moc_bgui.cpp: booksim_config.hpp \ - config_utils.hpp \ - bgui.hpp - $(MOC) $(INCPATH) bgui.hpp -o moc_bgui.cpp ${LEX_OBJS}: lex.yy.c y.tab.h $(CC) $(CPPFLAGS) -c $< -o $@ diff --git a/src/bgui.cpp b/src/bgui.cpp deleted file mode 100644 index 771c1648..00000000 --- a/src/bgui.cpp +++ /dev/null @@ -1,535 +0,0 @@ - -#include -#include "globals.hpp" -#include "booksim.hpp" -#include "bgui.hpp" -#include "stats.hpp" - -//pthread function -void* launchbooksim(void* j){ - bsjob* job =(bsjob*)j; - job->status=1; //lol this is definitley not atomic - job->return_status = job->bs(*(job->config)); - job->status=0; -} - -BooksimGUI::BooksimGUI(QWidget *parent) - : QWidget(parent) -{ - - simulationTimer = new QTimer(this); - connect(simulationTimer, SIGNAL(timeout()), this, SLOT(checksimulation())); - arbeit.bs = 0; - arbeit.config = 0; - arbeit.status = 0; - arbeit.return_status = false; - - //tab declaration - mainLayout = new QGridLayout; - QTabWidget *tabWidget = new QTabWidget; - mainLayout->addWidget(tabWidget,0,0); - configtab = new configTab(this); - simulationtab = new simulationTab; - tabWidget->addTab(configtab, tr("Configuration")); - tabWidget->addTab(simulationtab, tr("Simulation")); - connect(this, SIGNAL(updatestats(bool)),simulationtab, SLOT(readystats(bool))); - connect(this, SIGNAL(simulationstatus(bool)), simulationtab, SLOT(readystats(bool))); - - //run button - QPushButton *go_button = new QPushButton("Run Simulation"); - connect(go_button, SIGNAL(clicked()), this, SLOT(run())); - mainLayout->addWidget(go_button, 1, 0); - mainLayout->setRowStretch(1,0); - mainLayout->setRowStretch(0,1); - - setLayout(mainLayout); -} - -//transfer all the control and data from main.cpp -void BooksimGUI::RegisterSimFunc(booksimfunc wut, BookSimConfig * cf){ - arbeit.bs = wut; - arbeit.config = cf; - configtab->setup(cf); -} - -//spawn A thread -void BooksimGUI::run(){ - if(arbeit.status!=1){ - emit simulationstatus(false); - cout<<"Starting booksim run"<start(500); - } else { - cout<<"simulation already running\n"; - } -} - -//chekc booksim thread -//definitely not atomic lol -void BooksimGUI::checksimulation(){ - //done - if(arbeit.status==0){ - emit updatestats(true); - simulationTimer->stop(); - } else { //not done - - } -} - -configTab::configTab(QWidget *parent) - :QWidget(parent){ - configLayout = new QGridLayout; - config = 0; - setLayout(configLayout); - -} - -void configTab::setup( BookSimConfig * cf){ - - config = cf; - - //differentiate which options are part of the "important_map" - map not_advanced_list; - //data directly from booksim config - map const & str_map = cf->GetStrMap(); - map const & int_map = cf->GetIntMap(); - map const & float_map = cf->GetFloatMap(); - //gui display data from booksim config - vector > > important_map = cf->GetImportantMap(); - hmax = 0; - vmax = 0; - int grid_hindex = 0; - int grid_vindex = 0; - - - /////////Create a label and a textbox for each option, but they are not attached to anyting widgets yet - - str_map_obj.clear(); - str_map_label.clear(); - for( map::const_iterator i = str_map.begin(); - i!=str_map.end(); - i++){ - QLabel* tlabel = new QLabel(i->first.c_str()); - str_map_label[i->first] = tlabel; - QLineEdit* tline = new QLineEdit(); - tline->setText(i->second); - str_map_obj[i->first] = tline; - - } - - - stringstream numtochar; - int_map_obj.clear(); - int_map_label.clear(); - for( map::const_iterator i = int_map.begin(); - i!=int_map.end(); - i++){ - QLabel* tlabel = new QLabel(i->first.c_str()); - int_map_label[i->first] = tlabel; - QLineEdit* tline = new QLineEdit(); - numtochar<second; - tline->setText(numtochar.str().c_str()); - numtochar.str(""); - int_map_obj[i->first] = tline; - - } - - float_map_obj.clear(); - float_map_label.clear(); - for( map::const_iterator i = float_map.begin(); - i!=float_map.end(); - i++){ - QLabel* tlabel = new QLabel(i->first.c_str()); - float_map_label[i->first] = tlabel; - QLineEdit* tline = new QLineEdit(); - numtochar<second; - tline->setText(numtochar.str().c_str()); - numtochar.str(""); - float_map_obj[i->first] = tline; - } - - ///////Attach the widgets of important variables - - for(int i = 0; isize(); i++){ - QLabel* theader = new QLabel((*important_map)[i].first.c_str()); - theader->setFont(QFont("Times", 18, QFont::Bold)); - configLayout->addWidget(theader, grid_vindex++, grid_hindex,1,2,Qt::AlignHCenter ); - - for(int j = 0; j<(*important_map)[i].second.size(); j++){ - QLabel* tlabel = 0; - QLineEdit* tline = 0; - if(str_map_obj.find((*important_map)[i].second[j])!=str_map_obj.end()){ - tlabel = (str_map_label.find((*important_map)[i].second[j]))->second; - tline = (str_map_obj.find((*important_map)[i].second[j]))->second; - } else if(int_map_obj.find((*important_map)[i].second[j])!=int_map_obj.end()){ - tlabel = (int_map_label.find((*important_map)[i].second[j]))->second; - tline = (int_map_obj.find((*important_map)[i].second[j]))->second; - - } else if(float_map_obj.find((*important_map)[i].second[j])!=float_map_obj.end()){ - tlabel = (float_map_label.find((*important_map)[i].second[j]))->second; - tline = (float_map_obj.find((*important_map)[i].second[j]))->second; - } else { - cout<<"Probably a typo: "<<(*important_map)[i].second[j]<setRowStretch(grid_vindex, 0); - configLayout->addWidget(tlabel, grid_vindex,grid_hindex,Qt::AlignRight ); - configLayout->addWidget(tline, grid_vindex++,grid_hindex+1); - - } - grid_hindex+=2; - grid_vindex=0; - if((*important_map)[i].second.size()>vmax){ - vmax = (*important_map)[i].second.size()+1; - } - } - hmax = grid_hindex-1; - grid_hindex = 0; - - //Silly way to add dividers - QFrame* divider_frame1 = new QFrame(); - divider_frame1->setFrameShape(QFrame::HLine); - divider_frame1->setFrameShadow(QFrame::Sunken); - configLayout->addWidget(divider_frame1, vmax, 0, 1, hmax+1); - configLayout->setRowStretch(vmax, 10); - - - - QPushButton *advanced_button = new QPushButton("Advanced Settings"); - connect(advanced_button, SIGNAL(clicked()), this, SLOT(toggleadvanced())); - QPushButton *save_button = new QPushButton("Save Settings"); - connect(save_button, SIGNAL(clicked()), this, SLOT(saveconfig())); - write_edit = new QLineEdit(); - QPushButton *write_button = new QPushButton("Write Config to File: "); - connect(write_button, SIGNAL(clicked()), this, SLOT(writeconfig())); - - configLayout->addWidget(advanced_button, vmax+1, grid_hindex++); - configLayout->addWidget(save_button, vmax+1, grid_hindex++); - configLayout->addWidget(write_button, vmax+1, hmax-1); - configLayout->addWidget(write_edit, vmax+1, hmax); - configLayout->setRowStretch(vmax, 0); - - //can't think of any other way of adding a layoutmanager inside layout manager - //so we add a frame to the configlayout and then add a layout to the frame - advanced_frame = new QFrame(); - advanced_frame->setFrameShadow(QFrame::Sunken); - advanced_frame->hide(); - advanced_frame->setGeometry(200, 200, 1300, 600); - - QGridLayout* advancedLayout = new QGridLayout; - advanced_frame->setLayout(advancedLayout); - - int advanced_rows = 15; - - - //all the misc variables are added to the advanced frame/layoutmanager - grid_vindex=0; - grid_hindex=0; - for( map::const_iterator i = str_map_obj.begin(); - i!=str_map_obj.end(); - i++){ - if(not_advanced_list.find(i->first) == not_advanced_list.end()){ - QLabel* tlabel = 0; - QLineEdit* tline = 0; - tlabel = str_map_label.find(i->first)->second; - tline = str_map_obj.find(i->first)->second; - advancedLayout->addWidget(tlabel, grid_vindex,grid_hindex,Qt::AlignRight ); - advancedLayout->addWidget(tline, grid_vindex++,grid_hindex+1); - if(grid_vindex>advanced_rows){ - grid_vindex = 0; - grid_hindex +=2; - } - } - } - - for( map::const_iterator i = int_map_obj.begin(); - i!=int_map_obj.end(); - i++){ - if(not_advanced_list.find(i->first) == not_advanced_list.end()){ - QLabel* tlabel = 0; - QLineEdit* tline = 0; - tlabel = int_map_label.find(i->first)->second; - tline = int_map_obj.find(i->first)->second; - advancedLayout->addWidget(tlabel, grid_vindex,grid_hindex,Qt::AlignRight ); - advancedLayout->addWidget(tline, grid_vindex++,grid_hindex+1); - if(grid_vindex>advanced_rows){ - grid_vindex = 0; - grid_hindex +=2; - } - } - } - for( map::const_iterator i = float_map_obj.begin(); - i!=float_map_obj.end(); - i++){ - if(not_advanced_list.find(i->first) == not_advanced_list.end()){ - QLabel* tlabel = 0; - QLineEdit* tline = 0; - tlabel = float_map_label.find(i->first)->second; - tline = float_map_obj.find(i->first)->second; - advancedLayout->addWidget(tlabel, grid_vindex,grid_hindex,Qt::AlignRight ); - advancedLayout->addWidget(tline, grid_vindex++,grid_hindex+1); - if(grid_vindex>advanced_rows){ - grid_vindex = 0; - grid_hindex +=2; - } - } - } -} - -//show or not show the other hunder optoins -//the frame does not interact well with the layout manager when I "hide" it -void configTab::toggleadvanced(){ - advanced_frame->show(); -} - -void configTab::writeconfig(){ - assert(config!=0); - //the only file name check that I do, no spaces - size_t found; - string filename = write_edit->text().toStdString(); - found = filename.find(' '); - if(filename.substr(0,found).length()!=0){ - cout<<"Creating Config file: "<WriteFile(filename.substr(0,found)); - } else { - cout<<"No file name provided\n"; - } -} - - -//changes to the gui are not commited and will not have an effect without -//clicking the save buttono -void configTab::saveconfig(){ - for( map::const_iterator i = str_map_obj.begin(); - i!=str_map_obj.end(); - i++){ - config->Assign(i->first, i->second->text().toStdString()); - } - - for( map::const_iterator i = int_map_obj.begin(); - i!=int_map_obj.end(); - i++){ - - config->Assign(i->first, i->second->text().toUInt()); - } - for( map::const_iterator i = float_map_obj.begin(); - i!=float_map_obj.end(); - i++){ - config->Assign(i->first, i->second->text().toDouble()); - } -} - - -Histogram::Histogram(QWidget *parent) - :QWidget(parent){ - plot_data = 0; - bin_min = 0; - bin_max = 100; - -} - -void Histogram::paintEvent(QPaintEvent * /* event */) -{ - QPainter painter(this); - painter.setPen(Qt::NoPen); - painter.setBrush(Qt::black); - int height_max = 0; - - - - for(int i = bin_min; iGetBin(i) > height_max){ - height_max = plot_data->GetBin(i); - } - } - painter.translate(0, rect().height()); - painter.scale(float(rect().width())/float(bin_max-bin_min), float(rect().height())/float(height_max)); - for(int i = bin_min; iGetBin(i)); - } - -} - -Heatmap::Heatmap(QWidget *parent) - :QWidget(parent){ - min = 0.0; - max = 1.0; - - -} - - -QColor Heatmap::GetColor(float map){ - // by Ged Larsen - // map a float to 4 of 6 segments of a color progression - // - // -1 to -0.5 <0,0,1> to <0,1,1> dark blue to light blue - // -0.5 to 0 <0,1,1> to <0,1,0> light blue to green - // 0 to 0.5 <0,1,0> to <1,1,0> green to yellow - // 0.5 to 1 <1,1,0> to <1,0,0> yellow to red - - int fraction; - if (map < min) { - fraction = 0; - } - else if (map > max) { - fraction = 255; - } - else { - fraction = 255*map/(max-min)+127 - (max / (max-min))*255; - } - - if ( fraction <=63 ) { return QColor(0, 4*fraction, 255); } - else if ( fraction <=127 ) { return QColor(0, 255, 256 - 4*(fraction-63)); } - else if ( fraction <=191 ) { return QColor((fraction-127)*4-1, 255, 0); } - else { return QColor(255, 256 - 4*(fraction - 191), 0); } -} - -void Heatmap::paintEvent(QPaintEvent * /* event */) -{ - QPainter painter(this); - painter.setPen(Qt::NoPen); - painter.setBrush(Qt::black); - - - //next - -} - - -simulationTab::simulationTab(QWidget *parent) - :QWidget(parent){ - simulationLayout = new QGridLayout; - setLayout(simulationLayout); - curr_mode = simulationTab::GENERAL; - stats_ready = false; - - generalFrame = new QTextEdit(); - generalFrame->setReadOnly(true); - generalFrame->setFrameShape(QFrame::Box); - simulationLayout->addWidget(generalFrame,1,0); - - - - pgraph = new Histogram(); - pmin = new QLineEdit("0"); - pmax = new QLineEdit("100"); - pset = new QPushButton("Change Scale"); - connect(pset, SIGNAL(clicked()),this,SLOT(changescale())); - connect(this, SIGNAL(redrawhist(int)), this, SLOT(getstats(int))); - packetFrame = new QFrame(); - packetFrame->setFrameShape(QFrame::Box); - packetLayout = new QGridLayout; - packetFrame->setLayout(packetLayout); - packetLayout->addWidget(pgraph, 0,0,1,5); - packetLayout->addWidget(new QLabel("Min"), 1,0); - packetLayout->addWidget(pmin, 1,1); - packetLayout->addWidget(new QLabel("Max"), 1,2); - packetLayout->addWidget(pmax, 1,3); - packetLayout->addWidget(pset, 1,4); - packetLayout->setRowStretch(0,10); - packetLayout->setRowStretch(1,0); - simulationLayout->addWidget(packetFrame,1,0); - packetFrame->hide(); - - ngraph = new Heatmap(); - nodeFrame = new QFrame(); - nodeFrame ->setFrameShape(QFrame::Box); - nodeLayout = new QGridLayout; - nodeLayout->addWidget(ngraph, 0,0,1,5); - nodeFrame->setLayout(nodeLayout); - simulationLayout->addWidget(nodeFrame,1,0); - nodeFrame->hide(); - - channelFrame = new QFrame(); - channelFrame ->setFrameShape(QFrame::Box); - channelLayout = new QGridLayout; - channelFrame->setLayout(channelLayout); - simulationLayout->addWidget(channelFrame,1,0); - channelFrame->hide(); - - mode_selector = new QComboBox(this); - mode_selector->addItem("General"); - mode_selector->addItem("Packet Latency"); - mode_selector->addItem("Node Throughput"); - mode_selector->addItem("Channel Load"); - - simulationLayout->addWidget(mode_selector, 0,0); - connect(mode_selector, SIGNAL(activated(int)), this, SLOT(getstats(int))); - connect(this, SIGNAL(gotostats(int)), this, SLOT(getstats(int))); -} - -void simulationTab::getstats(int m){ - curr_mode = (simulationTab::StatModes)m; - generalFrame->hide(); - packetFrame->hide(); - nodeFrame->hide(); - channelFrame->hide(); - stringstream infotext; - if(stats_ready){ - - switch(curr_mode){ - case simulationTab::GENERAL : - //copied over from trafficmanager - infotext.str(""); - infotext << "Overall minimum latency = " << GetStats("overall_min_latency_stat_0")->Average( ) - << " (" << GetStats("overall_min_latency_stat_0")->NumSamples( ) << " samples)" << endl; - infotext << "Overall average latency = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - infotext << "Overall maximum latency = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - infotext << "Overall minimum transaction latency = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - infotext << "Overall average transaction latency = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - infotext << "Overall maximum transaction latency = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - - infotext << "Overall minimum fragmentation = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - infotext << "Overall average fragmentation = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - infotext << "Overall maximum fragmentation = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - infotext << "Overall average accepted rate = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - - infotext << "Overall min accepted rate = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - - infotext << "Average hops = " <Average( ) - << " (" <NumSamples( ) << " samples)" << endl; - generalFrame->setText(infotext.str().c_str()); - generalFrame->show(); - break; - case simulationTab::PACKET_LATENCY : - - - pgraph->plot_data = GetStats("latency_stat_0"); - packetFrame->show(); - break; - case simulationTab::NODE_THROUGHPUT: - nodeFrame->show(); - break; - case simulationTab::CHANNEL_LOAD : - channelFrame->show(); - break; - default: - break; - } - - } else { - generalFrame->setText("No simulation data available"); - generalFrame->show(); - - } - -} - -void simulationTab::readystats(bool sim_status){ - stats_ready = sim_status; - emit gotostats(int(curr_mode)); -} diff --git a/src/bgui.hpp b/src/bgui.hpp deleted file mode 100644 index c0f957e1..00000000 --- a/src/bgui.hpp +++ /dev/null @@ -1,197 +0,0 @@ -#ifndef _BGUI_HPP_ -#define _BGUI_HPP_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "booksim_config.hpp" -#include "globals.hpp" - -#include -#include -#include - -//for allocsim in main.cpp -typedef bool (*booksimfunc)( const BookSimConfig & ); - -//for pthread -struct bsjob{ - booksimfunc bs; - BookSimConfig * config; - //0 booksim is free, 1 booksim is already running - int status; - bool return_status; -} ; - - -class configTab : public QWidget -{ - //qt required - Q_OBJECT - public: - configTab(QWidget *parent = 0); - void setup(BookSimConfig * cf); - -public slots: - void toggleadvanced(); - void writeconfig(); - void saveconfig(); -private: - //layout manager for the config tab - QGridLayout *configLayout; - //another pointer to the booksim config file - BookSimConfig * config; - - //displaying the misc booksim options - QFrame* advanced_frame; - - //for the layout manager - int vmax; - int hmax; - - //write cofig file name widget - QLineEdit *write_edit; - - //all the widgets asoociated with all the booksi options - //labels are texts and lineedits are the text boxes - //can't consolidate them because config->assign is type specific - map str_map_label; - map str_map_obj; - map int_map_label; - map int_map_obj; - map float_map_label; - map float_map_obj; -}; - -class Heatmap: public QWidget -{ -public: - Heatmap(QWidget *parent = 0); - - QColor GetColor(float max); - Stats * plot_data; - - float min; - float max; -protected: - void paintEvent(QPaintEvent *event); - - -}; - -class Histogram : public QWidget -{ -public: - Histogram(QWidget *parent = 0); - - Stats * plot_data; - int bin_min; - int bin_max; -protected: - void paintEvent(QPaintEvent *event); - -}; - - -class simulationTab : public QWidget -{ - //Qt required - Q_OBJECT - public: - simulationTab(QWidget *parent = 0); - - enum StatModes { GENERAL = 0, - PACKET_LATENCY = 1, - NODE_THROUGHPUT = 2, - CHANNEL_LOAD = 3}; - -signals: - void gotostats(int); - void redrawhist(int); -public slots: - void getstats(int m ); - void readystats(bool status); - void changescale(){ - pgraph->bin_min = pmin->text().toInt(); - pgraph->bin_max = pmax->text().toInt(); - emit redrawhist(simulationTab::PACKET_LATENCY); - } -private: - // - QGridLayout *simulationLayout; - - // - QTextEdit *generalFrame; - - Histogram * pgraph; - QLineEdit *pmin; - QLineEdit *pmax; - QPushButton *pset; - QFrame *packetFrame; - QGridLayout *packetLayout; - - Heatmap* ngraph; - QFrame *nodeFrame; - QGridLayout *nodeLayout; - QFrame *channelFrame; - QGridLayout *channelLayout; - - // - QComboBox* mode_selector; - - StatModes curr_mode; - bool stats_ready; -}; - - - -class BooksimGUI : public QWidget -{ - //Qt required - Q_OBJECT - -public: - BooksimGUI(QWidget *parent = 0); - ~BooksimGUI(){} - - //allocsime is called by the gui instead of main, - void RegisterSimFunc(booksimfunc, BookSimConfig * cf); -public slots: - void run(); - void checksimulation(); -signals: - void updatestats(bool status); - void simulationstatus(bool status); -private: - - //booksim job data such as functio pointer are here for pthread - bsjob arbeit; - //pthread struct - pthread_t bsthread; - - //Layout manger for the whole winodw - QGridLayout *mainLayout; - - //each tab is declared here - configTab *configtab; - simulationTab *simulationtab; - // - QTimer *simulationTimer; - -}; - - - -#endif diff --git a/src/booksim_config.cpp b/src/booksim_config.cpp index 4066f2c5..08f88e75 100644 --- a/src/booksim_config.cpp +++ b/src/booksim_config.cpp @@ -48,15 +48,17 @@ BookSimConfig::BookSimConfig( ) _int_map["subnets"] = 1; //==== Topology options ======================= - //important AddStrField( "topology", "torus" ); _int_map["k"] = 8; //network radix _int_map["n"] = 2; //network dimension _int_map["c"] = 1; //concentration AddStrField( "routing_function", "none" ); + + //simulator tries to correclty adjust latency for node/router placement _int_map["use_noc_latency"] = 1; - //not critical + + //used for noc latency calcualtion for network with concentration _int_map["x"] = 8; //number of routers in X _int_map["y"] = 8; //number of routers in Y _int_map["xr"] = 1; //number of nodes per router in X only if c>1 @@ -82,6 +84,7 @@ BookSimConfig::BookSimConfig( ) _int_map["output_delay"] = 0; _int_map["credit_delay"] = 0; _float_map["internal_speedup"] = 1.0; + //with switch speedup flits requires otuput buffering //full output buffer will cancel switch allocation requests //default setting is unlimited @@ -100,9 +103,9 @@ BookSimConfig::BookSimConfig( ) AddStrField("spec_sw_allocator", "prio"); _int_map["num_vcs"] = 16; - _int_map["vc_buf_size"] = 8; - _int_map["buf_size"] = -1; - AddStrField("buffer_policy", "private"); + _int_map["vc_buf_size"] = 8; //per vc buffer size + _int_map["buf_size"] = -1; //shared buffer size + AddStrField("buffer_policy", "private"); //buffer sharing policy _int_map["private_bufs"] = -1; _int_map["private_buf_size"] = 1; @@ -211,7 +214,7 @@ BookSimConfig::BookSimConfig( ) AddStrField( "workload", "synthetic({0.1,1,bernoulli,uniform})" ); - _int_map["warmup_periods"] = 0; // number of samples periods to "warm-up" the simulation + _int_map["warmup_periods"] = 3; // number of samples periods to "warm-up" the simulation _int_map["sample_period"] = 1000; // how long between measurements _int_map["max_samples"] = 10; // maximum number of sample periods in a simulation @@ -298,62 +301,6 @@ BookSimConfig::BookSimConfig( ) AddStrField("network_file",""); } - -#ifdef USE_GUI - -//A list of important simulator for the booksim gui, anything else not listed here is still included -//but just not very organized -vector > > BookSimConfig::GetImportantMap() { - //Vector of 5 categories, each category is a vector of potions. Maps don't work because it autosorts - vector< pair > > important; - important.push_back( make_pair( "Topology", vector() )); - important[0].second.push_back("topology"); - important[0].second.push_back("k"); - important[0].second.push_back("n"); - important[0].second.push_back("c"); - important[0].second.push_back( "routing_function"); - important[0].second.push_back("use_noc_latency"); - - important.push_back(make_pair("Router", vector())); - important[1].second.push_back("router"); - important[1].second.push_back("num_vcs"); - important[1].second.push_back("vc_buf_size"); - important[1].second.push_back("routing_delay"); - important[1].second.push_back("vc_alloc_delay"); - important[1].second.push_back("sw_alloc_delay"); - important[1].second.push_back("st_prepare_delay"); - important[1].second.push_back("st_final_delay"); - - important.push_back(make_pair("Allocator", vector())); - important[2].second.push_back("vc_allocator"); - important[2].second.push_back("sw_allocator"); - important[2].second.push_back("arb_type"); - important[2].second.push_back("priority"); - important[2].second.push_back("speculative"); - - important.push_back(make_pair("Simulation", vector())); - important[3].second.push_back("traffic"); - important[3].second.push_back("injection_rate"); - important[3].second.push_back("injection_rate_uses_flits"); - important[3].second.push_back("sim_type"); - important[3].second.push_back("latency_thres"); - important[3].second.push_back("packet_size"); - important[3].second.push_back("injection_process"); - important[3].second.push_back("sample_period"); - - important.push_back(make_pair("Statistics", vector())); - important[4].second.push_back("print_activity"); - important[4].second.push_back("print_csv_results"); - important[4].second.push_back("print_vc_stats"); - important[4].second.push_back("stats_out"); - important[4].second.push_back("sim_power"); - important[4].second.push_back("power_output_file"); - - return important; -} - -#endif - PowerConfig::PowerConfig( ) { diff --git a/src/booksim_config.hpp b/src/booksim_config.hpp index 164a1fcf..42bee233 100644 --- a/src/booksim_config.hpp +++ b/src/booksim_config.hpp @@ -35,11 +35,6 @@ class BookSimConfig : public Configuration { public: BookSimConfig( ); - -#ifdef USE_GUI - vector > > GetImportantMap(); -#endif - }; #endif diff --git a/src/examples/mesh88_lat b/src/examples/mesh88_lat index bafdbfeb..dccabf76 100644 --- a/src/examples/mesh88_lat +++ b/src/examples/mesh88_lat @@ -34,38 +34,35 @@ k = 8; n = 2; // Routing - routing_function = dor; // Flow control - -num_vcs = 2; -vc_buf_size = 16; - +num_vcs = 8; +vc_buf_size = 8; wait_for_tail_credit = 1; // Router architecture - vc_allocator = islip; sw_allocator = islip; alloc_iters = 1; credit_delay = 2; -routing_delay = 1; +routing_delay = 0; vc_alloc_delay = 1; +sw_alloc_delay = 1; input_speedup = 2; output_speedup = 1; internal_speedup = 1.0; -// Traffic -traffic = uniform; +// Traffic +traffic = transpose; packet_size = 20; -// Simulation -sim_type = latency; -injection_rate = 0.01; +// Simulation +sim_type = latency; +injection_rate = 0.005; diff --git a/src/flitchannel.cpp b/src/flitchannel.cpp index 89c544aa..5ecb0f90 100644 --- a/src/flitchannel.cpp +++ b/src/flitchannel.cpp @@ -47,7 +47,7 @@ // ---------------------------------------------------------------------- FlitChannel::FlitChannel(Module * parent, string const & name, int classes) : Channel(parent, name), _routerSource(NULL), _routerSourcePort(-1), - _routerSink(NULL), _routerSinkPort(-1), _idle(0), _classes(classes) { + _routerSink(NULL), _routerSinkPort(-1), _idle(0) { _active.resize(classes, 0); } diff --git a/src/flitchannel.hpp b/src/flitchannel.hpp index 5f9d9d8e..261c4119 100644 --- a/src/flitchannel.hpp +++ b/src/flitchannel.hpp @@ -94,7 +94,6 @@ class FlitChannel : public Channel { // Statistics for Activity Factors vector _active; int _idle; - int _classes; }; #endif diff --git a/src/main.cpp b/src/main.cpp index 130c8339..e587a7f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,10 +41,7 @@ #include #include -#ifdef USE_GUI -#include -#include "bgui.hpp" -#endif + #include #include "booksim.hpp" @@ -93,9 +90,7 @@ bool gTrace; ostream * gWatchOut; -#ifdef USE_GUI -bool gGUIMode = false; -#endif + ///////////////////////////////////////////////////////////////////////////// @@ -161,29 +156,10 @@ int main( int argc, char **argv ) BookSimConfig config; -#ifdef USE_GUI - for(int i = 1; i < argc; ++i) { - string arg(argv[i]); - if(arg=="-g"){ - gGUIMode = true; - break; - } - } -#endif + if ( !ParseArgs( &config, argc, argv ) ) { -#ifdef USE_GUI - if(gGUIMode){ - cout<< "No config file found"<RegisterSimFunc(&Simulate,&config); - bs->setGeometry(100, 100, 1200, 355); - bs->show(); - return app.exec(); - } -#endif - bool result = Simulate( config ); return result ? -1 : 0; } diff --git a/src/networks/dragonfly.cpp b/src/networks/dragonfly.cpp index b539cc6c..01a2281d 100644 --- a/src/networks/dragonfly.cpp +++ b/src/networks/dragonfly.cpp @@ -217,12 +217,12 @@ void DragonFlyNew::_ComputeSize( const Configuration &config ) void DragonFlyNew::_BuildNet( const Configuration &config ) { - int _output; - int _input; + int _output=-1; + int _input=-1; + int _dim_ID=-1; + int _num_ports_per_switch=-1; + int _dim_size=-1; int c; - int _dim_ID; - int _num_ports_per_switch; - int _dim_size; ostringstream router_name; diff --git a/src/networks/kncube.cpp b/src/networks/kncube.cpp index 5f89d612..07259a34 100644 --- a/src/networks/kncube.cpp +++ b/src/networks/kncube.cpp @@ -239,7 +239,7 @@ void KNCube::InsertRandomFaults( const Configuration &config ) num_fails = config.GetInt( "link_failures" ); - if ( num_fails ) { + if ( _size && num_fails ) { prev_seed = RandomIntLong( ); RandomSeed( config.GetInt( "fail_seed" ) ); diff --git a/src/power/techfile.txt b/src/power/techfile.txt new file mode 100755 index 00000000..c9537139 --- /dev/null +++ b/src/power/techfile.txt @@ -0,0 +1,26 @@ +// 2007 ITRS predictions for a 32nm high-performance library +H_INVD2 = 8;//int +W_INVD2 = 3;//int +H_DFQD1 = 8;//int +W_DFQD1 = 16;//int +H_ND2D1 = 8;//int +W_ND2D1 = 3;//int +H_SRAM = 8;//int +W_SRAM = 6;//int +Vdd = 0.9;//float +R = 606.321;//float +IoffSRAM = 0.00000032;//float +// 70 C +IoffP = 0.00000102;//float +IoffN = 0.00000102;//float +Cg_pwr = 0.000000000000000534;//float +Cd_pwr = 0.000000000000000267;//float +Cgdl = 0.0000000000000001068;//float +Cg = 0.000000000000000534;//float +Cd = 0.000000000000000267;//float +LAMBDA = 0.016;//float +MetalPitch = 0.000080;//float +Rw = 0.720044;//float +Cw_gnd = 0.000000000000267339;//float +Cw_cpl = 0.000000000000267339;//float +wire_length = 2.0;//float \ No newline at end of file diff --git a/src/routefunc.cpp b/src/routefunc.cpp index 7048fbd9..64bca5cb 100644 --- a/src/routefunc.cpp +++ b/src/routefunc.cpp @@ -1517,7 +1517,6 @@ void min_adapt_torus( const Router *r, const Flit *f, int in_channel, OutputSet if ( f->ph == 0 ) { outputs->AddRange( out_port, vcBegin, vcBegin, 0 ); } else { - assert(f->ph == 1); outputs->AddRange( out_port, vcBegin+1, vcBegin+1, 0 ); } } diff --git a/src/routers/chaos_router.cpp b/src/routers/chaos_router.cpp index 8d8eccc8..98e95e1c 100644 --- a/src/routers/chaos_router.cpp +++ b/src/routers/chaos_router.cpp @@ -589,13 +589,13 @@ void ChaosRouter::_OutputAdvance( ) for ( int m = 0; m < _multi_queue_size; ++m ) { if ( _multi_match[m] != -1 ) { - if ( !_multi_queue[m].empty( ) ) { - f = _multi_queue[m].front( ); - _multi_queue[m].pop( ); - } else { + if ( _multi_queue[m].empty( ) ) { cout << "State = " << _multi_state[m] << endl; Error( "Multi queue empty, but matched!" ); } + assert( !_multi_queue[m].empty( ) ); + f = _multi_queue[m].front( ); + _multi_queue[m].pop( ); _crossbar_pipe->Write( f, _multi_match[m] );