1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 66 unchanged lines hidden (view full) --- 75 sc_core::sc_module *_sc_mod; 76 Object *_obj; 77 bool _ended; 78 bool _deprecatedConstructor; 79 80 UniqueNameGen nameGen; 81 82 public: |
83 Module(const char *name); 84 ~Module(); 85 |
86 static Module * 87 fromScModule(::sc_core::sc_module *mod) 88 { 89 return mod->_gem5_module; 90 } 91 |
92 void finish(Object *this_obj); 93 94 const char *name() const { return _name; } 95 void endModule() { _ended = true; } 96 void deprecatedConstructor() { _deprecatedConstructor = true; } 97 98 sc_core::sc_module * 99 sc_mod() const --- 30 unchanged lines hidden (view full) --- 130 void startOfSimulation(); 131 void endOfSimulation(); 132}; 133 134Module *currentModule(); 135Module *newModuleChecked(); 136Module *newModule(); 137 |
138static inline Module * 139pickParentModule() 140{ 141 ::sc_core::sc_object *obj = pickParentObj(); 142 auto mod = dynamic_cast<::sc_core::sc_module *>(obj); 143 if (!mod) 144 return nullptr; 145 return Module::fromScModule(mod); 146} 147static inline void 148pushParentModule(Module *m) 149{ 150 pushParentObj(m->obj()->sc_obj()); 151} 152static inline void 153popParentModule() 154{ 155 assert(pickParentModule()); 156 popParentObj(); 157} |
158 159extern std::list<Module *> allModules; 160 161} // namespace sc_gem5 162 163#endif //__SYSTEMC_CORE_MODULE_HH__ |