diff options
Diffstat (limited to 'src/intersim2')
| -rw-r--r-- | src/intersim2/CMakeLists.txt | 106 | ||||
| -rw-r--r-- | src/intersim2/Makefile | 6 | ||||
| -rw-r--r-- | src/intersim2/config_utils.cpp | 10 | ||||
| -rw-r--r-- | src/intersim2/config_utils.hpp | 2 | ||||
| -rw-r--r-- | src/intersim2/interconnect_interface.cpp | 2 | ||||
| -rw-r--r-- | src/intersim2/networks/anynet.cpp | 2 | ||||
| -rw-r--r-- | src/intersim2/networks/dragonfly.cpp | 26 | ||||
| -rw-r--r-- | src/intersim2/networks/flatfly_onchip.cpp | 4 | ||||
| -rw-r--r-- | src/intersim2/networks/kncube.cpp | 2 | ||||
| -rw-r--r-- | src/intersim2/networks/qtree.cpp | 2 | ||||
| -rw-r--r-- | src/intersim2/vc.cpp | 2 |
11 files changed, 135 insertions, 29 deletions
diff --git a/src/intersim2/CMakeLists.txt b/src/intersim2/CMakeLists.txt new file mode 100644 index 0000000..c3da1b1 --- /dev/null +++ b/src/intersim2/CMakeLists.txt @@ -0,0 +1,106 @@ +option(GPGPUSIM_INTERSIM_STANDALONE "Whether to also build intersim in standalone mode" OFF) + +# Specify Flex and Bison target +BISON_TARGET(intersim_config_parser config.y ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c + COMPILE_FLAGS "-y -d --file-prefix=${CMAKE_CURRENT_BINARY_DIR}/y") +FLEX_TARGET(intersim_config_lexer config.l ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c) +ADD_FLEX_BISON_DEPENDENCY(intersim_config_lexer intersim_config_parser) + +# Set generated source files to CXX +set_source_files_properties(${BISON_intersim_config_parser_OUTPUT_SOURCE} + ${FLEX_intersim_config_lexer_OUTPUTS} + PROPERTIES LANGUAGE CXX) + +# Create booksim or libintersim.a +# Shared include path +list(APPEND intersim_INC ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/allocators + ${CMAKE_CURRENT_SOURCE_DIR}/arbiters + ${CMAKE_CURRENT_SOURCE_DIR}/networks + ${CMAKE_CURRENT_SOURCE_DIR}/power + ${CMAKE_CURRENT_SOURCE_DIR}/routers + ${PROJECT_SOURCE_DIR}/src) + +# Shared source files +list(APPEND intersim_SRC + ${BISON_intersim_config_parser_OUTPUT_SOURCE} + ${FLEX_intersim_config_lexer_OUTPUTS} + allocators/allocator.cpp + allocators/islip.cpp + allocators/loa.cpp + allocators/maxsize.cpp + allocators/pim.cpp + allocators/selalloc.cpp + allocators/separable.cpp + allocators/separable_input_first.cpp + allocators/separable_output_first.cpp + allocators/wavefront.cpp + arbiters/arbiter.cpp + arbiters/matrix_arb.cpp + arbiters/prio_arb.cpp + arbiters/roundrobin_arb.cpp + arbiters/tree_arb.cpp + batchtrafficmanager.cpp + booksim_config.cpp + buffer.cpp + buffer_state.cpp + config_utils.cpp + credit.cpp + flitchannel.cpp + flit.cpp + gputrafficmanager.cpp + injection.cpp + interconnect_interface.cpp + intersim_config.cpp + main.cpp + misc_utils.cpp + module.cpp + networks/anynet.cpp + networks/cmesh.cpp + networks/dragonfly.cpp + networks/fattree.cpp + networks/flatfly_onchip.cpp + networks/fly.cpp + networks/kncube.cpp + networks/network.cpp + networks/qtree.cpp + networks/tree4.cpp + outputset.cpp + packet_reply_info.cpp + power/buffer_monitor.cpp + power/power_module.cpp + power/switch_monitor.cpp + rng_double_wrapper.cpp + rng_wrapper.cpp + routefunc.cpp + routers/chaos_router.cpp + routers/event_router.cpp + routers/iq_router.cpp + routers/router.cpp + stats.cpp + traffic.cpp + trafficmanager.cpp + vc.cpp) + +# If standalone, also build for it +if(GPGPUSIM_INTERSIM_STANDALONE) + list(REMOVE_ITEM ${intersim_SRC} interconnect_interface.cpp) + add_executable(booksim ${intersim_SRC}) + target_include_directories(booksim PUBLIC + ${intersim_INC}) + target_include_directories(booksim PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_include_directories(booksim PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) + # Remove globally set TRACING_ON flag + target_compile_options(booksim PRIVATE -UTRACING_ON) +endif() + +# Specify sources for libintersim.a +add_library(intersim STATIC ${intersim_SRC}) +target_include_directories(intersim PUBLIC + ${intersim_INC} + ${PROJECT_SOURCE_DIR}/src/gpgpu-sim) +target_include_directories(intersim PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories(intersim PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) +target_compile_definitions(intersim PRIVATE CREATE_LIBRARY) +# Remove globally set TRACING_ON flag +target_compile_options(intersim PRIVATE -UTRACING_ON) diff --git a/src/intersim2/Makefile b/src/intersim2/Makefile index 3eeeb70..a7485e2 100644 --- a/src/intersim2/Makefile +++ b/src/intersim2/Makefile @@ -28,7 +28,7 @@ # Makefile # CXX = g++ -CC = gcc +CC = g++ CREATE_LIBRARY ?= 0 INTERFACE = interconnect_interface.cpp DEBUG ?= 0 @@ -136,10 +136,10 @@ depend: makedepend -f$(OBJDIR)/Makefile.makedepend -I$(INCPATH) -p$(OBJDIR)/ $(ALL_SRCS) 2> /dev/null ${LEX_OBJS}: $(OBJDIR)/lex.yy.c $(OBJDIR)/y.tab.h - $(CC) $(CPPFLAGS) -c $< -o $@ + $(CC) -Wno-unused-function $(CPPFLAGS) -c $< -o $@ ${YACC_OBJS}: $(OBJDIR)/y.tab.c $(OBJDIR)/y.tab.h - $(CC) $(CPPFLAGS) -c $< -o $@ + $(CC) -Wno-unused-function $(CPPFLAGS) -c $< -o $@ ${OBJDIR}/%.o: %.cpp $(CXX) $(CPPFLAGS) -c $< -o $@ diff --git a/src/intersim2/config_utils.cpp b/src/intersim2/config_utils.cpp index fad5fce..a896a93 100644 --- a/src/intersim2/config_utils.cpp +++ b/src/intersim2/config_utils.cpp @@ -199,27 +199,27 @@ Configuration * Configuration::GetTheConfig() //============================================================ -extern "C" void config_error( char const * msg, int lineno ) +void config_error( char * msg, int lineno ) { Configuration::GetTheConfig( )->ParseError( msg, lineno ); } -extern "C" void config_assign_string( char const * field, char const * value ) + void config_assign_string( char const * field, char const * value ) { Configuration::GetTheConfig()->Assign(field, value); } -extern "C" void config_assign_int( char const * field, int value ) +void config_assign_int( char const * field, int value ) { Configuration::GetTheConfig()->Assign(field, value); } -extern "C" void config_assign_float( char const * field, double value ) +void config_assign_float( char const * field, double value ) { Configuration::GetTheConfig()->Assign(field, value); } -extern "C" int config_input(char * line, int max_size) +int config_input(char * line, int max_size) { return Configuration::GetTheConfig()->Input(line, max_size); } diff --git a/src/intersim2/config_utils.hpp b/src/intersim2/config_utils.hpp index de3343b..1d960b6 100644 --- a/src/intersim2/config_utils.hpp +++ b/src/intersim2/config_utils.hpp @@ -35,7 +35,7 @@ #include<map> #include<vector> -extern "C" int yyparse(); +int yyparse(); class Configuration { static Configuration * theConfig; diff --git a/src/intersim2/interconnect_interface.cpp b/src/intersim2/interconnect_interface.cpp index 1e1a2d7..438852e 100644 --- a/src/intersim2/interconnect_interface.cpp +++ b/src/intersim2/interconnect_interface.cpp @@ -200,7 +200,7 @@ void InterconnectInterface::Push(unsigned input_deviceID, unsigned output_device void* InterconnectInterface::Pop(unsigned deviceID) { int icntID = _node_map[deviceID]; -#if DEBUG +#if 0 cout<<"Call interconnect POP " << output<<endl; #endif diff --git a/src/intersim2/networks/anynet.cpp b/src/intersim2/networks/anynet.cpp index 4db1dfb..d7c6f22 100644 --- a/src/intersim2/networks/anynet.cpp +++ b/src/intersim2/networks/anynet.cpp @@ -491,7 +491,7 @@ void AnyNet::readFile(){ } sort(node_check.begin(), node_check.end()); for(size_t i = 0; i<node_check.size(); i++){ - if(node_check[i] != i){ + if(node_check[i] != (int)i){ cout<<"Anynet:booksim trafficmanager assumes sequential node numbering starting at 0\n"; assert(false); } diff --git a/src/intersim2/networks/dragonfly.cpp b/src/intersim2/networks/dragonfly.cpp index 01a2281..f5b637e 100644 --- a/src/intersim2/networks/dragonfly.cpp +++ b/src/intersim2/networks/dragonfly.cpp @@ -111,7 +111,7 @@ int dragonfly_port(int rID, int source, int dest){ int dest_grp_ID = int(dest/_grp_num_nodes); int grp_output=-1; int grp_RID=-1; - int group_dest=-1; + // int group_dest=-1; //which router within this group the packet needs to go to if (dest_grp_ID == grp_ID) { @@ -123,7 +123,7 @@ int dragonfly_port(int rID, int source, int dest){ grp_output = dest_grp_ID - 1; } grp_RID = int(grp_output /gP) + grp_ID * _grp_num_routers; - group_dest = grp_RID * gP; + // group_dest = grp_RID * gP; } //At the last hop @@ -221,7 +221,7 @@ void DragonFlyNew::_BuildNet( const Configuration &config ) int _input=-1; int _dim_ID=-1; int _num_ports_per_switch=-1; - int _dim_size=-1; + // int _dim_size=-1; int c; ostringstream router_name; @@ -314,7 +314,7 @@ void DragonFlyNew::_BuildNet( const Configuration &config ) // intra-group GROUP channels for ( int dim = 0; dim < _n; ++dim ) { - _dim_size = powi(_k,dim); + // _dim_size = powi(_k,dim); _dim_ID = ((int) (node / ( powi(_p, dim)))); @@ -356,16 +356,16 @@ void DragonFlyNew::_BuildNet( const Configuration &config ) // add INPUT channels -- "optical" channels connecting the groups - int _grp_num_routers; + // int _grp_num_routers; int grp_output; - int grp_ID2; + // int grp_ID2; for ( int cnt = 0; cnt < _p; ++cnt ) { // _dim_ID grp_output = _dim_ID* _p + cnt; - _grp_num_routers = powi(_k, _n-1); - grp_ID2 = (int) ((grp_ID - 1) / (_k - 1)); + // _grp_num_routers = powi(_k, _n-1); + // grp_ID2 = (int) ((grp_ID - 1) / (_k - 1)); if ( grp_ID > grp_output) { @@ -495,8 +495,8 @@ void ugal_dragonflynew( const Router *r, const Flit *f, int in_channel, int debug = f->watch; int out_port = -1; int out_vc = 0; - int min_queue_size, min_hopcnt; - int nonmin_queue_size, nonmin_hopcnt; + int min_queue_size; //, min_hopcnt; + int nonmin_queue_size; //, nonmin_hopcnt; int intm_grp_ID; int intm_rID; @@ -523,13 +523,13 @@ void ugal_dragonflynew( const Router *r, const Flit *f, int in_channel, f->ph = 1; } else { //congestion metrics using queue length, obtained by GetUsedCredit() - min_hopcnt = dragonflynew_hopcnt(f->src, f->dest); + // min_hopcnt = dragonflynew_hopcnt(f->src, f->dest); min_router_output = dragonfly_port(rID, f->src, f->dest); min_queue_size = max(r->GetUsedCredit(min_router_output), 0) ; - nonmin_hopcnt = dragonflynew_hopcnt(f->src, f->intm) + - dragonflynew_hopcnt(f->intm,f->dest); + // nonmin_hopcnt = dragonflynew_hopcnt(f->src, f->intm) + + // dragonflynew_hopcnt(f->intm,f->dest); nonmin_router_output = dragonfly_port(rID, f->src, f->intm); nonmin_queue_size = max(r->GetUsedCredit(nonmin_router_output), 0); diff --git a/src/intersim2/networks/flatfly_onchip.cpp b/src/intersim2/networks/flatfly_onchip.cpp index fd17c1a..df43371 100644 --- a/src/intersim2/networks/flatfly_onchip.cpp +++ b/src/intersim2/networks/flatfly_onchip.cpp @@ -1204,7 +1204,7 @@ void ugal_pni_flatfly_onchip( const Router *r, const Flit *f, int in_channel, int find_distance (int src, int dest) { int dist = 0; int _dim = gN; - int _dim_size; + // int _dim_size; int src_tmp= (int) src / gC; int dest_tmp = (int) dest / gC; @@ -1212,7 +1212,7 @@ int find_distance (int src, int dest) { // cout << " HOP CNT between src: " << src << " dest: " << dest; for (int d=0;d < _dim; d++) { - _dim_size = powi(gK, d )*gC; + // _dim_size = powi(gK, d )*gC; //if ((int)(src / _dim_size) != (int)(dest / _dim_size)) // dist++; src_id = src_tmp % gK; diff --git a/src/intersim2/networks/kncube.cpp b/src/intersim2/networks/kncube.cpp index 03e13e7..178c905 100644 --- a/src/intersim2/networks/kncube.cpp +++ b/src/intersim2/networks/kncube.cpp @@ -231,7 +231,7 @@ void KNCube::InsertRandomFaults( const Configuration &config ) int num_fails; unsigned long prev_seed; - int node, chan; + int node, chan = 0; int i, j, t, n, c; bool available; diff --git a/src/intersim2/networks/qtree.cpp b/src/intersim2/networks/qtree.cpp index 7214947..37d3d7c 100644 --- a/src/intersim2/networks/qtree.cpp +++ b/src/intersim2/networks/qtree.cpp @@ -84,7 +84,7 @@ void QTree::_BuildNet( const Configuration& config ) { ostringstream routerName; - int h, r, pos, port; + int h, r = 0 , pos, port; for (h = 0; h < _n; h++) { for (pos = 0 ; pos < powi( _k, h ) ; ++pos ) { diff --git a/src/intersim2/vc.cpp b/src/intersim2/vc.cpp index 94e8c6b..4c94445 100644 --- a/src/intersim2/vc.cpp +++ b/src/intersim2/vc.cpp @@ -82,7 +82,7 @@ void VC::AddFlit( Flit *f ) assert(f); if(_expected_pid >= 0) { - if(f->pid != _expected_pid) { + if((long long int)f->pid != _expected_pid) { ostringstream err; err << "Received flit " << f->id << " with unexpected packet ID: " << f->pid << " (expected: " << _expected_pid << ")"; |
