From 5872389715a194dd91b17e46b770537415d50e30 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 9 May 2018 18:42:03 -0700 Subject: systemc: Stub out the predefined channels. Change-Id: Ie030aad26875bd49e54981ec1e9076b7b5af6630 Reviewed-on: https://gem5-review.googlesource.com/10839 Reviewed-by: Jason Lowe-Power Maintainer: Gabe Black --- src/systemc/channel/SConscript | 39 +++++++++++ src/systemc/channel/sc_clock.cc | 108 ++++++++++++++++++++++++++++++ src/systemc/channel/sc_event_queue.cc | 69 +++++++++++++++++++ src/systemc/channel/sc_in_resolved.cc | 48 +++++++++++++ src/systemc/channel/sc_inout_resolved.cc | 85 +++++++++++++++++++++++ src/systemc/channel/sc_mutex.cc | 68 +++++++++++++++++++ src/systemc/channel/sc_out_resolved.cc | 82 +++++++++++++++++++++++ src/systemc/channel/sc_semaphore.cc | 76 +++++++++++++++++++++ src/systemc/channel/sc_signal_resolved.cc | 82 +++++++++++++++++++++++ src/systemc/channel/warn_unimpl.cc | 42 ++++++++++++ 10 files changed, 699 insertions(+) create mode 100644 src/systemc/channel/SConscript create mode 100644 src/systemc/channel/sc_clock.cc create mode 100644 src/systemc/channel/sc_event_queue.cc create mode 100644 src/systemc/channel/sc_in_resolved.cc create mode 100644 src/systemc/channel/sc_inout_resolved.cc create mode 100644 src/systemc/channel/sc_mutex.cc create mode 100644 src/systemc/channel/sc_out_resolved.cc create mode 100644 src/systemc/channel/sc_semaphore.cc create mode 100644 src/systemc/channel/sc_signal_resolved.cc create mode 100644 src/systemc/channel/warn_unimpl.cc (limited to 'src/systemc/channel') diff --git a/src/systemc/channel/SConscript b/src/systemc/channel/SConscript new file mode 100644 index 000000000..3ca8801c8 --- /dev/null +++ b/src/systemc/channel/SConscript @@ -0,0 +1,39 @@ +# 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']: + Source('sc_clock.cc') + Source('sc_event_queue.cc') + Source('sc_in_resolved.cc') + Source('sc_inout_resolved.cc') + Source('sc_out_resolved.cc') + Source('sc_mutex.cc') + Source('sc_semaphore.cc') + Source('sc_signal_resolved.cc') + Source('warn_unimpl.cc') diff --git a/src/systemc/channel/sc_clock.cc b/src/systemc/channel/sc_clock.cc new file mode 100644 index 000000000..ac1d3369a --- /dev/null +++ b/src/systemc/channel/sc_clock.cc @@ -0,0 +1,108 @@ +/* + * 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/channel/sc_clock.hh" +#include "systemc/ext/core/sc_module.hh" // for sc_gen_unique_name + +namespace sc_core +{ + +sc_clock::sc_clock() : + sc_interface(), sc_signal(sc_gen_unique_name("clock")) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_clock::sc_clock(const char *name) : sc_interface(), sc_signal(name) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_clock::sc_clock(const char *name, const sc_time &period, + double duty_cycle, const sc_time &start_time, + bool posedge_first) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_clock::sc_clock(const char *name, double period_v, sc_time_unit period_tu, + double duty_cycle) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_clock::sc_clock(const char *name, double period_v, sc_time_unit period_tu, + double duty_cycle, double start_time_v, + sc_time_unit start_time_tu, bool posedge_first) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_clock::~sc_clock() {} + +void +sc_clock::write(const bool &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const sc_time & +sc_clock::period() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const sc_time *)nullptr; +} + +double +sc_clock::duty_cycle() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0.0; +} + +const sc_time & +sc_clock::start_time() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const sc_time *)nullptr; +} + +bool +sc_clock::posedge_first() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return false; +} + +const char *sc_clock::kind() const { return "sc_clock"; } + +void sc_clock::before_end_of_elaboration() {} + +} // namespace sc_core diff --git a/src/systemc/channel/sc_event_queue.cc b/src/systemc/channel/sc_event_queue.cc new file mode 100644 index 000000000..47485fdc0 --- /dev/null +++ b/src/systemc/channel/sc_event_queue.cc @@ -0,0 +1,69 @@ +/* + * 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/channel/sc_event_queue.hh" + +namespace sc_core +{ + +sc_event_queue::sc_event_queue(sc_module_name name) : + sc_interface(), sc_event_queue_if(), sc_module(name) +{} + +sc_event_queue::~sc_event_queue() {} + +const char *sc_event_queue::kind() const { return "sc_event_queue"; } + +void +sc_event_queue::notify(double, sc_time_unit) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_event_queue::notify(const sc_time &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_event_queue::cancel_all() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +const sc_event & +sc_event_queue::default_event() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *(const sc_event *)nullptr; +} + +} // namespace sc_core diff --git a/src/systemc/channel/sc_in_resolved.cc b/src/systemc/channel/sc_in_resolved.cc new file mode 100644 index 000000000..b57f4cd7d --- /dev/null +++ b/src/systemc/channel/sc_in_resolved.cc @@ -0,0 +1,48 @@ +/* + * 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/channel/sc_in_resolved.hh" + +namespace sc_core +{ + +sc_in_resolved::sc_in_resolved() : sc_in() {} + +sc_in_resolved::sc_in_resolved(const char *name) : + sc_in(name) +{} + +sc_in_resolved::~sc_in_resolved() {} + +void sc_in_resolved::end_of_elaboration() {} + +const char *sc_in_resolved::kind() const { return "sc_in_resolved"; } + +} // namespace sc_core diff --git a/src/systemc/channel/sc_inout_resolved.cc b/src/systemc/channel/sc_inout_resolved.cc new file mode 100644 index 000000000..71cece846 --- /dev/null +++ b/src/systemc/channel/sc_inout_resolved.cc @@ -0,0 +1,85 @@ +/* + * 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/channel/sc_inout_resolved.hh" + +namespace sc_core +{ + +sc_inout_resolved::sc_inout_resolved() : sc_inout() {} + +sc_inout_resolved::sc_inout_resolved(const char *name) : + sc_inout(name) +{} + +sc_inout_resolved::~sc_inout_resolved() {} + +void sc_inout_resolved::end_of_elaboration() {} + +sc_inout_resolved & +sc_inout_resolved::operator = (const sc_dt::sc_logic &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_inout_resolved & +sc_inout_resolved::operator = (const sc_signal_in_if &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_inout_resolved & +sc_inout_resolved::operator = ( + const sc_port, 1> &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_inout_resolved & +sc_inout_resolved::operator = ( + const sc_port, 1> &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_inout_resolved & +sc_inout_resolved::operator = (const sc_inout_resolved &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +const char *sc_inout_resolved::kind() const { return "sc_inout_resolved"; } + +} // namespace sc_core diff --git a/src/systemc/channel/sc_mutex.cc b/src/systemc/channel/sc_mutex.cc new file mode 100644 index 000000000..80d086f55 --- /dev/null +++ b/src/systemc/channel/sc_mutex.cc @@ -0,0 +1,68 @@ +/* + * 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/channel/sc_mutex.hh" +#include "systemc/ext/core/sc_module.hh" // for sc_gen_unique_name + +namespace sc_core +{ + +sc_mutex::sc_mutex() : sc_interface(), sc_mutex_if(), + sc_object(sc_gen_unique_name("mutex")) +{} + +sc_mutex::sc_mutex(const char *name) : + sc_interface(), sc_mutex_if(), sc_object(name) +{} + +int +sc_mutex::lock() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +int +sc_mutex::trylock() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +int +sc_mutex::unlock() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +const char *sc_mutex::kind() const { return "sc_mutex"; } + +} // namespace sc_core diff --git a/src/systemc/channel/sc_out_resolved.cc b/src/systemc/channel/sc_out_resolved.cc new file mode 100644 index 000000000..a3947f68a --- /dev/null +++ b/src/systemc/channel/sc_out_resolved.cc @@ -0,0 +1,82 @@ +/* + * 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/channel/sc_out_resolved.hh" + +namespace sc_core +{ + +sc_out_resolved::sc_out_resolved() : sc_out() {} + +sc_out_resolved::sc_out_resolved(const char *name) : + sc_out(name) {} + +sc_out_resolved::~sc_out_resolved() {} + +sc_out_resolved & +sc_out_resolved::operator = (const sc_dt::sc_logic &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_out_resolved & +sc_out_resolved::operator = (const sc_signal_in_if &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_out_resolved & +sc_out_resolved::operator = ( + const sc_port, 1> &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_out_resolved & +sc_out_resolved::operator = ( + const sc_port, 1> &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_out_resolved & +sc_out_resolved::operator = (const sc_out_resolved &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +const char *sc_out_resolved::kind() const { return "sc_out_resolved"; } + +} // namespace sc_core diff --git a/src/systemc/channel/sc_semaphore.cc b/src/systemc/channel/sc_semaphore.cc new file mode 100644 index 000000000..cfae59804 --- /dev/null +++ b/src/systemc/channel/sc_semaphore.cc @@ -0,0 +1,76 @@ +/* + * 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/channel/sc_semaphore.hh" +#include "systemc/ext/core/sc_module.hh" // for sc_gen_unique_name + +namespace sc_core +{ + +sc_semaphore::sc_semaphore(int) : + sc_interface(), sc_semaphore_if(), + sc_object(sc_gen_unique_name("semaphore")) +{} + +sc_semaphore::sc_semaphore(const char *name, int) : + sc_interface(), sc_semaphore_if(), sc_object(name) +{} + +int +sc_semaphore::wait() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +int +sc_semaphore::trywait() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +int +sc_semaphore::post() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +int +sc_semaphore::get_value() const +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return 0; +} + +const char *sc_semaphore::kind() const { return "sc_semaphore"; } + +} // namespace sc_core diff --git a/src/systemc/channel/sc_signal_resolved.cc b/src/systemc/channel/sc_signal_resolved.cc new file mode 100644 index 000000000..90431842e --- /dev/null +++ b/src/systemc/channel/sc_signal_resolved.cc @@ -0,0 +1,82 @@ +/* + * 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/channel/sc_signal_resolved.hh" +#include "systemc/ext/core/sc_module.hh" // for sc_gen_unique_name + +namespace sc_core +{ + +sc_signal_resolved::sc_signal_resolved() : sc_interface(), + sc_signal( + sc_gen_unique_name("signal_resolved")) +{} + +sc_signal_resolved::sc_signal_resolved(const char *name) : + sc_interface(), sc_signal(name) +{} + +sc_signal_resolved::~sc_signal_resolved() {} + +void +sc_signal_resolved::register_port(sc_port_base &, const char *) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_signal_resolved::write(const sc_dt::sc_logic &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +sc_signal_resolved & +sc_signal_resolved::operator = (const sc_dt::sc_logic &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +sc_signal_resolved & +sc_signal_resolved::operator = (const sc_signal_resolved &) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); + return *this; +} + +const char *sc_signal_resolved::kind() const { return "sc_signal_resolved"; } + +void +sc_signal_resolved::update() +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +} // namespace sc_core diff --git a/src/systemc/channel/warn_unimpl.cc b/src/systemc/channel/warn_unimpl.cc new file mode 100644 index 000000000..82fd8367b --- /dev/null +++ b/src/systemc/channel/warn_unimpl.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/channel/warn_unimpl.hh" + +namespace sc_core +{ + +void +sc_channel_warn_unimpl(const char *func) +{ + warn("%s not implemented.\n", func); +} + +} // namespace sc_core -- cgit v1.2.3