Commit 4c027f76 authored by Robert Ricci's avatar Robert Ricci
Browse files

Add a new 'unique' flag to the ptop file - tells assign that there is

some reason, which is invisible to assign, that a node should never
be considered the same as another. This is for scoring, so that assign
doesn't prefer to give you 2 DSL nodes if you ask for 1 DSL and one
generic wide-area.
parent 5bb058de
......@@ -166,6 +166,10 @@ int parse_ptop(tb_pgraph &PG, tb_sgraph &SG, istream& i)
// an actual pnode later
p->subnode_of_name = value;
} else if ("unique") == 0) {
// Means that we should never put this pnode into a ptype with
// other pnodes
p->unique = true;
} else {
ptop_error("Bad flag given: " << flag << ".");
......@@ -63,6 +63,15 @@ struct hashlinkinfo {
int pclass_equiv(tb_pgraph &PG, tb_pnode *a,tb_pnode *b)
typedef hash_multiset<link_info,hashlinkinfo> link_set;
// The unique flag is used to signify that there is some reason that assign
// is not aware of that the node is unique, and shouldn't be put into a
// pclass. The usual reason for doing this is for scoring purposes - ie.
// don't prefer one just because it's the same pclass as another that, in
// reality, is very different.
if (a->unique || b->unique) {
return 0;
// check type information
for (tb_pnode::types_map::iterator it=a->types.begin();
......@@ -78,7 +78,8 @@ public:
total_bandwidth(0), my_class(NULL),
my_own_class(NULL), assigned_nodes(),
trivial_bw(0), trivial_bw_used(0), subnode_of(NULL),
subnode_of_name(""), has_subnode(false) {;}
subnode_of_name(""), has_subnode(false),
unique(false) {;}
class type_record {
......@@ -146,6 +147,10 @@ public:
// used to do late bindind
bool has_subnode; // whether or not this node has any subnodes
bool unique; // says that this pnode should never go into a
// pclass with other nodes, because of some
// characteristic that is not known to assign
bool set_current_type(crope type) {
if (types.find(type) == types.end()) {
Supports Markdown
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