sc_prim.cc (13238:3521d1f59c22) | sc_prim.cc (13283:362061d5b968) |
---|---|
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 --- 34 unchanged lines hidden (view full) --- 43namespace sc_core 44{ 45 46sc_prim_channel::sc_prim_channel() : _gem5_channel(nullptr) 47{ 48 if (sc_is_running()) { 49 SC_REPORT_ERROR("(E113) insert primitive channel failed", 50 "simulation running"); | 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 --- 34 unchanged lines hidden (view full) --- 43namespace sc_core 44{ 45 46sc_prim_channel::sc_prim_channel() : _gem5_channel(nullptr) 47{ 48 if (sc_is_running()) { 49 SC_REPORT_ERROR("(E113) insert primitive channel failed", 50 "simulation running"); |
51 } else if (::sc_gem5::scheduler.elaborationDone()) { | 51 } 52 if (::sc_gem5::scheduler.elaborationDone()) { |
52 SC_REPORT_ERROR("(E113) insert primitive channel failed", 53 "elaboration done"); | 53 SC_REPORT_ERROR("(E113) insert primitive channel failed", 54 "elaboration done"); |
54 } else { 55 _gem5_channel = new sc_gem5::Channel(this); | |
56 } | 55 } |
56 _gem5_channel = new sc_gem5::Channel(this); |
|
57} 58 59sc_prim_channel::sc_prim_channel(const char *_name) : 60 sc_object(_name), _gem5_channel(nullptr) 61{ 62 if (sc_is_running()) { 63 SC_REPORT_ERROR("(E113) insert primitive channel failed", 64 "simulation running"); | 57} 58 59sc_prim_channel::sc_prim_channel(const char *_name) : 60 sc_object(_name), _gem5_channel(nullptr) 61{ 62 if (sc_is_running()) { 63 SC_REPORT_ERROR("(E113) insert primitive channel failed", 64 "simulation running"); |
65 } else if (::sc_gem5::scheduler.elaborationDone()) { | 65 } 66 if (::sc_gem5::scheduler.elaborationDone()) { |
66 SC_REPORT_ERROR("(E113) insert primitive channel failed", 67 "elaboration done"); | 67 SC_REPORT_ERROR("(E113) insert primitive channel failed", 68 "elaboration done"); |
68 } else { 69 _gem5_channel = new sc_gem5::Channel(this); | |
70 } | 69 } |
70 _gem5_channel = new sc_gem5::Channel(this); |
|
71} 72 73sc_prim_channel::~sc_prim_channel() { delete _gem5_channel; } 74 75void 76sc_prim_channel::request_update() 77{ 78 _gem5_channel->requestUpdate(); --- 167 unchanged lines hidden --- | 71} 72 73sc_prim_channel::~sc_prim_channel() { delete _gem5_channel; } 74 75void 76sc_prim_channel::request_update() 77{ 78 _gem5_channel->requestUpdate(); --- 167 unchanged lines hidden --- |