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