Commit 0a984024 authored by Misbah Mubarak's avatar Misbah Mubarak

adjusting vcs with df-dally, making vc optional for df-dally

parent 0a22a582
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <cortex/topology.h> #include <cortex/topology.h>
#endif #endif
#define DF_DALLY 1
#define DUMP_CONNECTIONS 1 #define DUMP_CONNECTIONS 1
#define CREDIT_SIZE 8 #define CREDIT_SIZE 8
#define DFLY_HASH_TABLE_SIZE 4999 #define DFLY_HASH_TABLE_SIZE 4999
...@@ -44,6 +43,8 @@ ...@@ -44,6 +43,8 @@
#define LP_CONFIG_NM_ROUT (model_net_lp_config_names[DRAGONFLY_CUSTOM_ROUTER]) #define LP_CONFIG_NM_ROUT (model_net_lp_config_names[DRAGONFLY_CUSTOM_ROUTER])
#define LP_METHOD_NM_ROUT (model_net_method_names[DRAGONFLY_CUSTOM_ROUTER]) #define LP_METHOD_NM_ROUT (model_net_method_names[DRAGONFLY_CUSTOM_ROUTER])
static int DF_DALLY = 0;
using namespace std; using namespace std;
struct Link { struct Link {
int offset, type; int offset, type;
...@@ -519,6 +520,10 @@ static void dragonfly_read_config(const char * anno, dragonfly_param *params){ ...@@ -519,6 +520,10 @@ static void dragonfly_read_config(const char * anno, dragonfly_param *params){
fprintf(stderr, "Buffer size of global channels not specified, setting to %d\n", p->global_vc_size); fprintf(stderr, "Buffer size of global channels not specified, setting to %d\n", p->global_vc_size);
} }
rc = configuration_get_value_int(&config, "PARAMS", "df-dally-vc", anno, &DF_DALLY);
if(rc) {
DF_DALLY = 0;
}
rc = configuration_get_value_int(&config, "PARAMS", "cn_vc_size", anno, &p->cn_vc_size); rc = configuration_get_value_int(&config, "PARAMS", "cn_vc_size", anno, &p->cn_vc_size);
if(rc) { if(rc) {
p->cn_vc_size = 1024; p->cn_vc_size = 1024;
...@@ -589,18 +594,21 @@ static void dragonfly_read_config(const char * anno, dragonfly_param *params){ ...@@ -589,18 +594,21 @@ static void dragonfly_read_config(const char * anno, dragonfly_param *params){
// else { // else {
// printf("Overriding num_vcs: p->num_vcs=%d\n",p->num_vcs); // printf("Overriding num_vcs: p->num_vcs=%d\n",p->num_vcs);
// } // }
#ifndef DF_DALLY if(DF_DALLY == 0)
{
if(routing == PROG_ADAPTIVE) if(routing == PROG_ADAPTIVE)
p->num_vcs = 10; p->num_vcs = 10;
else else
p->num_vcs = 8; p->num_vcs = 8;
#else }
else
{
if(routing == PROG_ADAPTIVE) if(routing == PROG_ADAPTIVE)
p->num_vcs = 4; p->num_vcs = 4;
else else
p->num_vcs = 3; p->num_vcs = 3;
#endif }
rc = configuration_get_value_int(&config, "PARAMS", "num_groups", anno, &p->num_groups); rc = configuration_get_value_int(&config, "PARAMS", "num_groups", anno, &p->num_groups);
if(rc) { if(rc) {
printf("Number of groups not specified. Aborting"); printf("Number of groups not specified. Aborting");
...@@ -2920,25 +2928,27 @@ router_packet_receive( router_state * s, ...@@ -2920,25 +2928,27 @@ router_packet_receive( router_state * s,
output_chan = 0; output_chan = 0;
if(output_port < s->params->intra_grp_radix) { if(output_port < s->params->intra_grp_radix) {
#ifndef DF_DALLY if(DF_DALLY == 0)
{
if(cur_chunk->msg.my_g_hop == 1) { if(cur_chunk->msg.my_g_hop == 1) {
if(routing == PROG_ADAPTIVE && cur_chunk->msg.my_l_hop != 4) { if(routing == PROG_ADAPTIVE && cur_chunk->msg.my_l_hop < 4) {
cur_chunk->msg.my_l_hop = 4; cur_chunk->msg.my_l_hop = 4;
} else if(cur_chunk->msg.my_l_hop < 2) { } else if(cur_chunk->msg.my_l_hop < 2) {
cur_chunk->msg.my_l_hop = 2; cur_chunk->msg.my_l_hop = 2;
} }
} else if (cur_chunk->msg.my_g_hop == 2) { } else if (cur_chunk->msg.my_g_hop == 2) {
if(routing == PROG_ADAPTIVE && cur_chunk->msg.my_l_hop != 6) { if(routing == PROG_ADAPTIVE && cur_chunk->msg.my_l_hop < 6) {
cur_chunk->msg.my_l_hop = 6; cur_chunk->msg.my_l_hop = 6;
} else if(cur_chunk->msg.my_l_hop < 4) { } else if(cur_chunk->msg.my_l_hop < 4) {
cur_chunk->msg.my_l_hop = 4; cur_chunk->msg.my_l_hop = 4;
} }
} }
#else }
else {
if(cur_chunk->msg.my_g_hop == 1) { if(cur_chunk->msg.my_g_hop == 1) {
if(routing == PROG_ADAPTIVE && cur_chunk->msg.my_l_hop != 2){ if(routing == PROG_ADAPTIVE && cur_chunk->msg.my_l_hop != 2){
cur_chunk->msg.my_l_hop = 2; cur_chunk->msg.my_l_hop = 2;
} else if(cur_chunk->msg.my_l_hop < 1){ } else if(cur_chunk->msg.my_l_hop != 1){
cur_chunk->msg.my_l_hop = 1; cur_chunk->msg.my_l_hop = 1;
} }
} }
...@@ -2946,10 +2956,10 @@ router_packet_receive( router_state * s, ...@@ -2946,10 +2956,10 @@ router_packet_receive( router_state * s,
if(routing == PROG_ADAPTIVE && cur_chunk->msg.my_l_hop != 3) { if(routing == PROG_ADAPTIVE && cur_chunk->msg.my_l_hop != 3) {
cur_chunk->msg.my_l_hop = 3; cur_chunk->msg.my_l_hop = 3;
} }
else if(cur_chunk->msg.my_l_hop < 2) else if(cur_chunk->msg.my_l_hop != 2)
cur_chunk->msg.my_l_hop = 2; cur_chunk->msg.my_l_hop = 2;
} }
#endif }
output_chan = cur_chunk->msg.my_l_hop; output_chan = cur_chunk->msg.my_l_hop;
max_vc_size = s->params->local_vc_size; max_vc_size = s->params->local_vc_size;
cur_chunk->msg.my_l_hop++; cur_chunk->msg.my_l_hop++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment