diff options
Diffstat (limited to 'src/systemc/core')
-rw-r--r-- | src/systemc/core/SConscript | 46 | ||||
-rw-r--r-- | src/systemc/core/SystemC.py | 63 | ||||
-rw-r--r-- | src/systemc/core/kernel.cc | 45 | ||||
-rw-r--r-- | src/systemc/core/kernel.hh | 55 | ||||
-rw-r--r-- | src/systemc/core/sc_attr.cc | 92 | ||||
-rw-r--r-- | src/systemc/core/sc_event.cc | 322 | ||||
-rw-r--r-- | src/systemc/core/sc_export.cc | 42 | ||||
-rw-r--r-- | src/systemc/core/sc_interface.cc | 59 | ||||
-rw-r--r-- | src/systemc/core/sc_main.cc | 124 | ||||
-rw-r--r-- | src/systemc/core/sc_module.cc | 542 | ||||
-rw-r--r-- | src/systemc/core/sc_module_name.cc | 59 | ||||
-rw-r--r-- | src/systemc/core/sc_object.cc | 177 | ||||
-rw-r--r-- | src/systemc/core/sc_port.cc | 42 | ||||
-rw-r--r-- | src/systemc/core/sc_prim.cc | 215 | ||||
-rw-r--r-- | src/systemc/core/sc_sensitive.cc | 64 | ||||
-rw-r--r-- | src/systemc/core/sc_time.cc | 232 |
16 files changed, 2179 insertions, 0 deletions
diff --git a/src/systemc/core/SConscript b/src/systemc/core/SConscript new file mode 100644 index 000000000..a94eb0012 --- /dev/null +++ b/src/systemc/core/SConscript @@ -0,0 +1,46 @@ +# Copyright 2018 Google, Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Gabe Black + +Import('*') + +if env['USE_SYSTEMC']: + SimObject('SystemC.py') + + Source('kernel.cc') + + Source('sc_attr.cc') + Source('sc_event.cc') + Source('sc_export.cc') + Source('sc_interface.cc') + Source('sc_main.cc') + Source('sc_module.cc') + Source('sc_module_name.cc') + Source('sc_object.cc') + Source('sc_port.cc') + Source('sc_prim.cc') + Source('sc_sensitive.cc') + Source('sc_time.cc') diff --git a/src/systemc/core/SystemC.py b/src/systemc/core/SystemC.py new file mode 100644 index 000000000..41fecb2c2 --- /dev/null +++ b/src/systemc/core/SystemC.py @@ -0,0 +1,63 @@ +# Copyright 2018 Google, Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Gabe Black + +from m5.SimObject import SimObject + +# This class represents the systemc kernel. There should be exactly one in the +# simulation. It receives gem5 SimObject lifecycle callbacks (init, regStats, +# etc.) and manages the lifecycle of the systemc simulation accordingly. +# It also acts as a collecting point for systemc related control functionality. +class SystemC_Kernel(SimObject): + type = 'SystemC_Kernel' + cxx_class = 'SystemC::Kernel' + cxx_header = 'systemc/core/kernel.hh' + + def sc_main(self, *args): + '''Call the systemc sc_main function with the given string args''' + from _m5.systemc import sc_main + sc_main(*args) + +# This class represents systemc sc_object instances in python config files. It +# inherits from SimObject in python, but the c++ version, sc_core::sc_object, +# doesn't inherit from gem5's c++ SimObject class. +class SystemC_ScObject(SimObject): + type = 'SystemC_ScObject' + abstract = True + cxx_class = 'sc_core::sc_object' + cxx_header = 'systemc/ext/core/sc_object.hh' + + # Clear cxx_base to stop the c++ binding code from assuming + # sc_core::sc_object inherits from SimObject, even though SystemC_ScObject + # does on the python side. + cxx_base = None + + # Hide the cxx_exports from SimObject since we don't inherit from + # SimObject on the c++ side and so don't have those methods to call down + # into. + locals().update({ + method.name: (lambda *a, **k: None) for method in SimObject.cxx_exports + }) diff --git a/src/systemc/core/kernel.cc b/src/systemc/core/kernel.cc new file mode 100644 index 000000000..288a037cc --- /dev/null +++ b/src/systemc/core/kernel.cc @@ -0,0 +1,45 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "systemc/core/kernel.hh" + +namespace SystemC +{ + +Kernel::Kernel(Params *params) : SimObject(params) +{ +} + +} // namespace SystemC + +SystemC::Kernel * +SystemC_KernelParams::create() +{ + return new SystemC::Kernel(this); +} diff --git a/src/systemc/core/kernel.hh b/src/systemc/core/kernel.hh new file mode 100644 index 000000000..9a81d9db4 --- /dev/null +++ b/src/systemc/core/kernel.hh @@ -0,0 +1,55 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#ifndef __SYSTEMC_KERNEL_HH__ +#define __SYSTEMC_KERNEL_HH__ + +#include "params/SystemC_Kernel.hh" +#include "sim/sim_object.hh" + +namespace SystemC +{ + +/* + * This class represents the systemc kernel. There should be exactly one in + * the simulation. It receives gem5 SimObject lifecycle callbacks (init, + * regStats, etc.) and manages the lifecycle of the systemc simulation + * accordingly. It also acts as a collecting point for systemc related + * control functionality. + */ +class Kernel : public SimObject +{ + public: + typedef SystemC_KernelParams Params; + Kernel(Params *params); +}; + +} // namespace SystemC + +#endif // __SYSTEMC_KERNEL_H__ diff --git a/src/systemc/core/sc_attr.cc b/src/systemc/core/sc_attr.cc new file mode 100644 index 000000000..28e0b6010 --- /dev/null +++ b/src/systemc/core/sc_attr.cc @@ -0,0 +1,92 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "base/logging.hh" +#include "systemc/ext/core/sc_attr.hh" + +namespace sc_core +{ + +sc_attr_base::sc_attr_base(const std::string &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_attr_base::sc_attr_base(const sc_attr_base &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_attr_base::~sc_attr_base() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const std::string & +sc_attr_base::name() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const std::string *)nullptr; +} + +void +sc_attr_base::warn_unimpl(const char *func) +{ + warn("%s not implemented.\n", func); +} + +sc_attr_cltn::iterator +sc_attr_cltn::begin() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return (iterator)nullptr; +} + +sc_attr_cltn::const_iterator +sc_attr_cltn::begin() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return (const_iterator)nullptr; +} + +sc_attr_cltn::iterator +sc_attr_cltn::end() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return (iterator)nullptr; +} + +sc_attr_cltn::const_iterator +sc_attr_cltn::end() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return (const_iterator)nullptr; +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_event.cc b/src/systemc/core/sc_event.cc new file mode 100644 index 000000000..0cdab2a50 --- /dev/null +++ b/src/systemc/core/sc_event.cc @@ -0,0 +1,322 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "base/logging.hh" +#include "systemc/ext/core/sc_event.hh" + +namespace sc_core +{ + +void +sc_event_finder::warn_unimpl(const char *func) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event_and_list::sc_event_and_list() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event_and_list::sc_event_and_list(const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event_and_list::sc_event_and_list(const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event_and_list & +sc_event_and_list::operator = (const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +int +sc_event_and_list::size() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +void +sc_event_and_list::swap(sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event_and_list & +sc_event_and_list::operator &= (const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_event_and_list & +sc_event_and_list::operator &= (const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_event_and_expr +sc_event_and_list::operator & (const sc_event &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_event_and_expr(); +} + +sc_event_and_expr +sc_event_and_list::operator & (const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_event_and_expr(); +} + +sc_event_or_list::sc_event_or_list() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event_or_list::sc_event_or_list(const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event_or_list::sc_event_or_list(const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event_or_list& +sc_event_or_list::operator = (const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_event_or_list::~sc_event_or_list() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +int +sc_event_or_list::size() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +void +sc_event_or_list::swap(sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event_or_list & +sc_event_or_list::operator |= (const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_event_or_list & +sc_event_or_list::operator |= (const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_event_or_expr +sc_event_or_list::operator | (const sc_event &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_event_or_expr(); +} + +sc_event_or_expr +sc_event_or_list::operator | (const sc_event_or_list &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_event_or_expr(); +} + +sc_event_and_expr::operator const sc_event_and_list &() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const sc_event_and_list *)nullptr; +} + +sc_event_and_expr +operator & (sc_event_and_expr expr, sc_event const &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return expr; +} + +sc_event_and_expr +operator & (sc_event_and_expr expr, sc_event_and_list const &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return expr; +} + +sc_event_or_expr::operator const sc_event_or_list &() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const sc_event_or_list *)nullptr; +} + +sc_event_or_expr +operator | (sc_event_or_expr expr, sc_event const &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return expr; +} + +sc_event_or_expr +operator | (sc_event_or_expr expr, sc_event_or_list const &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return expr; +} + +sc_event::sc_event() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event::sc_event(const char *) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event::~sc_event() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const char * +sc_event::name() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return ""; +} + +const char * +sc_event::basename() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return ""; +} + +bool +sc_event::in_hierarchy() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return false; +} + +sc_object * +sc_event::get_parent_object() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return (sc_object *)nullptr; +} + +void +sc_event::notify() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_event::notify(const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_event::notify(double, sc_time_unit) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_event::cancel() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_event_and_expr +sc_event::operator & (const sc_event &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_event_and_expr(); +} + +sc_event_and_expr +sc_event::operator & (const sc_event_and_list &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_event_and_expr(); +} + +sc_event_or_expr +sc_event::operator | (const sc_event &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_event_or_expr(); +} + +sc_event_or_expr +sc_event::operator | (const sc_event_or_list &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_event_or_expr(); +} + +const std::vector<sc_event *> & +sc_get_top_level_events() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const std::vector<sc_event *> *)nullptr; +} + +sc_event * +sc_find_event(const char *) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return (sc_event *)nullptr; +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_export.cc b/src/systemc/core/sc_export.cc new file mode 100644 index 000000000..387b8a7fd --- /dev/null +++ b/src/systemc/core/sc_export.cc @@ -0,0 +1,42 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "base/logging.hh" +#include "systemc/ext/core/sc_export.hh" + +namespace sc_core +{ + +void +sc_export_base::warn_unimpl(const char *func) const +{ + warn("%s not implemented.\n", func); +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_interface.cc b/src/systemc/core/sc_interface.cc new file mode 100644 index 000000000..e01bdccfd --- /dev/null +++ b/src/systemc/core/sc_interface.cc @@ -0,0 +1,59 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "base/logging.hh" +#include "systemc/ext/core/sc_interface.hh" + +namespace sc_core +{ + +void +sc_interface::register_port(sc_port_base &, const char *) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const sc_event & +sc_interface::default_event() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(sc_event *)nullptr; +} + +sc_interface::~sc_interface() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_interface::sc_interface() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_main.cc b/src/systemc/core/sc_main.cc new file mode 100644 index 000000000..5a6108a6b --- /dev/null +++ b/src/systemc/core/sc_main.cc @@ -0,0 +1,124 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include <cstring> + +#include "base/logging.hh" +#include "python/pybind11/pybind.hh" +#include "sim/init.hh" +#include "systemc/ext/core/sc_main.hh" + +// A default version of this function in case one isn't otherwise defined. +// This ensures everything will link properly whether or not the user defined +// a custom sc_main function. If they didn't but still try to call it, throw +// an error and die. +[[gnu::weak]] int +sc_main(int argc, char *argv[]) +{ + // If python attempts to call sc_main but no sc_main was defined... + fatal("sc_main called but not defined.\n"); +} + +namespace sc_core +{ + +namespace +{ + +bool scMainCalled = false; + +int _argc = 0; +char **_argv = NULL; + +// This wrapper adapts the python version of sc_main to the c++ version. +void +sc_main(pybind11::args args) +{ + panic_if(scMainCalled, "sc_main called more than once."); + + _argc = args.size(); + _argv = new char *[_argc]; + + // Initialize all the _argvs to NULL so we can delete [] them + // unconditionally. + for (int idx = 0; idx < _argc; idx++) + _argv[idx] = NULL; + + // Attempt to convert all the arguments to strings. If that fails, clean + // up after ourselves. Also don't count this as a call to sc_main since + // we never got to the c++ version of that function. + try { + for (int idx = 0; idx < _argc; idx++) { + std::string arg = args[idx].cast<std::string>(); + _argv[idx] = new char[arg.length() + 1]; + strcpy(_argv[idx], arg.c_str()); + } + } catch (...) { + // If that didn't work for some reason (probably a conversion error) + // blow away _argv and _argc and pass on the exception. + for (int idx = 0; idx < _argc; idx++) + delete [] _argv[idx]; + delete [] _argv; + _argc = 0; + throw; + } + + // At this point we're going to call the c++ sc_main, so we can't try + // again later. + scMainCalled = true; + + //TODO Start a new fiber to call sc_main from. + ::sc_main(_argc, _argv); +} + +// Make our sc_main wrapper available in the internal _m5 python module under +// the systemc submodule. +void +systemc_pybind(pybind11::module &m_internal) +{ + pybind11::module m = m_internal.def_submodule("systemc"); + m.def("sc_main", &sc_main); +} +EmbeddedPyBind embed_("systemc", &systemc_pybind); + +} // anonymous namespace + +int +sc_argc() +{ + return _argc; +} + +const char *const * +sc_argv() +{ + return _argv; +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_module.cc b/src/systemc/core/sc_module.cc new file mode 100644 index 000000000..6bbb9dca6 --- /dev/null +++ b/src/systemc/core/sc_module.cc @@ -0,0 +1,542 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "base/logging.hh" +#include "systemc/ext/core/sc_module.hh" + +namespace sc_core +{ + +sc_bind_proxy::sc_bind_proxy(const sc_interface &interface) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_bind_proxy::sc_bind_proxy(const sc_port_base &port) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const sc_bind_proxy SC_BIND_PROXY_NUL(*(const sc_port_base *)nullptr); + +sc_module::~sc_module() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const char * +sc_module::kind() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return ""; +} + +const sc_bind_proxy SC_BIND_PROXY_NIL(*(const sc_port_base *)nullptr); + +void +sc_module::operator () (const sc_bind_proxy &p001, + const sc_bind_proxy &p002, + const sc_bind_proxy &p003, + const sc_bind_proxy &p004, + const sc_bind_proxy &p005, + const sc_bind_proxy &p006, + const sc_bind_proxy &p007, + const sc_bind_proxy &p008, + const sc_bind_proxy &p009, + const sc_bind_proxy &p010, + const sc_bind_proxy &p011, + const sc_bind_proxy &p012, + const sc_bind_proxy &p013, + const sc_bind_proxy &p014, + const sc_bind_proxy &p015, + const sc_bind_proxy &p016, + const sc_bind_proxy &p017, + const sc_bind_proxy &p018, + const sc_bind_proxy &p019, + const sc_bind_proxy &p020, + const sc_bind_proxy &p021, + const sc_bind_proxy &p022, + const sc_bind_proxy &p023, + const sc_bind_proxy &p024, + const sc_bind_proxy &p025, + const sc_bind_proxy &p026, + const sc_bind_proxy &p027, + const sc_bind_proxy &p028, + const sc_bind_proxy &p029, + const sc_bind_proxy &p030, + const sc_bind_proxy &p031, + const sc_bind_proxy &p032, + const sc_bind_proxy &p033, + const sc_bind_proxy &p034, + const sc_bind_proxy &p035, + const sc_bind_proxy &p036, + const sc_bind_proxy &p037, + const sc_bind_proxy &p038, + const sc_bind_proxy &p039, + const sc_bind_proxy &p040, + const sc_bind_proxy &p041, + const sc_bind_proxy &p042, + const sc_bind_proxy &p043, + const sc_bind_proxy &p044, + const sc_bind_proxy &p045, + const sc_bind_proxy &p046, + const sc_bind_proxy &p047, + const sc_bind_proxy &p048, + const sc_bind_proxy &p049, + const sc_bind_proxy &p050, + const sc_bind_proxy &p051, + const sc_bind_proxy &p052, + const sc_bind_proxy &p053, + const sc_bind_proxy &p054, + const sc_bind_proxy &p055, + const sc_bind_proxy &p056, + const sc_bind_proxy &p057, + const sc_bind_proxy &p058, + const sc_bind_proxy &p059, + const sc_bind_proxy &p060, + const sc_bind_proxy &p061, + const sc_bind_proxy &p062, + const sc_bind_proxy &p063, + const sc_bind_proxy &p064) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const std::vector<sc_object *> & +sc_module::get_child_objects() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const std::vector<sc_object *> *)nullptr; +} + +const std::vector<sc_event *> & +sc_module::get_child_events() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const std::vector<sc_event *> *)nullptr; +} + +sc_module::sc_module(const sc_module_name &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_module::sc_module() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::reset_signal_is(const sc_in<bool> &, bool) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::reset_signal_is(const sc_inout<bool> &, bool) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::reset_signal_is(const sc_out<bool> &, bool) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::reset_signal_is(const sc_signal_in_if<bool> &, bool) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + + +void +sc_module::async_reset_signal_is(const sc_in<bool> &, bool) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::async_reset_signal_is(const sc_inout<bool> &, bool) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::async_reset_signal_is(const sc_out<bool> &, bool) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::async_reset_signal_is(const sc_signal_in_if<bool> &, bool) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + + +void +sc_module::dont_initialize() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::set_stack_size(size_t) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + + +void +sc_module::next_trigger() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(double, sc_time_unit) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(const sc_time &, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(double, sc_time_unit, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(const sc_time &, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(double, sc_time_unit, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(const sc_time &, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::next_trigger(double, sc_time_unit, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + + +void +sc_module::wait() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(int) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(double, sc_time_unit) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(const sc_time &, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(double, sc_time_unit, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(const sc_time &, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(double, sc_time_unit, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(const sc_time &, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_module::wait(double, sc_time_unit, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + + +void +next_trigger() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(double, sc_time_unit) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(const sc_time &, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(double, sc_time_unit, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(const sc_time &, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(double, sc_time_unit, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(const sc_time &, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +next_trigger(double, sc_time_unit, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + + +void +wait() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(int) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(double, sc_time_unit) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(const sc_time &, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(double, sc_time_unit, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(const sc_time &, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(double, sc_time_unit, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(const sc_time &, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +wait(double, sc_time_unit, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const char * +sc_gen_unique_name(const char *) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return ""; +} + +bool +sc_start_of_simulation_invoked() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return false; +} + +bool +sc_end_of_simulation_invoked() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return false; +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_module_name.cc b/src/systemc/core/sc_module_name.cc new file mode 100644 index 000000000..2646d431a --- /dev/null +++ b/src/systemc/core/sc_module_name.cc @@ -0,0 +1,59 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + + +#include "base/logging.hh" +#include "systemc/ext/core/sc_module_name.hh" + +namespace sc_core +{ + +sc_module_name::sc_module_name(const char *name) : + _name(name), _on_the_stack(true) +{ + warn("%s: Module name not added to stack.\n", __PRETTY_FUNCTION__); +} + +sc_module_name::sc_module_name(const sc_module_name &other) : + _name(other._name), _on_the_stack(false) +{} + +sc_module_name::~sc_module_name() +{ + if (_on_the_stack) { + warn("%s: Module name not removed from stack.\n", __PRETTY_FUNCTION__); + } +} + +sc_module_name::operator const char *() const +{ + return _name; +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_object.cc b/src/systemc/core/sc_object.cc new file mode 100644 index 000000000..554bc221f --- /dev/null +++ b/src/systemc/core/sc_object.cc @@ -0,0 +1,177 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "base/logging.hh" +#include "systemc/ext/core/sc_object.hh" + +namespace sc_core +{ + +const char * +sc_object::name() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return "sc_object"; +} + +const char * +sc_object::basename() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return "sc_object"; +} + +const char * +sc_object::kind() const +{ + return "sc_object"; +} + +void +sc_object::print(std::ostream &out) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_object::dump(std::ostream &out) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const std::vector<sc_object *> & +sc_object::get_child_objects() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const std::vector<sc_object *> *)nullptr; +} + +const std::vector<sc_event *> & +sc_object::get_child_events() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const std::vector<sc_event *> *)nullptr; +} + +sc_object * +sc_object::get_parent_object() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return NULL; +} + +bool +sc_object::add_attribute(sc_attr_base &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return false; +} + +sc_attr_base * +sc_object::get_attribute(const std::string &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return NULL; +} + +sc_attr_base * +sc_object::remove_attribute(const std::string &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return NULL; +} + +void +sc_object::remove_all_attributes() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +int +sc_object::num_attributes() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +sc_attr_cltn & +sc_object::attr_cltn() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(sc_attr_cltn *)NULL; +} + +const sc_attr_cltn & +sc_object::attr_cltn() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(sc_attr_cltn *)NULL; +} + +sc_object::sc_object() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_object::sc_object(const char *name) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_object::sc_object(const sc_object &arg) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_object & +sc_object::operator = (const sc_object &) +{ + return *this; +} + +sc_object::~sc_object() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const std::vector<sc_object *> & +sc_get_top_level_objects() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const std::vector<sc_object *> *)nullptr; +} + +sc_object * +sc_find_object(const char *) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return NULL; +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_port.cc b/src/systemc/core/sc_port.cc new file mode 100644 index 000000000..e1823bcc9 --- /dev/null +++ b/src/systemc/core/sc_port.cc @@ -0,0 +1,42 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "base/logging.hh" +#include "systemc/ext/core/sc_port.hh" + +namespace sc_core +{ + +void +sc_port_base::warn_unimpl(const char *func) +{ + warn("%s not implemented.\n", func); +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_prim.cc b/src/systemc/core/sc_prim.cc new file mode 100644 index 000000000..0daf317cd --- /dev/null +++ b/src/systemc/core/sc_prim.cc @@ -0,0 +1,215 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "base/logging.hh" +#include "systemc/ext/core/sc_prim.hh" + +namespace sc_core +{ + +const char * +sc_prim_channel::kind() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return ""; +} + +sc_prim_channel::sc_prim_channel() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_prim_channel::sc_prim_channel(const char *) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::request_update() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::async_request_update() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(double, sc_time_unit) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(const sc_time &, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(double, sc_time_unit, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(const sc_time &, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(double, sc_time_unit, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(const sc_time &, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::next_trigger(double, sc_time_unit, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(int) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(double, sc_time_unit) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(const sc_time &, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(double, sc_time_unit, const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(const sc_time &, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(double, sc_time_unit, const sc_event_or_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(const sc_time &, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_prim_channel::wait(double, sc_time_unit, const sc_event_and_list &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_sensitive.cc b/src/systemc/core/sc_sensitive.cc new file mode 100644 index 000000000..e182fa003 --- /dev/null +++ b/src/systemc/core/sc_sensitive.cc @@ -0,0 +1,64 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "base/logging.hh" +#include "systemc/ext/core/sc_sensitive.hh" + +namespace sc_core +{ + +sc_sensitive & +sc_sensitive::operator << (const sc_event &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_sensitive & +sc_sensitive::operator << (const sc_interface &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_sensitive & +sc_sensitive::operator << (const sc_port_base &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_sensitive & +sc_sensitive::operator << (sc_event_finder &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +} // namespace sc_core diff --git a/src/systemc/core/sc_time.cc b/src/systemc/core/sc_time.cc new file mode 100644 index 000000000..022895733 --- /dev/null +++ b/src/systemc/core/sc_time.cc @@ -0,0 +1,232 @@ +/* + * Copyright 2018 Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Gabe Black + */ + +#include "base/logging.hh" +#include "systemc/ext/core/sc_time.hh" + +namespace sc_core +{ + +sc_time::sc_time() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_time::sc_time(double, sc_time_unit) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_time::sc_time(const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_time & +sc_time::operator = (const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_dt::uint64 +sc_time::value() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +double +sc_time::to_double() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0.0; +} +double +sc_time::to_seconds() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0.0; +} + +const std::string +sc_time::to_string() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return ""; +} + +bool +sc_time::operator == (const sc_time &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return true; +} + +bool +sc_time::operator != (const sc_time &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return false; +} + +bool +sc_time::operator < (const sc_time &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return false; +} + +bool +sc_time::operator <= (const sc_time &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return true; +} + +bool +sc_time::operator > (const sc_time &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return false; +} + +bool +sc_time::operator >= (const sc_time &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return true; +} + +sc_time & +sc_time::operator += (const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_time & +sc_time::operator -= (const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_time & +sc_time::operator *= (double) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_time & +sc_time::operator /= (double) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +void +sc_time::print(std::ostream &) const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const sc_time +operator + (const sc_time &, const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_time(); +} + +const sc_time +operator - (const sc_time &, const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_time(); +} + +const sc_time +operator * (const sc_time &, double) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_time(); +} + +const sc_time +operator * (double, const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_time(); +} + +const sc_time +operator / (const sc_time &, double) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_time(); +} + +double +operator / (const sc_time &, const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0.0; +} + +std::ostream & +operator << (std::ostream &os, const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return os; +} + +const sc_time SC_ZERO_TIME; + +void +sc_set_time_resolution(double, sc_time_unit) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_time +sc_get_time_resolution() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return sc_time(); +} + +const sc_time & +sc_max_time() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const sc_time *)nullptr; +} + +} // namespace sc_core |