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 9 * notice, this list of conditions and the following disclaimer in the 10 * documentation and/or other materials provided with the distribution; 11 * neither the name of the copyright holders nor the names of its 12 * contributors may be used to endorse or promote products derived from 13 * this software without specific prior written permission. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * 27 * Authors: Gabe Black 28 */ 29
|
30#include <vector> 31 |
32#include "base/logging.hh"
|
33#include "systemc/core/object.hh" |
34#include "systemc/ext/core/sc_object.hh" 35 36namespace sc_core 37{ 38
|
39namespace 40{ 41 42std::vector<sc_object *> top_level_objects; 43 44} // anonymous namespace 45 |
46const char * 47sc_object::name() const 48{
|
39 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
40 return "sc_object";
|
49 return _gem5_object->name(); |
50} 51 52const char * 53sc_object::basename() const 54{
|
46 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
47 return "sc_object";
|
55 return _gem5_object->basename(); |
56} 57
|
50const char *
51sc_object::kind() const
52{
53 return "sc_object";
54}
55
|
58void 59sc_object::print(std::ostream &out) const 60{
|
59 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
61 _gem5_object->print(out); |
62} 63 64void 65sc_object::dump(std::ostream &out) const 66{
|
65 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
67 _gem5_object->dump(out); |
68} 69 70const std::vector<sc_object *> & 71sc_object::get_child_objects() const 72{
|
71 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
72 return *(const std::vector<sc_object *> *)nullptr;
|
73 return _gem5_object->get_child_objects(); |
74} 75 76const std::vector<sc_event *> & 77sc_object::get_child_events() const 78{
|
78 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
79 return *(const std::vector<sc_event *> *)nullptr;
|
79 return _gem5_object->get_child_events(); |
80} 81 82sc_object * 83sc_object::get_parent_object() const 84{
|
85 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
86 return NULL;
|
85 return _gem5_object->get_parent_object(); |
86} 87 88bool
|
90sc_object::add_attribute(sc_attr_base &)
|
89sc_object::add_attribute(sc_attr_base &attr) |
90{
|
92 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
93 return false;
|
91 return _gem5_object->add_attribute(attr); |
92} 93 94sc_attr_base *
|
97sc_object::get_attribute(const std::string &)
|
95sc_object::get_attribute(const std::string &name) |
96{
|
99 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
100 return NULL;
|
97 return _gem5_object->get_attribute(name); |
98} 99 100sc_attr_base *
|
104sc_object::remove_attribute(const std::string &)
|
101sc_object::remove_attribute(const std::string &name) |
102{
|
106 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
107 return NULL;
|
103 return _gem5_object->remove_attribute(name); |
104} 105 106void 107sc_object::remove_all_attributes() 108{
|
113 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
109 return _gem5_object->remove_all_attributes(); |
110} 111 112int 113sc_object::num_attributes() const 114{
|
119 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
120 return 0;
|
115 return _gem5_object->num_attributes(); |
116} 117 118sc_attr_cltn & 119sc_object::attr_cltn() 120{
|
126 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
127 return *(sc_attr_cltn *)NULL;
|
121 return _gem5_object->attr_cltn(); |
122} 123 124const sc_attr_cltn & 125sc_object::attr_cltn() const 126{
|
133 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
134 return *(sc_attr_cltn *)NULL;
|
127 return _gem5_object->attr_cltn(); |
128} 129 130sc_simcontext * 131sc_object::simcontext() const 132{
|
140 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
141 return nullptr;
|
133 return _gem5_object->simcontext(); |
134} 135 136sc_object::sc_object() 137{
|
146 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
138 _gem5_object = new sc_gem5::Object(this); |
139} 140 141sc_object::sc_object(const char *name) 142{
|
151 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
143 _gem5_object = new sc_gem5::Object(this, name); |
144} 145
|
154sc_object::sc_object(const sc_object &arg)
|
146sc_object::sc_object(const sc_object &other) |
147{
|
156 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
148 _gem5_object = new sc_gem5::Object(this, *other._gem5_object); |
149} 150 151sc_object &
|
160sc_object::operator = (const sc_object &)
|
152sc_object::operator = (const sc_object &other) |
153{
|
154 *_gem5_object = *other._gem5_object; |
155 return *this; 156} 157 158sc_object::~sc_object() 159{
|
167 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
160 delete _gem5_object; |
161} 162 163const std::vector<sc_object *> & 164sc_get_top_level_objects() 165{
|
173 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
174 return *(const std::vector<sc_object *> *)nullptr;
|
166 return sc_gem5::topLevelObjects; |
167} 168 169sc_object *
|
178sc_find_object(const char *)
|
170sc_find_object(const char *name) |
171{
|
180 warn("%s not implemented.\n", __PRETTY_FUNCTION__);
181 return NULL;
|
172 return sc_gem5::findObject(name); |
173} 174 175} // namespace sc_core
|