Commit b4fdc62f authored by Tarun Prabhu's avatar Tarun Prabhu

Fixed a bug relating to inter-switch links presented with the

components out of order. Other minor fixes included to get GCC to
reduce the number of GCC warnings.
parent 09cdc850
This diff is collapsed.
...@@ -114,9 +114,8 @@ class annotate_rspec_v2 : public annotate_rspec ...@@ -114,9 +114,8 @@ class annotate_rspec_v2 : public annotate_rspec
const xercesc::DOMElement* const xercesc::DOMElement*
getIfaceOnNode(const xercesc::DOMElement* plink, std::string physNodeId); getIfaceOnNode(const xercesc::DOMElement* plink, std::string physNodeId);
// Retuns the id of the physical source node // Retuns the component id of the nth interface of a link
// for the nth interface of a link std::string getNthInterface (const xercesc::DOMElement* link, int n);
std::string getNodeForNthInterface (const xercesc::DOMElement* link, int n);
// Annotates the end point of a link // Annotates the end point of a link
bool annotate_endpoint(xercesc::DOMElement* iface, std::string virtId); bool annotate_endpoint(xercesc::DOMElement* iface, std::string virtId);
...@@ -126,6 +125,11 @@ class annotate_rspec_v2 : public annotate_rspec ...@@ -126,6 +125,11 @@ class annotate_rspec_v2 : public annotate_rspec
// Adds a fixed interface element to an interface // Adds a fixed interface element to an interface
void addFixedInterface(xercesc::DOMElement* interface,std::string shortname); void addFixedInterface(xercesc::DOMElement* interface,std::string shortname);
// Orders the links in the specified list of links from head to tail
// The first element in the list MUST be the head
// WARNING: This will destroy in the input list
std::list<const char*>* reorderLinks (std::list<const char*>* links);
}; };
#endif //for __ANNOTATE_RSPEC_H #endif //for __ANNOTATE_RSPEC_H
......
...@@ -38,7 +38,7 @@ namespace featuredesire { ...@@ -38,7 +38,7 @@ namespace featuredesire {
class tb_featuredesire_policy { class tb_featuredesire_policy {
public: public:
tb_featuredesire_policy(): allowable(true), limited_use(false), tb_featuredesire_policy(): allowable(true), limited_use(false),
min_use(0.0f), max_use(0.0f) { ; }; max_use(0.0f), min_use(0.0f) { ; };
/* /*
* Functions for maintaining FD policy state. Inline, since they're * Functions for maintaining FD policy state. Inline, since they're
* so simple. * so simple.
......
...@@ -135,7 +135,6 @@ int parse_request(tb_vgraph &vg, char *filename) { ...@@ -135,7 +135,6 @@ int parse_request(tb_vgraph &vg, char *filename) {
doc = domParser->getDocument(); doc = domParser->getDocument();
request_root = doc->getDocumentElement(); request_root = doc->getDocumentElement();
bool is_physical;
string type = XStr (request_root->getAttribute(XStr("type").x())).c(); string type = XStr (request_root->getAttribute(XStr("type").x())).c();
if (type != "request") { if (type != "request") {
cout << "*** RSpec type must be \"request\" in " << filename cout << "*** RSpec type must be \"request\" in " << filename
...@@ -154,7 +153,7 @@ int parse_request(tb_vgraph &vg, char *filename) { ...@@ -154,7 +153,7 @@ int parse_request(tb_vgraph &vg, char *filename) {
rspecParser = new rspec_parser_v2(RSPEC_TYPE_REQ); rspecParser = new rspec_parser_v2(RSPEC_TYPE_REQ);
break; break;
default: default:
cerr << "*** Unsupported rspec ver. " << rspecVersion cout << "*** Unsupported rspec ver. " << rspecVersion
<< " ... Aborting " << endl; << " ... Aborting " << endl;
exit(EXIT_FATAL); exit(EXIT_FATAL);
} }
...@@ -266,7 +265,7 @@ bool populate_node(DOMElement* elt, ...@@ -266,7 +265,7 @@ bool populate_node(DOMElement* elt,
bool isStatic = false; bool isStatic = false;
bool isUnlimited = false; bool isUnlimited = false;
if (typeCount > 1) { if (typeCount > 1) {
cerr << "*** Too many node types (" << typeCount << ") on " cout << "*** Too many node types (" << typeCount << ") on "
<< virtualId << " (allowed 1) ... Aborting " << endl; << virtualId << " (allowed 1) ... Aborting " << endl;
return false; return false;
} }
...@@ -326,8 +325,8 @@ bool populate_node(DOMElement* elt, ...@@ -326,8 +325,8 @@ bool populate_node(DOMElement* elt,
if (no_type) { if (no_type) {
// If they gave no type, just assume it's a PC for // If they gave no type, just assume it's a PC for
// now. This is not really a good assumption. // now. This is not really a good assumption.
cerr << "WARNING: No type information found on node. " XMLDEBUG("WARNING: No type information found on node. "
<< "Defaulting to " << typeName.c_str() << endl; << "Defaulting to " << typeName.c_str() << endl);
} }
v = new tb_vnode(virtualId.c_str(), typeName.c_str(), typeSlots); v = new tb_vnode(virtualId.c_str(), typeName.c_str(), typeSlots);
...@@ -418,8 +417,8 @@ bool populate_node(DOMElement* elt, ...@@ -418,8 +417,8 @@ bool populate_node(DOMElement* elt,
* Pull nodes from the document, and populate assign's own data structures * Pull nodes from the document, and populate assign's own data structures
*/ */
bool populate_nodes(DOMElement *root, bool populate_nodes(DOMElement *root,
tb_vgraph &vg, map< pair<string, string>, tb_vgraph &vg, map< pair<string, string>,
pair<string, string> >* fixed_interfaces) { pair<string, string> >* fixed_interfaces) {
bool is_ok = true; bool is_ok = true;
/* /*
* Get a list of all nodes in this document * Get a list of all nodes in this document
...@@ -428,7 +427,7 @@ bool populate_nodes(DOMElement *root, ...@@ -428,7 +427,7 @@ bool populate_nodes(DOMElement *root,
int nodeCount = nodes->getLength(); int nodeCount = nodes->getLength();
XMLDEBUG("Found " << nodeCount << " nodes in rspec" << endl); XMLDEBUG("Found " << nodeCount << " nodes in rspec" << endl);
for (size_t i = 0; i < nodeCount; i++) { for (unsigned i = 0; i < nodeCount; i++) {
DOMNode *node = nodes->item(i); DOMNode *node = nodes->item(i);
// This should not be able to fail, because all elements in // This should not be able to fail, because all elements in
// this list came from the getElementsByTagName() call // this list came from the getElementsByTagName() call
...@@ -608,18 +607,18 @@ bool populate_link (DOMElement* elt, ...@@ -608,18 +607,18 @@ bool populate_link (DOMElement* elt,
} }
if (dstNode == "" || dstIface == "") { if (dstNode == "" || dstIface == "") {
cout << "*** No destination node found on interface for link " cout << "*** No destination node found on interface for link "
<< virtualId << endl; << virtualId << endl;
return false; return false;
} }
if (vname2vertex.find(srcNode.c_str()) == vname2vertex.end()) { if (vname2vertex.find(srcNode.c_str()) == vname2vertex.end()) {
cout << "*** Bad link " << virtualId cout << "*** Bad link " << virtualId
<< ", non-existent source node " << srcNode << endl; << ", non-existent source node " << srcNode << endl;
return false; return false;
} }
if (vname2vertex.find(dstNode.c_str()) == vname2vertex.end()) { if (vname2vertex.find(dstNode.c_str()) == vname2vertex.end()) {
cout << "*** Bad link " << virtualId cout << "*** Bad link " << virtualId
<< ", non-existent destination node " << dstNode << endl; << ", non-existent destination node " << dstNode << endl;
return false; return false;
} }
...@@ -658,6 +657,7 @@ bool populate_link (DOMElement* elt, ...@@ -658,6 +657,7 @@ bool populate_link (DOMElement* elt,
if (it != fixed_interfaces->end()) { if (it != fixed_interfaces->end()) {
fix_dstIface = true; fix_dstIface = true;
fixed_dstIface = (it->second).second; fixed_dstIface = (it->second).second;
} }
if (emulated) { if (emulated) {
...@@ -738,7 +738,7 @@ bool populate_vclass (struct vclass vclass, tb_vgraph& vg) ...@@ -738,7 +738,7 @@ bool populate_vclass (struct vclass vclass, tb_vgraph& vg)
if (vclass.type.type == SOFT_VCLASS) { if (vclass.type.type == SOFT_VCLASS) {
v = new tb_vclass (XStr(name).f(), vclass.type.weight); v = new tb_vclass (XStr(name).f(), vclass.type.weight);
if (v == NULL) { if (v == NULL) {
cerr << "*** Could not create vclass " << vclass.name << endl; cout << "*** Could not create vclass " << vclass.name << endl;
return false; return false;
} }
vclass_map[name] = v; vclass_map[name] = v;
...@@ -759,7 +759,7 @@ bool populate_vclasses (DOMElement* root, tb_vgraph& vg) ...@@ -759,7 +759,7 @@ bool populate_vclasses (DOMElement* root, tb_vgraph& vg)
{ {
bool isOk = true; bool isOk = true;
vector<struct vclass> vclasses = rspecParser->readVClasses(root); vector<struct vclass> vclasses = rspecParser->readVClasses(root);
cerr << "Found " << vclasses.size() << " vclasses." << endl; XMLDEBUG("Found " << vclasses.size() << " vclasses." << endl);
for (unsigned int i = 0; i < vclasses.size(); i++) { for (unsigned int i = 0; i < vclasses.size(); i++) {
isOk &= populate_vclass(vclasses[i], vg); isOk &= populate_vclass(vclasses[i], vg);
} }
......
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
class tb_pclass { class tb_pclass {
public: public:
tb_pclass() : name(), size(0), used_members(0), refcount(0), disabled(false), tb_pclass() : name(), size(0), used_members(0), disabled(false), refcount(0),
is_dynamic(false) {;} is_dynamic(false) {;}
typedef map<fstring,tb_pnodelist*> pclass_members_map; typedef map<fstring,tb_pnodelist*> pclass_members_map;
......
...@@ -79,7 +79,7 @@ void print_solution(const solution &s) { ...@@ -79,7 +79,7 @@ void print_solution(const solution &s) {
for (;vit != veit;++vit) { for (;vit != veit;++vit) {
vn = get(vvertex_pmap,*vit); vn = get(vvertex_pmap,*vit);
if (! s.is_assigned(*vit)) { if (! s.is_assigned(*vit)) {
cout << "unassigned: " << vn->name << endl; cout << "unassigned: " << vn->name << endl;
} else { } else {
#ifdef WITH_XML #ifdef WITH_XML
string node_name = XStr(vn -> name).c(); string node_name = XStr(vn -> name).c();
...@@ -108,7 +108,7 @@ void print_solution(const solution &s) { ...@@ -108,7 +108,7 @@ void print_solution(const solution &s) {
vedge_iterator eit,eendit; vedge_iterator eit,eendit;
tie(eit,eendit) = edges(VG); tie(eit,eendit) = edges(VG);
for (;eit!=eendit;++eit) { for (;eit!=eendit;++eit) {
tb_vlink *vlink = get(vedge_pmap,*eit); tb_vlink *vlink = get(vedge_pmap,*eit);
#ifdef WITH_XML #ifdef WITH_XML
if (both_inputs_rspec) { if (both_inputs_rspec) {
...@@ -135,7 +135,7 @@ void print_solution(const solution &s) { ...@@ -135,7 +135,7 @@ void print_solution(const solution &s) {
#ifdef WITH_XML #ifdef WITH_XML
if (both_inputs_rspec) { if (both_inputs_rspec) {
rspec_annotater->annotate_element((vlink->name).c_str(), rspec_annotater->annotate_element((vlink->name).c_str(),
(p->name).c_str()); (p->name).c_str());
if (is_generated) if (is_generated)
continue; continue;
} }
......
...@@ -115,7 +115,7 @@ node_interface_pair parse_interface_xml(const xercesc::DOMElement* tag); ...@@ -115,7 +115,7 @@ node_interface_pair parse_interface_xml(const xercesc::DOMElement* tag);
/* /*
* Bundle the componentspec attributes together * Bundle the componentspec attributes together
*/ */
typedef struct component_spec struct component_spec
{ {
string component_manager_uuid; string component_manager_uuid;
string component_name; string component_name;
...@@ -130,7 +130,7 @@ component_spec parse_component_spec (const xercesc::DOMElement* element); ...@@ -130,7 +130,7 @@ component_spec parse_component_spec (const xercesc::DOMElement* element);
/* /*
* Bundle the InterfaceSpec attributes together * Bundle the InterfaceSpec attributes together
*/ */
typedef struct interface_spec struct interface_spec
{ {
string virtual_node_id; string virtual_node_id;
string virtual_interface_id; string virtual_interface_id;
......
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