00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TORC_GENERIC_PARSER_EDIFCONTEXT_HPP
00017 #define TORC_GENERIC_PARSER_EDIFCONTEXT_HPP
00018
00019 #include "torc/generic/om/PointerTypes.hpp"
00020 #include "torc/generic/parser/ParserPointerTypes.hpp"
00021 #include <stack>
00022
00023
00024 #include <boost/shared_ptr.hpp>
00025
00026 namespace torc { namespace generic { class Cell; } }
00027 namespace torc { namespace generic { class Design; } }
00028 namespace torc { namespace generic { class Instance; } }
00029 namespace torc { namespace generic { class Library; } }
00030 namespace torc { namespace generic { class Linker; } }
00031 namespace torc { namespace generic { class Net; } }
00032 namespace torc { namespace generic { class NetBundle; } }
00033 namespace torc { namespace generic { class ObjectFactory; } }
00034 namespace torc { namespace generic { class ParserOptions; } }
00035 namespace torc { namespace generic { class Port; } }
00036 namespace torc { namespace generic { class PortReference; } }
00037 namespace torc { namespace generic { class PortBundle; } }
00038 namespace torc { namespace generic { class Property; } }
00039 namespace torc { namespace generic { class PropertyContainer; } }
00040 namespace torc { namespace generic { class Root; } }
00041 namespace torc { namespace generic { class View; } }
00042 namespace torc { namespace generic { class Instance; } }
00043 namespace torc { namespace generic { class Status; } }
00044 namespace torc { namespace generic { class StatusContainer; } }
00045 namespace torc { namespace generic { class Permutable; } }
00046 namespace torc { namespace generic { class InterfaceJoinedInfo; } }
00047 namespace torc { namespace generic { class SimulationInfo; } }
00048 namespace torc { namespace generic { class Simulate; } }
00049 namespace torc { namespace generic { class LogicValue; } }
00050 namespace torc { namespace generic { class Apply; } }
00051 namespace torc { namespace generic { class LogicalResponse; } }
00052 namespace torc { namespace generic { class LogicElement; } }
00053 namespace torc { namespace generic { class WaveValue; } }
00054 namespace torc { namespace generic { class Timing; } }
00055 namespace torc { namespace generic { class PathDelay; } }
00056 namespace torc { namespace generic { class Event; } }
00057 namespace torc { namespace generic { class ForbiddenEvent; } }
00058
00059 namespace torc {
00060 namespace generic {
00061
00062 class EdifContext {
00063 public:
00064 inline RootSharedPtr
00065 getRoot() const throw();
00066
00067 void
00068 setRoot( const RootSharedPtr &inRoot ) throw();
00069
00070 inline LinkerSharedPtr
00071 getLinker() const throw();
00072
00073 void
00074 setLinker( const LinkerSharedPtr &inLinker ) throw();
00075
00076 inline LibrarySharedPtr
00077 getCurrentLibrary() const throw();
00078
00079 void
00080 setCurrentLibrary(
00081 const LibrarySharedPtr &inLibrary ) throw();
00082
00083 inline CellSharedPtr
00084 getCurrentCell() const throw();
00085
00086 void
00087 setCurrentCell( const CellSharedPtr &inCell ) throw();
00088
00089 inline DesignSharedPtr
00090 getCurrentDesign() const throw();
00091
00092 void
00093 setCurrentDesign( const DesignSharedPtr &inDesign ) throw();
00094
00095 inline ViewSharedPtr
00096 getCurrentView() const throw();
00097
00098 void
00099 setCurrentView( const ViewSharedPtr &inView ) throw();
00100
00101
00102 inline InstanceSharedPtr
00103 getCurrentInstance() const throw();
00104
00105 void
00106 setCurrentInstance( const InstanceSharedPtr &inInstance ) throw();
00107
00108
00109 inline PortSharedPtr
00110 getCurrentPort() const throw();
00111
00112 void
00113 setCurrentPort( const PortSharedPtr &inPort ) throw();
00114
00115 inline PortReferenceSharedPtr
00116 getCurrentPortRef() const throw();
00117
00118 void
00119 setCurrentPortRef(
00120 const PortReferenceSharedPtr &inPortRef ) throw();
00121
00122 void
00123 pushCurrentNet( const NetSharedPtr &inNet ) throw();
00124
00125 NetSharedPtr
00126 getCurrentNet() throw();
00127
00128 void
00129 popCurrentNet() throw();
00130
00131 void
00132 setCurrentNet( const NetSharedPtr &inNet ) throw();
00133
00134 inline StatusSharedPtr
00135 getCurrentStatus() const throw();
00136
00137 void
00138 setCurrentStatus( const StatusSharedPtr &inStatus ) throw();
00139
00140 inline WrittenSharedPtr
00141 getCurrentWritten() const throw();
00142
00143 void
00144 setCurrentWritten( const WrittenSharedPtr &inWritten ) throw();
00145
00146
00147 inline SimulationInfoSharedPtr
00148 getCurrentSimulationInfo() const throw();
00149
00150 void
00151 setCurrentSimulationInfo( const SimulationInfoSharedPtr &inSimulationInfo ) throw();
00152
00153
00154 inline SimulateSharedPtr
00155 getCurrentSimulate() const throw();
00156
00157 void
00158 setCurrentSimulate( const SimulateSharedPtr &inSimulate ) throw();
00159
00160
00161 inline ApplySharedPtr
00162 getCurrentApply() const throw();
00163
00164 void
00165 setCurrentApply( const ApplySharedPtr &inApply ) throw();
00166
00167
00168 inline LogicalResponseSharedPtr
00169 getCurrentLogicalResponse() const throw();
00170
00171 void
00172 setCurrentLogicalResponse( const LogicalResponseSharedPtr & inLogicalResponse ) throw();
00173
00174
00175 inline WaveValueSharedPtr
00176 getCurrentWaveValue() const throw();
00177
00178 void
00179 setCurrentWaveValue( const WaveValueSharedPtr & inWaveValue ) throw();
00180
00181
00182
00183 inline LogicValueSharedPtr
00184 getCurrentLogicValue() const throw();
00185
00186 void
00187 setCurrentLogicValue( const LogicValueSharedPtr &inLogicValue ) throw();
00188
00189
00190 inline TimingSharedPtr
00191 getCurrentTiming() const throw();
00192
00193 void
00194 setCurrentTiming( const TimingSharedPtr &inTiming ) throw();
00195
00196
00197 inline PathDelaySharedPtr
00198 getCurrentPathDelay() const throw();
00199
00200 void
00201 setCurrentPathDelay( const PathDelaySharedPtr &inPathDelay ) throw();
00202
00203
00204 inline EventSharedPtr
00205 getCurrentEvent() const throw();
00206
00207 void
00208 setCurrentEvent( const EventSharedPtr &inEvent ) throw();
00209
00210
00211 inline ForbiddenEventSharedPtr
00212 getCurrentForbiddenEvent() const throw();
00213
00214 void
00215 setCurrentForbiddenEvent( const ForbiddenEventSharedPtr &inForbiddenEvent ) throw();
00216
00217 void
00218 popStatusContainer() throw();
00219
00220 void
00221 pushStatusContainer(
00222 const StatusContainerSharedPtr &inStatusContainer ) throw();
00223
00224 StatusContainerSharedPtr
00225 getCurrentStatusContainer() const throw();
00226
00227 PortBundleSharedPtr
00228 getCurrentPortBundleContext() throw();
00229
00230 void
00231 pushPortBundleContext( PortBundleSharedPtr inPortBundleContext ) throw();
00232
00233 void
00234 popPortBundleContext() throw();
00235
00236 NetBundleSharedPtr
00237 getCurrentNetBundleContext() throw();
00238
00239 void
00240 pushNetBundleContext( NetBundleSharedPtr inNetBundleContext ) throw();
00241
00242 void
00243 popNetBundleContext() throw();
00244
00245 inline bool
00246 getIsInInstance() const throw();
00247
00248 void
00249 setIsInInstance( bool inIsInInstance ) throw();
00250
00251 inline const ParserOptions &
00252 getOptions() const throw();
00253
00254 inline ObjectFactorySharedPtr
00255 getFactory() const throw();
00256
00257 void
00258 setFactory(
00259 const ObjectFactorySharedPtr &inFactory) throw();
00260
00261 inline bool
00262 getIsViewBeingLinked() const throw();
00263
00264 void
00265 setIsViewBeingLinked( bool inIsViewBeingLinked ) throw();
00266
00267 void
00268 pushProperty(
00269 const PropertySharedPtr &inProperty) throw();
00270
00271 void
00272 popProperty() throw();
00273
00274 PropertySharedPtr
00275 getCurrentProperty() throw();
00276
00277 void
00278 popPropertyContainer() throw();
00279
00280 void
00281 pushPropertyContainer(
00282 const PropertyContainerSharedPtr &inPropertyContainer ) throw();
00283
00284 PropertyContainerSharedPtr
00285 getCurrentPropertyContainer() const throw();
00286
00287 inline int32_t
00288 getPropertyDepth() const throw();
00289
00290 void
00291 incrementPropertyDepth() throw();
00292
00293 void
00294 decrementPropertyDepth() throw();
00295
00296
00297 void
00298 pushPermutable(
00299 const PermutableSharedPtr &inPermutable) throw();
00300
00301 void
00302 popPermutable() throw();
00303
00304 PermutableSharedPtr
00305 getCurrentPermutable() throw();
00306
00307 inline int32_t
00308 getPermutableDepth() const throw();
00309
00310 void
00311 incrementPermutableDepth() throw();
00312
00313 void
00314 decrementPermutableDepth() throw();
00315
00316
00317 void
00318 pushInterfaceJoinedInfo(
00319 const InterfaceJoinedInfoSharedPtr &inInterfaceJoinedInfo) throw();
00320
00321 void
00322 popInterfaceJoinedInfo() throw();
00323
00324 InterfaceJoinedInfoSharedPtr
00325 getCurrentInterfaceJoinedInfo() throw();
00326
00327 inline int32_t
00328 getInterfaceJoinedInfoDepth() const throw();
00329
00330 void
00331 incrementInterfaceJoinedInfoDepth() throw();
00332
00333 void
00334 decrementInterfaceJoinedInfoDepth() throw();
00335
00336
00337 void
00338 pushLogicElement(
00339 const LogicElementSharedPtr &inLogicElement) throw();
00340
00341 void
00342 popLogicElement() throw();
00343
00344 LogicElementSharedPtr
00345 getCurrentLogicElement() throw();
00346
00347 inline int32_t
00348 getLogicElementDepth() const throw();
00349
00350 void
00351 incrementLogicElementDepth() throw();
00352
00353 void
00354 decrementLogicElementDepth() throw();
00355
00356 EdifContext( const RootSharedPtr &inRoot,
00357 const LinkerSharedPtr &inLinker,
00358 const ObjectFactorySharedPtr &inFactory,
00359 const ParserOptions &inOptions );
00360 ~EdifContext() throw();
00361
00362 private:
00363 RootSharedPtr mRoot;
00364 LinkerSharedPtr mLinker;
00365 ObjectFactorySharedPtr mFactory;
00366 const ParserOptions &mOptions;
00367 LibrarySharedPtr mCurrentLibrary;
00368 DesignSharedPtr mCurrentDesign;
00369 CellSharedPtr mCurrentCell;
00370 ViewSharedPtr mCurrentView;
00371 InstanceSharedPtr mCurrentInstance;
00372 PortSharedPtr mCurrentPort;
00373 PortReferenceSharedPtr mCurrentPortRef;
00374 NetSharedPtr mCurrentNet;
00375 StatusSharedPtr mCurrentStatus;
00376 WrittenSharedPtr mCurrentWritten;
00377 std::stack< StatusContainerSharedPtr > mStatusContainer;
00378 std::stack< PortBundleSharedPtr > mPortBundleContext;
00379 std::stack< NetBundleSharedPtr > mNetBundleContext;
00380 bool mIsInInstance;
00381 bool mIsViewBeingLinked;
00382 std::stack< PropertySharedPtr > mProperty;
00383 std::stack< PropertyContainerSharedPtr > mPropertyContainer;
00384 std::stack< NetSharedPtr > mNet;
00385 int32_t mPropertyDepth;
00386 std::stack< PermutableSharedPtr > mPermutable;
00387 int32_t mPermutableDepth;
00388 std::stack< InterfaceJoinedInfoSharedPtr > mInterfaceJoinedInfo;
00389 int32_t mInterfaceJoinedInfoDepth;
00390 SimulationInfoSharedPtr mCurrentSimulationInfo;
00391 SimulateSharedPtr mCurrentSimulate;
00392 ApplySharedPtr mCurrentApply;
00393 LogicalResponseSharedPtr mCurrentLogicalResponse;
00394 WaveValueSharedPtr mCurrentWaveValue;
00395 LogicValueSharedPtr mCurrentLogicValue;
00396 TimingSharedPtr mCurrentTiming;
00397 PathDelaySharedPtr mCurrentPathDelay;
00398 EventSharedPtr mCurrentEvent;
00399 ForbiddenEventSharedPtr mCurrentForbiddenEvent;
00400 std::stack< LogicElementSharedPtr > mLogicElement;
00401 int32_t mLogicElementDepth;
00402 };
00403
00404 inline RootSharedPtr
00405 EdifContext::getRoot() const throw() {
00406 return mRoot;
00407 }
00408
00409 inline LinkerSharedPtr
00410 EdifContext::getLinker() const throw() {
00411 return mLinker;
00412 }
00413
00414 inline LibrarySharedPtr
00415 EdifContext::getCurrentLibrary() const throw() {
00416 return mCurrentLibrary;
00417 }
00418
00419 inline DesignSharedPtr
00420 EdifContext::getCurrentDesign() const throw() {
00421 return mCurrentDesign;
00422 }
00423
00424 inline CellSharedPtr
00425 EdifContext::getCurrentCell() const throw() {
00426 return mCurrentCell;
00427 }
00428
00429 inline ViewSharedPtr
00430 EdifContext::getCurrentView() const throw() {
00431 return mCurrentView;
00432 }
00433
00434 inline InstanceSharedPtr
00435 EdifContext::getCurrentInstance() const throw() {
00436 return mCurrentInstance;
00437 }
00438
00439 inline PortSharedPtr
00440 EdifContext::getCurrentPort() const throw() {
00441 return mCurrentPort;
00442 }
00443
00444 inline PortReferenceSharedPtr
00445 EdifContext::getCurrentPortRef() const throw() {
00446 return mCurrentPortRef;
00447 }
00448
00449 inline bool
00450 EdifContext::getIsInInstance() const throw() {
00451 return mIsInInstance;
00452 }
00453
00454 inline StatusSharedPtr
00455 EdifContext::getCurrentStatus() const throw() {
00456 return mCurrentStatus;
00457 }
00458
00459 inline WrittenSharedPtr
00460 EdifContext::getCurrentWritten() const throw() {
00461 return mCurrentWritten;
00462 }
00463
00464 inline SimulationInfoSharedPtr
00465 EdifContext::getCurrentSimulationInfo() const throw() {
00466 return mCurrentSimulationInfo;
00467 }
00468
00469 inline SimulateSharedPtr
00470 EdifContext::getCurrentSimulate() const throw() {
00471 return mCurrentSimulate;
00472 }
00473
00474 inline ApplySharedPtr
00475 EdifContext::getCurrentApply() const throw() {
00476 return mCurrentApply;
00477 }
00478
00479 inline LogicalResponseSharedPtr
00480 EdifContext::getCurrentLogicalResponse() const throw() {
00481 return mCurrentLogicalResponse;
00482 }
00483
00484 inline WaveValueSharedPtr
00485 EdifContext::getCurrentWaveValue() const throw() {
00486 return mCurrentWaveValue;
00487 }
00488
00489 inline LogicValueSharedPtr
00490 EdifContext::getCurrentLogicValue() const throw() {
00491 return mCurrentLogicValue;
00492 }
00493
00494 inline TimingSharedPtr
00495 EdifContext::getCurrentTiming() const throw() {
00496 return mCurrentTiming;
00497 }
00498
00499 inline PathDelaySharedPtr
00500 EdifContext::getCurrentPathDelay() const throw() {
00501 return mCurrentPathDelay;
00502 }
00503
00504 inline EventSharedPtr
00505 EdifContext::getCurrentEvent() const throw() {
00506 return mCurrentEvent;
00507 }
00508
00509 inline ForbiddenEventSharedPtr
00510 EdifContext::getCurrentForbiddenEvent() const throw() {
00511 return mCurrentForbiddenEvent;
00512 }
00513
00514 inline const ParserOptions &
00515 EdifContext::getOptions() const throw() {
00516 return mOptions;
00517 }
00518
00519 inline ObjectFactorySharedPtr
00520 EdifContext::getFactory() const throw() {
00521 return mFactory;
00522 }
00523
00524 inline bool
00525 EdifContext::getIsViewBeingLinked() const throw() {
00526 return mIsViewBeingLinked;
00527 }
00528
00529
00530 inline int32_t
00531 EdifContext::getPropertyDepth() const throw() {
00532 return mPropertyDepth;
00533 }
00534
00535 inline int32_t
00536 EdifContext::getPermutableDepth() const throw() {
00537 return mPermutableDepth;
00538 }
00539
00540 inline int32_t
00541 EdifContext::getInterfaceJoinedInfoDepth() const throw() {
00542 return mInterfaceJoinedInfoDepth;
00543 }
00544
00545 inline int32_t
00546 EdifContext::getLogicElementDepth() const throw() {
00547 return mLogicElementDepth;
00548 }
00549
00550 }
00551 }
00552
00553 #endif // TORC_GENERIC_PARSER_EDIFCONTEXT_HPP