summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/icnt_wrapper.cc
diff options
context:
space:
mode:
authorDongdong Li <[email protected]>2013-08-22 20:28:46 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:50:58 -0700
commit69d31fcda599d82e9bcf5970bdecbc181388e5ef (patch)
treed3c58fb0f7ca14bc91e069408e2807188fd88af3 /src/gpgpu-sim/icnt_wrapper.cc
parent33262d1b6c2101dc43eb748d432df43097a1c849 (diff)
Refactoring:
1. Decouple the constructor of interconnect interface 2. Some type changed to unsigned from int Fixed Bug: wrong variable in InterconnectInterface::Busy() Review: 83001 [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 16877]
Diffstat (limited to 'src/gpgpu-sim/icnt_wrapper.cc')
-rw-r--r--src/gpgpu-sim/icnt_wrapper.cc30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/gpgpu-sim/icnt_wrapper.cc b/src/gpgpu-sim/icnt_wrapper.cc
index c005dd9..ee58ece 100644
--- a/src/gpgpu-sim/icnt_wrapper.cc
+++ b/src/gpgpu-sim/icnt_wrapper.cc
@@ -30,16 +30,17 @@
#include "../intersim2/globals.hpp"
#include "../intersim2/interconnect_interface.hpp"
-icnt_init_p icnt_init;
-icnt_has_buffer_p icnt_has_buffer;
-icnt_push_p icnt_push;
-icnt_pop_p icnt_pop;
-icnt_transfer_p icnt_transfer;
-icnt_busy_p icnt_busy;
-icnt_display_stats_p icnt_display_stats;
+icnt_create_p icnt_create;
+icnt_init_p icnt_init;
+icnt_has_buffer_p icnt_has_buffer;
+icnt_push_p icnt_push;
+icnt_pop_p icnt_pop;
+icnt_transfer_p icnt_transfer;
+icnt_busy_p icnt_busy;
+icnt_display_stats_p icnt_display_stats;
icnt_display_overall_stats_p icnt_display_overall_stats;
-icnt_display_state_p icnt_display_state;
-icnt_get_flit_size_p icnt_get_flit_size;
+icnt_display_state_p icnt_display_state;
+icnt_get_flit_size_p icnt_get_flit_size;
int g_network_mode;
char* g_network_config_filename;
@@ -48,6 +49,12 @@ char* g_network_config_filename;
// Wrapper to intersim2 to accompany old icnt_wrapper
// TODO: use delegate/boost/c++11<funtion> instead
+
+static void intersim2_create(unsigned int n_shader, unsigned int n_mem)
+{
+ g_icnt_interface->CreateInterconnect(n_shader, n_mem);
+}
+
static void intersim2_init()
{
g_icnt_interface->Init();
@@ -104,12 +111,13 @@ void icnt_reg_options( class OptionParser * opp )
option_parser_register(opp, "-inter_config_file", OPT_CSTR, &g_network_config_filename, "Interconnection network config file", "mesh");
}
-void icnt_wrapper_init( unsigned int n_shader, unsigned int n_mem )
+void icnt_wrapper_init()
{
switch (g_network_mode) {
case INTERSIM:
//FIXME: delete the object: may add icnt_done wrapper
- g_icnt_interface = new InterconnectInterface(g_network_config_filename, n_shader, n_mem );
+ g_icnt_interface = InterconnectInterface::New(g_network_config_filename);
+ icnt_create = intersim2_create;
icnt_init = intersim2_init;
icnt_has_buffer = intersim2_has_buffer;
icnt_push = intersim2_push;