00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef HAVE_CONFIG_H
00017 #include "torc/generic/config.h"
00018 #endif
00019
00020 #include "torc/generic/parser/EdifContext.hpp"
00021 #include "torc/generic/util/Log.hpp"
00022
00023 namespace torc {
00024 namespace generic {
00025
00026 void
00027 EdifContext::setRoot(
00028 const RootSharedPtr &inRoot ) throw() {
00029 mRoot = inRoot;
00030 }
00031
00032 void
00033 EdifContext::setLinker(
00034 const LinkerSharedPtr &inLinker ) throw() {
00035 mLinker = inLinker;
00036 }
00037
00038 void
00039 EdifContext::setCurrentLibrary(
00040 const LibrarySharedPtr &inLibrary ) throw() {
00041 mCurrentLibrary = inLibrary;
00042 }
00043
00044 void
00045 EdifContext::setCurrentDesign(
00046 const DesignSharedPtr &inDesign ) throw() {
00047 mCurrentDesign = inDesign;
00048 }
00049
00050 void
00051 EdifContext::setCurrentCell(
00052 const CellSharedPtr &inCell ) throw() {
00053 mCurrentCell = inCell;
00054 }
00055
00056 void
00057 EdifContext::setCurrentView(
00058 const ViewSharedPtr &inView ) throw() {
00059 mCurrentView = inView;
00060 }
00061
00062 void
00063 EdifContext::setCurrentInstance(
00064 const InstanceSharedPtr &inInstance ) throw() {
00065 mCurrentInstance = inInstance;
00066 }
00067
00068 void
00069 EdifContext::setCurrentPort(
00070 const PortSharedPtr &inPort ) throw() {
00071 mCurrentPort = inPort;
00072 }
00073
00074 void
00075 EdifContext::setCurrentPortRef(
00076 const PortReferenceSharedPtr &inPortRef ) throw() {
00077 mCurrentPortRef = inPortRef;
00078 }
00079
00080 void
00081 EdifContext::pushCurrentNet( const NetSharedPtr &inNet ) throw() {
00082 mNet.push( inNet );
00083 }
00084
00085 void
00086 EdifContext::setCurrentNet(
00087 const NetSharedPtr &inNet ) throw() {
00088 mCurrentNet = inNet;
00089 }
00090
00091 void
00092 EdifContext::popCurrentNet() throw() {
00093 assert( !mNet.empty() );
00094 mNet.pop();
00095 }
00096
00097 NetSharedPtr
00098 EdifContext::getCurrentNet() throw() {
00099 return ( !mNet.empty() )
00100 ? mNet.top() : NetSharedPtr();
00101 }
00102
00103 void
00104 EdifContext::setCurrentStatus(
00105 const StatusSharedPtr &inStatus ) throw() {
00106 mCurrentStatus = inStatus;
00107 }
00108
00109 void
00110 EdifContext::setCurrentWritten(
00111 const WrittenSharedPtr &inWritten ) throw() {
00112 mCurrentWritten = inWritten;
00113 }
00114
00115 void
00116 EdifContext::setCurrentSimulationInfo(
00117 const SimulationInfoSharedPtr &inSimulationInfo ) throw() {
00118 mCurrentSimulationInfo = inSimulationInfo;
00119 }
00120
00121 void
00122 EdifContext::setCurrentSimulate(
00123 const SimulateSharedPtr &inSimulate ) throw() {
00124 mCurrentSimulate = inSimulate;
00125 }
00126
00127 void
00128 EdifContext::setCurrentApply(
00129 const ApplySharedPtr &inApply ) throw() {
00130 mCurrentApply = inApply;
00131 }
00132
00133 void
00134 EdifContext::setCurrentLogicalResponse(
00135 const LogicalResponseSharedPtr &inLogicalResponse ) throw() {
00136 mCurrentLogicalResponse = inLogicalResponse;
00137 }
00138
00139 void
00140 EdifContext::setCurrentWaveValue(
00141 const WaveValueSharedPtr &inWaveValue ) throw() {
00142 mCurrentWaveValue = inWaveValue;
00143 }
00144
00145 void
00146 EdifContext::setCurrentLogicValue(
00147 const LogicValueSharedPtr &inLogicValue ) throw() {
00148 mCurrentLogicValue = inLogicValue;
00149 }
00150
00151 void
00152 EdifContext::setCurrentTiming(
00153 const TimingSharedPtr &inTiming ) throw() {
00154 mCurrentTiming = inTiming;
00155 }
00156
00157 void
00158 EdifContext::setCurrentPathDelay(
00159 const PathDelaySharedPtr &inPathDelay ) throw() {
00160 mCurrentPathDelay = inPathDelay;
00161 }
00162
00163 void
00164 EdifContext::setCurrentEvent(
00165 const EventSharedPtr &inEvent ) throw() {
00166 mCurrentEvent = inEvent;
00167 }
00168
00169 void
00170 EdifContext::setCurrentForbiddenEvent(
00171 const ForbiddenEventSharedPtr &inForbiddenEvent ) throw() {
00172 mCurrentForbiddenEvent = inForbiddenEvent;
00173 }
00174
00175 void
00176 EdifContext::pushStatusContainer(
00177 const StatusContainerSharedPtr &inStatusContainer
00178 ) throw() {
00179 mStatusContainer.push( inStatusContainer );
00180 }
00181
00182 void
00183 EdifContext::popStatusContainer() throw() {
00184 assert( !mStatusContainer.empty() );
00185 mStatusContainer.pop();
00186 }
00187
00188 StatusContainerSharedPtr
00189 EdifContext::getCurrentStatusContainer() const throw() {
00190 return ( !mStatusContainer.empty() )
00191 ? mStatusContainer.top()
00192 : StatusContainerSharedPtr();
00193 }
00194
00195 PortBundleSharedPtr
00196 EdifContext::getCurrentPortBundleContext() throw() {
00197 return ( !mPortBundleContext.empty() )
00198 ? mPortBundleContext.top()
00199 : PortBundleSharedPtr();
00200 }
00201
00202 void
00203 EdifContext::pushPortBundleContext(
00204 PortBundleSharedPtr inPortBundleContext ) throw() {
00205 mPortBundleContext.push( inPortBundleContext );
00206 }
00207
00208 void
00209 EdifContext::popPortBundleContext() throw() {
00210 assert( !mPortBundleContext.empty() );
00211 mPortBundleContext.pop();
00212 }
00213
00214 NetBundleSharedPtr
00215 EdifContext::getCurrentNetBundleContext() throw() {
00216 return ( !mNetBundleContext.empty() )
00217 ? mNetBundleContext.top()
00218 : NetBundleSharedPtr();
00219 }
00220
00221 void
00222 EdifContext::pushNetBundleContext(
00223 NetBundleSharedPtr inNetBundleContext ) throw() {
00224 mNetBundleContext.push( inNetBundleContext );
00225 }
00226
00227 void
00228 EdifContext::popNetBundleContext() throw() {
00229 assert( !mNetBundleContext.empty() );
00230 mNetBundleContext.pop();
00231 }
00232
00233 void
00234 EdifContext::setIsInInstance( bool inIsInInstance ) throw() {
00235 mIsInInstance = inIsInInstance;
00236 }
00237
00238 void
00239 EdifContext::setFactory(
00240 const ObjectFactorySharedPtr &inFactory) throw() {
00241 mFactory = inFactory;
00242 }
00243
00244 void
00245 EdifContext::setIsViewBeingLinked(
00246 bool inIsViewBeingLinked ) throw() {
00247 mIsViewBeingLinked = inIsViewBeingLinked;
00248 }
00249
00250 void
00251 EdifContext::pushProperty(
00252 const PropertySharedPtr &inProperty) throw() {
00253 mProperty.push( inProperty );
00254 }
00255
00256 void
00257 EdifContext::popProperty() throw() {
00258 assert( !mProperty.empty() );
00259 mProperty.pop();
00260 }
00261
00262 PropertySharedPtr
00263 EdifContext::getCurrentProperty() throw() {
00264 return ( !mProperty.empty() )
00265 ? mProperty.top() : PropertySharedPtr();
00266 }
00267
00268 void
00269 EdifContext::pushPropertyContainer(
00270 const PropertyContainerSharedPtr &inPropertyContainer
00271 ) throw() {
00272 mPropertyContainer.push( inPropertyContainer );
00273 }
00274
00275 void
00276 EdifContext::popPropertyContainer() throw() {
00277 assert( !mPropertyContainer.empty() );
00278 mPropertyContainer.pop();
00279 }
00280
00281 void
00282 EdifContext::incrementPropertyDepth() throw() {
00283 mPropertyDepth++;
00284 }
00285
00286 void
00287 EdifContext::decrementPropertyDepth() throw() {
00288 mPropertyDepth--;
00289 }
00290
00291 PropertyContainerSharedPtr
00292 EdifContext::getCurrentPropertyContainer() const throw() {
00293 return ( !mPropertyContainer.empty() )
00294 ? mPropertyContainer.top()
00295 : PropertyContainerSharedPtr();
00296 }
00297
00298
00299 void
00300 EdifContext::pushPermutable(
00301 const PermutableSharedPtr &inPermutable) throw() {
00302 mPermutable.push( inPermutable );
00303 }
00304
00305 void
00306 EdifContext::popPermutable() throw() {
00307 assert( !mPermutable.empty() );
00308 mPermutable.pop();
00309 }
00310
00311 PermutableSharedPtr
00312 EdifContext::getCurrentPermutable() throw() {
00313 return ( !mPermutable.empty() )
00314 ? mPermutable.top() : PermutableSharedPtr();
00315 }
00316
00317 void
00318 EdifContext::incrementPermutableDepth() throw() {
00319 mPermutableDepth++;
00320 }
00321
00322 void
00323 EdifContext::decrementPermutableDepth() throw() {
00324 mPermutableDepth--;
00325 }
00326
00327
00328 void
00329 EdifContext::pushInterfaceJoinedInfo(
00330 const InterfaceJoinedInfoSharedPtr &inInterfaceJoinedInfo) throw() {
00331 mInterfaceJoinedInfo.push( inInterfaceJoinedInfo );
00332 }
00333
00334 void
00335 EdifContext::popInterfaceJoinedInfo() throw() {
00336 assert( !mInterfaceJoinedInfo.empty() );
00337 mInterfaceJoinedInfo.pop();
00338 }
00339
00340 InterfaceJoinedInfoSharedPtr
00341 EdifContext::getCurrentInterfaceJoinedInfo() throw() {
00342 return ( !mInterfaceJoinedInfo.empty() )
00343 ? mInterfaceJoinedInfo.top() : InterfaceJoinedInfoSharedPtr();
00344 }
00345
00346 void
00347 EdifContext::incrementInterfaceJoinedInfoDepth() throw() {
00348 mInterfaceJoinedInfoDepth++;
00349 }
00350
00351 void
00352 EdifContext::decrementInterfaceJoinedInfoDepth() throw() {
00353 mInterfaceJoinedInfoDepth--;
00354 }
00355
00356
00357 void
00358 EdifContext::pushLogicElement(
00359 const LogicElementSharedPtr &inLogicElement) throw() {
00360 mLogicElement.push( inLogicElement );
00361 }
00362
00363 void
00364 EdifContext::popLogicElement() throw() {
00365 assert( !mLogicElement.empty() );
00366 mLogicElement.pop();
00367 }
00368
00369 LogicElementSharedPtr
00370 EdifContext::getCurrentLogicElement() throw() {
00371 return ( !mLogicElement.empty() )
00372 ? mLogicElement.top() : LogicElementSharedPtr();
00373 }
00374
00375 void
00376 EdifContext::incrementLogicElementDepth() throw() {
00377 mLogicElementDepth++;
00378 }
00379
00380 void
00381 EdifContext::decrementLogicElementDepth() throw() {
00382 mLogicElementDepth--;
00383 }
00384
00385 EdifContext::EdifContext( const RootSharedPtr &inRoot,
00386 const LinkerSharedPtr &inLinker,
00387 const ObjectFactorySharedPtr &inFactory,
00388 const ParserOptions &inOptions )
00389 :mRoot( inRoot ),
00390 mLinker( inLinker ),
00391 mFactory( inFactory ),
00392 mOptions( inOptions ),
00393 mCurrentLibrary(),
00394 mCurrentDesign(),
00395 mCurrentCell(),
00396 mCurrentView(),
00397 mCurrentInstance(),
00398 mCurrentPort(),
00399 mCurrentNet(),
00400 mCurrentStatus(),
00401 mCurrentWritten(),
00402 mStatusContainer(),
00403 mPortBundleContext(),
00404 mNetBundleContext(),
00405 mIsInInstance(),
00406 mIsViewBeingLinked( false ),
00407 mProperty(),
00408 mPropertyContainer(),
00409 mPropertyDepth(0),
00410 mPermutable(),
00411 mPermutableDepth(0),
00412 mInterfaceJoinedInfo(),
00413 mInterfaceJoinedInfoDepth(0),
00414 mCurrentSimulationInfo(),
00415 mCurrentSimulate(),
00416 mCurrentApply(),
00417 mCurrentLogicalResponse(),
00418 mCurrentWaveValue(),
00419 mCurrentLogicValue(),
00420 mCurrentTiming(),
00421 mCurrentEvent(),
00422 mCurrentForbiddenEvent(),
00423 mLogicElement(),
00424 mLogicElementDepth(0) {
00425 log("Context created\n");
00426 }
00427
00428 EdifContext::~EdifContext() throw() {
00429 log("Context destroyed\n");
00430 }
00431
00432 }
00433 }
00434