summaryrefslogtreecommitdiff
path: root/src/systemc/ext
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemc/ext')
-rw-r--r--src/systemc/ext/core/sc_attr.hh98
-rw-r--r--src/systemc/ext/core/sc_event.hh151
-rw-r--r--src/systemc/ext/core/sc_export.hh101
-rw-r--r--src/systemc/ext/core/sc_interface.hh57
-rw-r--r--src/systemc/ext/core/sc_main.hh44
-rw-r--r--src/systemc/ext/core/sc_module.hh246
-rw-r--r--src/systemc/ext/core/sc_module_name.hh56
-rw-r--r--src/systemc/ext/core/sc_object.hh80
-rw-r--r--src/systemc/ext/core/sc_port.hh192
-rw-r--r--src/systemc/ext/core/sc_prim.hh97
-rw-r--r--src/systemc/ext/core/sc_sensitive.hh52
-rw-r--r--src/systemc/ext/core/sc_time.hh98
-rw-r--r--src/systemc/ext/dt/int/sc_nbdefs.hh168
13 files changed, 1440 insertions, 0 deletions
diff --git a/src/systemc/ext/core/sc_attr.hh b/src/systemc/ext/core/sc_attr.hh
new file mode 100644
index 000000000..d7baa149d
--- /dev/null
+++ b/src/systemc/ext/core/sc_attr.hh
@@ -0,0 +1,98 @@
+/*
+ * 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_EXT_CORE_SC_ATTR_HH__
+#define __SYSTEMC_EXT_CORE_SC_ATTR_HH__
+
+#include <string>
+
+namespace sc_core
+{
+
+class sc_attr_base
+{
+ public:
+ sc_attr_base(const std::string &);
+ sc_attr_base(const sc_attr_base &);
+ virtual ~sc_attr_base();
+
+ const std::string &name() const;
+
+ protected:
+ void warn_unimpl(const char *func);
+
+ private:
+ // Disabled
+ sc_attr_base();
+ sc_attr_base &operator = (const sc_attr_base &);
+};
+
+template <class T>
+class sc_attribute : public sc_attr_base
+{
+ public:
+ sc_attribute(const std::string &_name) : sc_attr_base(_name)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+ sc_attribute(const std::string &_name, const T &t) :
+ sc_attr_base(_name), value(t)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+ sc_attribute(const sc_attribute<T> &other) :
+ sc_attr_base(other.name()), value(other.value)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+ virtual ~sc_attribute() { warn_unimpl(__PRETTY_FUNCTION__); }
+ T value;
+
+ private:
+ // Disabled
+ sc_attribute() {}
+ sc_attribute<T> &operator = (const sc_attribute<T> &) { return *this; }
+};
+
+class sc_attr_cltn
+{
+ public:
+ typedef sc_attr_base *elem_type;
+ typedef elem_type *iterator;
+ typedef const elem_type *const_iterator;
+
+ iterator begin();
+ const_iterator begin() const;
+ iterator end();
+ const_iterator end() const;
+};
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_ATTR_HH__
diff --git a/src/systemc/ext/core/sc_event.hh b/src/systemc/ext/core/sc_event.hh
new file mode 100644
index 000000000..d4d719b95
--- /dev/null
+++ b/src/systemc/ext/core/sc_event.hh
@@ -0,0 +1,151 @@
+/*
+ * 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_EXT_CORE_SC_EVENT_HH__
+#define __SYSTEMC_EXT_CORE_SC_EVENT_HH__
+
+#include <vector>
+
+#include "sc_time.hh"
+
+namespace sc_core
+{
+
+class sc_event;
+class sc_event_and_expr;
+class sc_event_or_expr;
+class sc_object;
+class sc_port_base;
+
+class sc_event_finder
+{
+ protected:
+ void warn_unimpl(const char *func) const;
+};
+
+template <class IF>
+class sc_event_finder_t : public sc_event_finder
+{
+ public:
+ sc_event_finder_t(const sc_port_base &,
+ const sc_event & (IF::*event_method)() const)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+};
+
+class sc_event_and_list
+{
+ public:
+ sc_event_and_list();
+ sc_event_and_list(const sc_event_and_list &);
+ sc_event_and_list(const sc_event &);
+ sc_event_and_list &operator = (const sc_event_and_list &);
+
+ int size() const;
+ void swap(sc_event_and_list &);
+
+ sc_event_and_list &operator &= (const sc_event &);
+ sc_event_and_list &operator &= (const sc_event_and_list &);
+
+ sc_event_and_expr operator & (const sc_event &) const;
+ sc_event_and_expr operator & (const sc_event_and_list &);
+};
+
+class sc_event_or_list
+{
+ public:
+ sc_event_or_list();
+ sc_event_or_list(const sc_event_or_list &);
+ sc_event_or_list(const sc_event &);
+ sc_event_or_list& operator = (const sc_event_or_list &);
+ ~sc_event_or_list();
+
+ int size() const;
+ void swap(sc_event_or_list &);
+
+ sc_event_or_list &operator |= (const sc_event &);
+ sc_event_or_list &operator |= (const sc_event_or_list &);
+
+ sc_event_or_expr operator | (const sc_event &) const;
+ sc_event_or_expr operator | (const sc_event_or_list &) const;
+};
+
+class sc_event_and_expr
+{
+ public:
+ operator const sc_event_and_list &() const;
+};
+
+sc_event_and_expr operator & (sc_event_and_expr, sc_event const &);
+sc_event_and_expr operator & (sc_event_and_expr, sc_event_and_list const &);
+
+class sc_event_or_expr
+{
+ public:
+ operator const sc_event_or_list &() const;
+};
+
+sc_event_or_expr operator | (sc_event_or_expr, sc_event const &);
+sc_event_or_expr operator | (sc_event_or_expr, sc_event_or_list const &);
+
+class sc_event
+{
+ public:
+ sc_event();
+ explicit sc_event(const char *);
+ ~sc_event();
+
+ const char *name() const;
+ const char *basename() const;
+ bool in_hierarchy() const;
+ sc_object *get_parent_object() const;
+
+ void notify();
+ void notify(const sc_time &);
+ void notify(double, sc_time_unit);
+ void cancel();
+
+ sc_event_and_expr operator & (const sc_event &) const;
+ sc_event_and_expr operator & (const sc_event_and_list &) const;
+ sc_event_or_expr operator | (const sc_event &) const;
+ sc_event_or_expr operator | (const sc_event_or_list &) const;
+
+ private:
+ // Disabled
+ sc_event(const sc_event &) {}
+ sc_event &operator = (const sc_event &) { return *this; }
+};
+
+const std::vector<sc_event *> &sc_get_top_level_events();
+sc_event *sc_find_event(const char *);
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_INTERFACE_HH__
diff --git a/src/systemc/ext/core/sc_export.hh b/src/systemc/ext/core/sc_export.hh
new file mode 100644
index 000000000..dc2176492
--- /dev/null
+++ b/src/systemc/ext/core/sc_export.hh
@@ -0,0 +1,101 @@
+/*
+ * 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_EXT_CORE_SC_EXPORT_HH__
+#define __SYSTEMC_EXT_CORE_SC_EXPORT_HH__
+
+#include "sc_object.hh"
+
+namespace sc_core
+{
+
+class sc_interface;
+
+class sc_export_base : public sc_object
+{
+ public:
+ void warn_unimpl(const char *func) const;
+};
+
+template <class IF>
+class sc_export : public sc_export_base
+{
+ public:
+ sc_export() { warn_unimpl(__PRETTY_FUNCTION__); }
+ explicit sc_export(const char *) { warn_unimpl(__PRETTY_FUNCTION__); }
+ virtual ~sc_export() { warn_unimpl(__PRETTY_FUNCTION__); };
+
+ virtual const char *kind() const { return "sc_export"; }
+
+ void operator () (IF &) { warn_unimpl(__PRETTY_FUNCTION__); };
+ virtual void bind(IF &) { warn_unimpl(__PRETTY_FUNCTION__); };
+ operator IF & () { warn_unimpl(__PRETTY_FUNCTION__); };
+ operator const IF & () const { warn_unimpl(__PRETTY_FUNCTION__); };
+
+ IF *
+ operator -> ()
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return nullptr;
+ }
+ const IF *
+ operator -> () const
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return nullptr;
+ }
+
+ virtual sc_interface *
+ get_iterface()
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return nullptr;
+ }
+ virtual const sc_interface *
+ get_interface() const
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return nullptr;
+ }
+
+ protected:
+ virtual void before_end_of_elaboration() {}
+ virtual void end_of_elaboration() {}
+ virtual void start_of_simulation() {}
+ virtual void end_of_simulation() {}
+
+ private:
+ // Disabled
+ sc_export(const sc_export<IF> &);
+ sc_export<IF> &operator = (const sc_export<IF> &);
+};
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_EXPORT_HH__
diff --git a/src/systemc/ext/core/sc_interface.hh b/src/systemc/ext/core/sc_interface.hh
new file mode 100644
index 000000000..2073f5362
--- /dev/null
+++ b/src/systemc/ext/core/sc_interface.hh
@@ -0,0 +1,57 @@
+/*
+ * 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_EXT_CORE_SC_INTERFACE_HH__
+#define __SYSTEMC_EXT_CORE_SC_INTERFACE_HH__
+
+namespace sc_core
+{
+
+class sc_port_base;
+class sc_event;
+
+class sc_interface
+{
+ public:
+ virtual void register_port(sc_port_base &, const char *);
+ virtual const sc_event &default_event() const;
+ virtual ~sc_interface();
+
+ protected:
+ sc_interface();
+
+ private:
+ // Disabled
+ sc_interface(const sc_interface &) {}
+ sc_interface &operator = (const sc_interface &) { return *this; }
+};
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_INTERFACE_HH__
diff --git a/src/systemc/ext/core/sc_main.hh b/src/systemc/ext/core/sc_main.hh
new file mode 100644
index 000000000..9bf0d0aae
--- /dev/null
+++ b/src/systemc/ext/core/sc_main.hh
@@ -0,0 +1,44 @@
+/*
+ * 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_EXT_CORE_SC_MAIN_HH__
+#define __SYSTEMC_EXT_CORE_SC_MAIN_HH__
+
+extern "C" int sc_main(int argc, char *argv[]);
+
+namespace sc_core
+{
+ extern "C" int sc_argc();
+
+ // The standard version of this function doesn't have these "const"
+ // qualifiers, but the canonical SystemC implementation does.
+ extern "C" const char *const *sc_argv();
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_MAIN_HH__
diff --git a/src/systemc/ext/core/sc_module.hh b/src/systemc/ext/core/sc_module.hh
new file mode 100644
index 000000000..4c4ebb269
--- /dev/null
+++ b/src/systemc/ext/core/sc_module.hh
@@ -0,0 +1,246 @@
+/*
+ * 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_CORE_EXT_SC_MODULE_HH__
+#define __SYSTEMC_CORE_EXT_SC_MODULE_HH__
+
+#include <vector>
+
+#include "sc_object.hh"
+#include "sc_sensitive.hh"
+#include "sc_time.hh"
+
+namespace sc_core
+{
+
+template <class T>
+class sc_in;
+template <class T>
+class sc_out;
+template <class T>
+class sc_inout;
+template <class T>
+class sc_signal_in_if;
+
+class sc_event;
+class sc_event_and_list;
+class sc_event_or_list;
+class sc_module_name;
+
+class sc_bind_proxy
+{
+ public:
+ sc_bind_proxy(const sc_interface &interface);
+ sc_bind_proxy(const sc_port_base &port);
+};
+
+extern const sc_bind_proxy SC_BIND_PROXY_NIL;
+
+class sc_module : public sc_object
+{
+ public:
+ virtual ~sc_module();
+
+ virtual const char *kind() const;
+
+ void operator () (const sc_bind_proxy &p001,
+ const sc_bind_proxy &p002 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p003 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p004 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p005 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p006 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p007 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p008 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p009 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p010 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p011 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p012 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p013 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p014 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p015 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p016 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p017 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p018 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p019 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p020 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p021 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p022 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p023 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p024 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p025 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p026 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p027 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p028 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p029 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p030 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p031 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p032 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p033 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p034 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p035 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p036 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p037 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p038 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p039 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p040 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p041 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p042 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p043 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p044 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p045 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p046 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p047 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p048 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p049 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p050 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p051 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p052 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p053 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p054 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p055 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p056 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p057 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p058 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p059 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p060 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p061 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p062 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p063 = SC_BIND_PROXY_NIL,
+ const sc_bind_proxy &p064 = SC_BIND_PROXY_NIL);
+
+ virtual const std::vector<sc_object *> &get_child_objects() const;
+ virtual const std::vector<sc_event *> &get_child_events() const;
+
+ protected:
+ sc_module(const sc_module_name &);
+ sc_module();
+
+ void reset_signal_is(const sc_in<bool> &, bool);
+ void reset_signal_is(const sc_inout<bool> &, bool);
+ void reset_signal_is(const sc_out<bool> &, bool);
+ void reset_signal_is(const sc_signal_in_if<bool> &, bool);
+
+ void async_reset_signal_is(const sc_in<bool> &, bool);
+ void async_reset_signal_is(const sc_inout<bool> &, bool);
+ void async_reset_signal_is(const sc_out<bool> &, bool);
+ void async_reset_signal_is(const sc_signal_in_if<bool> &, bool);
+
+ sc_sensitive sensitive;
+
+ void dont_initialize();
+ void set_stack_size(size_t);
+
+ void next_trigger();
+ void next_trigger(const sc_event &);
+ void next_trigger(const sc_event_or_list &);
+ void next_trigger(const sc_event_and_list &);
+ void next_trigger(const sc_time &);
+ void next_trigger(double, sc_time_unit);
+ void next_trigger(const sc_time &, const sc_event &);
+ void next_trigger(double, sc_time_unit, const sc_event &);
+ void next_trigger(const sc_time &, const sc_event_or_list &);
+ void next_trigger(double, sc_time_unit, const sc_event_or_list &);
+ void next_trigger(const sc_time &, const sc_event_and_list &);
+ void next_trigger(double, sc_time_unit, const sc_event_and_list &);
+
+ void wait();
+ void wait(int);
+ void wait(const sc_event &);
+ void wait(const sc_event_or_list &);
+ void wait(const sc_event_and_list &);
+ void wait(const sc_time &);
+ void wait(double, sc_time_unit);
+ void wait(const sc_time &, const sc_event &);
+ void wait(double, sc_time_unit, const sc_event &);
+ void wait(const sc_time &, const sc_event_or_list &);
+ void wait(double, sc_time_unit, const sc_event_or_list &);
+ void wait(const sc_time &, const sc_event_and_list &);
+ void wait(double, sc_time_unit, const sc_event_and_list &);
+
+ virtual void before_end_of_elaboration() {}
+ virtual void end_of_elaboration() {}
+ virtual void start_of_simulation() {}
+ virtual void end_of_simulation() {}
+
+ private:
+ // Disabled
+ sc_module(const sc_module &) : sc_object() {};
+ sc_module &operator = (const sc_module &) { return *this; }
+};
+
+void next_trigger();
+void next_trigger(const sc_event &);
+void next_trigger(const sc_event_or_list &);
+void next_trigger(const sc_event_and_list &);
+void next_trigger(const sc_time &);
+void next_trigger(double, sc_time_unit);
+void next_trigger(const sc_time &, const sc_event &);
+void next_trigger(double, sc_time_unit, const sc_event &);
+void next_trigger(const sc_time &, const sc_event_or_list &);
+void next_trigger(double, sc_time_unit, const sc_event_or_list &);
+void next_trigger(const sc_time &, const sc_event_and_list &);
+void next_trigger(double, sc_time_unit, const sc_event_and_list &);
+
+void wait();
+void wait(int);
+void wait(const sc_event &);
+void wait(const sc_event_or_list &);
+void wait(const sc_event_and_list &);
+void wait(const sc_time &);
+void wait(double, sc_time_unit);
+void wait(const sc_time &, const sc_event &);
+void wait(double, sc_time_unit, const sc_event &);
+void wait(const sc_time &, const sc_event_or_list &);
+void wait(double, sc_time_unit, const sc_event_or_list &);
+void wait(const sc_time &, const sc_event_and_list &);
+void wait(double, sc_time_unit, const sc_event_and_list &);
+
+#define SC_MODULE(name) struct name : ::sc_core::sc_module
+
+#define SC_CTOR(name) \
+ typedef name SC_CURRENT_USER_MODULE; \
+ name(::sc_core::sc_module_name)
+
+#define SC_HAS_PROCESS(name) typedef name SC_CURRENT_USER_MODULE
+
+#define SC_METHOD(name) /* Implementation defined */
+#define SC_THREAD(name) /* Implementation defined */
+#define SC_CTHREAD(name, clk) /* Implementation defined */
+
+const char *sc_gen_unique_name(const char *);
+
+typedef sc_module sc_behavior;
+typedef sc_module sc_channel;
+
+bool sc_start_of_simulation_invoked();
+bool sc_end_of_simulation_invoked();
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_MODULE_HH__
diff --git a/src/systemc/ext/core/sc_module_name.hh b/src/systemc/ext/core/sc_module_name.hh
new file mode 100644
index 000000000..7ae2fd689
--- /dev/null
+++ b/src/systemc/ext/core/sc_module_name.hh
@@ -0,0 +1,56 @@
+/*
+ * 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_EXT_CORE_SC_MODULE_NAME_HH__
+#define __SYSTEMC_EXT_CORE_SC_MODULE_NAME_HH__
+
+namespace sc_core
+{
+
+class sc_module_name
+{
+ public:
+ sc_module_name(const char *);
+ sc_module_name(const sc_module_name &);
+ ~sc_module_name();
+
+ operator const char *() const;
+
+ private:
+ const char *_name;
+ bool _on_the_stack;
+
+ // Disabled
+ sc_module_name() {}
+ sc_module_name &operator = (const sc_module_name &) { return *this; }
+};
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_MODULE_NAME_HH__
diff --git a/src/systemc/ext/core/sc_object.hh b/src/systemc/ext/core/sc_object.hh
new file mode 100644
index 000000000..0e975814f
--- /dev/null
+++ b/src/systemc/ext/core/sc_object.hh
@@ -0,0 +1,80 @@
+/*
+ * 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_EXT_CORE_SC_OBJECT_HH__
+#define __SYSTEMC_EXT_CORE_SC_OBJECT_HH__
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+namespace sc_core
+{
+
+class sc_event;
+class sc_attr_base;
+class sc_attr_cltn;
+
+class sc_object
+{
+ public:
+ const char *name() const;
+ const char *basename() const;
+
+ virtual const char *kind() const;
+
+ virtual void print(std::ostream & =std::cout) const;
+ virtual void dump(std::ostream & =std::cout) const;
+
+ virtual const std::vector<sc_object *> &get_child_objects() const;
+ virtual const std::vector<sc_event *> &get_child_events() const;
+ sc_object *get_parent_object() const;
+
+ bool add_attribute(sc_attr_base &);
+ sc_attr_base *get_attribute(const std::string &);
+ sc_attr_base *remove_attribute(const std::string &);
+ void remove_all_attributes();
+ int num_attributes() const;
+ sc_attr_cltn &attr_cltn();
+ const sc_attr_cltn &attr_cltn() const;
+
+ protected:
+ sc_object();
+ sc_object(const char *);
+ sc_object(const sc_object &);
+ sc_object &operator = (const sc_object &);
+ virtual ~sc_object();
+};
+
+const std::vector<sc_object *> &sc_get_top_level_objects();
+sc_object *sc_find_object(const char *);
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_OBJECT_HH__
diff --git a/src/systemc/ext/core/sc_port.hh b/src/systemc/ext/core/sc_port.hh
new file mode 100644
index 000000000..1d32422a5
--- /dev/null
+++ b/src/systemc/ext/core/sc_port.hh
@@ -0,0 +1,192 @@
+/*
+ * 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_EXT_CORE_SC_PORT_HH__
+#define __SYSTEMC_EXT_CORE_SC_PORT_HH__
+
+#include "sc_object.hh"
+
+namespace sc_core
+{
+
+class sc_interface;
+
+enum sc_port_policy
+{
+ SC_ONE_OR_MORE_BOUND, // Default
+ SC_ZERO_OR_MORE_BOUND,
+ SC_ALL_BOUND
+};
+
+class sc_port_base : public sc_object
+{
+ public:
+ void warn_unimpl(const char *func);
+};
+
+template <class IF>
+class sc_port_b : public sc_port_base
+{
+ public:
+ void
+ operator () (IF &)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+
+ void
+ operator () (sc_port_b<IF> &)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+
+ virtual void
+ bind(IF &)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+
+ virtual void
+ bind(sc_port_b<IF> &)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+
+ int
+ size() const
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return 0;
+ }
+
+ IF *
+ operator -> ()
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return (IF *)nullptr;
+ }
+
+ const IF *
+ operator -> () const
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return (IF *)nullptr;
+ }
+
+ IF *
+ operator [] (int)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return (IF *)nullptr;
+ }
+
+ const IF *
+ operator [] (int) const
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return (IF *)nullptr;
+ }
+
+ virtual sc_interface *
+ get_interface()
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return (sc_interface *)nullptr;
+ }
+
+ virtual const sc_interface *
+ get_interface() const
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return (sc_interface *)nullptr;
+ }
+
+ protected:
+ virtual void before_end_of_elaboration() {}
+ virtual void end_of_elaboration() {}
+ virtual void start_of_elaboration() {}
+ virtual void end_of_simulation() {}
+
+ explicit sc_port_b(int, sc_port_policy)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+
+ sc_port_b(const char *, int, sc_port_policy)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+
+ virtual ~sc_port_b()
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+
+ private:
+ // Disabled
+ sc_port_b() {}
+ sc_port_b(const sc_port_b<IF> &) {}
+ sc_port_b<IF> &operator = (const sc_port_b<IF> &) { return *this; }
+};
+
+template <class IF, int N=1, sc_port_policy P=SC_ONE_OR_MORE_BOUND>
+class sc_port : public sc_port_b<IF>
+{
+ public:
+ sc_port()
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+
+ explicit sc_port(const char *)
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+
+ virtual ~sc_port()
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ }
+
+ virtual const char *
+ kind() const
+ {
+ warn_unimpl(__PRETTY_FUNCTION__);
+ return "";
+ }
+
+ private:
+ // Disabled
+ sc_port(const sc_port<IF, N, P> &) {}
+ sc_port<IF, N, P> &operator = (const sc_port<IF, N, P> &) { return *this; }
+};
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_PORT_HH__
diff --git a/src/systemc/ext/core/sc_prim.hh b/src/systemc/ext/core/sc_prim.hh
new file mode 100644
index 000000000..d6265cb56
--- /dev/null
+++ b/src/systemc/ext/core/sc_prim.hh
@@ -0,0 +1,97 @@
+/*
+ * 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_EXT_CORE_SC_PRIM_HH__
+#define __SYSTEMC_EXT_CORE_SC_PRIM_HH__
+
+#include "sc_object.hh"
+#include "sc_time.hh"
+
+namespace sc_core
+{
+
+class sc_event;
+class sc_event_and_list;
+class sc_event_or_list;
+
+class sc_prim_channel : public sc_object
+{
+ public:
+ virtual const char *kind() const;
+
+ protected:
+ sc_prim_channel();
+ explicit sc_prim_channel(const char *);
+ virtual ~sc_prim_channel() {}
+
+ void request_update();
+ void async_request_update();
+ virtual void update() {}
+
+ void next_trigger();
+ void next_trigger(const sc_event &);
+ void next_trigger(const sc_event_or_list &);
+ void next_trigger(const sc_event_and_list &);
+ void next_trigger(const sc_time &);
+ void next_trigger(double, sc_time_unit);
+ void next_trigger(const sc_time &, const sc_event &);
+ void next_trigger(double, sc_time_unit, const sc_event &);
+ void next_trigger(const sc_time &, const sc_event_or_list &);
+ void next_trigger(double, sc_time_unit, const sc_event_or_list &);
+ void next_trigger(const sc_time &, const sc_event_and_list &);
+ void next_trigger(double, sc_time_unit, const sc_event_and_list &);
+
+ void wait();
+ void wait(int);
+ void wait(const sc_event &);
+ void wait(const sc_event_or_list &);
+ void wait(const sc_event_and_list &);
+ void wait(const sc_time &);
+ void wait(double, sc_time_unit);
+ void wait(const sc_time &, const sc_event &);
+ void wait(double, sc_time_unit, const sc_event &);
+ void wait(const sc_time &, const sc_event_or_list &);
+ void wait(double, sc_time_unit, const sc_event_or_list &);
+ void wait(const sc_time &, const sc_event_and_list &);
+ void wait(double, sc_time_unit, const sc_event_and_list &);
+
+ virtual void before_end_of_elaboration() {}
+ virtual void end_of_elaboration() {}
+ virtual void start_of_simulation() {}
+ virtual void end_of_simulation() {}
+
+ private:
+ // Disabled
+ sc_prim_channel(const sc_prim_channel &);
+ sc_prim_channel &operator = (const sc_prim_channel &);
+};
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_PRIM_HH__
diff --git a/src/systemc/ext/core/sc_sensitive.hh b/src/systemc/ext/core/sc_sensitive.hh
new file mode 100644
index 000000000..62f18b6d2
--- /dev/null
+++ b/src/systemc/ext/core/sc_sensitive.hh
@@ -0,0 +1,52 @@
+/*
+ * 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_EXT_CORE_SC_SENSITIVE_HH__
+#define __SYSTEMC_EXT_CORE_SC_SENSITIVE_HH__
+
+namespace sc_core
+{
+
+class sc_event;
+class sc_event_finder;
+class sc_interface;
+class sc_port_base;
+
+class sc_sensitive
+{
+ public:
+ sc_sensitive &operator << (const sc_event &);
+ sc_sensitive &operator << (const sc_interface &);
+ sc_sensitive &operator << (const sc_port_base &);
+ sc_sensitive &operator << (sc_event_finder &);
+};
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_SENSITIVE_HH__
diff --git a/src/systemc/ext/core/sc_time.hh b/src/systemc/ext/core/sc_time.hh
new file mode 100644
index 000000000..456d59e02
--- /dev/null
+++ b/src/systemc/ext/core/sc_time.hh
@@ -0,0 +1,98 @@
+/*
+ * 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_EXT_CORE_SC_TIME_HH__
+#define __SYSTEMC_EXT_CORE_SC_TIME_HH__
+
+#include <stdint.h>
+
+#include <iostream>
+
+#include "../dt/int/sc_nbdefs.hh"
+
+namespace sc_core
+{
+
+enum sc_time_unit {
+ SC_FS = 0,
+ SC_PS,
+ SC_NS,
+ SC_US,
+ SC_MS,
+ SC_SEC
+};
+
+class sc_time
+{
+ public:
+ sc_time();
+ sc_time(double, sc_time_unit);
+ sc_time(const sc_time &);
+
+ sc_time &operator = (const sc_time &);
+
+ sc_dt::uint64 value() const;
+ double to_double() const;
+ double to_seconds() const;
+ const std::string to_string() const;
+
+ bool operator == (const sc_time &) const;
+ bool operator != (const sc_time &) const;
+ bool operator < (const sc_time &) const;
+ bool operator <= (const sc_time &) const;
+ bool operator > (const sc_time &) const;
+ bool operator >= (const sc_time &) const;
+
+ sc_time &operator += (const sc_time &);
+ sc_time &operator -= (const sc_time &);
+ sc_time &operator *= (double);
+ sc_time &operator /= (double);
+
+ void print(std::ostream & =std::cout) const;
+};
+
+const sc_time operator + (const sc_time &, const sc_time &);
+const sc_time operator - (const sc_time &, const sc_time &);
+
+const sc_time operator * (const sc_time &, double);
+const sc_time operator * (double, const sc_time &);
+const sc_time operator / (const sc_time &, double);
+double operator / (const sc_time &, const sc_time &);
+
+std::ostream &operator << (std::ostream &, const sc_time &);
+
+extern const sc_time SC_ZERO_TIME;
+
+void sc_set_time_resolution(double, sc_time_unit);
+sc_time sc_get_time_resolution();
+const sc_time &sc_max_time();
+
+} // namespace sc_core
+
+#endif //__SYSTEMC_EXT_CORE_SC_TIME_HH__
diff --git a/src/systemc/ext/dt/int/sc_nbdefs.hh b/src/systemc/ext/dt/int/sc_nbdefs.hh
new file mode 100644
index 000000000..48d735adf
--- /dev/null
+++ b/src/systemc/ext/dt/int/sc_nbdefs.hh
@@ -0,0 +1,168 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+ sc_nbdefs.h -- Top level header file for arbitrary precision signed/unsigned
+ arithmetic. This file defines all the constants needed.
+ *****************************************************************************/
+
+#ifndef __SYSTEMC_DT_SC_NBDEFS_H__
+#define __SYSTEMC_DT_SC_NBDEFS_H__
+
+#include <stdint.h>
+
+#include <climits>
+
+namespace sc_dt
+{
+
+// ----------------------------------------------------------------------------
+// ENUM : sc_numrep
+//
+// Enumeration of number representations for character string conversion.
+// ----------------------------------------------------------------------------
+
+enum sc_numrep
+{
+ SC_NOBASE = 0,
+ SC_BIN = 2,
+ SC_OCT = 8,
+ SC_DEC = 10,
+ SC_HEX = 16,
+ SC_BIN_US,
+ SC_BIN_SM,
+ SC_OCT_US,
+ SC_OCT_SM,
+ SC_HEX_US,
+ SC_HEX_SM,
+ SC_CSD
+};
+
+
+// Sign of a number:
+#define SC_NEG -1 // Negative number
+#define SC_ZERO 0 // Zero
+#define SC_POS 1 // Positive number
+#define SC_NOSIGN 2 // Uninitialized sc_signed number
+
+typedef unsigned char uchar;
+
+// A small_type number is at least a char. Defining an int is probably
+// better for alignment.
+typedef int small_type;
+
+// Attributes of a byte.
+#define BITS_PER_BYTE 8
+#define BYTE_RADIX 256
+#define BYTE_MASK 255
+
+// LOG2_BITS_PER_BYTE = log2(BITS_PER_BYTE), assuming that
+// BITS_PER_BYTE is a power of 2.
+#define LOG2_BITS_PER_BYTE 3
+
+// Attributes of the unsigned long. These definitions are used mainly in
+// the functions that are aware of the internal representation of digits,
+// e.g., get/set_packed_rep().
+#define BYTES_PER_DIGIT_TYPE 4
+#define BITS_PER_DIGIT_TYPE 32
+
+// Attributes of a digit, i.e., unsigned long less the overflow bits.
+#define BYTES_PER_DIGIT 4
+#define BITS_PER_DIGIT 30
+#define DIGIT_RADIX (1ul << BITS_PER_DIGIT)
+#define DIGIT_MASK (DIGIT_RADIX - 1)
+// Make sure that BYTES_PER_DIGIT = ceil(BITS_PER_DIGIT / BITS_PER_BYTE).
+
+// Similar attributes for the half of a digit. Note that
+// HALF_DIGIT_RADIX is equal to the square root of DIGIT_RADIX. These
+// definitions are used mainly in the multiplication routines.
+#define BITS_PER_HALF_DIGIT (BITS_PER_DIGIT / 2)
+#define HALF_DIGIT_RADIX (1ul << BITS_PER_HALF_DIGIT)
+#define HALF_DIGIT_MASK (HALF_DIGIT_RADIX - 1)
+
+// DIV_CEIL2(x, y) = ceil(x / y). x and y are positive numbers.
+#define DIV_CEIL2(x, y) (((x) - 1) / (y) + 1)
+
+// DIV_CEIL(x) = ceil(x / BITS_PER_DIGIT) = the number of digits to
+// store x bits. x is a positive number.
+#define DIV_CEIL(x) DIV_CEIL2(x, BITS_PER_DIGIT)
+
+#ifdef SC_MAX_NBITS
+static const int MAX_NDIGITS = DIV_CEIL(SC_MAX_NBITS) + 2;
+// Consider a number with x bits another with y bits. The maximum
+// number of bits happens when we multiply them. The result will have
+// (x + y) bits. Assume that x + y <= SC_MAX_NBITS. Then, DIV_CEIL(x) +
+// DIV_CEIL(y) <= DIV_CEIL(SC_MAX_NBITS) + 2. This is the reason for +2
+// above. With this change, MAX_NDIGITS must be enough to hold the
+// result of any operation.
+#endif
+
+// Support for "digit" vectors used to hold the values of sc_signed,
+// sc_unsigned, sc_bv_base, and sc_lv_base data types. This type is also used
+// in the concatenation support. An sc_digit is currently an unsigned 32-bit
+// quantity. The typedef used is an unsigned int, rather than an unsigned long,
+// since the unsigned long data type varies in size between 32-bit and 64-bit
+// machines.
+
+typedef unsigned int sc_digit; // 32-bit unsigned integer
+
+// Support for the long long type. This type is not in the standard
+// but is usually supported by compilers.
+typedef int64_t int64;
+typedef uint64_t uint64;
+
+static const uint64 UINT64_ZERO = 0ULL;
+static const uint64 UINT64_ONE = 1ULL;
+static const uint64 UINT64_32ONES = 0x00000000ffffffffULL;
+
+// Bits per ...
+// will be deleted in the future. Use numeric_limits instead
+#define BITS_PER_CHAR 8
+#define BITS_PER_INT (sizeof(int) * BITS_PER_CHAR)
+#define BITS_PER_LONG (sizeof(long) * BITS_PER_CHAR)
+#define BITS_PER_INT64 (sizeof(::sc_dt::int64) * BITS_PER_CHAR)
+#define BITS_PER_UINT (sizeof(unsigned int) * BITS_PER_CHAR)
+#define BITS_PER_ULONG (sizeof(unsigned long) * BITS_PER_CHAR)
+#define BITS_PER_UINT64 (sizeof(::sc_dt::uint64) * BITS_PER_CHAR)
+
+// Digits per ...
+#define DIGITS_PER_CHAR 1
+#define DIGITS_PER_INT ((BITS_PER_INT+29)/30)
+#define DIGITS_PER_LONG ((BITS_PER_LONG+29)/30)
+#define DIGITS_PER_INT64 ((BITS_PER_INT64+29)/30)
+#define DIGITS_PER_UINT ((BITS_PER_UINT+29)/30)
+#define DIGITS_PER_ULONG ((BITS_PER_ULONG+29)/30)
+#define DIGITS_PER_UINT64 ((BITS_PER_UINT64+29)/30)
+
+// Above, BITS_PER_X is mainly used for sc_signed, and BITS_PER_UX is
+// mainly used for sc_unsigned.
+
+static const small_type NB_DEFAULT_BASE = SC_DEC;
+
+// For sc_int code:
+
+typedef int64 int_type;
+typedef uint64 uint_type;
+#define SC_INTWIDTH 64
+static const uint64 UINT_ZERO = UINT64_ZERO;
+static const uint64 UINT_ONE = UINT64_ONE;
+
+} // namespace sc_dt
+
+#endif