torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::Decompiler Class Referenceabstract

#include <Decompiler.hpp>

+ Inheritance diagram for torc::generic::Decompiler:
+ Collaboration diagram for torc::generic::Decompiler:

Public Member Functions

void visit (Root &inroot) throw (Error)
 
void visit (Design &inDesign) throw (Error)
 
void visit (Library &inlibrary) throw (Error)
 
void visit (Cell &incell) throw (Error)
 
void visit (View &inview) throw (Error)
 
void visit (ScalarPort &inscalarPort) throw (Error)
 
void visit (VectorPort &invectorPort) throw (Error)
 
void visit (VectorPortBit &inportBit) throw (Error)
 
void visit (PortBundle &inportBundle) throw (Error)
 
void visit (ScalarNet &inscalarNet) throw (Error)
 
void visit (VectorNet &invectorNet) throw (Error)
 
void visit (VectorNetBit &innetBit) throw (Error)
 
void visit (NetBundle &innetBundle) throw (Error)
 
void visit (SingleInstance &insingleInstance) throw (Error)
 
void visit (InstanceArray &ininstanceArray) throw (Error)
 
void visit (InstanceArrayMember &ininstanceArray) throw (Error)
 
void visit (ScalarPortReference &inScalarPortRef) throw (Error)
 
void visit (VectorPortReference &inVectorPortRef) throw (Error)
 
void visit (VectorPortBitReference &inVectorPortBitRef) throw (Error)
 
void visit (PortBundleReference &inPortBundleRef) throw (Error)
 
void visit (SingleParameter &insingleParameter) throw (Error)
 
void visit (ParameterArray &inparamArray) throw (Error)
 
void visit (ParameterArrayElement &inParamArrayElement) throw (Error)
 
void visit (Property &inProperty) throw (Error)
 
void visit (PortList &inPortList) throw (Error)
 
void visit (PortListAlias &inPortListAlias) throw (Error)
 
void visit (Status &inStatus) throw (Error)
 
void visit (Permutable &inPermutable) throw (Error)
 
void visit (InterfaceJoinedInfo &inInterfaceJoinedInfo) throw (Error)
 
void visit (SimulationInfo &simuInfo) throw (Error)
 
void visit (Simulate &simulate) throw (Error)
 
void visit (Apply &apply) throw (Error)
 
void visit (LogicalResponse &logicalResponse) throw (Error)
 
void visit (LogicValue &logicVal) throw (Error)
 
void visit (LogicElement &logicElement) throw (Error)
 
void visit (WaveValue &waveValue) throw (Error)
 
void visit (Timing &timing) throw (Error)
 
void visit (Event &event) throw (Error)
 
void visit (ForbiddenEvent &forbiddenevent) throw (Error)
 
void printValueType (const Value &value) throw (Error)
 
void printValue (const Value &value) throw (Error)
 
void printUnit (const Unit unit) throw (Error)
 
void printDerivation (const Derivation derivation) throw (Error)
 
void printArray (const std::vector< size_t > &outVector, size_t depth, std::vector< ParameterSharedPtr >::iterator &itStart, std::vector< ParameterSharedPtr >::iterator &itEnd) throw (Error)
 
void printPortAttributes (const PortAttributesSharedPtr &inAttrib) throw (Error)
 
void printNetAttributes (const NetAttributesSharedPtr &inAttrib) throw (Error)
 
void printViewInterfaceAttributes (const InterfaceAttributesSharedPtr &inAttrib) throw (Error)
 
void printLogicValueAttributes (const LogicValueAttributesSharedPtr &inAttrib) throw (Error)
 
void printUserData (std::list< std::string > inElements) throw (Error)
 
void printComments (std::vector< std::string > &inElements) throw (Error)
 
void operator() () throw (Error)
 
void decompile () throw (Error)
 
size_t getIndentation () const
 
void setIndentation (size_t inIndentation)
 
 Decompiler (const RootSharedPtr &inRoot, std::ostream &outStream=std::cout)
 
 Decompiler (const Decompiler &inSource)
 
 ~Decompiler () throw ()
 
Decompileroperator= (const Decompiler &inSource)
 
virtual void visit (_Tp &client)=0 throw (Error)
 

Private Attributes

RootSharedPtr mRoot
 
std::ostream & mOut
 
bool mIsJoiningContext
 
bool mIsPermutableContext
 
bool mIsExternContext
 
bool mParamAssignContext
 
bool mIsPortInstanceContext
 
size_t mIndentation
 
VisitorApplier< DecompilermApplier
 

Detailed Description

This class generates an EDIF 2 0 0 file from an existing class hierarchy. It writes to a stream, so this can be used to write to any stream including string streams.

Definition at line 34 of file Decompiler.hpp.

Constructor & Destructor Documentation

torc::generic::Decompiler::Decompiler ( const RootSharedPtr inRoot,
std::ostream &  outStream = std::cout 
)

Definition at line 2349 of file Decompiler.cpp.

2349  : mRoot(inRoot),
2350  mOut(outStream), mIsJoiningContext(false), mIsPermutableContext(false),
2352  mIndentation(0), mApplier(*this) {}
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
torc::generic::Decompiler::Decompiler ( const Decompiler inSource)

Definition at line 2356 of file Decompiler.cpp.

torc::generic::Decompiler::~Decompiler ( )
throw (
)

Definition at line 2354 of file Decompiler.cpp.

2354 {}

Member Function Documentation

void torc::generic::Decompiler::decompile ( )
throw (Error
)

Decompile the tree.

Parameters
[in]rootRoot of the OM tree.

Definition at line 2336 of file Decompiler.cpp.

2336  {
2337  try {
2338  mRoot->accept(*this);
2339  } catch(Error& e) {
2340  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
2341  throw;
2342  }
2343 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t torc::generic::Decompiler::getIndentation ( ) const
inline

Definition at line 173 of file Decompiler.hpp.

173  {
174  return mIndentation;
175 }
void torc::generic::Decompiler::operator() ( void  )
throw (Error
)

Convenience wrapper function to call decompile()

Definition at line 2322 of file Decompiler.cpp.

2323  {
2324  decompile();
2325 }
2326 catch(Error& e) {
2327  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
2328  throw;
2329 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

Decompiler & torc::generic::Decompiler::operator= ( const Decompiler inSource)

Definition at line 2361 of file Decompiler.cpp.

2361  {
2362  if(this != &inSource) {
2363  mRoot = inSource.mRoot;
2368  mIndentation = inSource.mIndentation;
2369  }
2370  return *this;
2371 }
void torc::generic::Decompiler::printArray ( const std::vector< size_t > &  outVector,
size_t  depth,
std::vector< ParameterSharedPtr >::iterator &  itStart,
std::vector< ParameterSharedPtr >::iterator &  itEnd 
)
throw (Error
)

Definition at line 2007 of file Decompiler.cpp.

2009  {
2010  Indenter indent(*this);
2011 
2012  size_t array_size = outVector.size();
2013  /*std::vector<size_t>::const_iterator it = outVector.begin();*/
2014  for(size_t i = 0; i < outVector.at(array_size - depth); i++) {
2015  if(depth == 1) {
2016  printValue((*itStart)->getValue());
2017  mOut << " ";
2018  if(itStart != itEnd) {
2019  ++itStart;
2020  }
2021  } else {
2022  mOut << std::endl << indent << " ";
2023  printValueType((*itStart)->getValue());
2024  printArray(outVector, depth - 1, itStart, itEnd);
2025  mOut << ")";
2026  }
2027  }
2028 }
void printValueType(const Value &value)
void printArray(const std::vector< size_t > &outVector, size_t depth, std::vector< ParameterSharedPtr >::iterator &itStart, std::vector< ParameterSharedPtr >::iterator &itEnd)
void printValue(const Value &value)
void torc::generic::Decompiler::printComments ( std::vector< std::string > &  inElements)
throw (Error
)

Definition at line 1813 of file Decompiler.cpp.

1813  {
1814  try {
1815  Indenter indent(*this);
1816  if(!inElements.empty()) {
1817  for(std::vector<std::string>::iterator it = inElements.begin(); it != inElements.end();
1818  ++it) {
1819  mOut << std::endl << indent << "(comment " << "\"" << trimLeadingSpaces(*it) << "\""
1820  << ")";
1821  }
1822  }
1823  } catch(Error& e) {
1824  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1825  throw;
1826  }
1827 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::printDerivation ( const Derivation  derivation)
throw (Error
)

Definition at line 1986 of file Decompiler.cpp.

1986  {
1987  mOut << " (derivation ";
1988  switch(derivation) {
1989  case eDerivationCalculated: {
1990  mOut << "CALCULATED";
1991  break;
1992  }
1993  case eDerivationMeasured: {
1994  mOut << "MEASURED";
1995  break;
1996  }
1997  case eDerivationRequired: {
1998  mOut << "REQUIRED";
1999  break;
2000  }
2001  default: {
2002  }
2003  }
2004  mOut << ")" << std::endl;
2005 }
void torc::generic::Decompiler::printLogicValueAttributes ( const LogicValueAttributesSharedPtr inAttrib)
throw (Error
)

Definition at line 2205 of file Decompiler.cpp.

2206  {
2207 
2208  if(!inAttrib)
2209  return;
2210 
2211  Indenter indent(*this);
2212  try {
2213  {
2214  if(inAttrib->getIsVoltageMapSet()) {
2215  Value::MiNoMax mnm = inAttrib->getVoltageMap();
2216  Value val(Value::eValueTypeMiNoMax, mnm);
2217  mOut << std::endl << indent << "(voltageMap ";
2218  printValue(val);
2219  mOut << ")";
2220  }
2221  }
2222  {
2223  if(inAttrib->getIsCurrentMapSet()) {
2224  Value::MiNoMax mnm = inAttrib->getCurrentMap();
2225  Value val(Value::eValueTypeMiNoMax, mnm);
2226  mOut << std::endl << indent << "(currentMap ";
2227  printValue(val);
2228  mOut << ")";
2229  }
2230  }
2231  {
2232  if(inAttrib->getIsBooleanMapSet()) {
2233  Value::Boolean boolean = inAttrib->getBooleanMap();
2234  Value val(Value::eValueTypeBoolean, boolean);
2235  mOut << std::endl << indent << "(booleanMap ";
2236  printValue(val);
2237  mOut << ")";
2238  }
2239  }
2240  {
2241  LogicValueSharedPtr logicVal = inAttrib->getWeakLogicValue();
2242  if(logicVal) {
2243  mOut << std::endl << indent << "(weak " << logicVal->getName() << ")";
2244  }
2245  }
2246  {
2247  LogicValueSharedPtr logicVal = inAttrib->getStrongLogicValue();
2248  if(logicVal) {
2249  mOut << std::endl << indent << "(strong " << logicVal->getName() << ")";
2250  }
2251  }
2252  {
2253  std::list<LogicValueSharedPtr> outLogicValues;
2254  inAttrib->getCompoundLogicValues(outLogicValues);
2255  if(!outLogicValues.empty()) {
2256  mOut << std::endl << indent << "(compound";
2257  std::list<LogicValueSharedPtr>::iterator it = outLogicValues.begin();
2258  for(; it != outLogicValues.end(); it++) {
2259  mOut << " " << (*it)->getName();
2260  }
2261  mOut << ")";
2262  } else {
2263  }
2264  }
2265  {
2266  std::list<LogicValueSharedPtr> outLogicValues;
2267  inAttrib->getDominatedLogicValues(outLogicValues);
2268  if(!outLogicValues.empty()) {
2269  mOut << std::endl << indent << "(dominates";
2270  std::list<LogicValueSharedPtr>::iterator it = outLogicValues.begin();
2271  for(; it != outLogicValues.end(); it++) {
2272  mOut << " " << (*it)->getName();
2273  }
2274  mOut << ")";
2275  } else {
2276  }
2277  }
2278  {
2279  std::list<LogicValueSharedPtr> outLogicValues;
2280  inAttrib->getResolvedLogicValues(outLogicValues);
2281  if(!outLogicValues.empty()) {
2282  mOut << std::endl << indent << "(resolves";
2283  std::list<LogicValueSharedPtr>::iterator it = outLogicValues.begin();
2284  for(; it != outLogicValues.end(); it++) {
2285  mOut << " " << (*it)->getName();
2286  }
2287  mOut << ")";
2288  } else {
2289  }
2290  }
2291  {
2292  bool isolated = inAttrib->getIsIsolated();
2293  if(isolated) {
2294  mOut << std::endl << indent << "(isolated)";
2295  }
2296  }
2297  {
2298  typedef LogicValueAttributes::LogicMap LogicMap;
2299  std::list<LogicMap*> outLogicMaps;
2300  inAttrib->getLogicMaps(outLogicMaps);
2301  if(!outLogicMaps.empty()) {
2302  std::list<LogicMap*>::iterator it = outLogicMaps.begin();
2303 
2304  for(; it != outLogicMaps.end(); it++) {
2305  if((*it)->mLogicMapType == LogicMap::eLogicMapTypeInput) {
2306  mOut << std::endl << indent << "(logicMapInput ";
2307  } else {
2308  mOut << std::endl << indent << "(logicMapOutput ";
2309  }
2310  mOut << "(logicRef " << (*it)->mLogicRef;
2311  mOut << " (libraryRef " << (*it)->mLibraryRef << ")";
2312  mOut << "))";
2313  }
2314  } else {
2315  }
2316  }
2317  } catch(Error& e) {
2318  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
2319  throw;
2320  }
2321 }
boost::shared_ptr< LogicValue > LogicValueSharedPtr
This structure is for logicRef and libraryRef used in logicMapInput/logicMapOutput.
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void printValue(const Value &value)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::printNetAttributes ( const NetAttributesSharedPtr inAttrib)
throw (Error
)

Definition at line 2131 of file Decompiler.cpp.

2131  {
2132  if(!inAttrib)
2133  return;
2134 
2135  Indenter indent(*this);
2136  try {
2137  (*this).setIndentation((*this).getIndentation() - 2);
2138  if(inAttrib->getIsCriticalitySet()) {
2139  int32_t criticality = inAttrib->getCriticality();
2140  mOut << std::endl << indent << "(criticality " << criticality << ")";
2141  }
2142  if(inAttrib->getIsNetDelaySet()) {
2143  NetDelay netDelay = inAttrib->getNetDelay();
2144  mOut << std::endl << indent << "(netDelay " << std::endl;
2145  mOut << indent;
2146  printDerivation(netDelay.getDerivation());
2147 
2148  mOut << indent << " (delay ";
2149  Value::MiNoMax mnm = netDelay.getDelay();
2150  Value val(Value::eValueTypeMiNoMax, mnm);
2151  printValue(val);
2152  mOut << ")";
2153 
2154  //Print transition/becomes
2155  if(NULL != netDelay.getTransition()) {
2156  netDelay.getTransition()->accept(*this);
2157  }
2158  mOut << std::endl << indent << ")";
2159  }
2160  (*this).setIndentation((*this).getIndentation() + 2);
2161  } catch(Error& e) {
2162  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
2163  throw;
2164  }
2165 }
void printDerivation(const Derivation derivation)
const LogicElementSharedPtr getTransition() const
Definition: NetDelay.hpp:113
Represents the netDelay attribute of Net.
Definition: NetDelay.hpp:32
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
const Value::MiNoMax getDelay() const
Definition: NetDelay.hpp:104
void printValue(const Value &value)
const Derivation getDerivation() const
Definition: NetDelay.hpp:95
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::printPortAttributes ( const PortAttributesSharedPtr inAttrib)
throw (Error
)

Definition at line 2030 of file Decompiler.cpp.

2030  {
2031  if(!inAttrib)
2032  return;
2033 
2034  Indenter indent(*this);
2035  try {
2036  {
2037  Value unused = inAttrib->getUnused();
2038  if(unused.getIsSet()) {
2039  mOut << std::endl << indent << "(unused)";
2040  }
2041  }
2042  {
2043  Value designator = inAttrib->getDesignator();
2044  if(designator.getIsSet()) {
2045  mOut << std::endl << indent << "(designator " << "\""
2046  << designator.get<Value::String>() << "\"" << ")";
2047  }
2048  }
2049  {
2050  Value val = inAttrib->getDcFaninLoad();
2051  if(val.getIsSet()) {
2052  mOut << std::endl << indent << "(dcFaninLoad ";
2053  printValue(val);
2054  mOut << ")";
2055  }
2056  }
2057  {
2058  Value val = inAttrib->getDcFanoutLoad();
2059  if(val.getIsSet()) {
2060  mOut << std::endl << indent << "(dcFanoutLoad ";
2061  printValue(val);
2062  mOut << ")";
2063  }
2064  }
2065  {
2066  Value val = inAttrib->getDcMaxFanin();
2067  if(val.getIsSet()) {
2068  mOut << std::endl << indent << "(dcMaxFanin ";
2069  printValue(val);
2070  mOut << ")";
2071  }
2072  }
2073  {
2074  Value val = inAttrib->getDcMaxFanout();
2075  if(val.getIsSet()) {
2076  mOut << std::endl << indent << "(dcMaxFanout ";
2077  printValue(val);
2078  mOut << ")";
2079  }
2080  }
2081  {
2082  Value val = inAttrib->getAcLoad();
2083  if(val.getIsSet()) {
2084  mOut << std::endl << indent << "(acLoad ";
2085  printValue(val);
2086  mOut << ")";
2087  }
2088  }
2089  if(inAttrib->getIsPortDelaySet()) {
2090  PortDelay delay = inAttrib->getPortDelay();
2091  mOut << std::endl << indent << "(portDelay " << std::endl;
2092  mOut << indent;
2093  printDerivation(delay.getDerivation());
2094  switch(delay.getType()) {
2095  case PortDelay::eTypeDelay: {
2096  mOut << indent << " (delay ";
2097  Value::MiNoMax mnm = delay.getDelay();
2098  Value val(Value::eValueTypeMiNoMax, mnm);
2099  printValue(val);
2100  mOut << ")";
2101  break;
2102  }
2104  mOut << indent << " (loadDelay ";
2105  {
2106  Value::MiNoMax mnm = delay.getDelay();
2107  Value val(Value::eValueTypeMiNoMax, mnm);
2108  printValue(val);
2109  }
2110  {
2111  Value::MiNoMax mnm = delay.getAcLoad();
2112  Value val(Value::eValueTypeMiNoMax, mnm);
2113  printValue(val);
2114  }
2115  mOut << ")";
2116  break;
2117  }
2118  }
2119  //Print transition/becomes
2120  if(NULL != delay.getTransition()) {
2121  delay.getTransition()->accept(*this);
2122  }
2123  mOut << ")";
2124  }
2125  } catch(Error& e) {
2126  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
2127  throw;
2128  }
2129 }
const bool getIsSet() const
Definition: Value.hpp:357
const Value::MiNoMax getDelay() const
Definition: PortDelay.hpp:148
void printDerivation(const Derivation derivation)
Represents the portDelay attribute on Port or PortReference.
Definition: PortDelay.hpp:36
std::string String
Definition: Value.hpp:61
const Value::MiNoMax getAcLoad() const
Definition: PortDelay.hpp:152
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
const Derivation getDerivation() const
Definition: PortDelay.hpp:140
const LogicElementSharedPtr getTransition() const
Definition: PortDelay.hpp:161
void printValue(const Value &value)
const PortDelay::Type getType() const
Definition: PortDelay.hpp:144
_ValueType get() const
Definition: Value.hpp:386
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::printUnit ( const Unit  unit)
throw (Error
)

Definition at line 1915 of file Decompiler.cpp.

1915  {
1916  switch(unit) {
1917  case eUnitAngle: {
1918  mOut << " (unit ANGLE )";
1919  break;
1920  }
1921  case eUnitCapacitance: {
1922  mOut << " (unit CAPACITANCE )";
1923  break;
1924  }
1925  case eUnitConductance: {
1926  mOut << " (unit CONDUCTANCE )";
1927  break;
1928  }
1929  case eUnitCharge: {
1930  mOut << " (unit CHARGE )";
1931  break;
1932  }
1933  case eUnitCurrent: {
1934  mOut << " (unit CURRENT )";
1935  break;
1936  }
1937  case eUnitDistance: {
1938  mOut << " (unit DISTANCE )";
1939  break;
1940  }
1941  case eUnitEnergy: {
1942  mOut << " (unit ENERGY )";
1943  break;
1944  }
1945  case eUnitFlux: {
1946  mOut << " (unit FLUX )";
1947  break;
1948  }
1949  case eUnitFrequency: {
1950  mOut << " (unit FREQUENCY )";
1951  break;
1952  }
1953  case eUnitInductance: {
1954  mOut << " (unit INDUCTANCE )";
1955  break;
1956  }
1957  case eUnitMass: {
1958  mOut << " (unit MASS )";
1959  break;
1960  }
1961  case eUnitPower: {
1962  mOut << " (unit POWER )";
1963  break;
1964  }
1965  case eUnitResistance: {
1966  mOut << " (unit RESISTANCE )";
1967  break;
1968  }
1969  case eUnitTemperature: {
1970  mOut << " (unit TEMPERATURE )";
1971  break;
1972  }
1973  case eUnitTime: {
1974  mOut << " (unit TIME )";
1975  break;
1976  }
1977  case eUnitVoltage: {
1978  mOut << " (unit VOLTAGE )";
1979  break;
1980  }
1981  default: {
1982  }
1983  }
1984 }
void torc::generic::Decompiler::printUserData ( std::list< std::string >  inElements)
throw (Error
)

Definition at line 1797 of file Decompiler.cpp.

1797  {
1798  try {
1799  Indenter indent(*this);
1800  if(!inElements.empty()) {
1801  for(std::list<std::string>::iterator it = inElements.begin(); it != inElements.end();
1802  ++it) {
1803  mOut << std::endl << indent << "(userData " << trimLeadingSpaces(*it);
1804  }
1805  }
1806  } catch(Error& e) {
1807  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1808  throw;
1809  }
1810 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::printValue ( const Value value)
throw (Error
)

Definition at line 1859 of file Decompiler.cpp.

1859  {
1860  if(!value.getIsSet()) {
1861  return;
1862  }
1863  switch(value.getType()) {
1864  case Value::eValueTypeBoolean: {
1865  mOut << ((value.get<Value::Boolean>()) ? "(true)" : "(false)");
1866  break;
1867  }
1868  case Value::eValueTypeInteger: {
1869  mOut << value.get<Value::Integer>();
1870  break;
1871  }
1872  case Value::eValueTypeMiNoMax: {
1873  Value::MiNoMax mnm = value.get<Value::MiNoMax>();
1874  mOut << "(mnm ";
1875  if(!mnm.getMinUndefined()) {
1876  Value val(Value::eValueTypeNumber, mnm.getMin());
1877  printValue(val);
1878  mOut << " ";
1879  } else {
1880  mOut << "(undefined) ";
1881  }
1882 
1884  printValue(val);
1885  mOut << " ";
1886 
1887  if(!mnm.getMinUndefined()) {
1888  Value val(Value::eValueTypeNumber, mnm.getMax());
1889  printValue(val);
1890  } else {
1891  mOut << "(undefined)";
1892  }
1893  mOut << ")";
1894  break;
1895  }
1896  case Value::eValueTypeNumber: {
1897  Value::Number num = value.get<Value::Number>();
1898  mOut << "(e " << num.getMantissa() << " " << num.getExponent() << ")";
1899  break;
1900  }
1901  case Value::eValueTypePoint: {
1902  Value::Point pt = value.get<Value::Point>();
1903  mOut << "(pt " << pt.getX() << " " << pt.getY() << ")";
1904  break;
1905  }
1906  case Value::eValueTypeString: {
1907  mOut << "\"" << value.get<Value::String>() << "\"";
1908  break;
1909  }
1910  default: {
1911  }
1912  }
1913 }
const bool getIsSet() const
Definition: Value.hpp:357
const Value::Number getNominal() const
Definition: Value.hpp:323
const bool getMinUndefined() const
Definition: Value.hpp:311
std::string String
Definition: Value.hpp:61
const int32_t getY() const
Definition: Value.hpp:339
const Value::Number getMax() const
Definition: Value.hpp:307
const int32_t getX() const
Definition: Value.hpp:335
const Type getType() const
Definition: Value.hpp:348
const Value::Number getMin() const
Definition: Value.hpp:319
const int32_t getExponent() const
Definition: Value.hpp:331
void printValue(const Value &value)
const int32_t getMantissa() const
Definition: Value.hpp:327
_ValueType get() const
Definition: Value.hpp:386

+ Here is the call graph for this function:

void torc::generic::Decompiler::printValueType ( const Value value)
throw (Error
)

Definition at line 1828 of file Decompiler.cpp.

1828  {
1829  switch(value.getType()) {
1830  case Value::eValueTypeBoolean: {
1831  mOut << " (boolean ";
1832  break;
1833  }
1834  case Value::eValueTypeInteger: {
1835  mOut << " (integer ";
1836  break;
1837  }
1838  case Value::eValueTypeMiNoMax: {
1839  mOut << " (minomax ";
1840  break;
1841  }
1842  case Value::eValueTypeNumber: {
1843  mOut << " (number ";
1844  break;
1845  }
1846  case Value::eValueTypePoint: {
1847  mOut << " (point ";
1848  break;
1849  }
1850  case Value::eValueTypeString: {
1851  mOut << " (string ";
1852  break;
1853  }
1854  default: {
1855  }
1856  }
1857 }
const Type getType() const
Definition: Value.hpp:348
void torc::generic::Decompiler::printViewInterfaceAttributes ( const InterfaceAttributesSharedPtr inAttrib)
throw (Error
)

Definition at line 2167 of file Decompiler.cpp.

2168  {
2169  if(!inAttrib)
2170  return;
2171 
2172  Indenter indent(*this);
2173  try {
2174  if(!inAttrib->getDesignator().empty()) {
2175  mOut << std::endl << indent << " (designator " << "\"" << inAttrib->getDesignator()
2176  << "\"" << ")";
2177  }
2178 
2179  if(NULL != inAttrib->getSimulate()) {
2180  (*this).setIndentation((*this).getIndentation() - 4);
2181  inAttrib->getSimulate()->accept(*this);
2182  (*this).setIndentation((*this).getIndentation() + 4);
2183  }
2184 
2185  if(NULL != inAttrib->getTiming()) {
2186  (*this).setIndentation((*this).getIndentation() - 4);
2187  inAttrib->getTiming()->accept(*this);
2188  (*this).setIndentation((*this).getIndentation() + 4);
2189  }
2190 
2191  //Print Comments
2192  std::vector < std::string > comments = inAttrib->getComments();
2193  printComments(comments);
2194 
2195  std::list < std::string > userDatas;
2196  inAttrib->getUserData(userDatas);
2197  printUserData(userDatas);
2198  } catch(Error& e) {
2199  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
2200  throw;
2201  }
2202 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::setIndentation ( size_t  inIndentation)

Definition at line 2345 of file Decompiler.cpp.

2345  {
2346  mIndentation = inIndentation;
2347 }
void torc::generic::Decompiler::visit ( Root inroot)
throw (Error
)

Definition at line 178 of file Decompiler.cpp.

178  {
179  try {
180  CircularDependencyResolver resolver;
181  resolver.resolve(root.getSharedThis());
182  if(!root.getOriginalName().empty()) {
183  mOut << "(edif (rename " << root.getName() << " " << "\"" << root.getOriginalName()
184  << "\"" << ")" << std::endl;
185  } else {
186  mOut << "(edif " << root.getName() << std::endl;
187  }
188  mOut << " (edifVersion " << (int32_t) root.getVersion().mFirst << " "
189  << (int32_t) root.getVersion().mSecond << " " << (int32_t) root.getVersion().mThird
190  << ")" << std::endl;
191  mOut << " (edifLevel " << root.getLevel() << ")" << std::endl;
192  mOut << " (keywordMap (keywordLevel 0" << "))";
193 
194  //Print Comments
195  std::vector < std::string > comments = root.getComments();
196  printComments(comments);
197 
198  root.applyOnAllStatuses(mApplier);
199 
200  mIsExternContext = true;
201  std::for_each(resolver.mExterns.begin(), resolver.mExterns.end(), mApplier);
202  mIsExternContext = false;
203 
204  std::for_each(resolver.mConcreteLibs.begin(), resolver.mConcreteLibs.end(), mApplier);
205  root.applyOnAllDesigns(mApplier);
206 
207  std::list < std::string > elements;
208  root.getUserData(elements);
209  printUserData(elements);
210 
211  mOut << std::endl << ")" << std::endl;
212  } catch(Error& e) {
213  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
214  throw;
215  }
216 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( Design inDesign)
throw (Error
)

Definition at line 219 of file Decompiler.cpp.

219  {
220  try {
221  Indenter indent(*this);
222  if(!design.getOriginalName().empty()) {
223  mOut << std::endl << indent << "(design " << "(rename " << design.getName() << " "
224  << "\"" << design.getOriginalName() << "\"" << ")";
225  } else {
226  mOut << std::endl << indent << "(design " << design.getName();
227  }
228  mOut << std::endl << indent << " (cellRef " << design.getCellRefName() << " (libraryRef "
229  << design.getLibraryRefName() << "))";
230 
231  //Print Comments
232  std::vector < std::string > comments = design.getComments();
233  printComments(comments);
234 
235  design.applyOnAllStatuses(mApplier);
236  design.applyOnAllProperties(mApplier);
237 
238  std::list < std::string > elements;
239  design.getUserData(elements);
240  printUserData(elements);
241 
242  mOut << std::endl << indent << ")";
243  } catch(Error& e) {
244  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
245  throw;
246  }
247 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( Library inlibrary)
throw (Error
)

Definition at line 250 of file Decompiler.cpp.

250  {
251  try {
252  Indenter indent(*this);
253  if(mIsExternContext || library.getIsExtern()) {
254  if(!library.getOriginalName().empty()) {
255  mOut << std::endl << indent << "(external ";
256  mOut << std::endl << indent << " (rename " << library.getName() << " " << "\""
257  << library.getOriginalName() << "\"" << ")";
258  } else {
259  mOut << std::endl << indent << "(external " << library.getName();
260  }
261  } else {
262  if(!library.getOriginalName().empty()) {
263  mOut << std::endl << indent << "(library ";
264  mOut << std::endl << indent << " (rename " << library.getName() << " " << "\""
265  << library.getOriginalName() << "\"" << ")";
266  } else {
267  mOut << std::endl << indent << "(library " << library.getName();
268  }
269  }
270  mOut << std::endl << indent << " (ediflevel " << library.getLevel() << ")"
271  << " (technology (numberDefinition";
272 
273  std::map<Unit, ScaleFactor> outScaleFactors;
274  outScaleFactors = library.getScaleFactors();
275  std::map<Unit, ScaleFactor>::iterator it = outScaleFactors.begin();
276  for(; it != outScaleFactors.end(); ++it) {
277  Unit unit = (*it).first;
278  ScaleFactor scale = (*it).second;
279  mOut << std::endl << indent << " (scale ";
282  printUnit(unit);
283  mOut << ")";
284  }
285  mOut << ")";
286 
287  SimulationInfoSharedPtr simuInfo = library.getSimulationInfo();
288  if(simuInfo) {
289  simuInfo->accept(*this);
290  }
291  mOut << ")";
292 
293  //Print Comments
294  std::vector < std::string > comments = library.getComments();
295  printComments(comments);
296 
297  library.applyOnAllStatuses(mApplier);
298 
299  std::list < std::string > elements;
300  library.getUserData(elements);
301  printUserData(elements);
302 
303  library.applyOnAllCells(mApplier);
304  mOut << std::endl << indent << ")";
305  } catch(Error& e) {
306  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
307  throw;
308  }
309 }
const Value::Number getSiValue() const
Definition: ScaleFactor.hpp:94
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
const Value::Number getEdifValue() const
Definition: ScaleFactor.hpp:85
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void printUnit(const Unit unit)
boost::shared_ptr< SimulationInfo > SimulationInfoSharedPtr
void printValue(const Value &value)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( Cell incell)
throw (Error
)

Definition at line 312 of file Decompiler.cpp.

312  {
313  try {
314  Indenter indent(*this);
315  std::string cellType;
316  switch(cell.getType()) {
317  case Cell::eTypeTie: {
318  cellType = "TIE";
319  break;
320  }
321  case Cell::eTypeRipper: {
322  cellType = "RIPPER";
323  break;
324  }
325  case Cell::eTypeGeneric: {
326  cellType = "GENERIC";
327  break;
328  }
329  default: {
330  }
331  }
332  if(!cell.getOriginalName().empty()) {
333  mOut << std::endl << indent << "(cell ";
334  mOut << std::endl << indent << " (rename " << cell.getName() << " " << "\""
335  << cell.getOriginalName() << "\"" << ")";
336  } else {
337  mOut << std::endl << indent << "(cell " << cell.getName();
338  }
339  mOut << std::endl << indent << " (cellType " << cellType << ")";
340 
341  //Print Comments
342  std::vector < std::string > comments = cell.getComments();
343  printComments(comments);
344 
345  cell.applyOnAllStatuses(mApplier);
346 
347  std::list < std::string > elements;
348  cell.getUserData(elements);
349  printUserData(elements);
350 
351  cell.applyOnAllViews(mApplier);
352  cell.applyOnAllProperties(mApplier);
353  mOut << std::endl << indent << ")";
354  } catch(Error& e) {
355  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
356  throw;
357  }
358 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
std::string string
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( View inview)
throw (Error
)

Definition at line 361 of file Decompiler.cpp.

361  {
362  try {
363  Indenter indent(*this);
364  std::string viewType;
365  switch(view.getType()) {
366  case View::eTypeMaskLayout: {
367  viewType = "MASKLAYOUT";
368  break;
369  }
370  case View::eTypePCBLayout: {
371  viewType = "PCBLAYOUT";
372  break;
373  }
374  case View::eTypeNetlist: {
375  viewType = "NETLIST";
376  break;
377  }
378  case View::eTypeSchematic: {
379  viewType = "SCHEMATIC";
380  break;
381  }
382  case View::eTypeSymbolic: {
383  viewType = "SYMBOLIC";
384  break;
385  }
386  case View::eTypeBehavior: {
387  viewType = "BEHAVIOR";
388  break;
389  }
390  case View::eTypeLogicModel: {
391  viewType = "LOGICMODEL";
392  break;
393  }
394  case View::eTypeDocument: {
395  viewType = "DOCUMENT";
396  break;
397  }
398  case View::eTypeGraphic: {
399  viewType = "GRAPHIC";
400  break;
401  }
402  case View::eTypeStranger: {
403  viewType = "STRANGER";
404  break;
405  }
406  }
407  if(!view.getOriginalName().empty()) {
408  mOut << std::endl << indent << "(view ";
409  mOut << std::endl << indent << " (rename " << view.getName() << " " << "\""
410  << view.getOriginalName() << "\"" << ")";
411  } else {
412  mOut << std::endl << indent << "(view " << view.getName();
413  }
414  mOut << std::endl << indent << " (viewType " << viewType << ")";
415 
416  if(View::eTypeNetlist != view.getType()) {
417  mOut << view.getNonNetlistViewData();
418  return;
419  }
420 
421  mOut << std::endl << indent << " (interface ";
422  mIsJoiningContext = false;
423  view.applyOnAllPorts(mApplier);
424  printViewInterfaceAttributes(view.getInterfaceAttributes());
425  typedef std::map<std::string, ParameterSharedPtr> Params;
426  ParameterMapSharedPtr params = view.getParameters();
427  ParameterContext context = view.getParameterContext();
428  Params paramMap;
429  params->getAllParameters(context, paramMap);
430  for(Params::iterator it = paramMap.begin(); it != paramMap.end(); it++) {
431  (*it).second->accept(*this);
432  }
433  mIsJoiningContext = true;
434  view.applyOnAllPermutables(mApplier);
435  view.applyOnAllInterfaceJoinedInfos(mApplier);
436  mOut << std::endl << indent << " )";
437  view.applyOnAllProperties(mApplier);
438 
439  //Print Comments
440  std::vector < std::string > comments = view.getComments();
441  printComments(comments);
442 
443  view.applyOnAllStatuses(mApplier);
444 
445  std::list < std::string > elements;
446  view.getUserData(elements);
447  printUserData(elements);
448 
449  if(!mIsExternContext) {
450 
451  std::vector<InstanceSharedPtr> instVec;
452  view.getInstances(instVec);
453 
454  std::vector<NetSharedPtr> netVec;
455  view.getNets(netVec);
456 
457  if(!instVec.empty() || !netVec.empty()) {
458  mOut << std::endl << indent << " (contents ";
459  //Print all instances of the current view
460  mIsJoiningContext = false;
461  view.applyOnAllInstances(mApplier);
462 
463  if(NULL != view.getSimulate()) {
464  view.getSimulate()->accept(*this);
465  }
466 
467  //Print all net info
468  mIsJoiningContext = true;
469  view.applyOnAllNets(mApplier);
470 
471  if(NULL != view.getTiming()) {
472  view.getTiming()->accept(*this);
473  }
474 
475  mOut << std::endl << indent << " )";
476  }
477  }
478  mOut << std::endl << indent << ")";
479  } catch(Error& e) {
480  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
481  throw;
482  }
483 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
void printViewInterfaceAttributes(const InterfaceAttributesSharedPtr &inAttrib)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
std::string string
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< ParameterMap > ParameterMapSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( ScalarPort inscalarPort)
throw (Error
)

Definition at line 486 of file Decompiler.cpp.

486  {
487  try {
488  Indenter indent(*this);
489  if(!mIsJoiningContext) {
490  if(!port.getOriginalName().empty()) {
491  mOut << std::endl << indent << "(port ";
492  mOut << std::endl << indent << " (rename " << port.getName() << " " << "\""
493  << port.getOriginalName() << "\"" << ")";
494  } else {
495  mOut << std::endl << indent << "(port " << port.getName();
496  }
497  switch(port.getDirection()) {
498  case ePortDirectionIn: {
499  mOut << std::endl << indent << " (direction INPUT)";
500  break;
501  }
502  case ePortDirectionOut: {
503  mOut << std::endl << indent << " (direction OUTPUT)";
504  break;
505  }
506  case ePortDirectionInOut: {
507  mOut << std::endl << indent << " (direction INOUT)";
508  break;
509  }
510  default: {
511  }
512  }
513  printPortAttributes(port.getAttributes());
514 
515  //Print Comments
516  std::vector < std::string > comments = port.getComments();
517  printComments(comments);
518 
519  std::list < std::string > elements;
520  port.getUserData(elements);
521  printUserData(elements);
522 
523  port.applyOnAllProperties(mApplier);
524  mOut << std::endl << indent << ")";
525  } else {
526  mOut << std::endl << indent << "(portRef " << port.getName();
527  PortSharedPtr parentCol = port.getParentCollection();
528  if(parentCol) {
529  parentCol->accept(*this);
530  }
531  mOut << ")";
532  }
533  } catch(Error& e) {
534  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
535  throw;
536  }
537 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< Port > PortSharedPtr
void printPortAttributes(const PortAttributesSharedPtr &inAttrib)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( VectorPort invectorPort)
throw (Error
)

Definition at line 563 of file Decompiler.cpp.

563  {
564  try {
565  Indenter indent(*this);
566  if(mIsJoiningContext) {
567  mOut << std::endl << indent << "(portRef " << port.getName();
568  PortSharedPtr parentCol = port.getParentCollection();
569  if(parentCol) {
570  parentCol->accept(*this);
571  }
572  mOut << ")";
573  } else {
574  if(!port.getOriginalName().empty()) {
575  mOut << std::endl << indent << "(port ";
576  mOut << std::endl << indent << " (array (rename " << port.getName() << " " << "\""
577  << port.getOriginalName() << "\"" << ")" << " ";
578  } else {
579  mOut << std::endl << indent << "(port (array " << port.getName() << " ";
580  }
581  std::vector < size_t > limits;
582  port.getLimits(limits);
583  copy(limits.begin(), limits.end(), std::ostream_iterator < size_t > (mOut, " "));
584  mOut << ")";
585  switch(port.getDirection()) {
586  case ePortDirectionIn: {
587  mOut << std::endl << indent << " (direction INPUT)";
588  break;
589  }
590  case ePortDirectionOut: {
591  mOut << std::endl << indent << " (direction OUTPUT)";
592  break;
593  }
594  case ePortDirectionInOut: {
595  mOut << std::endl << indent << " (direction INOUT)";
596  break;
597  }
598  default: {
599  }
600 
601  }
602  printPortAttributes(port.getAttributes());
603 
604  //Print Comments
605  std::vector < std::string > comments = port.getComments();
606  printComments(comments);
607 
608  std::list < std::string > elements;
609  port.getUserData(elements);
610  printUserData(elements);
611 
612  port.applyOnAllProperties(mApplier);
613  mOut << std::endl << indent << ")";
614  }
615  } catch(Error& e) {
616  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
617  throw;
618  }
619 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< Port > PortSharedPtr
void printPortAttributes(const PortAttributesSharedPtr &inAttrib)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( VectorPortBit inportBit)
throw (Error
)

Definition at line 645 of file Decompiler.cpp.

645  {
646  try {
647  Indenter indent(*this);
648  if(mIsJoiningContext) {
649  PortSharedPtr parent = bit.getParentCollection();
650  mOut << std::endl << indent << "(portRef (member " << parent->getName() << " ";
651  copy(bit.getIndices().begin(), bit.getIndices().end(),
652  std::ostream_iterator < size_t > (mOut, " "));
653  mOut << ")";
654  PortSharedPtr parentCol = parent->getParentCollection();
655  if(parentCol) {
656  parentCol->accept(*this);
657  }
658  mOut << ")";
659  bit.applyOnAllProperties(mApplier);
660  } else {
661  }
662  } catch(Error& e) {
663  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
664  throw;
665  }
666 }
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< Port > PortSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( PortBundle inportBundle)
throw (Error
)

Definition at line 696 of file Decompiler.cpp.

696  {
697  try {
698  Indenter indent(*this);
699  if(mIsJoiningContext) {
701  mOut << std::endl << indent << "(portRef " << port.getName();
702  } else {
703  mOut << " (portRef " << port.getName();
704  }
705  PortSharedPtr parentCol = port.getParentCollection();
706  if(parentCol) {
707  parentCol->accept(*this);
708  }
709  mOut << ")";
710  } else {
711  if(!port.getOriginalName().empty()) {
712  mOut << std::endl << indent << "(portBundle ";
713  mOut << std::endl << indent << " (rename " << port.getName() << " " << "\""
714  << port.getOriginalName() << "\"" << ")";
715  } else {
716  mOut << std::endl << indent << "(portBundle " << port.getName();
717  }
718  {
719  Indenter subIndent(*this);
720  mOut << std::endl << subIndent << "(listOfPorts ";
721  port.applyOnAllChildren(mApplier);
722  mOut << std::endl << subIndent << ")";
723  }
724 
725  //Print Comments
726  std::vector < std::string > comments = port.getComments();
727  printComments(comments);
728 
729  std::list < std::string > elements;
730  port.getUserData(elements);
731  printUserData(elements);
732 
733  mOut << std::endl << indent << ")";
734  }
735  port.applyOnAllProperties(mApplier);
736  } catch(Error& e) {
737  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
738  throw;
739  }
740 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< Port > PortSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( ScalarNet inscalarNet)
throw (Error
)

Definition at line 828 of file Decompiler.cpp.

828  {
829  try {
830  Indenter indent(*this);
831  if(mIsJoiningContext) {
832  if(!net.getOriginalName().empty()) {
833  mOut << std::endl << indent << "(net ";
834  mOut << std::endl << indent << " (rename " << net.getName() << " " << "\""
835  << net.getOriginalName() << "\"" << ")";
836  } else {
837  mOut << std::endl << indent << "(net " << net.getName();
838  }
839 
840  mOut << std::endl << indent << " (joined ";
841  mIsJoiningContext = true;
842  net.applyOnAllConnectedPorts(mApplier);
843  net.applyOnAllConnectedPortRefs(mApplier);
844  net.applyOnAllConnectedPortLists(mApplier);
845  mOut << std::endl << indent << " )";
846 
847  printNetAttributes(net.getAttributes());
848 
849  //Print Comments
850  std::vector < std::string > comments = net.getComments();
851  printComments(comments);
852 
853  std::list < std::string > elements;
854  net.getUserData(elements);
855  printUserData(elements);
856 
857  net.applyOnAllSubnets(mApplier);
858  net.applyOnAllProperties(mApplier);
859  mOut << std::endl << indent << ")";
860  } else {
861  mOut << std::endl << indent << "(netRef " << net.getName();
862  NetSharedPtr parentCol = net.getParentCollection();
863  if(parentCol) {
864  parentCol->accept(*this);
865  }
866  mOut << ")";
867  }
868  } catch(Error& e) {
869  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
870  throw;
871  }
872 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< Net > NetSharedPtr
void printNetAttributes(const NetAttributesSharedPtr &inAttrib)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( VectorNet invectorNet)
throw (Error
)

Definition at line 920 of file Decompiler.cpp.

920  {
921  try {
922  Indenter indent(*this);
923  if(mIsJoiningContext) {
924  if(!net.getOriginalName().empty()) {
925  mOut << std::endl << indent << "(net ";
926  mOut << std::endl << indent << " (array (rename " << net.getName() << " " << "\""
927  << net.getOriginalName() << "\"" << ")" << " ";
928  } else {
929  mOut << std::endl << indent << "(net (array " << net.getName() << " ";
930  }
931  std::vector < size_t > limits;
932  net.getLimits(limits);
933  copy(limits.begin(), limits.end(), std::ostream_iterator < size_t > (mOut, " "));
934  mOut << ")";
935 
936  mOut << std::endl << indent << " (joined";
937  mIsJoiningContext = true;
938  net.applyOnAllConnectedPorts(mApplier);
939  net.applyOnAllConnectedPortRefs(mApplier);
940  net.applyOnAllConnectedPortLists(mApplier);
941  mOut << std::endl << indent << " )";
942 
943  printNetAttributes(net.getAttributes());
944 
945  //Print Comments
946  std::vector < std::string > comments = net.getComments();
947  printComments(comments);
948 
949  std::list < std::string > elements;
950  net.getUserData(elements);
951  printUserData(elements);
952 
953  net.applyOnAllSubnets(mApplier);
954  net.applyOnAllProperties(mApplier);
955  mOut << std::endl << indent << ")";
956  } else {
957  mOut << std::endl << indent << "(netRef " << net.getName();
958  NetSharedPtr parentCol = net.getParentCollection();
959  if(parentCol) {
960  parentCol->accept(*this);
961  }
962  mOut << ")";
963  }
964 
965  } catch(Error& e) {
966  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
967  throw;
968  }
969 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< Net > NetSharedPtr
void printNetAttributes(const NetAttributesSharedPtr &inAttrib)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( VectorNetBit innetBit)
throw (Error
)

Definition at line 972 of file Decompiler.cpp.

972  {
973  try {
974  //mIsJoiningContext = true;
975 #if 0
976  mOut << " VectorNetBit name : " << net.getName() << std::endl;
977  mOut << " Size : " << net.getSize() << std::endl;
978  net.applyOnAllSubnets(mApplier);
979  net.applyOnAllConnectedPorts(mApplier);
980  net.applyOnAllConnectedPortRefs(mApplier);
981  net.applyOnAllProperties(mApplier);
982 #endif
983  //TBD
984  //mIsJoiningContext = false;
985  } catch(Error& e) {
986  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
987  throw;
988  }
989 }
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( NetBundle innetBundle)
throw (Error
)

Definition at line 875 of file Decompiler.cpp.

875  {
876  try {
877  Indenter indent(*this);
878  if(mIsJoiningContext) {
879  if(!net.getOriginalName().empty()) {
880  mOut << std::endl << indent << "(netbundle ";
881  mOut << std::endl << indent << " (rename " << net.getName() << " " << "\""
882  << net.getOriginalName() << "\"" << ")";
883  } else {
884  mOut << std::endl << indent << "(netbundle " << net.getName();
885  }
886  mOut << std::endl << indent << " (listOfNets ";
887  net.applyOnAllSubnets(mApplier);
888  net.applyOnAllChildren(mApplier);
889  net.applyOnAllConnectedPorts(mApplier);
890  net.applyOnAllConnectedPortRefs(mApplier);
891  net.applyOnAllConnectedPortLists(mApplier);
892 
893  mOut << std::endl << indent << " )";
894 
895  //Print Comments
896  std::vector < std::string > comments = net.getComments();
897  printComments(comments);
898 
899  std::list < std::string > elements;
900  net.getUserData(elements);
901  printUserData(elements);
902 
903  net.applyOnAllProperties(mApplier);
904  mOut << std::endl << indent << ")";
905  } else {
906  mOut << std::endl << indent << "(netRef " << net.getName();
907  NetSharedPtr parentCol = net.getParentCollection();
908  if(parentCol) {
909  parentCol->accept(*this);
910  }
911  mOut << ")";
912  }
913  } catch(Error& e) {
914  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
915  throw;
916  }
917 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< Net > NetSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( SingleInstance insingleInstance)
throw (Error
)

Definition at line 761 of file Decompiler.cpp.

761  {
762  try {
763 
764  if(mIsJoiningContext) {
765  mOut << " (instanceRef " << instance.getName() << ")";
766  } else {
767  Indenter indent(*this);
768  if(!instance.getOriginalName().empty()) {
769  mOut << std::endl << indent << "(instance ";
770  mOut << std::endl << indent << " (rename " << instance.getName() << " " << "\""
771  << instance.getOriginalName() << "\"" << ")";
772  } else {
773  mOut << std::endl << indent << "(instance " << instance.getName();
774  }
775  mOut << std::endl << indent << " (viewRef " << instance.getMaster()->getName()
776  << " (cellRef " << instance.getMaster()->getParent()->getName() << " (libraryRef "
777  << instance.getMaster()->getParent()->getParent()->getName() << ")))";
778 
779  if(!instance.getDesignator().empty()) {
780  mOut << std::endl << indent << " (designator " << "\"" << instance.getDesignator()
781  << "\"" << ")";
782  }
783 
784  if(NULL != instance.getTiming()) {
785  instance.getTiming()->accept(*this);
786  }
787 
788  //Print Comments
789  std::vector < std::string > comments = instance.getComments();
790  printComments(comments);
791 
792  std::list < std::string > elements;
793  instance.getUserData(elements);
794  printUserData(elements);
795 
796  mParamAssignContext = true;
797  typedef std::map<std::string, ParameterSharedPtr> Params;
798  ParameterMapSharedPtr params = instance.getParameters();
799  ParameterContext context = instance.getParameterContext();
800  params->applyOnOverriddenParameters(context, mApplier);
801  mParamAssignContext = false;
802  instance.applyOnAllProperties(mApplier);
803  std::vector<PortReferenceSharedPtr> portRefs;
804  instance.getPortReferences(portRefs);
805  for(std::vector<PortReferenceSharedPtr>::iterator portRef = portRefs.begin();
806  portRef != portRefs.end(); ++portRef) {
807  PortAttributesSharedPtr attribs = (*portRef)->getAttributes();
808  if(attribs) {
809  mOut << std::endl << indent << " (portInstance ";
810  mIsPortInstanceContext = true;
811  mIsJoiningContext = true;
812  (*portRef)->accept(*this);
813  mIsJoiningContext = false;
814  mIsPortInstanceContext = false;
815  printPortAttributes(attribs);
816  mOut << std::endl << indent << " )";
817  }
818  }
819  mOut << std::endl << indent << ")";
820  }
821  } catch(Error& e) {
822  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
823  throw;
824  }
825 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
boost::shared_ptr< PortAttributes > PortAttributesSharedPtr
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void printPortAttributes(const PortAttributesSharedPtr &inAttrib)
boost::shared_ptr< ParameterMap > ParameterMapSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( InstanceArray ininstanceArray)
throw (Error
)

Definition at line 992 of file Decompiler.cpp.

992  {
993  try {
994  Indenter indent(*this);
995  if(!instanceArray.getOriginalName().empty()) {
996  mOut << std::endl << indent << "(instance ";
997  mOut << std::endl << indent << " (array (rename " << instanceArray.getName() << " "
998  << "\"" << instanceArray.getOriginalName() << "\"" << ")" << " ";
999  } else {
1000  mOut << std::endl << indent << "(instance (array " << instanceArray.getName() << " ";
1001  }
1002  std::vector < size_t > limits;
1003  instanceArray.getLimits(limits);
1004  copy(limits.begin(), limits.end(), std::ostream_iterator < size_t > (mOut, " "));
1005  mOut << ")";
1006  mOut << std::endl << indent << " (viewRef " << instanceArray.getMaster()->getName()
1007  << " (cellRef " << instanceArray.getMaster()->getParent()->getName() << " (libraryRef "
1008  << instanceArray.getMaster()->getParent()->getParent()->getName() << ")))";
1009 
1010  if(!instanceArray.getDesignator().empty()) {
1011  mOut << std::endl << indent << " (designator " << "\"" << instanceArray.getDesignator()
1012  << "\"" << ")";
1013  }
1014 
1015  //Print Comments
1016  std::vector < std::string > comments = instanceArray.getComments();
1017  printComments(comments);
1018 
1019  std::list < std::string > elements;
1020  instanceArray.getUserData(elements);
1021  printUserData(elements);
1022 
1023  mParamAssignContext = true;
1024  typedef std::map<std::string, ParameterSharedPtr> Params;
1025  ParameterMapSharedPtr params = instanceArray.getParameters();
1026  ParameterContext context = instanceArray.getParameterContext();
1027  params->applyOnOverriddenParameters(context, mApplier);
1028  mParamAssignContext = false;
1029  instanceArray.applyOnAllProperties(mApplier);
1030  mOut << std::endl << indent << ")";
1031  } catch(Error& e) {
1032  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1033  throw;
1034  }
1035 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< ParameterMap > ParameterMapSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( InstanceArrayMember ininstanceArray)
throw (Error
)

Definition at line 1038 of file Decompiler.cpp.

1038  {
1039  try {
1040  if(mIsJoiningContext) {
1041  mOut << "(instanceRef (member " << instance.getParentCollection()->getName() << " ";
1042  copy(instance.getIndices().begin(), instance.getIndices().end(),
1043  std::ostream_iterator < size_t > (mOut, " "));
1044  mOut << "))";
1045  } else {
1046  }
1047  } catch(Error& e) {
1048  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1049  throw;
1050  }
1051 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( ScalarPortReference inScalarPortRef)
throw (Error
)

Definition at line 540 of file Decompiler.cpp.

540  {
541  try {
542  Indenter indent(*this);
543  if(mIsJoiningContext) {
544  mOut << std::endl << indent << "(portRef " << portRef.getName();
545  PortReferenceSharedPtr parentCol = portRef.getParentCollection();
546  if(parentCol) {
547  parentCol->accept(*this);
548  } else {
550  portRef.getParent()->accept(*this);
551  }
552  }
553  mOut << ")";
554  } else {
555  }
556  } catch(Error& e) {
557  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
558  throw;
559  }
560 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< PortReference > PortReferenceSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( VectorPortReference inVectorPortRef)
throw (Error
)

Definition at line 622 of file Decompiler.cpp.

622  {
623  try {
624  Indenter indent(*this);
625  if(mIsJoiningContext) {
626  mOut << std::endl << indent << "(portRef " << portRef.getName() << " ";
627  PortReferenceSharedPtr parentCol = portRef.getParentCollection();
628  if(parentCol) {
629  parentCol->accept(*this);
630  } else {
632  portRef.getParent()->accept(*this);
633  }
634  }
635  mOut << ")";
636  } else {
637  }
638  } catch(Error& e) {
639  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
640  throw;
641  }
642 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< PortReference > PortReferenceSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

template<typename _Tp >
virtual void torc::generic::VisitorType< _Tp >::visit ( _Tp &  client)
throw (Error
)
pure virtualinherited

Visit the target object. This will typically be a derived leaf type.

Parameters
[in,out]clientA reference to the target object
Exceptions
ErrorException generated by any of the functions called from inside visit()

+ Here is the caller graph for this function:

void torc::generic::Decompiler::visit ( VectorPortBitReference inVectorPortBitRef)
throw (Error
)

Definition at line 669 of file Decompiler.cpp.

669  {
670  try {
671  Indenter indent(*this);
672  if(mIsJoiningContext) {
673  PortReferenceSharedPtr parent = bitRef.getParentCollection();
674  mOut << std::endl << indent << "(portRef (member " << parent->getName() << " ";
675  copy(bitRef.getIndices().begin(), bitRef.getIndices().end(),
676  std::ostream_iterator < size_t > (mOut, " "));
677  mOut << ")";
678  PortReferenceSharedPtr parentCol = parent->getParentCollection();
679  if(parentCol) {
680  parentCol->accept(*this);
681  } else {
683  parent->getParent()->accept(*this);
684  }
685  }
686  mOut << ")";
687  } else {
688  }
689  } catch(Error& e) {
690  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
691  throw;
692  }
693 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< PortReference > PortReferenceSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( PortBundleReference inPortBundleRef)
throw (Error
)

Definition at line 743 of file Decompiler.cpp.

743  {
744  try {
745  Indenter indent(*this);
746  mOut << std::endl << indent << "(portRef " << portRef.getName() << " ";
747  PortReferenceSharedPtr parentCol = portRef.getParentCollection();
748  if(parentCol) {
749  parentCol->accept(*this);
750  } else {
751  portRef.getParent()->accept(*this);
752  }
753  mOut << ")";
754  } catch(Error& e) {
755  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
756  throw;
757  }
758 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< PortReference > PortReferenceSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( SingleParameter insingleParameter)
throw (Error
)

Definition at line 1054 of file Decompiler.cpp.

1054  {
1055  try {
1056  Indenter indent(*this);
1057  if(!mParamAssignContext) {
1058  if(!inSingleParameter.getOriginalName().empty()) {
1059  mOut << std::endl << indent << "(parameter ";
1060  mOut << std::endl << indent << " (rename " << inSingleParameter.getName() << " "
1061  << "\"" << inSingleParameter.getOriginalName() << "\"" << ")";
1062  } else {
1063  mOut << std::endl << indent << "(parameter " << inSingleParameter.getName() << " ";
1064  }
1065  printValueType(inSingleParameter.getValue());
1066  printValue(inSingleParameter.getValue());
1067  mOut << ")";
1068  printUnit(inSingleParameter.getUnit());
1069  mOut << ")";
1070  } else {
1071  mOut << std::endl << indent << " (parameterAssign " << inSingleParameter.getName()
1072  << " ";
1073  printValueType(inSingleParameter.getValue());
1074  printValue(inSingleParameter.getValue());
1075  mOut << "))";
1076  }
1077  } catch(Error& e) {
1078  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1079  throw;
1080  }
1081 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void printUnit(const Unit unit)
void printValueType(const Value &value)
void printValue(const Value &value)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( ParameterArray inparamArray)
throw (Error
)

Definition at line 1084 of file Decompiler.cpp.

1084  {
1085  try {
1086  Indenter indent(*this);
1087  if(!mParamAssignContext) {
1088  if(!inparamArray.getOriginalName().empty()) {
1089  mOut << std::endl << indent << "(parameter ";
1090  mOut << std::endl << indent << " (array (rename " << inparamArray.getName() << " "
1091  << "\"" << inparamArray.getOriginalName() << "\"" << ")" << " ";
1092  } else {
1093  mOut << std::endl << indent << "(parameter (array " << inparamArray.getName()
1094  << " ";
1095  }
1096  std::vector < size_t > limits;
1097  inparamArray.getLimits(limits);
1098  copy(limits.begin(), limits.end(), std::ostream_iterator < size_t > (mOut, " "));
1099  mOut << ")" << std::endl << indent << " ";
1100  std::vector<ParameterSharedPtr> children;
1101  inparamArray.getChildren(children);
1102  std::vector<ParameterSharedPtr>::iterator start = children.begin();
1103  std::vector<ParameterSharedPtr>::iterator end = children.end();
1104  printValueType((*start)->getValue());
1105  printArray(limits, limits.size(), start, end);
1106  mOut << ")";
1107  printUnit(inparamArray.getUnit());
1108  mOut << std::endl << indent << ")";
1109  } else {
1110  mOut << std::endl << indent << " (parameterAssign " << inparamArray.getName();
1111  std::vector<ParameterSharedPtr> children;
1112  inparamArray.getChildren(children);
1113  if(!children.empty()) {
1114  std::vector < size_t > limits;
1115  inparamArray.getLimits(limits);
1116  std::vector<ParameterSharedPtr>::iterator start = children.begin();
1117  std::vector<ParameterSharedPtr>::iterator end = children.end();
1118  mOut << std::endl << indent << " ";
1119  printValueType((*start)->getValue());
1120  printArray(limits, limits.size(), start, end);
1121  mOut << ")";
1122  mOut << std::endl << indent << " )";
1123  }
1124  }
1125  } catch(Error& e) {
1126  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1127  throw;
1128  }
1129 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void printUnit(const Unit unit)
virtual const Unit getUnit() const
Definition: Parameter.cpp:44
void printValueType(const Value &value)
virtual const std::string getName() const
Definition: Nameable.hpp:89
void printArray(const std::vector< size_t > &outVector, size_t depth, std::vector< ParameterSharedPtr >::iterator &itStart, std::vector< ParameterSharedPtr >::iterator &itEnd)
virtual void getChildren(List &outChildren) const
Definition: Vector.hpp:428
void getLimits(std::vector< SizeType > &outLimits) const
Definition: Vector.hpp:652
virtual Name getOriginalName() const
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( ParameterArrayElement inParamArrayElement)
throw (Error
)

Definition at line 1131 of file Decompiler.cpp.

1131  {
1132  try {
1133  printValue(bit.getValue());
1134  printUnit(bit.getUnit());
1135  mOut << " ";
1136  } catch(Error& e) {
1137  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1138  throw;
1139  }
1140 }
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void printUnit(const Unit unit)
void printValue(const Value &value)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( Property inProperty)
throw (Error
)

Definition at line 1143 of file Decompiler.cpp.

1143  {
1144  try {
1145  Indenter indent(*this);
1146  if(!inProperty.getOriginalName().empty()) {
1147  mOut << std::endl << indent << "(property ";
1148  mOut << std::endl << indent << " (rename " << inProperty.getName() << " " << "\""
1149  << inProperty.getOriginalName() << "\"" << ")";
1150  } else {
1151  mOut << std::endl << indent << "(property " << inProperty.getName();
1152  }
1153  printValueType(inProperty.getValue());
1154  printValue(inProperty.getValue());
1155  mOut << ")";
1156 
1157  if(!inProperty.getOwner().empty()) {
1158  mOut << std::endl << indent << " (owner " << "\"" << inProperty.getOwner() << "\""
1159  << ")";
1160  }
1161 
1162  //Print Comments
1163  std::vector < std::string > comments = inProperty.getComments();
1164  printComments(comments);
1165 
1166  inProperty.applyOnAllChildren(mApplier);
1167  mOut << ")";
1168  } catch(Error& e) {
1169  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1170  throw;
1171  }
1172 }
void applyOnAllChildren(const _Action &action)
Definition: Property.hpp:207
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void printValueType(const Value &value)
const std::string getOwner() const
Definition: Property.hpp:194
virtual const std::string getName() const
Definition: Nameable.hpp:89
const Value getValue() const
Definition: Property.hpp:176
void printValue(const Value &value)
const std::vector< std::string > & getComments() const
Definition: Commentable.hpp:85
virtual Name getOriginalName() const
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( PortList inPortList)
throw (Error
)

Definition at line 1175 of file Decompiler.cpp.

1175  {
1176  try {
1177  Indenter indent(*this);
1178  if(mIsJoiningContext) {
1179  std::list<PortList::PortListElement> elements;
1180  inPortList.getChildren(elements);
1181  mOut << std::endl << indent << "(portList ";
1182  for(std::list<PortList::PortListElement>::iterator it = elements.begin();
1183  it != elements.end(); ++it) {
1184  switch((*it).getType()) {
1186  (*it).getPort()->accept(*this);
1187  break;
1188  }
1190  (*it).getPortReference()->accept(*this);
1191  break;
1192  }
1193  }
1194  }
1195  mOut << std::endl << indent << ")";
1196  } else {
1197  }
1198  } catch(Error& e) {
1199  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1200  throw;
1201  }
1202 }
void getChildren(std::list< PortListElement > &outPorts)
Definition: PortList.cpp:211
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( PortListAlias inPortListAlias)
throw (Error
)

Definition at line 1205 of file Decompiler.cpp.

1205  {
1206  try {
1207  Indenter indent(*this);
1208  mOut << std::endl << indent << "(portListAlias " << inPortListAlias.getName();
1209  mIsJoiningContext = true;
1210  inPortListAlias.getPortList()->accept(*this);
1211  mOut << std::endl << indent << ")";
1212  } catch(Error& e) {
1213  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1214  throw;
1215  }
1216 }
const PortListSharedPtr getPortList() const
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
virtual const std::string getName() const
Definition: Nameable.hpp:89
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( Status inStatus)
throw (Error
)

Definition at line 1219 of file Decompiler.cpp.

1219  {
1220  try {
1221  Indenter indent(*this);
1222  mOut << std::endl << indent << "(status ";
1223  std::vector<WrittenSharedPtr> elements;
1224  status.getWrittens(elements);
1225 
1226  for(std::vector<WrittenSharedPtr>::iterator it = elements.begin(); it != elements.end();
1227  ++it) {
1228  mOut << std::endl << indent << " (written ";
1229  mOut << std::endl << indent << " (timeStamp ";
1230  WrittenSharedPtr written = *it;
1231  TimeStamp timestamp = written->getTimeStamp();
1232  mOut << timestamp.getYear() << " " << timestamp.getMonth() << " " << timestamp.getDay()
1233  << " " << timestamp.getHour() << " " << timestamp.getMinute() << " "
1234  << timestamp.getSecond() << ")";
1235  if(!written->getAuthorName().empty()) {
1236  mOut << std::endl << indent << " (author " << "\"" << written->getAuthorName()
1237  << "\"" << ")";
1238  }
1239  if(!written->getProgramName().empty()) {
1240  mOut << std::endl << indent << " (program " << "\"" << written->getProgramName()
1241  << "\"";
1242  if(!written->getProgramVersion().empty()) {
1243  mOut << std::endl << indent << " (version " << "\""
1244  << written->getProgramVersion() << "\"" << ")";
1245  }
1246  mOut << ")";
1247  }
1248 
1249  if(!written->getDataOriginLocationName().empty()) {
1250  mOut << std::endl << indent << " (dataOrigin " << "\""
1251  << written->getDataOriginLocationName() << "\"";
1252  if(!written->getDataOriginVersion().empty()) {
1253  mOut << std::endl << indent << " (version " << "\""
1254  << written->getDataOriginVersion() << "\"" << ")";
1255  }
1256  mOut << ")";
1257  }
1258 
1259  //Print Comments
1260  std::vector < std::string > comments = written->getComments();
1261  printComments(comments);
1262 
1263  std::list < std::string > userDatas;
1264  written->getUserData(userDatas);
1265  printUserData(userDatas);
1266 
1267  written->applyOnAllProperties(mApplier);
1268 
1269  mOut << std::endl << indent << " )";
1270  }
1271  //Print Comments
1272  std::vector < std::string > comments = status.getComments();
1273  printComments(comments);
1274 
1275  std::list < std::string > userDatas;
1276  status.getUserData(userDatas);
1277  printUserData(userDatas);
1278 
1279  mOut << std::endl << indent << ")";
1280  } catch(Error& e) {
1281  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1282  throw;
1283  }
1284 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
uint32_t getSecond() const
Definition: TimeStamp.hpp:185
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
boost::shared_ptr< Written > WrittenSharedPtr
uint32_t getHour() const
Definition: TimeStamp.hpp:167
uint32_t getMonth() const
Definition: TimeStamp.hpp:149
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
uint32_t getYear() const
Definition: TimeStamp.hpp:140
Represents the time in Universal Time Coordinate (year, month, day, hour, minute, second) ...
Definition: TimeStamp.hpp:29
uint32_t getMinute() const
Definition: TimeStamp.hpp:176
uint32_t getDay() const
Definition: TimeStamp.hpp:158
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( Permutable inPermutable)
throw (Error
)

Definition at line 1287 of file Decompiler.cpp.

1287  {
1288  try {
1289  mIsPermutableContext = true;
1290  Indenter indent(*this);
1291  if(mIsJoiningContext) {
1292  std::vector<PortSharedPtr> outPorts;
1293  inPermutable.getPorts(outPorts);
1294  if(!inPermutable.getIsNonPermutable()) {
1295  mOut << std::endl << indent << "(permutable ";
1296  } else {
1297  mOut << std::endl << indent << "(nonPermutable ";
1298  }
1299  std::vector<PortSharedPtr>::iterator port = outPorts.begin();
1300  std::vector<PortSharedPtr>::iterator end = outPorts.end();
1301  for(; port != end; ++port) {
1302  (*port)->accept(*this);
1303  }
1304  inPermutable.applyOnAllChildren(mApplier);
1305  mOut << std::endl << indent << ")";
1306  } else {
1307  }
1308  mIsPermutableContext = false;
1309  } catch(Error& e) {
1310  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1311  throw;
1312  }
1313 }
void applyOnAllChildren(const _Action &action)
Definition: Permutable.hpp:212
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
const bool getIsNonPermutable() const
Definition: Permutable.hpp:229
void getPorts(std::vector< PortSharedPtr > &outPorts) const
Definition: Permutable.hpp:194
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( InterfaceJoinedInfo inInterfaceJoinedInfo)
throw (Error
)

Definition at line 1316 of file Decompiler.cpp.

1316  {
1317  try {
1318  mIsPermutableContext = true;
1319  Indenter indent(*this);
1320  if(mIsJoiningContext) {
1321  std::string joinedType;
1322  switch(inInterfaceJoinedInfo.getJoinedType()) {
1324  joinedType = "joined";
1325  break;
1326  }
1328  joinedType = "weakJoined";
1329  break;
1330  }
1332  joinedType = "mustJoin";
1333  break;
1334  }
1335  }
1336  mOut << std::endl << indent << "(" << joinedType;
1337  std::list<PortSharedPtr> outPorts;
1338  inInterfaceJoinedInfo.getPorts(outPorts);
1339 
1340  if(!outPorts.empty()) {
1341  std::list<PortSharedPtr>::iterator port = outPorts.begin();
1342  std::list<PortSharedPtr>::iterator end = outPorts.end();
1343  for(; port != end; ++port) {
1344  (*port)->accept(*this);
1345  }
1346  }
1347 
1348  std::list<PortListSharedPtr> outPortLists;
1349  inInterfaceJoinedInfo.getPortLists(outPortLists);
1350  if(!outPortLists.empty()) {
1351  std::list<PortListSharedPtr>::iterator portList = outPortLists.begin();
1352  std::list<PortListSharedPtr>::iterator end = outPortLists.end();
1353  for(; portList != end; ++portList) {
1354  (*portList)->accept(*this);
1355  }
1356  }
1357 
1358  inInterfaceJoinedInfo.applyOnAllChildren(mApplier);
1359  mOut << std::endl << indent << ")";
1360  } else {
1361  }
1362  mIsPermutableContext = false;
1363  } catch(Error& e) {
1364  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1365  throw;
1366  }
1367 }
void applyOnAllChildren(const _Action &action)
void getPortLists(std::list< PortListSharedPtr > &outPortLists) const
const JoinedType getJoinedType() const
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
std::string string
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void getPorts(std::list< PortSharedPtr > &outPorts) const
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( SimulationInfo simuInfo)
throw (Error
)

Definition at line 1370 of file Decompiler.cpp.

1370  {
1371  try {
1372  Indenter indent(*this);
1373  mOut << std::endl << indent << "(simulationInfo";
1374  simuInfo.applyOnAllLogicValues(mApplier);
1375 
1376  //Print Comments
1377  std::vector < std::string > comments = simuInfo.getComments();
1378  printComments(comments);
1379 
1380  //Print UserData
1381  std::list < std::string > elements;
1382  simuInfo.getUserData(elements);
1383  printUserData(elements);
1384 
1385  mOut << std::endl << indent << ")";
1386  } catch(Error& e) {
1387  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1388  throw;
1389  }
1390 }
void applyOnAllLogicValues(const _Action &action)
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void getUserData(std::list< std::string > &outUserData) const
const std::vector< std::string > & getComments() const
Definition: Commentable.hpp:85
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( Simulate simulate)
throw (Error
)

Definition at line 1393 of file Decompiler.cpp.

1393  {
1394  try {
1395  Indenter indent(*this);
1396  if(!simulate.getOriginalName().empty()) {
1397  mOut << std::endl << indent << "(simulate (rename " << simulate.getName() << " " << "\""
1398  << simulate.getOriginalName() << "\"" << ")";
1399  } else {
1400  mOut << std::endl << indent << "(simulate " << simulate.getName();
1401  }
1402 
1404  simulate.applyOnAllWaveValues(mApplier);
1405 
1406  std::vector<ApplySharedPtr> outAllApply;
1407  simulate.getAllApply(outAllApply);
1408  std::vector<ApplySharedPtr>::iterator it = outAllApply.begin();
1409  for(; it != outAllApply.end(); it++) {
1410  (*it)->accept(*this);
1411  }
1412 
1413  //Print Comments
1414  std::vector < std::string > comments = simulate.getComments();
1415  printComments(comments);
1416 
1417  //Print UserData
1418  std::list < std::string > elements;
1419  simulate.getUserData(elements);
1420  printUserData(elements);
1421 
1422  mOut << std::endl << indent << ")";
1423  } catch(Error& e) {
1424  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1425  throw;
1426  }
1427 }
void printUserData(std::list< std::string > inElements)
void getAllApply(std::vector< ApplySharedPtr > &outAllApply) const
Definition: Simulate.hpp:224
void applyOnAllPortListAlias(const _Action &action)
Definition: Simulate.hpp:242
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void getUserData(std::list< std::string > &outUserData) const
void applyOnAllWaveValues(const _Action &action)
Definition: Simulate.hpp:257
virtual const std::string getName() const
Definition: Nameable.hpp:89
const std::vector< std::string > & getComments() const
Definition: Commentable.hpp:85
virtual Name getOriginalName() const
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( Apply apply)
throw (Error
)

Definition at line 1430 of file Decompiler.cpp.

1430  {
1431  try {
1432  Indenter indent(*this);
1433  mOut << std::endl << indent << "(apply " << "(cycle " << apply.getNoOfCycle()
1434  << " (duration ";
1435  printValue(apply.getCycleDuration());
1436  mOut << "))";
1437 
1438  std::list<LogicalResponseSharedPtr> outLogicResponces;
1439  apply.getLogicResponses(outLogicResponces);
1440  std::list<LogicalResponseSharedPtr>::iterator logicIt = outLogicResponces.begin();
1441  for(; logicIt != outLogicResponces.end(); logicIt++) {
1442  (*logicIt)->accept(*this);
1443  }
1444 
1445  //Print Comments
1446  std::vector < std::string > comments = apply.getComments();
1447  printComments(comments);
1448 
1449  //Print UserData
1450  std::list < std::string > elements;
1451  apply.getUserData(elements);
1452  printUserData(elements);
1453 
1454  mOut << std::endl << indent << ")";
1455  } catch(Error& e) {
1456  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1457  throw;
1458  }
1459 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
const Value getCycleDuration() const
Definition: Apply.hpp:145
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
const int32_t getNoOfCycle() const
Definition: Apply.hpp:137
void getUserData(std::list< std::string > &outUserData) const
void getLogicResponses(std::list< LogicalResponseSharedPtr > &outLogicResponces) const
Definition: Apply.hpp:154
void printValue(const Value &value)
const std::vector< std::string > & getComments() const
Definition: Commentable.hpp:85
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( LogicalResponse logicalResponse)
throw (Error
)

Definition at line 1462 of file Decompiler.cpp.

1462  {
1463  try {
1464  Indenter indent(*this);
1465  std::string responseType;
1466  switch(logicalResponse.getResponseType()) {
1468  responseType = "logicInput";
1469  break;
1470  }
1472  responseType = "logicOutput";
1473  break;
1474  }
1475  }
1476  mOut << std::endl << indent << "(" << responseType;
1477  if(NULL != logicalResponse.getConnectedPort()) {
1478  mOut << " " << logicalResponse.getConnectedPort()->getName();
1479  }
1480  if(NULL != logicalResponse.getConnectedPortListAlias()) {
1481  mOut << " " << logicalResponse.getConnectedPortListAlias()->getName();
1482  }
1483  if(NULL != logicalResponse.getConnectedPortList()) {
1484  logicalResponse.getConnectedPortList()->accept(*this);
1485  }
1486  LogicElementSharedPtr logicElement = logicalResponse.getLogicWaveForm();
1487  if(logicElement) {
1488  logicElement->accept(*this);
1489  }
1490  mOut << ")";
1491  } catch(Error& e) {
1492  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1493  throw;
1494  }
1495 }
boost::shared_ptr< LogicElement > LogicElementSharedPtr
const PortListSharedPtr getConnectedPortList() const
std::string string
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
const ResponseType getResponseType() const
const LogicElementSharedPtr getLogicWaveForm() const
const PortListAliasSharedPtr getConnectedPortListAlias() const
const PortSharedPtr getConnectedPort() const
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( LogicValue logicVal)
throw (Error
)

Definition at line 1565 of file Decompiler.cpp.

1565  {
1566  try {
1567  Indenter indent(*this);
1568  if(!logicVal.getOriginalName().empty()) {
1569  mOut << std::endl << indent << "(logicValue ";
1570  mOut << std::endl << indent << " (rename " << logicVal.getName() << " " << "\""
1571  << logicVal.getOriginalName() << "\"" << ")";
1572  } else {
1573  mOut << std::endl << indent << "(logicValue " << logicVal.getName();
1574  }
1575 
1576  //TBD
1577  //Print attributes
1579 
1580  //Print Comments
1581  std::vector < std::string > comments = logicVal.getComments();
1582  printComments(comments);
1583 
1584  logicVal.applyOnAllProperties(mApplier);
1585 
1586  //Print UserData
1587  std::list < std::string > elements;
1588  logicVal.getUserData(elements);
1589  printUserData(elements);
1590 
1591  mOut << std::endl << indent << ")";
1592  } catch(Error& e) {
1593  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1594  throw;
1595  }
1596 }
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
void applyOnAllProperties(const _Action &action)
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
const LogicValueAttributesSharedPtr getAttributes() const
Definition: LogicValue.hpp:125
void getUserData(std::list< std::string > &outUserData) const
virtual const std::string getName() const
Definition: Nameable.hpp:89
void printLogicValueAttributes(const LogicValueAttributesSharedPtr &inAttrib)
const std::vector< std::string > & getComments() const
Definition: Commentable.hpp:85
virtual Name getOriginalName() const
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( LogicElement logicElement)
throw (Error
)

Definition at line 1498 of file Decompiler.cpp.

1498  {
1499  try {
1500  Indenter indent(*this);
1501  std::string type;
1502  std::string logicValueName;
1503  switch(logicElem.getType()) {
1505  type = "";
1506  logicValueName = logicElem.getName();
1507  break;
1508  }
1509  case LogicElement::eTypeList: {
1510  type = "logicList";
1511  break;
1512  }
1513  case LogicElement::eTypeOneOf: {
1514  type = "logicOneOf";
1515  break;
1516  }
1518  type = "logicWaveForm";
1519  break;
1520  }
1522  type = "ignore";
1523  break;
1524  }
1526  type = "transition";
1527  break;
1528  }
1530  type = "becomes";
1531  break;
1532  }
1533  }
1534 
1535  if(LogicElement::eTypeSingle == logicElem.getType()) {
1536  mOut << " " << logicValueName;
1537  } else {
1538  mOut << std::endl << indent << "(" << type;
1539  logicElem.applyOnAllChildren(mApplier);
1540  mOut << ")";
1541  }
1542  } catch(Error& e) {
1543  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1544  throw;
1545  }
1546 }
VisitorApplier< Decompiler > mApplier
Definition: Decompiler.hpp:170
std::string string
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( WaveValue waveValue)
throw (Error
)

Definition at line 1549 of file Decompiler.cpp.

1549  {
1550  try {
1551  Indenter indent(*this);
1552  mOut << std::endl << indent << "(waveValue " << waveValue.getName() << " ";
1553  printValue(waveValue.getDeltaTimeDuration());
1554  if(NULL != waveValue.getLogicWaveform()) {
1555  waveValue.getLogicWaveform()->accept(*this);
1556  }
1557  mOut << ")";
1558  } catch(Error& e) {
1559  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1560  throw;
1561  }
1562 }
const Value getDeltaTimeDuration() const
Definition: WaveValue.hpp:115
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
const LogicElementSharedPtr getLogicWaveform() const
Definition: WaveValue.hpp:124
virtual const std::string getName() const
Definition: Nameable.hpp:89
void printValue(const Value &value)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( Timing timing)
throw (Error
)

Definition at line 1599 of file Decompiler.cpp.

1599  {
1600  try {
1601  Indenter indent(*this);
1602  mOut << std::endl << indent << "(timing " << std::endl;
1603  mOut << indent;
1604  printDerivation(timing.getDerivation());
1605 
1606  std::list<PathDelaySharedPtr> outPathDelays;
1607  timing.getPathDelays(outPathDelays);
1608  std::list<PathDelaySharedPtr>::iterator pathDelayIt = outPathDelays.begin();
1609  for(; pathDelayIt != outPathDelays.end(); pathDelayIt++) {
1610  mOut << indent << " (pathDelay " << std::endl;
1611  mOut << indent << " (delay ";
1612  PathDelaySharedPtr pathDelay = *pathDelayIt;
1613  Value::MiNoMax mnm = pathDelay->getDelay();
1614  Value val(Value::eValueTypeMiNoMax, mnm);
1615  printValue(val);
1616  mOut << ")" << std::endl;
1617 
1618  //Print event
1619  std::list<EventSharedPtr> outEvents;
1620  pathDelay->getEvents(outEvents);
1621  std::list<EventSharedPtr>::iterator eventIt = outEvents.begin();
1622  for(; eventIt != outEvents.end(); eventIt++) {
1623  mOut << " ";
1624  (*eventIt)->accept(*this);
1625  }
1626  mOut << indent << " )" << std::endl;
1627  }
1628 
1629  //Print forbiddenEvent
1630  std::list<ForbiddenEventSharedPtr> outForbiddentEvents;
1631  timing.getForbiddentEvents(outForbiddentEvents);
1632  std::list<ForbiddenEventSharedPtr>::iterator forbiddentEventIt =
1633  outForbiddentEvents.begin();
1634  for(; forbiddentEventIt != outForbiddentEvents.end(); forbiddentEventIt++) {
1635  (*forbiddentEventIt)->accept(*this);
1636  }
1637 
1638  //Print Comments
1639  std::vector < std::string > comments = timing.getComments();
1640  printComments(comments);
1641 
1642  //Print UserData
1643  std::list < std::string > elements;
1644  timing.getUserData(elements);
1645  printUserData(elements);
1646 
1647  mOut << std::endl << indent << ")";
1648  } catch(Error& e) {
1649  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1650  throw;
1651  }
1652 }
const Derivation getDerivation() const
Definition: Timing.hpp:158
void printUserData(std::list< std::string > inElements)
void printComments(std::vector< std::string > &inElements)
void printDerivation(const Derivation derivation)
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void getPathDelays(std::list< PathDelaySharedPtr > &outPathDelays) const
Definition: Timing.hpp:167
void getUserData(std::list< std::string > &outUserData) const
void getForbiddentEvents(std::list< ForbiddenEventSharedPtr > &outForbiddentEvents) const
Definition: Timing.hpp:176
boost::shared_ptr< PathDelay > PathDelaySharedPtr
void printValue(const Value &value)
const std::vector< std::string > & getComments() const
Definition: Commentable.hpp:85
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( Event event)
throw (Error
)

Definition at line 1655 of file Decompiler.cpp.

1655  {
1656  try {
1657  Indenter indent(*this);
1658  std::string type;
1659  switch(event.getType()) {
1660  case Event::eTypeEvent: {
1661  type = "(event";
1662  break;
1663  }
1664  case Event::eTypeOffsetEvent: {
1665  type = "(offsetEvent (event";
1666  break;
1667  }
1668  }
1669 
1670  mOut << indent << type;
1671 
1672  //Print port or portGroup
1673  mIsJoiningContext = true;
1674  std::list<PortElement> outPortElements;
1675  event.getPortElements(outPortElements);
1676  std::list<PortElement>::iterator portElem = outPortElements.begin();
1677  std::list<PortElement>::iterator end = outPortElements.end();
1678  if(outPortElements.size() > 1) {
1679  (*this).setIndentation((*this).getIndentation() + 8);
1680  mOut << std::endl << indent << "(portGroup";
1681  }
1682  if(outPortElements.size() == 1) {
1683  (*this).setIndentation((*this).getIndentation() + 4);
1684  }
1685 
1686  for(; portElem != end; ++portElem) {
1687  switch((*portElem).getType()) {
1689  (*portElem).getPort()->accept(*this);
1690  break;
1691  }
1693  (*portElem).getPortReference()->accept(*this);
1694  break;
1695  }
1696  }
1697  }
1698 
1699  if(outPortElements.size() > 1) {
1700  mOut << ")";
1701  (*this).setIndentation((*this).getIndentation() - 8);
1702  }
1703  if(outPortElements.size() == 1) {
1704  (*this).setIndentation((*this).getIndentation() - 4);
1705  }
1706  //Print portList
1707  if(NULL != event.getPortList()) {
1708  (*this).setIndentation((*this).getIndentation() + 4);
1709  event.getPortList()->accept(*this);
1710  (*this).setIndentation((*this).getIndentation() - 4);
1711  }
1712  //Print net or netGroup
1713  mIsJoiningContext = false;
1714  std::list<NetSharedPtr> outNets;
1715  event.getNets(outNets);
1716  std::list<NetSharedPtr>::iterator net = outNets.begin();
1717  if(outNets.size() > 1) {
1718  (*this).setIndentation((*this).getIndentation() + 8);
1719  mOut << std::endl << indent << "(netGroup";
1720  }
1721  if(outNets.size() == 1) {
1722  (*this).setIndentation((*this).getIndentation() + 4);
1723  }
1724 
1725  for(; net != outNets.end(); ++net) {
1726  (*net)->accept(*this);
1727  }
1728 
1729  if(outNets.size() > 1) {
1730  mOut << ")";
1731  (*this).setIndentation((*this).getIndentation() - 8);
1732  }
1733  if(outNets.size() == 1) {
1734  (*this).setIndentation((*this).getIndentation() - 4);
1735  }
1736 
1737  //Print transition/becomes
1738  if(NULL != event.getTransition()) {
1739  (*this).setIndentation((*this).getIndentation() + 4);
1740  event.getTransition()->accept(*this);
1741  (*this).setIndentation((*this).getIndentation() - 4);
1742  }
1743 
1744  switch(event.getType()) {
1745  case Event::eTypeEvent: {
1746  mOut << ")" << std::endl;
1747  break;
1748  }
1749  case Event::eTypeOffsetEvent: {
1750  mOut << ") "; //end of event
1751  printValue(event.getOffsetTime());
1752  mOut << ")" << std::endl;
1753  break;
1754  }
1755  }
1756  } catch(Error& e) {
1757  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1758  throw;
1759  }
1760 }
const Type getType() const
Definition: Event.hpp:210
std::string string
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
const PortListSharedPtr getPortList() const
Definition: Event.hpp:229
const LogicElementSharedPtr getTransition() const
Definition: Event.hpp:248
void printValue(const Value &value)
const Value getOffsetTime() const
Definition: Event.hpp:256
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

void torc::generic::Decompiler::visit ( ForbiddenEvent forbiddenevent)
throw (Error
)

Definition at line 1763 of file Decompiler.cpp.

1763  {
1764  try {
1765  Indenter indent(*this);
1766  mOut << indent << "(forbiddenEvent" << std::endl;
1767  mOut << indent << " (timeInterval" << std::endl;
1768  if(NULL != forbiddenevent.getStartTimeInterval()) {
1769  mOut << " ";
1770  forbiddenevent.getStartTimeInterval()->accept(*this);
1771  }
1772  if(NULL != forbiddenevent.getEndTimeInterval()) {
1773  mOut << " ";
1774  forbiddenevent.getEndTimeInterval()->accept(*this);
1775  } else {
1776  mOut << " ";
1777  mOut << indent << " (duration ";
1778  printValue(forbiddenevent.getDuration());
1779  mOut << ")" << std::endl;
1780  }
1781  mOut << indent << " )" << std::endl;
1782 
1783  std::list<EventSharedPtr> outEvents;
1784  forbiddenevent.getEvents(outEvents);
1785  std::list<EventSharedPtr>::iterator eventIt = outEvents.begin();
1786  for(; eventIt != outEvents.end(); eventIt++) {
1787  (*eventIt)->accept(*this);
1788  }
1789  mOut << indent << ")";
1790  } catch(Error& e) {
1791  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
1792  throw;
1793  }
1794 }
const EventSharedPtr getStartTimeInterval() const
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
const Value getDuration() const
const EventSharedPtr getEndTimeInterval() const
void printValue(const Value &value)
void getEvents(std::list< EventSharedPtr > &outEvents) const
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)
Definition: Error.cpp:73

+ Here is the call graph for this function:

Field Documentation

VisitorApplier<Decompiler> torc::generic::Decompiler::mApplier
private

Definition at line 170 of file Decompiler.hpp.

size_t torc::generic::Decompiler::mIndentation
private

Definition at line 169 of file Decompiler.hpp.

bool torc::generic::Decompiler::mIsExternContext
private

Definition at line 166 of file Decompiler.hpp.

bool torc::generic::Decompiler::mIsJoiningContext
private

Definition at line 164 of file Decompiler.hpp.

bool torc::generic::Decompiler::mIsPermutableContext
private

Definition at line 165 of file Decompiler.hpp.

bool torc::generic::Decompiler::mIsPortInstanceContext
private

Definition at line 168 of file Decompiler.hpp.

std::ostream& torc::generic::Decompiler::mOut
private

Definition at line 163 of file Decompiler.hpp.

bool torc::generic::Decompiler::mParamAssignContext
private

Definition at line 167 of file Decompiler.hpp.

RootSharedPtr torc::generic::Decompiler::mRoot
private

Definition at line 162 of file Decompiler.hpp.


The documentation for this class was generated from the following files: