Modifications in OpenChams description:
- Add OpenChams::SlicingNode class to drive/parse XML files. OpenChams::SlicingNode contains information to create a real slicing tree (SlicingNode from hurricaneAMS) - Minor modification in Circuit.cpp for case when HBTree are not described in XML file.
This commit is contained in:
parent
0930660a1f
commit
5809fc7aa0
|
@ -38,6 +38,7 @@ projects = [
|
||||||
, "graph"
|
, "graph"
|
||||||
, "pharos"
|
, "pharos"
|
||||||
, "isis"
|
, "isis"
|
||||||
|
, "horus"
|
||||||
#, "schematic"
|
#, "schematic"
|
||||||
, "solver"
|
, "solver"
|
||||||
, "autoDTR"
|
, "autoDTR"
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
find_package(BISON REQUIRED)
|
find_package(BISON REQUIRED)
|
||||||
find_package(FLEX REQUIRED)
|
find_package(FLEX REQUIRED)
|
||||||
find_package(Doxygen)
|
find_package(Doxygen)
|
||||||
|
find_package(HURRICANE REQUIRED)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(cmake_modules)
|
add_subdirectory(cmake_modules)
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
INCLUDE_DIRECTORIES(${VLSISAPD_SOURCE_DIR}/src/openChams/src ${LIBXML2_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_PATH})
|
INCLUDE_DIRECTORIES( ${VLSISAPD_SOURCE_DIR}/src/openChams/src
|
||||||
|
${LIBXML2_INCLUDE_DIR}
|
||||||
|
${Boost_INCLUDE_DIRS}
|
||||||
|
${PYTHON_INCLUDE_PATH}
|
||||||
|
${HURRICANE_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
SET ( hpps vlsisapd/openChams/Circuit.h
|
SET ( hpps vlsisapd/openChams/Circuit.h
|
||||||
vlsisapd/openChams/Netlist.h
|
vlsisapd/openChams/Netlist.h
|
||||||
|
@ -21,6 +26,7 @@ SET ( hpps vlsisapd/openChams/Circuit.h
|
||||||
vlsisapd/openChams/NRCCstr.h
|
vlsisapd/openChams/NRCCstr.h
|
||||||
vlsisapd/openChams/DDP.h
|
vlsisapd/openChams/DDP.h
|
||||||
vlsisapd/openChams/DesignerCstrOC.h
|
vlsisapd/openChams/DesignerCstrOC.h
|
||||||
|
vlsisapd/openChams/SlicingTree.h
|
||||||
)
|
)
|
||||||
SET ( cpps Circuit.cpp
|
SET ( cpps Circuit.cpp
|
||||||
Netlist.cpp
|
Netlist.cpp
|
||||||
|
@ -41,23 +47,24 @@ SET ( cpps Circuit.cpp
|
||||||
NRCCstr.cpp
|
NRCCstr.cpp
|
||||||
DDP.cpp
|
DDP.cpp
|
||||||
DesignerCstrOC.cpp
|
DesignerCstrOC.cpp
|
||||||
)
|
SlicingTree.cpp
|
||||||
SET ( pycpps PyOpenChams.cpp
|
)
|
||||||
)
|
SET ( pycpps PyOpenChams.cpp
|
||||||
|
)
|
||||||
|
|
||||||
ADD_LIBRARY(openChams ${cpps})
|
ADD_LIBRARY(openChams ${cpps})
|
||||||
TARGET_LINK_LIBRARIES(openChams ${LIBXML2_LIBRARIES})
|
TARGET_LINK_LIBRARIES(openChams ${LIBXML2_LIBRARIES})
|
||||||
SET_TARGET_PROPERTIES(openChams PROPERTIES VERSION 1.0 SOVERSION 1)
|
SET_TARGET_PROPERTIES(openChams PROPERTIES VERSION 1.0 SOVERSION 1)
|
||||||
INSTALL(TARGETS openChams DESTINATION lib${LIB_SUFFIX} )
|
INSTALL(TARGETS openChams DESTINATION lib${LIB_SUFFIX} )
|
||||||
|
|
||||||
IF(Boost_FOUND)
|
IF(Boost_FOUND)
|
||||||
ADD_LIBRARY(pyOPENCHAMS MODULE ${pycpps})
|
ADD_LIBRARY(pyOPENCHAMS MODULE ${pycpps})
|
||||||
SET_TARGET_PROPERTIES(pyOPENCHAMS PROPERTIES
|
SET_TARGET_PROPERTIES(pyOPENCHAMS PROPERTIES
|
||||||
OUTPUT_NAME "OPENCHAMS"
|
OUTPUT_NAME "OPENCHAMS"
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
)
|
)
|
||||||
TARGET_LINK_LIBRARIES(pyOPENCHAMS openChams ${LIBXML2_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
|
TARGET_LINK_LIBRARIES(pyOPENCHAMS openChams ${LIBXML2_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
|
||||||
INSTALL(TARGETS pyOPENCHAMS DESTINATION ${PYTHON_SITE_PACKAGES})
|
INSTALL(TARGETS pyOPENCHAMS DESTINATION ${PYTHON_SITE_PACKAGES})
|
||||||
ENDIF(Boost_FOUND)
|
ENDIF(Boost_FOUND)
|
||||||
|
|
||||||
INSTALL(FILES ${hpps} DESTINATION include/vlsisapd/openChams)
|
INSTALL(FILES ${hpps} DESTINATION include/vlsisapd/openChams)
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the VLSI SAPD Software.
|
// This file is part of the VLSI SAPD Software.
|
||||||
// Copyright (c) UPMC/LIP6 2009-2012, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2009-2016, All Rights Reserved
|
||||||
//
|
//
|
||||||
// +-----------------------------------------------------------------+
|
// +-----------------------------------------------------------------+
|
||||||
// | V L S I S A P D |
|
// | V L S I S A P D |
|
||||||
// | OpenChams Circuit Data Base |
|
// | OpenChams Circuit Data Base |
|
||||||
// | |
|
// | |
|
||||||
// | Author : Damien Dupuis |
|
// | Author : Damien Dupuis |
|
||||||
|
// | Eric Lao |
|
||||||
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
// | =============================================================== |
|
// | =============================================================== |
|
||||||
// | C++ Module : "./Circuit.cpp" |
|
// | C++ Module : "./Circuit.cpp" |
|
||||||
|
@ -152,6 +153,7 @@ namespace OpenChams {
|
||||||
static bool readSchematicDone = false;
|
static bool readSchematicDone = false;
|
||||||
static bool readSizingDone = false;
|
static bool readSizingDone = false;
|
||||||
static bool readLayoutDone = false;
|
static bool readLayoutDone = false;
|
||||||
|
static bool readSlicingTreeDone = false;
|
||||||
|
|
||||||
Circuit::Circuit(const std::string& name, const std::string& techno)
|
Circuit::Circuit(const std::string& name, const std::string& techno)
|
||||||
: _name (name)
|
: _name (name)
|
||||||
|
@ -161,6 +163,7 @@ namespace OpenChams {
|
||||||
, _schematic (NULL)
|
, _schematic (NULL)
|
||||||
, _sizing (NULL)
|
, _sizing (NULL)
|
||||||
, _layout (NULL)
|
, _layout (NULL)
|
||||||
|
, _slicingtree (NULL)
|
||||||
{
|
{
|
||||||
readSubCircuitsPathsDone = false;
|
readSubCircuitsPathsDone = false;
|
||||||
readCircuitParametersDone = false;
|
readCircuitParametersDone = false;
|
||||||
|
@ -981,16 +984,16 @@ namespace OpenChams {
|
||||||
|
|
||||||
Layout* layout = new Layout(this);
|
Layout* layout = new Layout(this);
|
||||||
xmlNode* child = node->children;
|
xmlNode* child = node->children;
|
||||||
//cerr << "** L ** " << node->name << ": " << node->type << endl;
|
//cerr << "** L ** " << node->name << ": " << node->type << endl;
|
||||||
for (xmlNode* node = child; node; node = node->next) {
|
for (xmlNode* node = child; node; node = node->next) {
|
||||||
if (node->type == XML_ELEMENT_NODE) {
|
if (node->type == XML_ELEMENT_NODE) {
|
||||||
if (xmlStrEqual(node->name, (xmlChar*)"instance")) {
|
if (xmlStrEqual(node->name, (xmlChar*)"instance")) {
|
||||||
readInstanceLayout(node, layout);
|
readInstanceLayout(node, layout);
|
||||||
} else if (xmlStrEqual(node->name, (xmlChar*)"hbtree")) {
|
} else if (xmlStrEqual(node->name, (xmlChar*)"hbtree")) {
|
||||||
readHBTree(node, layout);
|
readHBTree(node, layout);
|
||||||
} else {
|
} else {
|
||||||
cerr << "[WARNING] Only 'instance' and 'hbtree' nodes are allowed in 'layout' section, others will be ignored." << endl;
|
cerr << "[WARNING] Only 'instance' and 'hbtree' nodes are allowed in 'layout' section, others will be ignored." << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
readLayoutDone = true;
|
readLayoutDone = true;
|
||||||
|
@ -1010,10 +1013,10 @@ namespace OpenChams {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Circuit::readHBTree(xmlNode* node, Layout* layout) {
|
void Circuit::readHBTree(xmlNode* node, Layout* layout) {
|
||||||
// HBTree node can have only one child (group or bloc)
|
// HBTree node can have only one child (group or bloc)
|
||||||
xmlNode* child = node->children;
|
xmlNode* child = node->children;
|
||||||
if (child->type == XML_ELEMENT_NODE) {
|
if (child->type == XML_ELEMENT_NODE) {
|
||||||
// create root node
|
// create root node
|
||||||
// thanks to readNodeOrBloc
|
// thanks to readNodeOrBloc
|
||||||
Node* root = readNodeOrBloc(child);
|
Node* root = readNodeOrBloc(child);
|
||||||
// save root node in layout
|
// save root node in layout
|
||||||
|
@ -1022,70 +1025,70 @@ namespace OpenChams {
|
||||||
}
|
}
|
||||||
|
|
||||||
Node* Circuit::readNodeOrBloc(xmlNode* node, Node* parent) {
|
Node* Circuit::readNodeOrBloc(xmlNode* node, Node* parent) {
|
||||||
// 1 - create Node based on xmlNode* passed as argument
|
// 1 - create Node based on xmlNode* passed as argument
|
||||||
if (node->type == XML_ELEMENT_NODE) {
|
if (node->type == XML_ELEMENT_NODE) {
|
||||||
bool isAGroup = xmlStrEqual(node->name, (xmlChar*)"group");
|
bool isAGroup = xmlStrEqual(node->name, (xmlChar*)"group");
|
||||||
xmlChar* nameC = xmlGetProp(node, (xmlChar*)"name");
|
xmlChar* nameC = xmlGetProp(node, (xmlChar*)"name");
|
||||||
xmlChar* posiC = xmlGetProp(node, (xmlChar*)"position");
|
xmlChar* posiC = xmlGetProp(node, (xmlChar*)"position");
|
||||||
if (!nameC)
|
if (!nameC)
|
||||||
throw OpenChamsException("[ERROR] 'bloc' and 'group' nodes in 'hbtree' must have at least a 'name' property.");
|
throw OpenChamsException("[ERROR] 'bloc' and 'group' nodes in 'hbtree' must have at least a 'name' property.");
|
||||||
Node* nodeOC = NULL;
|
Node* nodeOC = NULL;
|
||||||
const std::string& name ((const char*)nameC);
|
const std::string& name ((const char*)nameC);
|
||||||
Node::Position pos = Node::NONE;
|
Node::Position pos = Node::NONE;
|
||||||
if (posiC) {
|
if (posiC) {
|
||||||
string posStr ((const char*)posiC);
|
string posStr ((const char*)posiC);
|
||||||
if (posStr == "right") pos = Node::RIGHT;
|
if (posStr == "right") pos = Node::RIGHT;
|
||||||
else if (posStr == "top") pos = Node::TOP;
|
else if (posStr == "top") pos = Node::TOP;
|
||||||
else throw OpenChamsException("[ERROR] 'position' property of 'bloc' and 'group' nodes must be 'right' or 'top'.");
|
else throw OpenChamsException("[ERROR] 'position' property of 'bloc' and 'group' nodes must be 'right' or 'top'.");
|
||||||
}
|
}
|
||||||
if (isAGroup) {
|
if (isAGroup) {
|
||||||
Group* groupOC = new Group(name, pos, parent);
|
Group* groupOC = new Group(name, pos, parent);
|
||||||
xmlChar* isolatC = xmlGetProp(node, (xmlChar*)"isolation");
|
xmlChar* isolatC = xmlGetProp(node, (xmlChar*)"isolation");
|
||||||
xmlChar* alignC = xmlGetProp(node, (xmlChar*)"align");
|
xmlChar* alignC = xmlGetProp(node, (xmlChar*)"align");
|
||||||
xmlChar* pairedC = xmlGetProp(node, (xmlChar*)"paired");
|
xmlChar* pairedC = xmlGetProp(node, (xmlChar*)"paired");
|
||||||
if (isolatC) {
|
if (isolatC) {
|
||||||
string isolation ((const char*)isolatC);
|
string isolation ((const char*)isolatC);
|
||||||
if (isolation == "true") groupOC->setIsolated(true);
|
if (isolation == "true") groupOC->setIsolated(true);
|
||||||
else if (isolation == "false") groupOC->setIsolated(false);
|
else if (isolation == "false") groupOC->setIsolated(false);
|
||||||
else throw OpenChamsException("[ERROR] 'isolation' property of 'group' node must be 'true' or 'false'.");
|
else throw OpenChamsException("[ERROR] 'isolation' property of 'group' node must be 'true' or 'false'.");
|
||||||
}
|
}
|
||||||
if (alignC) {
|
if (alignC) {
|
||||||
string align ((const char*)alignC);
|
string align ((const char*)alignC);
|
||||||
Group::Align galign = Group::NONE;
|
Group::Align galign = Group::NONE;
|
||||||
if (align == "vertical") galign = Group::VERTICAL;
|
if (align == "vertical") galign = Group::VERTICAL;
|
||||||
else if (align == "horizontal") galign = Group::HORIZONTAL;
|
else if (align == "horizontal") galign = Group::HORIZONTAL;
|
||||||
else throw OpenChamsException("[ERROR] 'align' property of 'group' node must be 'vertical' or 'horizontal'.");
|
else throw OpenChamsException("[ERROR] 'align' property of 'group' node must be 'vertical' or 'horizontal'.");
|
||||||
groupOC->setAlign(galign);
|
groupOC->setAlign(galign);
|
||||||
}
|
}
|
||||||
if (pairedC) {
|
if (pairedC) {
|
||||||
string paired ((const char*)pairedC);
|
string paired ((const char*)pairedC);
|
||||||
if (paired == "true") groupOC->setPaired(true);
|
if (paired == "true") groupOC->setPaired(true);
|
||||||
else if (paired == "false") groupOC->setPaired(false);
|
else if (paired == "false") groupOC->setPaired(false);
|
||||||
else throw OpenChamsException("[ERROR] 'paired' property of 'group' node must be 'true' or 'false'.");
|
else throw OpenChamsException("[ERROR] 'paired' property of 'group' node must be 'true' or 'false'.");
|
||||||
}
|
}
|
||||||
nodeOC = groupOC;
|
nodeOC = groupOC;
|
||||||
} else {
|
} else {
|
||||||
nodeOC = new Bloc(name, pos, parent);
|
nodeOC = new Bloc(name, pos, parent);
|
||||||
}
|
}
|
||||||
// 2 - for each children (up to 2) readNodeOrBloc
|
// 2 - for each children (up to 2) readNodeOrBloc
|
||||||
for (xmlNode* child = node->children; child; child = child->next) {
|
for (xmlNode* child = node->children; child; child = child->next) {
|
||||||
if (child->type == XML_ELEMENT_NODE) {
|
if (child->type == XML_ELEMENT_NODE) {
|
||||||
Node* childOC = readNodeOrBloc(child, nodeOC);
|
Node* childOC = readNodeOrBloc(child, nodeOC);
|
||||||
// 3 - add to returned Node* to current Node* as right or top children (based on its position)
|
// 3 - add to returned Node* to current Node* as right or top children (based on its position)
|
||||||
switch(childOC->getPosition()) {
|
switch(childOC->getPosition()) {
|
||||||
case Node::RIGHT:
|
case Node::RIGHT:
|
||||||
nodeOC->setRight(childOC);
|
nodeOC->setRight(childOC);
|
||||||
break;
|
break;
|
||||||
case Node::TOP:
|
case Node::TOP:
|
||||||
nodeOC->setTop(childOC);
|
nodeOC->setTop(childOC);
|
||||||
break;
|
break;
|
||||||
case Node::NONE:
|
case Node::NONE:
|
||||||
if (!isAGroup)
|
if (!isAGroup)
|
||||||
throw OpenChamsException("[ERROR] a 'bloc' or 'group' without position is only allowed directly under a 'group'.");
|
throw OpenChamsException("[ERROR] a 'bloc' or 'group' without position is only allowed directly under a 'group'.");
|
||||||
Group* groupOC = dynamic_cast<Group*>(nodeOC);
|
Group* groupOC = dynamic_cast<Group*>(nodeOC);
|
||||||
groupOC->setRootNode(childOC);
|
groupOC->setRootNode(childOC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 4 - return current Node
|
// 4 - return current Node
|
||||||
return nodeOC;
|
return nodeOC;
|
||||||
|
@ -1103,6 +1106,254 @@ namespace OpenChams {
|
||||||
_absolutePath = _absolutePath.substr(0, found);
|
_absolutePath = _absolutePath.substr(0, found);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// SLICINGTREE //
|
||||||
|
void Circuit::readSlicingTree(xmlNode* node) {
|
||||||
|
if (readSlicingTreeDone) {
|
||||||
|
cerr << "[WARNING] Only one 'slicingtree' is allowed in circuit, others will be ignored." << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_slicingtree = readSlicingNode(node);
|
||||||
|
readSlicingTreeDone = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
SlicingNode* Circuit::readSlicingNode(xmlNode* xnode, SlicingNode* slicingNode) {
|
||||||
|
SlicingNode* snode = NULL;
|
||||||
|
|
||||||
|
xmlNode* child = xnode->children;
|
||||||
|
for (xmlNode* node = child; node; node = node->next) {
|
||||||
|
if (node->type == XML_ELEMENT_NODE) {
|
||||||
|
if (xmlStrEqual(node->name , (xmlChar*)"vertical" )) {
|
||||||
|
snode = createVerticalSlicingNode (node, slicingNode);
|
||||||
|
} else if (xmlStrEqual(node->name , (xmlChar*)"horizontal")) {
|
||||||
|
snode = createHorizontalSlicingNode(node, slicingNode);
|
||||||
|
} else if (xmlStrEqual(node->name , (xmlChar*)"device" )) {
|
||||||
|
snode = createDeviceSlicingNode (node, slicingNode);
|
||||||
|
} else if (xmlStrEqual(node->name , (xmlChar*)"routing" )) {
|
||||||
|
snode = createRoutingSlicingNode (node, slicingNode);
|
||||||
|
} else if (!xmlStrEqual(node->name, (xmlChar*)"comment" )) {
|
||||||
|
cerr << "[WARNING] Unknown " << node->name << " node in 'slicingtree' section, it will be ignored." << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return snode;
|
||||||
|
}
|
||||||
|
|
||||||
|
VSlicingNode* Circuit::createVerticalSlicingNode (xmlNode* xnode, SlicingNode* slicingNode) {
|
||||||
|
VSlicingNode* vnode = VSlicingNode::create(slicingNode);
|
||||||
|
|
||||||
|
xmlNode* child = xnode->children;
|
||||||
|
for (xmlNode* node = child; node; node = node->next) {
|
||||||
|
if (xmlStrEqual(node->name , (xmlChar*)"parameters")) {
|
||||||
|
setHVParameters(node, vnode);
|
||||||
|
} else if (xmlStrEqual(node->name, (xmlChar*)"symmetries")) {
|
||||||
|
setHVSymmetries(node, vnode);
|
||||||
|
} else if (xmlStrEqual(node->name, (xmlChar*)"children" )) {
|
||||||
|
addChildren(node, vnode);
|
||||||
|
} else if (!xmlStrEqual(node->name,(xmlChar*)"comment" )) {
|
||||||
|
cerr << "[WARNING] Unknown " << node->name << " node in 'vertical' section, it will be ignored." << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return vnode;
|
||||||
|
}
|
||||||
|
|
||||||
|
HSlicingNode* Circuit::createHorizontalSlicingNode (xmlNode* xnode, SlicingNode* slicingNode) {
|
||||||
|
HSlicingNode* hnode = HSlicingNode::create(slicingNode);
|
||||||
|
|
||||||
|
xmlNode* child = xnode->children;
|
||||||
|
for (xmlNode* node = child; node; node = node->next) {
|
||||||
|
if (xmlStrEqual(node->name, (xmlChar*)"children")) {
|
||||||
|
addChildren(node, hnode);
|
||||||
|
} else if (xmlStrEqual(node->name , (xmlChar*)"parameters")) {
|
||||||
|
setHVParameters(node, hnode);
|
||||||
|
} else if (xmlStrEqual(node->name , (xmlChar*)"symmetries")) {
|
||||||
|
setHVSymmetries(node, hnode);
|
||||||
|
} else if (!xmlStrEqual(node->name, (xmlChar*)"comment" )){
|
||||||
|
cerr << "[WARNING] Unknown " << node->name << " node in 'horizontal' section, it will be ignored." << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return hnode;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Circuit::addChildren (xmlNode* xnode, HVSlicingNode* hvnode) {
|
||||||
|
xmlNode* child = xnode->children;
|
||||||
|
for (xmlNode* node = child; node; node = node->next) {
|
||||||
|
if (node->type == XML_ELEMENT_NODE) {
|
||||||
|
if (xmlStrEqual(node->name , (xmlChar*)"vertical" )) {
|
||||||
|
hvnode->push_back(createVerticalSlicingNode (node, hvnode));
|
||||||
|
} else if (xmlStrEqual(node->name , (xmlChar*)"horizontal")) {
|
||||||
|
hvnode->push_back(createHorizontalSlicingNode(node, hvnode));
|
||||||
|
} else if (xmlStrEqual(node->name , (xmlChar*)"device" )) {
|
||||||
|
hvnode->push_back(createDeviceSlicingNode (node, hvnode));
|
||||||
|
} else if (xmlStrEqual(node->name , (xmlChar*)"routing" )) {
|
||||||
|
hvnode->push_back(createRoutingSlicingNode (node, hvnode));
|
||||||
|
} else if (!xmlStrEqual(node->name, (xmlChar*)"comment" )){
|
||||||
|
cerr << "[WARNING] Unknown " << node->name << " node in 'slicingtree' section, it will be ignored." << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Circuit::setHVParameters (xmlNode* xnode, HVSlicingNode* hvnode) {
|
||||||
|
bool toleranceRatioHSet = false;
|
||||||
|
bool toleranceRatioWSet = false;
|
||||||
|
bool toleranceBandHSet = false;
|
||||||
|
bool toleranceBandWSet = false;
|
||||||
|
|
||||||
|
xmlNode* child = xnode->children;
|
||||||
|
for (xmlNode* node = child; node; node = node->next) {
|
||||||
|
xmlChar* typeC = xmlGetProp(node, (xmlChar*)"type");
|
||||||
|
|
||||||
|
if (typeC) {
|
||||||
|
string type ((const char*)typeC);
|
||||||
|
|
||||||
|
if (type == "alignment") {
|
||||||
|
xmlChar* alignmentC = xmlGetProp(node, (xmlChar*)"alignment");
|
||||||
|
if (alignmentC){
|
||||||
|
string alignment ((const char*)alignmentC);
|
||||||
|
hvnode->setAlignment(alignment);
|
||||||
|
}
|
||||||
|
} else if (type == "toleranceBandH") {
|
||||||
|
xmlChar* toleranceBandHC = xmlGetProp(node, (xmlChar*)"toleranceBandH");
|
||||||
|
if (toleranceBandHC){
|
||||||
|
string toleranceBandH ((const char*)toleranceBandHC);
|
||||||
|
hvnode->setToleranceBandH(toleranceBandH);
|
||||||
|
toleranceBandHSet = true;
|
||||||
|
}
|
||||||
|
} else if (type == "toleranceBandW") {
|
||||||
|
xmlChar* toleranceBandWC = xmlGetProp(node, (xmlChar*)"toleranceBandW");
|
||||||
|
if (toleranceBandWC){
|
||||||
|
string toleranceBandW ((const char*)toleranceBandWC);
|
||||||
|
hvnode->setToleranceBandW(toleranceBandW);
|
||||||
|
toleranceBandWSet = true;
|
||||||
|
}
|
||||||
|
} else if (type == "toleranceRatioH") {
|
||||||
|
xmlChar* toleranceRatioHC = xmlGetProp(node, (xmlChar*)"toleranceRatioH");
|
||||||
|
if (toleranceRatioHC){
|
||||||
|
string toleranceRatioH ((const char*)toleranceRatioHC);
|
||||||
|
hvnode->setToleranceRatioH(toleranceRatioH);
|
||||||
|
toleranceRatioHSet = true;
|
||||||
|
}
|
||||||
|
} else if (type == "toleranceRatioW") {
|
||||||
|
xmlChar* toleranceRatioWC = xmlGetProp(node, (xmlChar*)"toleranceRatioW");
|
||||||
|
if (toleranceRatioWC){
|
||||||
|
string toleranceRatioW ((const char*)toleranceRatioWC);
|
||||||
|
hvnode->setToleranceRatioW(toleranceRatioW);
|
||||||
|
toleranceRatioWSet = true;
|
||||||
|
}
|
||||||
|
} else if (!xmlStrEqual(node->name, (xmlChar*)"comment" )){
|
||||||
|
cerr << "[WARNING] Unknown " << node->name << " node in 'HVparameters' section, it will be ignored." << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hvnode->isRoot()){
|
||||||
|
if (!toleranceRatioHSet){
|
||||||
|
hvnode->setToleranceRatioH(hvnode->getParent()->getToleranceRatioH());
|
||||||
|
}
|
||||||
|
if (!toleranceRatioWSet){
|
||||||
|
hvnode->setToleranceRatioW(hvnode->getParent()->getToleranceRatioW());
|
||||||
|
}
|
||||||
|
if (!toleranceBandHSet){
|
||||||
|
hvnode->setToleranceBandH(hvnode->getParent()->getToleranceBandH());
|
||||||
|
}
|
||||||
|
if (!toleranceBandWSet){
|
||||||
|
hvnode->setToleranceBandW(hvnode->getParent()->getToleranceBandW());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Circuit::setHVSymmetries (xmlNode* xnode, HVSlicingNode* hvnode) {
|
||||||
|
xmlNode* child = xnode->children;
|
||||||
|
for (xmlNode* node = child; node; node = node->next) {
|
||||||
|
xmlChar* sourceC = xmlGetProp(node, (xmlChar*)"source");
|
||||||
|
xmlChar* targetC = xmlGetProp(node, (xmlChar*)"target");
|
||||||
|
if ((sourceC)&&(targetC)) {
|
||||||
|
string source ((const char*)sourceC);
|
||||||
|
string target ((const char*)targetC);
|
||||||
|
hvnode->addSymmetry(source, target);
|
||||||
|
} else if (!xmlStrEqual(node->name, (xmlChar*)"comment" )){
|
||||||
|
cerr << "[WARNING] Unknown " << node->name << " node in 'HVsymmetries' section, it will be ignored." << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DSlicingNode* Circuit::createDeviceSlicingNode (xmlNode* xnode, SlicingNode* slicingNode) {
|
||||||
|
DSlicingNode* dnode = NULL;
|
||||||
|
|
||||||
|
xmlChar* instanceNameC = xmlGetProp(xnode, (xmlChar*)"instance");
|
||||||
|
if (instanceNameC){
|
||||||
|
string instanceName ((const char*)instanceNameC);
|
||||||
|
dnode = DSlicingNode::create( instanceName, slicingNode );
|
||||||
|
|
||||||
|
xmlNode* child = xnode->children;
|
||||||
|
for (xmlNode* node = child; node; node = node->next) {
|
||||||
|
xmlChar* typeC = xmlGetProp(node, (xmlChar*)"type");
|
||||||
|
if (typeC) {
|
||||||
|
string type ((const char*)typeC);
|
||||||
|
|
||||||
|
if (type == "alignment") {
|
||||||
|
xmlChar* alignmentC = xmlGetProp(node, (xmlChar*)"alignment");
|
||||||
|
if (alignmentC){
|
||||||
|
string alignment ((const char*)alignmentC);
|
||||||
|
dnode->setAlignment(alignment);
|
||||||
|
}
|
||||||
|
} else if (type == "preset") {
|
||||||
|
xmlChar* presetC = xmlGetProp(node, (xmlChar*)"preset");
|
||||||
|
if (presetC){
|
||||||
|
string preset ((const char*)presetC);
|
||||||
|
dnode->setPreset(preset);
|
||||||
|
}
|
||||||
|
} else if (type == "nfing") {
|
||||||
|
xmlChar* nfingC = xmlGetProp(node, (xmlChar*)"nfing");
|
||||||
|
if (nfingC){
|
||||||
|
string nfing ((const char*)nfingC);
|
||||||
|
dnode->setNFing(nfing);
|
||||||
|
}
|
||||||
|
} else if (type == "x") {
|
||||||
|
xmlChar* xC = xmlGetProp(node, (xmlChar*)"x");
|
||||||
|
if (xC){
|
||||||
|
string x ((const char*)xC);
|
||||||
|
dnode->setX(x);
|
||||||
|
}
|
||||||
|
} else if (type == "y") {
|
||||||
|
xmlChar* yC = xmlGetProp(node, (xmlChar*)"y");
|
||||||
|
if (yC){
|
||||||
|
string y ((const char*)yC);
|
||||||
|
dnode->setY(y);
|
||||||
|
}
|
||||||
|
} else if (type == "nodeSets") {
|
||||||
|
xmlChar* startC = xmlGetProp(node, (xmlChar*)"start");
|
||||||
|
xmlChar* stepC = xmlGetProp(node, (xmlChar*)"step");
|
||||||
|
xmlChar* countC = xmlGetProp(node, (xmlChar*)"count");
|
||||||
|
if ( (startC) && (stepC) && (countC) ){
|
||||||
|
string start ((const char*)startC);
|
||||||
|
string step ((const char*)stepC);
|
||||||
|
string count ((const char*)countC);
|
||||||
|
dnode->setStart(start);
|
||||||
|
dnode->setStep (step);
|
||||||
|
dnode->setCount(count);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
cerr << "[WARNING] Unknown " << type << " type in 'device/parameter' section, it will be ignored." << endl;
|
||||||
|
} else if (!xmlStrEqual(node->name, (xmlChar*)"comment" )){
|
||||||
|
cerr << "[WARNING] Unknown " << node->name << " node in 'device' section, it will be ignored." << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dnode;
|
||||||
|
}
|
||||||
|
|
||||||
|
RSlicingNode* Circuit::createRoutingSlicingNode (xmlNode* xnode, SlicingNode* slicingNode) {
|
||||||
|
RSlicingNode* rnode = NULL;
|
||||||
|
xmlChar* valueC = xmlGetProp(xnode, (xmlChar*)"value");
|
||||||
|
if (valueC){
|
||||||
|
string value ((const char*)valueC);
|
||||||
|
rnode = RSlicingNode::create(value, slicingNode);
|
||||||
|
}
|
||||||
|
return rnode;
|
||||||
|
}
|
||||||
|
|
||||||
Circuit* Circuit::readFromFile(const string filePath) {
|
Circuit* Circuit::readFromFile(const string filePath) {
|
||||||
LIBXML_TEST_VERSION;
|
LIBXML_TEST_VERSION;
|
||||||
Circuit* cir = NULL;
|
Circuit* cir = NULL;
|
||||||
|
@ -1112,7 +1363,7 @@ namespace OpenChams {
|
||||||
string error ("[ERROR] Failed to parse: ");
|
string error ("[ERROR] Failed to parse: ");
|
||||||
error += filePath;
|
error += filePath;
|
||||||
throw OpenChamsException(error);
|
throw OpenChamsException(error);
|
||||||
//return NULL;
|
//return NULL;
|
||||||
}
|
}
|
||||||
xmlNode* rootElement = xmlDocGetRootElement(doc);
|
xmlNode* rootElement = xmlDocGetRootElement(doc);
|
||||||
if (rootElement->type == XML_ELEMENT_NODE && xmlStrEqual(rootElement->name, (xmlChar*)"circuit")) {
|
if (rootElement->type == XML_ELEMENT_NODE && xmlStrEqual(rootElement->name, (xmlChar*)"circuit")) {
|
||||||
|
@ -1120,47 +1371,50 @@ namespace OpenChams {
|
||||||
xmlChar* technoNameC = xmlGetProp(rootElement, (xmlChar*)"techno");
|
xmlChar* technoNameC = xmlGetProp(rootElement, (xmlChar*)"techno");
|
||||||
|
|
||||||
if (circuitNameC && technoNameC) {
|
if (circuitNameC && technoNameC) {
|
||||||
const std::string& circuitName ((const char*)circuitNameC);
|
const std::string& circuitName ((const char*)circuitNameC);
|
||||||
const std::string& technoName ((const char*)technoNameC);
|
const std::string& technoName ((const char*)technoNameC);
|
||||||
cir = new Circuit(circuitName, technoName);
|
cir = new Circuit(circuitName, technoName);
|
||||||
} else {
|
} else {
|
||||||
throw OpenChamsException("[ERROR] 'circuit' node must have 'name' and 'techno' properties.");
|
throw OpenChamsException("[ERROR] 'circuit' node must have 'name' and 'techno' properties.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
cir->setAbsolutePath(filePath);
|
cir->setAbsolutePath(filePath);
|
||||||
|
|
||||||
xmlNode* child = rootElement->children;
|
xmlNode* child = rootElement->children;
|
||||||
for (xmlNode* node = child; node; node = node->next) {
|
for (xmlNode* node = child; node; node = node->next) {
|
||||||
if (node->type == XML_ELEMENT_NODE) {
|
if (node->type == XML_ELEMENT_NODE) {
|
||||||
if (xmlStrEqual(node->name, (xmlChar*)"subCircuitsPaths")) {
|
if (xmlStrEqual(node->name, (xmlChar*)"subCircuitsPaths")) {
|
||||||
cir->readSubCircuitsPaths(node);
|
cir->readSubCircuitsPaths(node);
|
||||||
}
|
}
|
||||||
else if (xmlStrEqual(node->name, (xmlChar*)"parameters")) {
|
else if (xmlStrEqual(node->name, (xmlChar*)"parameters")) {
|
||||||
cir->readCircuitParameters(node);
|
cir->readCircuitParameters(node);
|
||||||
}
|
}
|
||||||
else if (xmlStrEqual(node->name, (xmlChar*)"simulModels")) {
|
else if (xmlStrEqual(node->name, (xmlChar*)"simulModels")) {
|
||||||
cir->readSimulModels(node);
|
cir->readSimulModels(node);
|
||||||
}
|
}
|
||||||
else if (xmlStrEqual(node->name, (xmlChar*)"netlist")) {
|
else if (xmlStrEqual(node->name, (xmlChar*)"netlist")) {
|
||||||
cir->readNetList(node);
|
cir->readNetList(node);
|
||||||
}
|
}
|
||||||
else if (xmlStrEqual(node->name, (xmlChar*)"schematic")) {
|
else if (xmlStrEqual(node->name, (xmlChar*)"schematic")) {
|
||||||
cir->readSchematic(node);
|
cir->readSchematic(node);
|
||||||
}
|
}
|
||||||
else if (xmlStrEqual(node->name, (xmlChar*)"sizing")) {
|
else if (xmlStrEqual(node->name, (xmlChar*)"sizing")) {
|
||||||
cir->readSizing(node);
|
cir->readSizing(node);
|
||||||
}
|
}
|
||||||
else if (xmlStrEqual(node->name, (xmlChar*)"layout")) {
|
else if (xmlStrEqual(node->name, (xmlChar*)"layout")) {
|
||||||
cir->readLayout(node);
|
cir->readLayout(node);
|
||||||
}
|
}
|
||||||
else {
|
else if (xmlStrEqual(node->name, (xmlChar*)"slicingtree")) {
|
||||||
string error("[ERROR] Unknown section ");
|
cir->readSlicingTree(node);
|
||||||
error += string((const char*)node->name);
|
}
|
||||||
error += " in circuit description.";
|
else {
|
||||||
throw OpenChamsException(error);
|
string error("[ERROR] Unknown section ");
|
||||||
return NULL;
|
error += string((const char*)node->name);
|
||||||
}
|
error += " in circuit description.";
|
||||||
}
|
throw OpenChamsException(error);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!readNetListDone) {
|
if (!readNetListDone) {
|
||||||
|
@ -1213,6 +1467,16 @@ namespace OpenChams {
|
||||||
return _layout;
|
return _layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Circuit::setSlicingTree( SlicingNode* slicingtree ) {
|
||||||
|
if (_slicingtree)
|
||||||
|
throw OpenChamsException("[ERROR] Cannot create two slicing trees in one circuit.");
|
||||||
|
|
||||||
|
_slicingtree = slicingtree;
|
||||||
|
if (!_slicingtree)
|
||||||
|
throw OpenChamsException("[ERROR] Cannot create slicingtree.");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Circuit::driveHBTree(ofstream& file, Node* node, unsigned indent) {
|
void Circuit::driveHBTree(ofstream& file, Node* node, unsigned indent) {
|
||||||
if (!node) return;
|
if (!node) return;
|
||||||
for (unsigned i = 0 ; i < indent ; i++)
|
for (unsigned i = 0 ; i < indent ; i++)
|
||||||
|
@ -1233,16 +1497,16 @@ namespace OpenChams {
|
||||||
if (bloc) {
|
if (bloc) {
|
||||||
file << "<bloc name=\"" << bloc->getName() << "\"";
|
file << "<bloc name=\"" << bloc->getName() << "\"";
|
||||||
if (pos != "")
|
if (pos != "")
|
||||||
file << " position=\"" << pos << "\"";
|
file << " position=\"" << pos << "\"";
|
||||||
if (bloc->getTop() == NULL && bloc->getRight() == NULL)
|
if (bloc->getTop() == NULL && bloc->getRight() == NULL)
|
||||||
file << "/>" << endl;
|
file << "/>" << endl;
|
||||||
else {
|
else {
|
||||||
file << ">" << endl;
|
file << ">" << endl;
|
||||||
driveHBTree(file, bloc->getTop() , indent+1);
|
driveHBTree(file, bloc->getTop() , indent+1);
|
||||||
driveHBTree(file, bloc->getRight(), indent+1);
|
driveHBTree(file, bloc->getRight(), indent+1);
|
||||||
for (unsigned i = 0 ; i < indent ; i++)
|
for (unsigned i = 0 ; i < indent ; i++)
|
||||||
file << " ";
|
file << " ";
|
||||||
file << "</bloc>" << endl;
|
file << "</bloc>" << endl;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1275,6 +1539,17 @@ namespace OpenChams {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Circuit::driveSlicingTree(ofstream& file, SlicingNode* snode, unsigned indent) {
|
||||||
|
if (!snode) return;
|
||||||
|
for (unsigned i = 0 ; i < indent ; i++){ file << " "; }
|
||||||
|
file << "<slicingtree>" << endl;
|
||||||
|
|
||||||
|
snode->toXML(file, indent+1);
|
||||||
|
|
||||||
|
for (unsigned i = 0 ; i < indent ; i++){ file << " "; }
|
||||||
|
file << "</slicingtree>" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
bool Circuit::writeToFile(string filePath) {
|
bool Circuit::writeToFile(string filePath) {
|
||||||
ofstream file;
|
ofstream file;
|
||||||
file.open(filePath.c_str());
|
file.open(filePath.c_str());
|
||||||
|
@ -1284,21 +1559,21 @@ namespace OpenChams {
|
||||||
error += " for writing.";
|
error += " for writing.";
|
||||||
throw OpenChamsException(error);
|
throw OpenChamsException(error);
|
||||||
}
|
}
|
||||||
// checks before do anything
|
// checks before do anything
|
||||||
if (!_netlist) {
|
if (!_netlist) {
|
||||||
//cerr << "no netlist" << endl; cerr.flush();
|
//cerr << "no netlist" << endl; cerr.flush();
|
||||||
throw OpenChamsException("[ERROR] Cannot writeToFile since no netlist is defined !");
|
throw OpenChamsException("[ERROR] Cannot writeToFile since no netlist is defined !");
|
||||||
//return false;
|
//return false;
|
||||||
}
|
}
|
||||||
if (_netlist->hasNoInstances()) {
|
if (_netlist->hasNoInstances()) {
|
||||||
//cerr << "no instances" << endl; cerr.flush();
|
//cerr << "no instances" << endl; cerr.flush();
|
||||||
throw OpenChamsException("[ERROR] Cannot writeToFile since no instance is defined in netlist !");
|
throw OpenChamsException("[ERROR] Cannot writeToFile since no instance is defined in netlist !");
|
||||||
//return false;
|
//return false;
|
||||||
}
|
}
|
||||||
if (_netlist->hasNoNets()) {
|
if (_netlist->hasNoNets()) {
|
||||||
//cerr << "no nets" << endl; cerr.flush();
|
//cerr << "no nets" << endl; cerr.flush();
|
||||||
throw OpenChamsException("[ERROR] Cannot writeToFile since no net is defined in netlist !");
|
throw OpenChamsException("[ERROR] Cannot writeToFile since no net is defined in netlist !");
|
||||||
//return false;
|
//return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
file << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" << endl
|
file << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" << endl
|
||||||
|
@ -1306,7 +1581,7 @@ namespace OpenChams {
|
||||||
if (_subCircuitsPaths.size() != 0) {
|
if (_subCircuitsPaths.size() != 0) {
|
||||||
file << " <subCircuitsPaths>" << endl;
|
file << " <subCircuitsPaths>" << endl;
|
||||||
for (size_t i = 0 ; i < _subCircuitsPaths.size() ; i++ ) {
|
for (size_t i = 0 ; i < _subCircuitsPaths.size() ; i++ ) {
|
||||||
file << " <path path=\"" << _subCircuitsPaths[i] << "\"/>" << endl;
|
file << " <path path=\"" << _subCircuitsPaths[i] << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
file << " </subCircuitsPaths>" << endl;
|
file << " </subCircuitsPaths>" << endl;
|
||||||
}
|
}
|
||||||
|
@ -1315,7 +1590,7 @@ namespace OpenChams {
|
||||||
for (map<string,string>::const_iterator it = _params.getValues().begin() ; it != _params.getValues().end() ; ++it) {
|
for (map<string,string>::const_iterator it = _params.getValues().begin() ; it != _params.getValues().end() ; ++it) {
|
||||||
file << " <parameter name=\"" << (*it).first << "\" value=\"" << (*it).second << "\"/>" << endl;
|
file << " <parameter name=\"" << (*it).first << "\" value=\"" << (*it).second << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
//cerr << "_params.getValues().size() = " << _params.getValues().size() << endl;
|
//cerr << "_params.getValues().size() = " << _params.getValues().size() << endl;
|
||||||
file << " </parameters>" << endl;
|
file << " </parameters>" << endl;
|
||||||
}
|
}
|
||||||
file << " <netlist>" << endl
|
file << " <netlist>" << endl
|
||||||
|
@ -1326,46 +1601,46 @@ namespace OpenChams {
|
||||||
Instance* inst = (*it);
|
Instance* inst = (*it);
|
||||||
Device* dev = dynamic_cast<Device*>(inst);
|
Device* dev = dynamic_cast<Device*>(inst);
|
||||||
if (inst->hasNoConnectors()) {
|
if (inst->hasNoConnectors()) {
|
||||||
string error("[ERROR] Cannot writeToFile since instance (");
|
string error("[ERROR] Cannot writeToFile since instance (");
|
||||||
error += inst->getName();
|
error += inst->getName();
|
||||||
error += ") has no connectors !";
|
error += ") has no connectors !";
|
||||||
throw OpenChamsException(error);
|
throw OpenChamsException(error);
|
||||||
//return false;
|
//return false;
|
||||||
}
|
}
|
||||||
if (dev && dev->hasNoTransistors()) {
|
if (dev && dev->hasNoTransistors()) {
|
||||||
string error("[ERROR] Cannot writeToFile since device instance (");
|
string error("[ERROR] Cannot writeToFile since device instance (");
|
||||||
error += dev->getName();
|
error += dev->getName();
|
||||||
error += ") has no transistors !";
|
error += ") has no transistors !";
|
||||||
throw OpenChamsException(error);
|
throw OpenChamsException(error);
|
||||||
}
|
}
|
||||||
if (dev) {
|
if (dev) {
|
||||||
string sourceBulkStr = (dev->isSourceBulkConnected()) ? "True" : "False";
|
string sourceBulkStr = (dev->isSourceBulkConnected()) ? "True" : "False";
|
||||||
file << " <instance name=\"" << dev->getName() << "\" model=\"" << dev->getModel() << "\" mostype=\"" << dev->getMosType() << "\" sourceBulkConnected=\"" << sourceBulkStr << "\" order=\"" << dev->getOrder() << "\">" << endl;
|
file << " <instance name=\"" << dev->getName() << "\" model=\"" << dev->getModel() << "\" mostype=\"" << dev->getMosType() << "\" sourceBulkConnected=\"" << sourceBulkStr << "\" order=\"" << dev->getOrder() << "\">" << endl;
|
||||||
} else {
|
} else {
|
||||||
file << " <instance name=\"" << inst->getName() << "\" model=\"" << inst->getModel() << "\" order=\"" << inst->getOrder() << "\">" << endl;
|
file << " <instance name=\"" << inst->getName() << "\" model=\"" << inst->getModel() << "\" order=\"" << inst->getOrder() << "\">" << endl;
|
||||||
}
|
}
|
||||||
file << " <connectors>" << endl;
|
file << " <connectors>" << endl;
|
||||||
for (map<string, Net*>::const_iterator it = inst->getConnectors().begin() ; it != inst->getConnectors().end() ; ++it) {
|
for (map<string, Net*>::const_iterator it = inst->getConnectors().begin() ; it != inst->getConnectors().end() ; ++it) {
|
||||||
file << " <connector name=\"" << (*it).first << "\"/>" << endl;
|
file << " <connector name=\"" << (*it).first << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
file << " </connectors>" << endl;
|
file << " </connectors>" << endl;
|
||||||
if (dev) {
|
if (dev) {
|
||||||
file << " <transistors>" << endl;
|
file << " <transistors>" << endl;
|
||||||
for (vector<Transistor*>::const_iterator it = dev->getTransistors().begin() ; it != dev->getTransistors().end() ; ++it ) {
|
for (vector<Transistor*>::const_iterator it = dev->getTransistors().begin() ; it != dev->getTransistors().end() ; ++it ) {
|
||||||
Transistor* tr = (*it);
|
Transistor* tr = (*it);
|
||||||
file << " <transistor name=\"" << tr->getName() << "\">" << endl
|
file << " <transistor name=\"" << tr->getName() << "\">" << endl
|
||||||
<< " <connection gate=\"" << tr->getGate() << "\" source=\"" << tr->getSource() << "\" drain=\"" << tr->getDrain() << "\" bulk=\"" << tr->getBulk() << "\"/>" << endl
|
<< " <connection gate=\"" << tr->getGate() << "\" source=\"" << tr->getSource() << "\" drain=\"" << tr->getDrain() << "\" bulk=\"" << tr->getBulk() << "\"/>" << endl
|
||||||
<< " </transistor>" << endl;
|
<< " </transistor>" << endl;
|
||||||
}
|
}
|
||||||
file << " </transistors>" << endl;
|
file << " </transistors>" << endl;
|
||||||
}
|
}
|
||||||
if (!inst->getParameters().isEmpty()) {
|
if (!inst->getParameters().isEmpty()) {
|
||||||
Parameters params = inst->getParameters();
|
Parameters params = inst->getParameters();
|
||||||
file << " <parameters>" << endl;
|
file << " <parameters>" << endl;
|
||||||
for (map<string,string>::const_iterator it = params.getValues().begin() ; it != params.getValues().end() ; ++it) {
|
for (map<string,string>::const_iterator it = params.getValues().begin() ; it != params.getValues().end() ; ++it) {
|
||||||
file << " <parameter name=\"" << (*it).first << "\" value=\"" << (*it).second << "\"/>" << endl;
|
file << " <parameter name=\"" << (*it).first << "\" value=\"" << (*it).second << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
file << " </parameters>" << endl;
|
file << " </parameters>" << endl;
|
||||||
}
|
}
|
||||||
file << " </instance>" << endl;
|
file << " </instance>" << endl;
|
||||||
}
|
}
|
||||||
|
@ -1377,20 +1652,20 @@ namespace OpenChams {
|
||||||
for (vector<Net*>::iterator it = nets.begin() ; it != nets.end() ; ++it) {
|
for (vector<Net*>::iterator it = nets.begin() ; it != nets.end() ; ++it) {
|
||||||
Net* net = (*it);
|
Net* net = (*it);
|
||||||
if (net->hasNoConnections()) {
|
if (net->hasNoConnections()) {
|
||||||
string error("[ERROR] Cannot writeToFile since net (");
|
string error("[ERROR] Cannot writeToFile since net (");
|
||||||
error += net->getName();
|
error += net->getName();
|
||||||
error += ") has no connectors !";
|
error += ") has no connectors !";
|
||||||
throw OpenChamsException(error);
|
throw OpenChamsException(error);
|
||||||
//return false;
|
//return false;
|
||||||
}
|
}
|
||||||
if (!net->hasNoPorts() || !net->hasNoWires())
|
if (!net->hasNoPorts() || !net->hasNoWires())
|
||||||
schematicNets = true;
|
schematicNets = true;
|
||||||
string externStr = (net->isExternal()) ? "True" : "False";
|
string externStr = (net->isExternal()) ? "True" : "False";
|
||||||
file << " <net name=\"" << net->getName() << "\" type=\"" << net->getType() << "\" isExternal=\"" << externStr << "\">" << endl;
|
file << " <net name=\"" << net->getName() << "\" type=\"" << net->getType() << "\" isExternal=\"" << externStr << "\">" << endl;
|
||||||
vector<Net::Connection*> connections = net->getConnections();
|
vector<Net::Connection*> connections = net->getConnections();
|
||||||
sort(connections.begin(), connections.end(), ConnectionsSort);
|
sort(connections.begin(), connections.end(), ConnectionsSort);
|
||||||
for (vector<Net::Connection*>::iterator it = connections.begin() ; it != connections.end() ; ++it) {
|
for (vector<Net::Connection*>::iterator it = connections.begin() ; it != connections.end() ; ++it) {
|
||||||
file << " <connector instance=\"" << (*it)->getInstanceName() << "\" name=\"" << (*it)->getConnectorName() << "\"/>" << endl;
|
file << " <connector instance=\"" << (*it)->getInstanceName() << "\" name=\"" << (*it)->getConnectorName() << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
file << " </net>" << endl;
|
file << " </net>" << endl;
|
||||||
}
|
}
|
||||||
|
@ -1399,119 +1674,119 @@ namespace OpenChams {
|
||||||
if (_schematic && !_schematic->hasNoInstances()) {
|
if (_schematic && !_schematic->hasNoInstances()) {
|
||||||
file << " <schematic>" << endl;
|
file << " <schematic>" << endl;
|
||||||
for (map<string, Schematic::Infos*>::const_iterator it = _schematic->getInstances().begin() ; it != _schematic->getInstances().end(); ++it ) {
|
for (map<string, Schematic::Infos*>::const_iterator it = _schematic->getInstances().begin() ; it != _schematic->getInstances().end(); ++it ) {
|
||||||
Schematic::Infos* infos = (*it).second;
|
Schematic::Infos* infos = (*it).second;
|
||||||
file << " <instance name=\"" << ((*it).first) << "\" x=\"" << infos->getX() << "\" y=\"" << infos->getY() << "\" orient=\"" << infos->getOrientation() << "\"/>" << endl;
|
file << " <instance name=\"" << ((*it).first) << "\" x=\"" << infos->getX() << "\" y=\"" << infos->getY() << "\" orient=\"" << infos->getOrientation() << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
if (schematicNets) {
|
if (schematicNets) {
|
||||||
for (size_t i = 0 ; i < nets.size() ; i++) {
|
for (size_t i = 0 ; i < nets.size() ; i++) {
|
||||||
Net* net = nets[i];
|
Net* net = nets[i];
|
||||||
if (net->hasNoPorts() && net->hasNoWires())
|
if (net->hasNoPorts() && net->hasNoWires())
|
||||||
continue;
|
continue;
|
||||||
file << " <net name=\"" << net->getName() << "\">" << endl;
|
file << " <net name=\"" << net->getName() << "\">" << endl;
|
||||||
for (size_t j = 0 ; j < net->getPorts().size() ; j++) {
|
for (size_t j = 0 ; j < net->getPorts().size() ; j++) {
|
||||||
Port* port = net->getPorts()[j];
|
Port* port = net->getPorts()[j];
|
||||||
if (!port)
|
if (!port)
|
||||||
continue;
|
continue;
|
||||||
file << " <port type=\"" << port->getType() << "\" idx=\"" << port->getIndex() << "\" x=\"" << port->getX() << "\" y=\"" << port->getY() << "\" orient=\"" << port->getOrientation() << "\"/>" << endl;
|
file << " <port type=\"" << port->getType() << "\" idx=\"" << port->getIndex() << "\" x=\"" << port->getX() << "\" y=\"" << port->getY() << "\" orient=\"" << port->getOrientation() << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
for (size_t j = 0 ; j < net->getWires().size() ; j++) {
|
for (size_t j = 0 ; j < net->getWires().size() ; j++) {
|
||||||
Wire* wire = net->getWires()[j];
|
Wire* wire = net->getWires()[j];
|
||||||
file << " <wire>" << endl;
|
file << " <wire>" << endl;
|
||||||
WirePoint* start = wire->getStartPoint();
|
WirePoint* start = wire->getStartPoint();
|
||||||
WirePoint* end = wire->getEndPoint();
|
WirePoint* end = wire->getEndPoint();
|
||||||
// start point
|
// start point
|
||||||
if (dynamic_cast<InstancePoint*>(start)) {
|
if (dynamic_cast<InstancePoint*>(start)) {
|
||||||
InstancePoint* iP = static_cast<InstancePoint*>(start);
|
InstancePoint* iP = static_cast<InstancePoint*>(start);
|
||||||
file << " <connector name=\"" << iP->getName() << "\" plug=\"" << iP->getPlug() << "\"/>" << endl;
|
file << " <connector name=\"" << iP->getName() << "\" plug=\"" << iP->getPlug() << "\"/>" << endl;
|
||||||
} else if (dynamic_cast<PortPoint*>(start)) {
|
} else if (dynamic_cast<PortPoint*>(start)) {
|
||||||
PortPoint* pP = static_cast<PortPoint*>(start);
|
PortPoint* pP = static_cast<PortPoint*>(start);
|
||||||
file << " <connector idx=\"" << pP->getIndex() << "\"/>" << endl;
|
file << " <connector idx=\"" << pP->getIndex() << "\"/>" << endl;
|
||||||
} else {
|
} else {
|
||||||
throw OpenChamsException("[ERROR] Wire start point is nor an InstancePoint nor a PortPoint.");
|
throw OpenChamsException("[ERROR] Wire start point is nor an InstancePoint nor a PortPoint.");
|
||||||
}
|
}
|
||||||
// intermediate points
|
// intermediate points
|
||||||
for (size_t k = 0 ; k < wire->getIntermediatePoints().size() ; k++) {
|
for (size_t k = 0 ; k < wire->getIntermediatePoints().size() ; k++) {
|
||||||
IntermediatePoint* iP = wire->getIntermediatePoints()[k];
|
IntermediatePoint* iP = wire->getIntermediatePoints()[k];
|
||||||
file << " <point x=\"" << iP->getX() << "\" y=\"" << iP->getY() << "\"/>" << endl;
|
file << " <point x=\"" << iP->getX() << "\" y=\"" << iP->getY() << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
// end point
|
// end point
|
||||||
if (dynamic_cast<InstancePoint*>(end)) {
|
if (dynamic_cast<InstancePoint*>(end)) {
|
||||||
InstancePoint* iP = static_cast<InstancePoint*>(end);
|
InstancePoint* iP = static_cast<InstancePoint*>(end);
|
||||||
file << " <connector name=\"" << iP->getName() << "\" plug=\"" << iP->getPlug() << "\"/>" << endl;
|
file << " <connector name=\"" << iP->getName() << "\" plug=\"" << iP->getPlug() << "\"/>" << endl;
|
||||||
} else if (dynamic_cast<PortPoint*>(end)) {
|
} else if (dynamic_cast<PortPoint*>(end)) {
|
||||||
PortPoint* pP = static_cast<PortPoint*>(end);
|
PortPoint* pP = static_cast<PortPoint*>(end);
|
||||||
file << " <connector idx=\"" << pP->getIndex() << "\"/>" << endl;
|
file << " <connector idx=\"" << pP->getIndex() << "\"/>" << endl;
|
||||||
} else {
|
} else {
|
||||||
throw OpenChamsException("[ERROR] Wire end point is nor an InstancePoint nor a PortPoint.");
|
throw OpenChamsException("[ERROR] Wire end point is nor an InstancePoint nor a PortPoint.");
|
||||||
}
|
}
|
||||||
file << " </wire>" << endl;
|
file << " </wire>" << endl;
|
||||||
}
|
}
|
||||||
file << " </net>" << endl;
|
file << " </net>" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file << " </schematic>" << endl;
|
file << " </schematic>" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SIZING (modified by Farakh) ***************************************************************
|
// SIZING (modified by Farakh) ***************************************************************
|
||||||
if(_sizing && (!_sizing->hasNoOperators() || !_sizing->hasNoEquations()) )
|
if(_sizing && (!_sizing->hasNoOperators() || !_sizing->hasNoEquations()) )
|
||||||
file << " <sizing>" << endl;
|
file << " <sizing>" << endl;
|
||||||
if (_sizing && !_sizing->hasNoOperators()) {
|
if (_sizing && !_sizing->hasNoOperators()) {
|
||||||
// file << " <sizing>" << endl;
|
// file << " <sizing>" << endl;
|
||||||
for (map<string, Operator*>::const_iterator it = _sizing->getOperators().begin() ; it != _sizing->getOperators().end() ; ++it) {
|
for (map<string, Operator*>::const_iterator it = _sizing->getOperators().begin() ; it != _sizing->getOperators().end() ; ++it) {
|
||||||
Operator* op = (*it).second;
|
Operator* op = (*it).second;
|
||||||
string opName = op->getName();
|
string opName = op->getName();
|
||||||
transform(opName.begin(), opName.end(), opName.begin(), ::toupper);
|
transform(opName.begin(), opName.end(), opName.begin(), ::toupper);
|
||||||
file << " <instance name=\"" << ((*it).first) << "\" operator=\"" << opName << "\" simulModel=\"" << op->getSimulModel() << "\">" << endl;
|
file << " <instance name=\"" << ((*it).first) << "\" operator=\"" << opName << "\" simulModel=\"" << op->getSimulModel() << "\">" << endl;
|
||||||
if (!op->hasNoConstraints()) {
|
if (!op->hasNoConstraints()) {
|
||||||
for (map<string, Operator::Constraint*>::const_iterator cit = op->getConstraints().begin() ; cit != op->getConstraints().end() ; ++cit) {
|
for (map<string, Operator::Constraint*>::const_iterator cit = op->getConstraints().begin() ; cit != op->getConstraints().end() ; ++cit) {
|
||||||
Operator::Constraint* cn = (*cit).second;
|
Operator::Constraint* cn = (*cit).second;
|
||||||
const std::string& ref = cn->getRef();
|
const std::string& ref = cn->getRef();
|
||||||
if (ref.empty()) {
|
if (ref.empty()) {
|
||||||
file << " <constraint param=\"" << ((*cit).first) << "\" refEquation=\"" << cn->getRefParam() << "\" factor=\"" << cn->getFactor() << "\"/>" << endl;
|
file << " <constraint param=\"" << ((*cit).first) << "\" refEquation=\"" << cn->getRefParam() << "\" factor=\"" << cn->getFactor() << "\"/>" << endl;
|
||||||
} else {
|
} else {
|
||||||
file << " <constraint param=\"" << ((*cit).first) << "\" ref=\"" << cn->getRef() << "\" refParam=\"" << cn->getRefParam() << "\" factor=\"" << cn->getFactor() << "\"/>" << endl;
|
file << " <constraint param=\"" << ((*cit).first) << "\" ref=\"" << cn->getRef() << "\" refParam=\"" << cn->getRefParam() << "\" factor=\"" << cn->getFactor() << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file << " </instance>" << endl;
|
file << " </instance>" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// EQUATIONS
|
// EQUATIONS
|
||||||
if (_sizing && !_sizing->hasNoEquations()) {
|
if (_sizing && !_sizing->hasNoEquations()) {
|
||||||
file << " <equations>" << endl;
|
file << " <equations>" << endl;
|
||||||
// for (map<string, string>::const_iterator it = _sizing->getEquations().begin() ; it != _sizing->getEquations().end() ; ++it)
|
// for (map<string, string>::const_iterator it = _sizing->getEquations().begin() ; it != _sizing->getEquations().end() ; ++it)
|
||||||
// file << " <eq name=\"" << ((*it).first) << "\" equation=\"" << (*it).second << "\"/>" << endl;
|
// file << " <eq name=\"" << ((*it).first) << "\" equation=\"" << (*it).second << "\"/>" << endl;
|
||||||
file << " <cstr_designer>" << endl;
|
file << " <cstr_designer>" << endl;
|
||||||
for(map<string, Equation*>::const_iterator it = _sizing->getEquations().begin() ; it != _sizing->getEquations().end() ; ++it) {
|
for(map<string, Equation*>::const_iterator it = _sizing->getEquations().begin() ; it != _sizing->getEquations().end() ; ++it) {
|
||||||
if(dynamic_cast<DesignerCstrOC*>((*it).second))
|
if(dynamic_cast<DesignerCstrOC*>((*it).second))
|
||||||
file << " <cstr_dsg name=\"" << ((*it).first) << "\" equation=\"" << (*it).second->getEquationStr()[0] << "\"/>" << endl;
|
file << " <cstr_dsg name=\"" << ((*it).first) << "\" equation=\"" << (*it).second->getEquationStr()[0] << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
file << " </cstr_designer>" << endl;
|
file << " </cstr_designer>" << endl;
|
||||||
|
|
||||||
file << " <cstr_circuit_level>" << endl;
|
file << " <cstr_circuit_level>" << endl;
|
||||||
for(map<string, Equation*>::const_iterator it = _sizing->getEquations().begin() ; it != _sizing->getEquations().end() ; ++it) {
|
for(map<string, Equation*>::const_iterator it = _sizing->getEquations().begin() ; it != _sizing->getEquations().end() ; ++it) {
|
||||||
if(dynamic_cast<HighLevelCstr*>((*it).second))
|
if(dynamic_cast<HighLevelCstr*>((*it).second))
|
||||||
file << " <cstr_cl name=\"" << ((*it).first) << "\" equation=\"" << (*it).second->getEquationStr()[0] << "\"/>" << endl;
|
file << " <cstr_cl name=\"" << ((*it).first) << "\" equation=\"" << (*it).second->getEquationStr()[0] << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
file << " </cstr_circuit_level>" << endl;
|
file << " </cstr_circuit_level>" << endl;
|
||||||
|
|
||||||
file << " <nrc_cstr>" << endl;
|
file << " <nrc_cstr>" << endl;
|
||||||
for(map<string, Equation*>::const_iterator it = _sizing->getEquations().begin() ; it != _sizing->getEquations().end() ; ++it) {
|
for(map<string, Equation*>::const_iterator it = _sizing->getEquations().begin() ; it != _sizing->getEquations().end() ; ++it) {
|
||||||
if(dynamic_cast<NRCCstr*>((*it).second)) {
|
if(dynamic_cast<NRCCstr*>((*it).second)) {
|
||||||
NRCCstr* nrcCstr = (NRCCstr*)((*it).second);
|
NRCCstr* nrcCstr = (NRCCstr*)((*it).second);
|
||||||
file << " <nrc name=\"" << ((*it).first) << "\" param=\"" << nrcCstr->getVoltage() << "\" equation=\"" << (*it).second->getEquationStr()[0] << "\"/>" << endl;
|
file << " <nrc name=\"" << ((*it).first) << "\" param=\"" << nrcCstr->getVoltage() << "\" equation=\"" << (*it).second->getEquationStr()[0] << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file << " </nrc_cstr>" << endl;
|
file << " </nrc_cstr>" << endl;
|
||||||
|
|
||||||
file << " <ddps>" << endl;
|
file << " <ddps>" << endl;
|
||||||
for(map<string, Equation*>::const_iterator it = _sizing->getEquations().begin() ; it != _sizing->getEquations().end() ; ++it) {
|
for(map<string, Equation*>::const_iterator it = _sizing->getEquations().begin() ; it != _sizing->getEquations().end() ; ++it) {
|
||||||
if(dynamic_cast<DDP*>((*it).second)) {
|
if(dynamic_cast<DDP*>((*it).second)) {
|
||||||
file << " <ddp_i name=\"" << ((*it).first) << "\">" << endl;
|
file << " <ddp_i name=\"" << ((*it).first) << "\">" << endl;
|
||||||
for(map<int, string>::const_iterator it2 = (*it).second->getEquationStr().begin(); it2!=(*it).second->getEquationStr().end(); ++it2)
|
for(map<int, string>::const_iterator it2 = (*it).second->getEquationStr().begin(); it2!=(*it).second->getEquationStr().end(); ++it2)
|
||||||
file << " <ddp_eq equation=\"" << (*it2).second << "\"/>" << endl;
|
file << " <ddp_eq equation=\"" << (*it2).second << "\"/>" << endl;
|
||||||
file << " </ddp_i>" << endl;
|
file << " </ddp_i>" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file << " </ddps>" << endl;
|
file << " </ddps>" << endl;
|
||||||
|
|
||||||
|
@ -1520,22 +1795,29 @@ namespace OpenChams {
|
||||||
}
|
}
|
||||||
if(_sizing && (!_sizing->hasNoOperators() || !_sizing->hasNoEquations()) )
|
if(_sizing && (!_sizing->hasNoOperators() || !_sizing->hasNoEquations()) )
|
||||||
file << " </sizing>" << endl;
|
file << " </sizing>" << endl;
|
||||||
// *******************************************************************************************
|
// *******************************************************************************************
|
||||||
|
|
||||||
if (_layout) {
|
if (_layout) {
|
||||||
file << " <layout>" << endl;
|
file << " <layout>" << endl;
|
||||||
if (!_layout->hasNoInstance()) {
|
if (!_layout->hasNoInstance()) {
|
||||||
for (map<string, string>::const_iterator it = _layout->getInstances().begin() ; it != _layout->getInstances().end() ; ++it) {
|
for (map<string, string>::const_iterator it = _layout->getInstances().begin() ; it != _layout->getInstances().end() ; ++it) {
|
||||||
file << " <instance name=\"" << ((*it).first) << "\" style=\"" << ((*it).second) << "\"/>" << endl;
|
file << " <instance name=\"" << ((*it).first) << "\" style=\"" << ((*it).second) << "\"/>" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Node* root = _layout->getHBTreeRoot()) {
|
if (Node* root = _layout->getHBTreeRoot()) {
|
||||||
file << " <hbtree>" << endl;
|
file << " <hbtree>" << endl;
|
||||||
driveHBTree(file, root, 3);
|
driveHBTree(file, root, 3);
|
||||||
file << " </hbtree>" << endl;
|
file << " </hbtree>" << endl;
|
||||||
}
|
}
|
||||||
file << " </layout>" << endl;
|
file << " </layout>" << endl;
|
||||||
}
|
}
|
||||||
|
// *******************************************************************************************
|
||||||
|
|
||||||
|
if (_slicingtree) {
|
||||||
|
driveSlicingTree(file, _slicingtree, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
file << "</circuit>" << endl;
|
file << "</circuit>" << endl;
|
||||||
file.close();
|
file.close();
|
||||||
return true;
|
return true;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,13 +2,14 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the VLSI SAPD Software.
|
// This file is part of the VLSI SAPD Software.
|
||||||
// Copyright (c) UPMC/LIP6 2009-2012, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2009-2016, All Rights Reserved
|
||||||
//
|
//
|
||||||
// +-----------------------------------------------------------------+
|
// +-----------------------------------------------------------------+
|
||||||
// | V L S I S A P D |
|
// | V L S I S A P D |
|
||||||
// | OpenChams Circuit Data Base |
|
// | OpenChams Circuit Data Base |
|
||||||
// | |
|
// | |
|
||||||
// | Author : Damien Dupuis |
|
// | Author : Damien Dupuis |
|
||||||
|
// | Eric Lao |
|
||||||
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
// | =============================================================== |
|
// | =============================================================== |
|
||||||
// | C++ Header : "./vlsisapd/openChams/Circuit.h" |
|
// | C++ Header : "./vlsisapd/openChams/Circuit.h" |
|
||||||
|
@ -27,6 +28,7 @@
|
||||||
|
|
||||||
#include "vlsisapd/openChams/Parameters.h"
|
#include "vlsisapd/openChams/Parameters.h"
|
||||||
#include "vlsisapd/openChams/SimulModel.h"
|
#include "vlsisapd/openChams/SimulModel.h"
|
||||||
|
#include "vlsisapd/openChams/SlicingTree.h"
|
||||||
|
|
||||||
|
|
||||||
namespace OpenChams {
|
namespace OpenChams {
|
||||||
|
@ -58,6 +60,7 @@ namespace OpenChams {
|
||||||
inline Parameters getParameters ();
|
inline Parameters getParameters ();
|
||||||
inline void addSubCircuitPath ( std::string );
|
inline void addSubCircuitPath ( std::string );
|
||||||
inline std::vector<std::string>& getSubCircuitPaths ();
|
inline std::vector<std::string>& getSubCircuitPaths ();
|
||||||
|
inline SlicingNode* getSlicingTree ();
|
||||||
// Mutators.
|
// Mutators.
|
||||||
void addSimulModel ( unsigned
|
void addSimulModel ( unsigned
|
||||||
, SimulModel::Base
|
, SimulModel::Base
|
||||||
|
@ -69,7 +72,9 @@ namespace OpenChams {
|
||||||
Schematic* createSchematic ();
|
Schematic* createSchematic ();
|
||||||
Sizing* createSizing ();
|
Sizing* createSizing ();
|
||||||
Layout* createLayout ();
|
Layout* createLayout ();
|
||||||
|
void setSlicingTree ( SlicingNode* slicingtree );
|
||||||
void driveHBTree ( std::ofstream&, Node*, unsigned );
|
void driveHBTree ( std::ofstream&, Node*, unsigned );
|
||||||
|
void driveSlicingTree ( std::ofstream&, SlicingNode*, unsigned );
|
||||||
bool writeToFile ( std::string filePath );
|
bool writeToFile ( std::string filePath );
|
||||||
static Circuit* readFromFile ( const std::string filePath );
|
static Circuit* readFromFile ( const std::string filePath );
|
||||||
|
|
||||||
|
@ -112,6 +117,17 @@ namespace OpenChams {
|
||||||
void readHBTree ( xmlNode*, Layout* );
|
void readHBTree ( xmlNode*, Layout* );
|
||||||
Node* readNodeOrBloc ( xmlNode*, Node* parent = NULL );
|
Node* readNodeOrBloc ( xmlNode*, Node* parent = NULL );
|
||||||
void setAbsolutePath ( const std::string filePath );
|
void setAbsolutePath ( const std::string filePath );
|
||||||
|
// Slicingtree related XML methods.
|
||||||
|
void readSlicingTree ( xmlNode* );
|
||||||
|
SlicingNode* readSlicingNode ( xmlNode* xnode, SlicingNode* slicingNode = NULL );
|
||||||
|
VSlicingNode* createVerticalSlicingNode ( xmlNode* xnode, SlicingNode* slicingNode = NULL );
|
||||||
|
HSlicingNode* createHorizontalSlicingNode ( xmlNode* xnode, SlicingNode* slicingNode = NULL );
|
||||||
|
DSlicingNode* createDeviceSlicingNode ( xmlNode* xnode, SlicingNode* slicingNode = NULL );
|
||||||
|
RSlicingNode* createRoutingSlicingNode ( xmlNode* xnode, SlicingNode* slicingNode = NULL );
|
||||||
|
void addChildren ( xmlNode*, HVSlicingNode* );
|
||||||
|
void setHVParameters ( xmlNode*, HVSlicingNode* );
|
||||||
|
void setHVSymmetries ( xmlNode*, HVSlicingNode* );
|
||||||
|
|
||||||
// Utilities methods.
|
// Utilities methods.
|
||||||
void check_uppercase ( std::string& str, std::vector<std::string>& compares, std::string message );
|
void check_uppercase ( std::string& str, std::vector<std::string>& compares, std::string message );
|
||||||
void check_lowercase ( std::string& str, std::vector<std::string>& compares, std::string message );
|
void check_lowercase ( std::string& str, std::vector<std::string>& compares, std::string message );
|
||||||
|
@ -127,6 +143,7 @@ namespace OpenChams {
|
||||||
Layout* _layout;
|
Layout* _layout;
|
||||||
std::vector<std::string> _subCircuitsPaths;
|
std::vector<std::string> _subCircuitsPaths;
|
||||||
std::map<unsigned, SimulModel*> _simulModels;
|
std::map<unsigned, SimulModel*> _simulModels;
|
||||||
|
SlicingNode* _slicingtree;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -142,7 +159,7 @@ namespace OpenChams {
|
||||||
inline Parameters Circuit::getParameters () { return _params; }
|
inline Parameters Circuit::getParameters () { return _params; }
|
||||||
inline void Circuit::addSubCircuitPath (std::string path) { _subCircuitsPaths.push_back(path); }
|
inline void Circuit::addSubCircuitPath (std::string path) { _subCircuitsPaths.push_back(path); }
|
||||||
inline std::vector<std::string>& Circuit::getSubCircuitPaths () { return _subCircuitsPaths; }
|
inline std::vector<std::string>& Circuit::getSubCircuitPaths () { return _subCircuitsPaths; }
|
||||||
|
inline SlicingNode* Circuit::getSlicingTree () { return _slicingtree; }
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline std::string asString ( T value )
|
inline std::string asString ( T value )
|
||||||
|
|
|
@ -0,0 +1,392 @@
|
||||||
|
|
||||||
|
// -*- C++ -*-
|
||||||
|
//
|
||||||
|
// This file is part of the VLSI SAPD Software.
|
||||||
|
// Copyright (c) UPMC/LIP6 2008-2016, All Rights Reserved
|
||||||
|
//
|
||||||
|
// +-----------------------------------------------------------------+
|
||||||
|
// | V L S I S A P D |
|
||||||
|
// | OpenChams Circuit Data Base |
|
||||||
|
// | |
|
||||||
|
// | Author : Eric Lao |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Header : "./vlsisapd/openChams/SlicingTree.h" |
|
||||||
|
// +-----------------------------------------------------------------+
|
||||||
|
|
||||||
|
#ifndef __OPENCHAMS_SLICINGTREE_H__
|
||||||
|
#define __OPENCHAMS_SLICINGTREE_H__
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <list>
|
||||||
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
|
||||||
|
namespace OpenChams {
|
||||||
|
|
||||||
|
enum Flags { UnknownType = 1 << 0
|
||||||
|
, HorizontalSNode = 1 << 1
|
||||||
|
, VerticalSNode = 1 << 2
|
||||||
|
, DeviceSNode = 1 << 3
|
||||||
|
, RoutingSNode = 1 << 4
|
||||||
|
, UnknownAlignment = 1 << 5
|
||||||
|
, AlignLeft = 1 << 6
|
||||||
|
, AlignRight = 1 << 7
|
||||||
|
, AlignCenter = 1 << 8
|
||||||
|
, AlignTop = 1 << 9
|
||||||
|
, AlignBottom = 1 << 10
|
||||||
|
};
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
// Class : SlicingNode
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
|
||||||
|
class SlicingNode
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SlicingNode( SlicingNode* parent = NULL );
|
||||||
|
virtual ~SlicingNode(){};
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual unsigned int getType () const { return UnknownType; }
|
||||||
|
virtual void print () const {};
|
||||||
|
inline void recursiveDestroy ();
|
||||||
|
void setParent ( SlicingNode* parent );
|
||||||
|
SlicingNode* getParent () const;
|
||||||
|
inline bool isRoot () const;
|
||||||
|
virtual void setAlignment ( std::string alignment );
|
||||||
|
std::string alignmentToString() const;
|
||||||
|
//Error Methods
|
||||||
|
virtual std::string getInstanceName () const;
|
||||||
|
virtual unsigned int getAlignment () const;
|
||||||
|
virtual bool getPreset () const;
|
||||||
|
virtual double getX () const;
|
||||||
|
virtual double getY () const;
|
||||||
|
virtual int getNFing () const;
|
||||||
|
virtual double getStart () const;
|
||||||
|
virtual double getStep () const;
|
||||||
|
virtual double getCount () const;
|
||||||
|
|
||||||
|
virtual void setInstanceName ( std::string instanceName );
|
||||||
|
virtual void setPreset ( std::string preset );
|
||||||
|
virtual void setX ( std::string x );
|
||||||
|
virtual void setY ( std::string y );
|
||||||
|
virtual void setNFing ( std::string nfing );
|
||||||
|
virtual void setStart ( std::string start );
|
||||||
|
virtual void setStep ( std::string step );
|
||||||
|
virtual void setCount ( std::string count );
|
||||||
|
|
||||||
|
virtual void setPreset ( bool preset );
|
||||||
|
virtual void setX ( double x );
|
||||||
|
virtual void setY ( double y );
|
||||||
|
virtual void setNFing ( int nfing );
|
||||||
|
virtual void setStart ( double start );
|
||||||
|
virtual void setStep ( double step );
|
||||||
|
virtual void setCount ( double count );
|
||||||
|
|
||||||
|
virtual const std::vector<SlicingNode*> getChildren () const;
|
||||||
|
virtual std::list<std::pair <int,int> > getSymmetries () const;
|
||||||
|
|
||||||
|
virtual double getToleranceRatioH() const;
|
||||||
|
virtual double getToleranceRatioW() const;
|
||||||
|
virtual double getToleranceBandH () const;
|
||||||
|
virtual double getToleranceBandW () const;
|
||||||
|
|
||||||
|
virtual void setToleranceRatioH( std::string value );
|
||||||
|
virtual void setToleranceRatioW( std::string value );
|
||||||
|
virtual void setToleranceBandH ( std::string value );
|
||||||
|
virtual void setToleranceBandW ( std::string value );
|
||||||
|
|
||||||
|
virtual void setToleranceRatioH( double value );
|
||||||
|
virtual void setToleranceRatioW( double value );
|
||||||
|
virtual void setToleranceBandH ( double value );
|
||||||
|
virtual void setToleranceBandW ( double value );
|
||||||
|
|
||||||
|
virtual void push_back ( SlicingNode* node );
|
||||||
|
virtual void addSymmetry ( std::string source, std::string target );
|
||||||
|
virtual void addSymmetry ( int source, int target );
|
||||||
|
virtual double getValue () const;
|
||||||
|
virtual void setValue ( std::string value );
|
||||||
|
virtual void toXML ( std::ofstream& file, unsigned indent ){};
|
||||||
|
|
||||||
|
virtual std::string presetToString () const;
|
||||||
|
virtual std::string xToString () const;
|
||||||
|
virtual std::string yToString () const;
|
||||||
|
virtual std::string nfingToString () const;
|
||||||
|
virtual std::string startToString () const;
|
||||||
|
virtual std::string stepToString () const;
|
||||||
|
virtual std::string countToString () const;
|
||||||
|
virtual std::string valueToString () const;
|
||||||
|
|
||||||
|
virtual std::string toleranceRatioHToString() const;
|
||||||
|
virtual std::string toleranceRatioWToString() const;
|
||||||
|
virtual std::string toleranceBandHToString () const;
|
||||||
|
virtual std::string toleranceBandWToString () const;
|
||||||
|
|
||||||
|
virtual bool hasSameParentToleranceRatioH () const;
|
||||||
|
virtual bool hasSameParentToleranceRatioW () const;
|
||||||
|
virtual bool hasSameParentToleranceBandH () const;
|
||||||
|
virtual bool hasSameParentToleranceBandW () const;
|
||||||
|
|
||||||
|
virtual bool checkInitialPlacement( int& cpt ) const;
|
||||||
|
virtual std::list<SlicingNode*> getLeaves () const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
SlicingNode* _parent;
|
||||||
|
unsigned int _alignment;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline void SlicingNode::recursiveDestroy(){ delete(this); }
|
||||||
|
inline bool SlicingNode::isRoot () const { return (_parent == NULL); }
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
// Class : DeviceSNode
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
|
||||||
|
class DSlicingNode : public SlicingNode
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
DSlicingNode( std::string instanceName, SlicingNode* parent = NULL );
|
||||||
|
~DSlicingNode(){};
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline static DSlicingNode* create ( std::string instanceName, SlicingNode* parent = NULL );
|
||||||
|
inline std::string getInstanceName () const;
|
||||||
|
inline unsigned int getAlignment () const;
|
||||||
|
inline bool getPreset () const;
|
||||||
|
inline double getX () const;
|
||||||
|
inline double getY () const;
|
||||||
|
inline int getNFing () const;
|
||||||
|
inline double getStart () const;
|
||||||
|
inline double getStep () const;
|
||||||
|
inline double getCount () const;
|
||||||
|
inline unsigned int getType () const;
|
||||||
|
|
||||||
|
void setInstanceName ( std::string instanceName );
|
||||||
|
void setPreset ( std::string preset );
|
||||||
|
void setX ( std::string x );
|
||||||
|
void setY ( std::string y );
|
||||||
|
void setNFing ( std::string nfing );
|
||||||
|
void setStart ( std::string start );
|
||||||
|
void setStep ( std::string step );
|
||||||
|
void setCount ( std::string count );
|
||||||
|
|
||||||
|
inline void setPreset ( bool preset );
|
||||||
|
inline void setX ( double x );
|
||||||
|
inline void setY ( double y );
|
||||||
|
inline void setNFing ( int nfing );
|
||||||
|
inline void setStart ( double start );
|
||||||
|
inline void setStep ( double step );
|
||||||
|
inline void setCount ( double count );
|
||||||
|
|
||||||
|
void print () const;
|
||||||
|
void toXML ( std::ofstream& file, unsigned indent );
|
||||||
|
inline std::string presetToString () const;
|
||||||
|
inline std::string xToString () const;
|
||||||
|
inline std::string yToString () const;
|
||||||
|
inline std::string nfingToString () const;
|
||||||
|
inline std::string startToString () const;
|
||||||
|
inline std::string stepToString () const;
|
||||||
|
inline std::string countToString () const;
|
||||||
|
|
||||||
|
bool checkInitialPlacement ( int& cpt ) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string _instanceName;
|
||||||
|
bool _preset;
|
||||||
|
double _x;
|
||||||
|
double _y;
|
||||||
|
int _nfing;
|
||||||
|
double _start;
|
||||||
|
double _step;
|
||||||
|
double _count;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline DSlicingNode* DSlicingNode::create ( std::string instanceName, SlicingNode* parent ){ return new DSlicingNode( instanceName ); }
|
||||||
|
inline std::string DSlicingNode::getInstanceName () const { return _instanceName ; }
|
||||||
|
inline unsigned int DSlicingNode::getAlignment () const { return _alignment ; }
|
||||||
|
inline bool DSlicingNode::getPreset () const { return _preset ; }
|
||||||
|
inline double DSlicingNode::getX () const { return _x ; }
|
||||||
|
inline double DSlicingNode::getY () const { return _y ; }
|
||||||
|
inline int DSlicingNode::getNFing () const { return _nfing ; }
|
||||||
|
inline double DSlicingNode::getStart () const { return _start ; }
|
||||||
|
inline double DSlicingNode::getStep () const { return _step ; }
|
||||||
|
inline double DSlicingNode::getCount () const { return _count ; }
|
||||||
|
inline unsigned int DSlicingNode::getType () const { return DeviceSNode ; }
|
||||||
|
|
||||||
|
inline void DSlicingNode::setPreset ( bool preset ) { _preset = preset; }
|
||||||
|
inline void DSlicingNode::setX ( double x ) { _x = x ; }
|
||||||
|
inline void DSlicingNode::setY ( double y ) { _y = y ; }
|
||||||
|
inline void DSlicingNode::setNFing ( int nfing ) { _nfing = nfing ; }
|
||||||
|
inline void DSlicingNode::setStart ( double start ) { _start = start ; }
|
||||||
|
inline void DSlicingNode::setStep ( double step ) { _step = step ; }
|
||||||
|
inline void DSlicingNode::setCount ( double count ) { _count = count ; }
|
||||||
|
|
||||||
|
inline std::string DSlicingNode::presetToString () const { return _preset ? "true" : "false"; }
|
||||||
|
inline std::string DSlicingNode::xToString () const { return std::to_string(_x ); }
|
||||||
|
inline std::string DSlicingNode::yToString () const { return std::to_string(_y ); }
|
||||||
|
inline std::string DSlicingNode::nfingToString () const { return std::to_string(_nfing); }
|
||||||
|
inline std::string DSlicingNode::startToString () const { return std::to_string(_start); }
|
||||||
|
inline std::string DSlicingNode::stepToString () const { return std::to_string(_step ); }
|
||||||
|
inline std::string DSlicingNode::countToString () const { return std::to_string(_count); }
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
// Class : HVSlicingNode
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
|
||||||
|
class HVSlicingNode : public SlicingNode
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
HVSlicingNode( SlicingNode* parent = NULL );
|
||||||
|
virtual ~HVSlicingNode(){};
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline unsigned int getAlignment () const;
|
||||||
|
inline double getToleranceRatioH() const;
|
||||||
|
inline double getToleranceRatioW() const;
|
||||||
|
inline double getToleranceBandH () const;
|
||||||
|
inline double getToleranceBandW () const;
|
||||||
|
inline const std::vector<SlicingNode*> getChildren () const;
|
||||||
|
inline std::list<std::pair <int,int> > getSymmetries () const;
|
||||||
|
|
||||||
|
void setToleranceRatioH( std::string value );
|
||||||
|
void setToleranceRatioW( std::string value );
|
||||||
|
void setToleranceBandH ( std::string value );
|
||||||
|
void setToleranceBandW ( std::string value );
|
||||||
|
|
||||||
|
void setToleranceRatioH( double value );
|
||||||
|
void setToleranceRatioW( double value );
|
||||||
|
void setToleranceBandH ( double value );
|
||||||
|
void setToleranceBandW ( double value );
|
||||||
|
|
||||||
|
void push_back ( SlicingNode* node );
|
||||||
|
void addSymmetry ( std::string source, std::string target );
|
||||||
|
void addSymmetry ( int source, int target );
|
||||||
|
void recursiveDestroy ();
|
||||||
|
void print () const;
|
||||||
|
|
||||||
|
inline std::string toleranceRatioHToString () const;
|
||||||
|
inline std::string toleranceRatioWToString () const;
|
||||||
|
inline std::string toleranceBandHToString () const;
|
||||||
|
inline std::string toleranceBandWToString () const;
|
||||||
|
|
||||||
|
bool hasSameParentToleranceRatioH () const;
|
||||||
|
bool hasSameParentToleranceRatioW () const;
|
||||||
|
bool hasSameParentToleranceBandH () const;
|
||||||
|
bool hasSameParentToleranceBandW () const;
|
||||||
|
|
||||||
|
bool checkInitialPlacement ( int& cpt ) const;
|
||||||
|
std::list<SlicingNode*> getLeaves () const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
double _toleranceRatioH;
|
||||||
|
double _toleranceRatioW;
|
||||||
|
double _toleranceBandH;
|
||||||
|
double _toleranceBandW;
|
||||||
|
std::list<std::pair <int,int> > _symmetries;
|
||||||
|
std::vector<SlicingNode*> _children;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline unsigned int HVSlicingNode::getAlignment () const { return _alignment ; }
|
||||||
|
inline double HVSlicingNode::getToleranceRatioH() const { return _toleranceRatioH; }
|
||||||
|
inline double HVSlicingNode::getToleranceRatioW() const { return _toleranceRatioW; }
|
||||||
|
inline double HVSlicingNode::getToleranceBandH () const { return _toleranceBandH ; }
|
||||||
|
inline double HVSlicingNode::getToleranceBandW () const { return _toleranceBandW ; }
|
||||||
|
inline const std::vector<SlicingNode*> HVSlicingNode::getChildren () const { return _children ; }
|
||||||
|
inline std::list<std::pair<int,int> > HVSlicingNode::getSymmetries () const { return _symmetries ; }
|
||||||
|
|
||||||
|
inline std::string HVSlicingNode::toleranceRatioHToString() const { return std::to_string(_toleranceRatioH); }
|
||||||
|
inline std::string HVSlicingNode::toleranceRatioWToString() const { return std::to_string(_toleranceRatioW); }
|
||||||
|
inline std::string HVSlicingNode::toleranceBandHToString () const { return std::to_string(_toleranceBandH); }
|
||||||
|
inline std::string HVSlicingNode::toleranceBandWToString () const { return std::to_string(_toleranceBandW); }
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
// Class : HSlicingNode
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
|
||||||
|
class HSlicingNode: public HVSlicingNode
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
HSlicingNode( SlicingNode* parent = NULL );
|
||||||
|
~HSlicingNode(){};
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline static HSlicingNode* create ( SlicingNode* parent = NULL );
|
||||||
|
inline unsigned int getType () const;
|
||||||
|
void print () const;
|
||||||
|
void toXML ( std::ofstream& file, unsigned indent );
|
||||||
|
};
|
||||||
|
|
||||||
|
inline HSlicingNode* HSlicingNode::create ( SlicingNode* parent ){ return new HSlicingNode(parent); }
|
||||||
|
inline unsigned int HSlicingNode::getType() const { return HorizontalSNode ; }
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
// Class : VSlicingNode
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
|
||||||
|
class VSlicingNode: public HVSlicingNode
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
VSlicingNode( SlicingNode* parent = NULL );
|
||||||
|
~VSlicingNode(){};
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline static VSlicingNode* create ( SlicingNode* parent = NULL );
|
||||||
|
inline unsigned int getType () const;
|
||||||
|
void print () const;
|
||||||
|
void toXML ( std::ofstream& file, unsigned indent );
|
||||||
|
};
|
||||||
|
|
||||||
|
inline VSlicingNode* VSlicingNode::create ( SlicingNode* parent ){ return new VSlicingNode(parent); }
|
||||||
|
inline unsigned int VSlicingNode::getType() const { return VerticalSNode ; }
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
// Class : RoutingSNode
|
||||||
|
// -----------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
|
||||||
|
class RSlicingNode: public SlicingNode
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
RSlicingNode( std::string value, SlicingNode* parent = NULL );
|
||||||
|
RSlicingNode( double value, SlicingNode* parent = NULL );
|
||||||
|
~RSlicingNode(){};
|
||||||
|
|
||||||
|
public:
|
||||||
|
inline static RSlicingNode* create ( std::string value, SlicingNode* parent = NULL );
|
||||||
|
inline static RSlicingNode* create ( double value, SlicingNode* parent = NULL );
|
||||||
|
inline void recursiveDestroy ();
|
||||||
|
inline double getValue () const;
|
||||||
|
void setValue ( std::string value );
|
||||||
|
inline unsigned int getType () const;
|
||||||
|
void print () const;
|
||||||
|
void setAlignment ( std::string alignment) {};
|
||||||
|
void toXML ( std::ofstream& file, unsigned indent );
|
||||||
|
inline std::string valueToString () const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
double _value;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline RSlicingNode* RSlicingNode::create ( std::string value, SlicingNode* parent ){ return new RSlicingNode( value, parent ); }
|
||||||
|
inline RSlicingNode* RSlicingNode::create ( double value, SlicingNode* parent ){ return new RSlicingNode( value, parent ); }
|
||||||
|
inline double RSlicingNode::getValue () const{ return _value ; }
|
||||||
|
inline unsigned int RSlicingNode::getType () const{ return RoutingSNode; }
|
||||||
|
inline std::string RSlicingNode::valueToString () const { return std::to_string(_value); }
|
||||||
|
|
||||||
|
|
||||||
|
} // OpenChams namespace
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue