diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/systemc/core/sc_port.cc | 3 | ||||
-rw-r--r-- | src/systemc/core/sc_prim.cc | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/systemc/core/sc_port.cc b/src/systemc/core/sc_port.cc index 3a31e411d..50a67a3b6 100644 --- a/src/systemc/core/sc_port.cc +++ b/src/systemc/core/sc_port.cc @@ -56,7 +56,7 @@ reportError(const char *id, const char *add_msg, } sc_port_base::sc_port_base(const char *n, int max_size, sc_port_policy p) : - sc_object(n), _gem5Port(new ::sc_gem5::Port(this, max_size)) + sc_object(n), _gem5Port(nullptr) { if (sc_is_running()) { reportError("(E110) insert port failed", "simulation running", @@ -74,6 +74,7 @@ sc_port_base::sc_port_base(const char *n, int max_size, sc_port_policy p) : } else { m->ports.push_back(this); } + _gem5Port = new ::sc_gem5::Port(this, max_size); } sc_port_base::~sc_port_base() diff --git a/src/systemc/core/sc_prim.cc b/src/systemc/core/sc_prim.cc index 216bd78f9..099e5d8bf 100644 --- a/src/systemc/core/sc_prim.cc +++ b/src/systemc/core/sc_prim.cc @@ -48,12 +48,12 @@ sc_prim_channel::sc_prim_channel() : _gem5_channel(nullptr) if (sc_is_running()) { SC_REPORT_ERROR("(E113) insert primitive channel failed", "simulation running"); - } else if (::sc_gem5::scheduler.elaborationDone()) { + } + if (::sc_gem5::scheduler.elaborationDone()) { SC_REPORT_ERROR("(E113) insert primitive channel failed", "elaboration done"); - } else { - _gem5_channel = new sc_gem5::Channel(this); } + _gem5_channel = new sc_gem5::Channel(this); } sc_prim_channel::sc_prim_channel(const char *_name) : @@ -62,12 +62,12 @@ sc_prim_channel::sc_prim_channel(const char *_name) : if (sc_is_running()) { SC_REPORT_ERROR("(E113) insert primitive channel failed", "simulation running"); - } else if (::sc_gem5::scheduler.elaborationDone()) { + } + if (::sc_gem5::scheduler.elaborationDone()) { SC_REPORT_ERROR("(E113) insert primitive channel failed", "elaboration done"); - } else { - _gem5_channel = new sc_gem5::Channel(this); } + _gem5_channel = new sc_gem5::Channel(this); } sc_prim_channel::~sc_prim_channel() { delete _gem5_channel; } |