...
 
Commits (3)
...@@ -164,6 +164,10 @@ bool strategy_balance = false; ...@@ -164,6 +164,10 @@ bool strategy_balance = false;
// as possible onto pnodes // as possible onto pnodes
bool strategy_pack = false; bool strategy_pack = false;
// If true, turn the use of multiple ptypes from a scoring penalty into a
// violation
bool scoring_type_violation = false;
// Use XML for file input // Use XML for file input
// bool xml_input = false; // bool xml_input = false;
#ifdef WITH_XML #ifdef WITH_XML
...@@ -498,6 +502,7 @@ void print_help() { ...@@ -498,6 +502,7 @@ void print_help() {
cout << " -R - Randomize order of nodes in pclasses" << endl; cout << " -R - Randomize order of nodes in pclasses" << endl;
cout << " -S <str> - Set vnode packing strategy. Currently supported" << endl; cout << " -S <str> - Set vnode packing strategy. Currently supported" << endl;
cout << " values are 'balance' and 'pack'" << endl; cout << " values are 'balance' and 'pack'" << endl;
cout << " -Y - Turn use of multiple physical types into a violation" << endl;
cout << " cparams - You probably don't want to touch these!" << endl; cout << " cparams - You probably don't want to touch these!" << endl;
cout << " If you must, see config.h in the source for a list" cout << " If you must, see config.h in the source for a list"
<< endl; << endl;
...@@ -901,9 +906,9 @@ int main(int argc,char **argv) { ...@@ -901,9 +906,9 @@ int main(int argc,char **argv) {
char* ptopFileFormat; char* ptopFileFormat;
char* vtopFileFormat; char* vtopFileFormat;
char* delims = "/"; char* delims = "/";
char* flags = "s:v:l:t:rpPTdH:oguc:nx:y:W:FDf:RS:"; char* flags = "s:v:l:t:rpPTdH:oguc:nx:y:W:FDf:RS:Y";
#else #else
char* flags = "s:v:l:t:rpPTdH:oguc:nx:y:FDRS:"; char* flags = "s:v:l:t:rpPTdH:oguc:nx:y:FDRS:Y";
#endif #endif
while ((ch = getopt(argc,argv,flags)) != -1) { while ((ch = getopt(argc,argv,flags)) != -1) {
...@@ -1061,6 +1066,10 @@ int main(int argc,char **argv) { ...@@ -1061,6 +1066,10 @@ int main(int argc,char **argv) {
} }
break; break;
case 'Y':
scoring_type_violation = true;
break;
default: default:
print_help(); print_help();
} }
......
...@@ -52,6 +52,7 @@ extern switch_pred_map_map switch_preds; ...@@ -52,6 +52,7 @@ extern switch_pred_map_map switch_preds;
extern bool disable_pclasses; extern bool disable_pclasses;
extern bool strategy_balance; extern bool strategy_balance;
extern bool strategy_pack; extern bool strategy_pack;
extern bool scoring_type_violation;
double score; // The score of the current mapping double score; // The score of the current mapping
int violated; // How many times the restrictions int violated; // How many times the restrictions
...@@ -966,6 +967,9 @@ void remove_node(vvertex vv) ...@@ -966,6 +967,9 @@ void remove_node(vvertex vv)
&& (pnode->my_class->used_members == 0)) { && (pnode->my_class->used_members == 0)) {
SDEBUG(cerr << " freeing pclass" << endl); SDEBUG(cerr << " freeing pclass" << endl);
SSUB(SCORE_PCLASS); SSUB(SCORE_PCLASS);
if (scoring_type_violation) {
vinfo.mult_types--;
}
} }
// vclass // vclass
...@@ -1518,6 +1522,9 @@ int add_node(vvertex vv,pvertex pv, bool deterministic, bool is_fixed, bool skip ...@@ -1518,6 +1522,9 @@ int add_node(vvertex vv,pvertex pv, bool deterministic, bool is_fixed, bool skip
(pnode->my_class->used_members == 0)) { (pnode->my_class->used_members == 0)) {
SDEBUG(cerr << " new pclass" << endl); SDEBUG(cerr << " new pclass" << endl);
SADD(SCORE_PCLASS); SADD(SCORE_PCLASS);
if (scoring_type_violation) {
vinfo.mult_types++;
}
} }
// vclass // vclass
......
...@@ -45,6 +45,7 @@ class violated_info { ...@@ -45,6 +45,7 @@ class violated_info {
o << " trivial mix: " << vinfo.trivial_mix << endl; o << " trivial mix: " << vinfo.trivial_mix << endl;
o << " subnodes: " << vinfo.subnodes << endl; o << " subnodes: " << vinfo.subnodes << endl;
o << " max_types: " << vinfo.max_types << endl; o << " max_types: " << vinfo.max_types << endl;
o << " mult_types: " << vinfo.mult_types << endl;
#ifdef FIX_PLINK_ENDPOINTS #ifdef FIX_PLINK_ENDPOINTS
o << " endpoints: " << vinfo.incorrect_endpoints << endl; o << " endpoints: " << vinfo.incorrect_endpoints << endl;
#endif #endif
...@@ -55,13 +56,14 @@ class violated_info { ...@@ -55,13 +56,14 @@ class violated_info {
violated_info(): violated_info():
unassigned(0), pnode_load(0), no_connection(0), link_users(0), unassigned(0), pnode_load(0), no_connection(0), link_users(0),
bandwidth(0), desires(0), vclass(0), delay(0), bandwidth(0), desires(0), vclass(0), delay(0),
incorrect_endpoints(0), trivial_mix(0), subnodes(0), max_types(0) incorrect_endpoints(0), trivial_mix(0), subnodes(0), max_types(0),
mult_types(0)
{ } { }
int count_violations() const { int count_violations() const {
return unassigned + pnode_load + no_connection + link_users + bandwidth return unassigned + pnode_load + no_connection + link_users + bandwidth
+ desires + vclass + delay + incorrect_endpoints + trivial_mix + desires + vclass + delay + incorrect_endpoints + trivial_mix
+ subnodes + max_types; + subnodes + max_types + mult_types;
} }
int unassigned; int unassigned;
...@@ -76,6 +78,7 @@ class violated_info { ...@@ -76,6 +78,7 @@ class violated_info {
int trivial_mix; int trivial_mix;
int subnodes; int subnodes;
int max_types; int max_types;
int mult_types;
}; };
extern int violated; extern int violated;
......