systemc: Stub out the predefined channels.
Change-Id: Ie030aad26875bd49e54981ec1e9076b7b5af6630 Reviewed-on: https://gem5-review.googlesource.com/10839 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
39
src/systemc/channel/SConscript
Normal file
39
src/systemc/channel/SConscript
Normal file
@@ -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')
|
||||
108
src/systemc/channel/sc_clock.cc
Normal file
108
src/systemc/channel/sc_clock.cc
Normal file
@@ -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<bool>(sc_gen_unique_name("clock"))
|
||||
{
|
||||
warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
sc_clock::sc_clock(const char *name) : sc_interface(), sc_signal<bool>(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
|
||||
69
src/systemc/channel/sc_event_queue.cc
Normal file
69
src/systemc/channel/sc_event_queue.cc
Normal file
@@ -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
|
||||
48
src/systemc/channel/sc_in_resolved.cc
Normal file
48
src/systemc/channel/sc_in_resolved.cc
Normal file
@@ -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_dt::sc_logic>() {}
|
||||
|
||||
sc_in_resolved::sc_in_resolved(const char *name) :
|
||||
sc_in<sc_dt::sc_logic>(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
|
||||
85
src/systemc/channel/sc_inout_resolved.cc
Normal file
85
src/systemc/channel/sc_inout_resolved.cc
Normal file
@@ -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_dt::sc_logic>() {}
|
||||
|
||||
sc_inout_resolved::sc_inout_resolved(const char *name) :
|
||||
sc_inout<sc_dt::sc_logic>(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<sc_dt::sc_logic> &)
|
||||
{
|
||||
warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
sc_inout_resolved &
|
||||
sc_inout_resolved::operator = (
|
||||
const sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> &)
|
||||
{
|
||||
warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
sc_inout_resolved &
|
||||
sc_inout_resolved::operator = (
|
||||
const sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 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
|
||||
68
src/systemc/channel/sc_mutex.cc
Normal file
68
src/systemc/channel/sc_mutex.cc
Normal file
@@ -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
|
||||
82
src/systemc/channel/sc_out_resolved.cc
Normal file
82
src/systemc/channel/sc_out_resolved.cc
Normal file
@@ -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_dt::sc_logic>() {}
|
||||
|
||||
sc_out_resolved::sc_out_resolved(const char *name) :
|
||||
sc_out<sc_dt::sc_logic>(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<sc_dt::sc_logic> &)
|
||||
{
|
||||
warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
sc_out_resolved &
|
||||
sc_out_resolved::operator = (
|
||||
const sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> &)
|
||||
{
|
||||
warn("%s not implemented.\n", __PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
sc_out_resolved &
|
||||
sc_out_resolved::operator = (
|
||||
const sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 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
|
||||
76
src/systemc/channel/sc_semaphore.cc
Normal file
76
src/systemc/channel/sc_semaphore.cc
Normal file
@@ -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
|
||||
82
src/systemc/channel/sc_signal_resolved.cc
Normal file
82
src/systemc/channel/sc_signal_resolved.cc
Normal file
@@ -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_dt::sc_logic, SC_MANY_WRITERS>(
|
||||
sc_gen_unique_name("signal_resolved"))
|
||||
{}
|
||||
|
||||
sc_signal_resolved::sc_signal_resolved(const char *name) :
|
||||
sc_interface(), sc_signal<sc_dt::sc_logic, SC_MANY_WRITERS>(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
|
||||
42
src/systemc/channel/warn_unimpl.cc
Normal file
42
src/systemc/channel/warn_unimpl.cc
Normal file
@@ -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
|
||||
60
src/systemc/ext/channel/_channel.hh
Normal file
60
src/systemc/ext/channel/_channel.hh
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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_CHANNEL__CHANNEL_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL__CHANNEL_HH__
|
||||
|
||||
#include "sc_buffer.hh"
|
||||
#include "sc_clock.hh"
|
||||
#include "sc_event_queue.hh"
|
||||
#include "sc_fifo.hh"
|
||||
#include "sc_fifo_in.hh"
|
||||
#include "sc_fifo_in_if.hh"
|
||||
#include "sc_fifo_out.hh"
|
||||
#include "sc_fifo_out_if.hh"
|
||||
#include "sc_in.hh"
|
||||
#include "sc_in_resolved.hh"
|
||||
#include "sc_in_rv.hh"
|
||||
#include "sc_inout.hh"
|
||||
#include "sc_inout_resolved.hh"
|
||||
#include "sc_inout_rv.hh"
|
||||
#include "sc_mutex.hh"
|
||||
#include "sc_mutex_if.hh"
|
||||
#include "sc_out.hh"
|
||||
#include "sc_out_resolved.hh"
|
||||
#include "sc_out_rv.hh"
|
||||
#include "sc_semaphore.hh"
|
||||
#include "sc_semaphore_if.hh"
|
||||
#include "sc_signal.hh"
|
||||
#include "sc_signal_in_if.hh"
|
||||
#include "sc_signal_inout_if.hh"
|
||||
#include "sc_signal_resolved.hh"
|
||||
#include "sc_signal_rv.hh"
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL__CHANNEL_HH__
|
||||
95
src/systemc/ext/channel/_using.hh
Normal file
95
src/systemc/ext/channel/_using.hh
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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_CHANNEL__USING_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL__USING_HH__
|
||||
|
||||
#include "_channel.hh"
|
||||
|
||||
using sc_core::sc_buffer;
|
||||
|
||||
using sc_core::sc_in_clk;
|
||||
using sc_core::sc_clock;
|
||||
|
||||
using sc_core::sc_event_queue;
|
||||
|
||||
using sc_core::sc_fifo;
|
||||
|
||||
using sc_core::sc_fifo_in;
|
||||
|
||||
using sc_core::sc_fifo_nonblocking_in_if;
|
||||
using sc_core::sc_fifo_blocking_in_if;
|
||||
using sc_core::sc_fifo_in_if;
|
||||
|
||||
using sc_core::sc_fifo_out;
|
||||
|
||||
using sc_core::sc_fifo_nonblocking_out_if;
|
||||
using sc_core::sc_fifo_blocking_out_if;
|
||||
using sc_core::sc_fifo_out_if;
|
||||
|
||||
using sc_core::sc_in;
|
||||
|
||||
using sc_core::sc_in_resolved;
|
||||
|
||||
using sc_core::sc_in_rv;
|
||||
|
||||
using sc_core::sc_inout;
|
||||
|
||||
using sc_core::sc_inout_resolved;
|
||||
|
||||
using sc_core::sc_inout_rv;
|
||||
|
||||
using sc_core::sc_mutex;
|
||||
|
||||
using sc_core::sc_mutex_if;
|
||||
|
||||
using sc_core::sc_out;
|
||||
|
||||
using sc_core::sc_out_resolved;
|
||||
|
||||
using sc_core::sc_out_rv;
|
||||
|
||||
using sc_core::sc_semaphore;
|
||||
|
||||
using sc_core::sc_semaphore_if;
|
||||
|
||||
using sc_core::sc_signal;
|
||||
|
||||
using sc_core::sc_signal_in_if;
|
||||
|
||||
using sc_core::SC_ONE_WRITER;
|
||||
using sc_core::SC_MANY_WRITERS;
|
||||
using sc_core::sc_signal_write_if;
|
||||
using sc_core::sc_signal_inout_if;
|
||||
|
||||
using sc_core::sc_signal_resolved;
|
||||
|
||||
using sc_core::sc_signal_rv;
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL__USING_HH__
|
||||
90
src/systemc/ext/channel/sc_buffer.hh
Normal file
90
src/systemc/ext/channel/sc_buffer.hh
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_BUFFER_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_BUFFER_HH__
|
||||
|
||||
#include "../core/sc_module.hh" // for sc_gen_unique_name
|
||||
#include "sc_signal.hh"
|
||||
#include "warn_unimpl.hh" // for warn_unimpl
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
template <class T, sc_writer_policy WRITER_POLICY>
|
||||
class sc_buffer : public sc_signal<T, WRITER_POLICY>
|
||||
{
|
||||
public:
|
||||
sc_buffer() : sc_signal<T, WRITER_POLICY>(sc_gen_unique_name("buffer")) {}
|
||||
explicit sc_buffer(const char *name) :
|
||||
sc_signal<T, WRITER_POLICY>(sc_gen_unique_name(name))
|
||||
{}
|
||||
|
||||
virtual void
|
||||
write(const T&)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
sc_buffer<T, WRITER_POLICY> &
|
||||
operator = (const T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_buffer<T, WRITER_POLICY> &
|
||||
operator = (const sc_signal<T, WRITER_POLICY> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_buffer<T, WRITER_POLICY> &
|
||||
operator = (const sc_buffer<T, WRITER_POLICY> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual const char *kind() const { return "sc_buffer"; }
|
||||
|
||||
protected:
|
||||
virtual void
|
||||
update()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_buffer(const sc_buffer<T, WRITER_POLICY> &) {}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_BUFFER_HH__
|
||||
85
src/systemc/ext/channel/sc_clock.hh
Normal file
85
src/systemc/ext/channel/sc_clock.hh
Normal file
@@ -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
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEMC_EXT_CHANNEL_SC_CLOCK_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_CLOCK_HH__
|
||||
|
||||
#include "../core/sc_time.hh"
|
||||
#include "sc_signal.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
template <class T>
|
||||
class sc_in;
|
||||
|
||||
class sc_time;
|
||||
|
||||
class sc_clock : public sc_signal<bool>
|
||||
{
|
||||
public:
|
||||
sc_clock();
|
||||
explicit sc_clock(const char *name);
|
||||
|
||||
sc_clock(const char *name, const sc_time &period,
|
||||
double duty_cycle=0.5, const sc_time &start_time=SC_ZERO_TIME,
|
||||
bool posedge_first=true);
|
||||
|
||||
sc_clock(const char *name, double period_v, sc_time_unit period_tu,
|
||||
double duty_cycle=0.5);
|
||||
|
||||
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=true);
|
||||
|
||||
virtual ~sc_clock();
|
||||
|
||||
virtual void write(const bool &);
|
||||
|
||||
const sc_time &period() const;
|
||||
double duty_cycle() const;
|
||||
const sc_time &start_time() const;
|
||||
bool posedge_first() const;
|
||||
|
||||
virtual const char *kind() const;
|
||||
|
||||
protected:
|
||||
virtual void before_end_of_elaboration();
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_clock(const sc_clock &) : sc_interface(), sc_signal<bool>() {}
|
||||
sc_clock &operator = (const sc_clock &) { return *this; }
|
||||
};
|
||||
|
||||
typedef sc_in<bool> sc_in_clk;
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_CLOCK_HH__
|
||||
70
src/systemc/ext/channel/sc_event_queue.hh
Normal file
70
src/systemc/ext/channel/sc_event_queue.hh
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_EVENT_QUEUE_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_EVENT_QUEUE_HH__
|
||||
|
||||
#include "../core/sc_interface.hh"
|
||||
#include "../core/sc_module.hh" // for sc_gen_unique_name
|
||||
#include "../core/sc_module_name.hh"
|
||||
#include "../core/sc_time.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_event;
|
||||
|
||||
class sc_event_queue_if : public virtual sc_interface
|
||||
{
|
||||
public:
|
||||
virtual void notify(double, sc_time_unit) = 0;
|
||||
virtual void notify(const sc_time &) = 0;
|
||||
virtual void cancel_all() = 0;
|
||||
};
|
||||
|
||||
class sc_event_queue : public sc_event_queue_if, public sc_module
|
||||
{
|
||||
public:
|
||||
sc_event_queue(sc_module_name name=
|
||||
sc_module_name(sc_gen_unique_name("event_queue")));
|
||||
~sc_event_queue();
|
||||
|
||||
virtual const char *kind() const;
|
||||
|
||||
virtual void notify(double, sc_time_unit);
|
||||
virtual void notify(const sc_time &);
|
||||
virtual void cancel_all();
|
||||
|
||||
virtual const sc_event &default_event() const;
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_EVENT_QUEUE_HH__
|
||||
171
src/systemc/ext/channel/sc_fifo.hh
Normal file
171
src/systemc/ext/channel/sc_fifo.hh
Normal file
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_FIFO_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_FIFO_HH__
|
||||
|
||||
#include "../core/sc_module.hh" // for sc_gen_unique_name
|
||||
#include "../core/sc_prim.hh"
|
||||
#include "sc_fifo_in_if.hh"
|
||||
#include "sc_fifo_out_if.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_port_base;
|
||||
class sc_event;
|
||||
|
||||
template <class T>
|
||||
class sc_fifo : public sc_fifo_in_if<T>,
|
||||
public sc_fifo_out_if<T>,
|
||||
public sc_prim_channel
|
||||
{
|
||||
public:
|
||||
explicit sc_fifo(int size=16) :
|
||||
sc_fifo_in_if<T>(), sc_fifo_out_if<T>(),
|
||||
sc_prim_channel(sc_gen_unique_name("fifo"))
|
||||
{}
|
||||
explicit sc_fifo(const char *name, int size=16) :
|
||||
sc_fifo_in_if<T>(), sc_fifo_out_if<T>(),
|
||||
sc_prim_channel(name)
|
||||
{}
|
||||
virtual ~sc_fifo() {}
|
||||
|
||||
virtual void
|
||||
register_port(sc_port_base &, const char *)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
read(T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual T
|
||||
read()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(T *)nullptr;
|
||||
}
|
||||
virtual bool
|
||||
nb_read(T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
operator T()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(T *)nullptr;
|
||||
}
|
||||
|
||||
virtual void
|
||||
write(const T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual bool
|
||||
nb_write(const T&)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
sc_fifo<T> &
|
||||
operator = (const T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual const sc_event &
|
||||
data_Written_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
virtual const sc_event &
|
||||
data_read_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
|
||||
virtual int
|
||||
num_available() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
virtual int
|
||||
num_free() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual void
|
||||
print(std::ostream & =std::cout) const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual void
|
||||
dump(std::ostream & =std::cout) const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual const char *kind() const { return "sc_fifo"; }
|
||||
|
||||
protected:
|
||||
virtual void
|
||||
update()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_fifo(const sc_fifo<T> &) :
|
||||
sc_fifo_in_if<T>(), sc_fifo_in_if<T>(), sc_prim_channel()
|
||||
{}
|
||||
sc_fifo &operator = (const sc_fifo<T> &) { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
inline std::ostream &
|
||||
operator << (std::ostream &os, const sc_fifo<T> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_FIFO_HH__
|
||||
97
src/systemc/ext/channel/sc_fifo_in.hh
Normal file
97
src/systemc/ext/channel/sc_fifo_in.hh
Normal file
@@ -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_CHANNEL_SC_FIFO_IN_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_FIFO_IN_HH__
|
||||
|
||||
#include "../core/sc_port.hh"
|
||||
#include "sc_fifo_in_if.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_event;
|
||||
class sc_event_finder;
|
||||
|
||||
template <class T>
|
||||
class sc_fifo_in : public sc_port<sc_fifo_in_if<T>, 0>
|
||||
{
|
||||
public:
|
||||
sc_fifo_in() : sc_port<sc_fifo_in_if<T>, 0>() {}
|
||||
explicit sc_fifo_in(const char *name) : sc_port<sc_fifo_in_if<T>, 0>(name)
|
||||
{}
|
||||
virtual ~sc_fifo_in() {}
|
||||
|
||||
void
|
||||
read(T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
T
|
||||
read()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(T *)nullptr;
|
||||
}
|
||||
bool
|
||||
nb_read(T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
const sc_event &
|
||||
data_written_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
sc_event_finder &
|
||||
data_written() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
int
|
||||
num_available() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
virtual const char *kind() const { return "sc_fifo_in"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_fifo_in(const sc_fifo_in<T> &) : sc_port<sc_fifo_in_if<T>, 0>() {}
|
||||
sc_fifo_in<T> &operator = (const sc_fifo_in<T> &) { return *this; }
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_FIFO_IN_HH__
|
||||
74
src/systemc/ext/channel/sc_fifo_in_if.hh
Normal file
74
src/systemc/ext/channel/sc_fifo_in_if.hh
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_FIFO_IN_IF_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_FIFO_IN_IF_HH__
|
||||
|
||||
#include "../core/sc_interface.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_event;
|
||||
|
||||
template <class T>
|
||||
class sc_fifo_nonblocking_in_if : virtual public sc_interface
|
||||
{
|
||||
public:
|
||||
virtual bool ab_read(T &) = 0;
|
||||
virtual const sc_event &data_written_event() const = 0;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class sc_fifo_blocking_in_if : virtual public sc_interface
|
||||
{
|
||||
public:
|
||||
virtual void read(T &) = 0;
|
||||
virtual T read() = 0;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class sc_fifo_in_if : public sc_fifo_nonblocking_in_if<T>,
|
||||
public sc_fifo_blocking_in_if<T>
|
||||
{
|
||||
public:
|
||||
virtual int num_avaialble() const = 0;
|
||||
|
||||
protected:
|
||||
sc_fifo_in_if() : sc_interface() {}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_fifo_in_if(const sc_fifo_in_if<T> &);
|
||||
sc_fifo_in_if<T> &operator = (const sc_fifo_in_if<T> &) { return *this; }
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_FIFO_IN_IF_HH__
|
||||
92
src/systemc/ext/channel/sc_fifo_out.hh
Normal file
92
src/systemc/ext/channel/sc_fifo_out.hh
Normal file
@@ -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
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEMC_EXT_CHANNEL_SC_FIFO_OUT_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_FIFO_OUT_HH__
|
||||
|
||||
#include "../core/sc_port.hh"
|
||||
#include "sc_fifo_out_if.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_event;
|
||||
class sc_event_finder;
|
||||
|
||||
template <class T>
|
||||
class sc_fifo_out : public sc_port<sc_fifo_out_if<T>, 0>
|
||||
{
|
||||
public:
|
||||
sc_fifo_out() : sc_port<sc_fifo_out_if<T>, 0>() {}
|
||||
explicit sc_fifo_out(const char *name) :
|
||||
sc_port<sc_fifo_out_if<T>, 0>(name)
|
||||
{}
|
||||
virtual ~sc_fifo_out() {}
|
||||
|
||||
void
|
||||
write(const T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
bool
|
||||
nb_write(const T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
const sc_event &
|
||||
data_read_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
sc_event_finder &
|
||||
data_read() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
int
|
||||
num_free() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
virtual const char *kind() const { return "sc_fifo_out"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_fifo_out(const sc_fifo_out<T> &) : sc_port<sc_fifo_out_if<T>, 0>() {}
|
||||
sc_fifo_out<T> &operator = (const sc_fifo_out<T> &) { return *this; }
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_FIFO_OUT_HH__
|
||||
76
src/systemc/ext/channel/sc_fifo_out_if.hh
Normal file
76
src/systemc/ext/channel/sc_fifo_out_if.hh
Normal file
@@ -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
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEMC_EXT_CHANNEL_SC_FIFO_OUT_IF_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_FIFO_OUT_IF_HH__
|
||||
|
||||
#include "../core/sc_interface.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_event;
|
||||
|
||||
template <class T>
|
||||
class sc_fifo_nonblocking_out_if : virtual public sc_interface
|
||||
{
|
||||
public:
|
||||
virtual bool ab_write(const T &) = 0;
|
||||
virtual const sc_event &data_read_event() const = 0;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class sc_fifo_blocking_out_if : virtual public sc_interface
|
||||
{
|
||||
public:
|
||||
virtual void write(const T &) = 0;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class sc_fifo_out_if : public sc_fifo_nonblocking_out_if<T>,
|
||||
public sc_fifo_blocking_out_if<T>
|
||||
{
|
||||
public:
|
||||
virtual int num_free() const = 0;
|
||||
|
||||
protected:
|
||||
sc_fifo_out_if() : sc_interface(), sc_fifo_nonblocking_out_if<T>(),
|
||||
sc_fifo_blocking_out_if<T>()
|
||||
{}
|
||||
|
||||
private:
|
||||
sc_fifo_out_if(const sc_fifo_out_if<T> &) : sc_interface(),
|
||||
sc_fifo_nonblocking_out_if<T>(), sc_fifo_blocking_out_if<T>()
|
||||
{}
|
||||
sc_fifo_out_if<T> &operator = (const sc_fifo_out_if<T> &) { return *this; }
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_FIFO_OUT_IF_HH__
|
||||
433
src/systemc/ext/channel/sc_in.hh
Normal file
433
src/systemc/ext/channel/sc_in.hh
Normal file
@@ -0,0 +1,433 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_IN_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_IN_HH__
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "../core/sc_port.hh"
|
||||
#include "sc_signal_in_if.hh"
|
||||
#include "sc_signal_inout_if.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_event;
|
||||
class sc_event_finder;
|
||||
class sc_trace_file;
|
||||
|
||||
template <class T>
|
||||
class sc_in : public sc_port<sc_signal_in_if<T>, 1>
|
||||
{
|
||||
public:
|
||||
sc_in() : sc_port<sc_signal_in_if<T>, 1>() {}
|
||||
explicit sc_in(const char *name) : sc_port<sc_signal_in_if<T>, 1>(name) {}
|
||||
virtual ~sc_in() {}
|
||||
|
||||
virtual void
|
||||
bind(const sc_signal_in_if<T> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
operator () (const sc_signal_in_if<T> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
bind(sc_port<sc_signal_in_if<T>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
operator () (sc_port<sc_signal_in_if<T>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
bind(sc_port<sc_signal_inout_if<T>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
operator () (sc_port<sc_signal_inout_if<T>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
end_of_elaboration()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
const T &
|
||||
read() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const T *)nullptr;
|
||||
}
|
||||
operator const T& () const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const T *)nullptr;
|
||||
}
|
||||
|
||||
const sc_event &
|
||||
default_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
value_changed_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
bool
|
||||
event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
sc_event_finder &
|
||||
value_changed() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
|
||||
virtual const char *kind() const { return "sc_in"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_in(const sc_in<T> &) : sc_port<sc_signal_in_if<T>, 1>() {}
|
||||
sc_in<T> &operator = (const sc_in<T> &) { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
inline void
|
||||
sc_trace(sc_trace_file *, const sc_in<T> &, const std::string &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
template <>
|
||||
class sc_in<bool> : public sc_port<sc_signal_in_if<bool>, 1>
|
||||
{
|
||||
public:
|
||||
sc_in() : sc_port<sc_signal_in_if<bool>, 1>() {}
|
||||
explicit sc_in(const char *name) :
|
||||
sc_port<sc_signal_in_if<bool>, 1>(name) {}
|
||||
virtual ~sc_in() {}
|
||||
|
||||
virtual void
|
||||
bind(const sc_signal_in_if<bool> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
operator () (const sc_signal_in_if<bool> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
bind(sc_port<sc_signal_in_if<bool>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
operator () (sc_port<sc_signal_in_if<bool>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
bind(sc_port<sc_signal_inout_if<bool>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
operator () (sc_port<sc_signal_inout_if<bool>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
end_of_elaboration()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
const bool &
|
||||
read() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const bool *)nullptr;
|
||||
}
|
||||
operator const bool& () const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const bool *)nullptr;
|
||||
}
|
||||
|
||||
const sc_event &
|
||||
default_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
value_changed_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
posedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
negedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
posedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
negedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
sc_event_finder &
|
||||
value_changed() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
sc_event_finder &
|
||||
pos() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
sc_event_finder &
|
||||
neg() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
|
||||
virtual const char *kind() const { return "sc_in"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_in(const sc_in<bool> &) : sc_port<sc_signal_in_if<bool>, 1>() {}
|
||||
sc_in<bool> &operator = (const sc_in<bool> &) { return *this; }
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void
|
||||
sc_trace<bool>(sc_trace_file *, const sc_in<bool> &, const std::string &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
template <>
|
||||
class sc_in<sc_dt::sc_logic> :
|
||||
public sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>
|
||||
{
|
||||
public:
|
||||
sc_in() : sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>() {}
|
||||
explicit sc_in(const char *name) :
|
||||
sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>(name)
|
||||
{}
|
||||
virtual ~sc_in() {}
|
||||
|
||||
virtual void
|
||||
bind(const sc_signal_in_if<sc_dt::sc_logic> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
operator () (const sc_signal_in_if<sc_dt::sc_logic> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
bind(sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
operator () (sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
bind(sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
operator () (sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
end_of_elaboration()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
const sc_dt::sc_logic &
|
||||
read() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_dt::sc_logic *)nullptr;
|
||||
}
|
||||
operator const sc_dt::sc_logic& () const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_dt::sc_logic *)nullptr;
|
||||
}
|
||||
|
||||
const sc_event &
|
||||
default_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
value_changed_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
posedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
negedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_event *)nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
posedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
negedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
sc_event_finder &
|
||||
value_changed() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
sc_event_finder &
|
||||
pos() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
sc_event_finder &
|
||||
neg() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
|
||||
virtual const char *kind() const { return "sc_in"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_in(const sc_in<sc_dt::sc_logic> &) :
|
||||
sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>()
|
||||
{}
|
||||
sc_in<sc_dt::sc_logic> &
|
||||
operator = (const sc_in<sc_dt::sc_logic> &)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void
|
||||
sc_trace<sc_dt::sc_logic>(
|
||||
sc_trace_file *, const sc_in<sc_dt::sc_logic> &, const std::string &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_IN_HH__
|
||||
68
src/systemc/ext/channel/sc_in_resolved.hh
Normal file
68
src/systemc/ext/channel/sc_in_resolved.hh
Normal file
@@ -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
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEMC_EXT_CHANNEL_SC_IN_RESOLVED_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_IN_RESOLVED_HH__
|
||||
|
||||
#include "sc_in.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
class sc_logic;
|
||||
|
||||
}
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_in_resolved : public sc_in<sc_dt::sc_logic>
|
||||
{
|
||||
public:
|
||||
sc_in_resolved();
|
||||
explicit sc_in_resolved(const char *name);
|
||||
virtual ~sc_in_resolved();
|
||||
|
||||
virtual void end_of_elaboration();
|
||||
|
||||
virtual const char *kind() const;
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_in_resolved(const sc_in_resolved &) : sc_in<sc_dt::sc_logic>() {}
|
||||
sc_in_resolved &
|
||||
operator = (const sc_in_resolved &)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_IN_RESOLVED_HH__
|
||||
66
src/systemc/ext/channel/sc_in_rv.hh
Normal file
66
src/systemc/ext/channel/sc_in_rv.hh
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_IN_RV_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_IN_RV_HH__
|
||||
|
||||
#include "sc_in.hh"
|
||||
|
||||
namespace sc_dt
|
||||
{
|
||||
|
||||
template <int W>
|
||||
class sc_lv;
|
||||
|
||||
} // namespace sc_dt
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
template <int W>
|
||||
class sc_in_rv : public sc_in<sc_dt::sc_lv<W>>
|
||||
{
|
||||
public:
|
||||
sc_in_rv() : sc_in<sc_dt::sc_lv<W>>() {}
|
||||
explicit sc_in_rv(const char *name) : sc_in<sc_dt::sc_lv<W>>(name) {}
|
||||
virtual ~sc_in_rv() {};
|
||||
|
||||
virtual void end_of_elaboration() {}
|
||||
|
||||
virtual const char *kind() const { return "sc_in_rv"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_in_rv(const sc_in_rv<W> &) : sc_in<sc_dt::sc_lv<W>>() {}
|
||||
sc_in_rv<W> &operator = (const sc_in_rv<W> &) { *this; }
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_IN_RV_HH__
|
||||
466
src/systemc/ext/channel/sc_inout.hh
Normal file
466
src/systemc/ext/channel/sc_inout.hh
Normal file
@@ -0,0 +1,466 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_INOUT_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_INOUT_HH__
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "../core/sc_port.hh"
|
||||
#include "sc_signal_inout_if.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace sc_dt
|
||||
{
|
||||
|
||||
class sc_logic;
|
||||
|
||||
} // namespace sc_dt
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_event;
|
||||
class sc_event_finder;
|
||||
class sc_trace_file;
|
||||
|
||||
template <class T>
|
||||
class sc_inout : public sc_port<sc_signal_inout_if<T>, 1>
|
||||
{
|
||||
public:
|
||||
sc_inout() : sc_port<sc_signal_inout_if<T>, 1>() {}
|
||||
explicit sc_inout(const char *name) :
|
||||
sc_port<sc_signal_inout_if<T>, 1>(name)
|
||||
{}
|
||||
virtual ~sc_inout() {}
|
||||
|
||||
void
|
||||
initialize(const T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
initialize(const sc_signal_in_if<T> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void end_of_elaboration() {}
|
||||
|
||||
const T &
|
||||
read() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const T *)nullptr;
|
||||
}
|
||||
operator const T& () const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const T *)nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
write(const T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
sc_inout<T> &
|
||||
operator = (const T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<T> *)nullptr;
|
||||
}
|
||||
sc_inout<T> &
|
||||
operator = (const sc_signal_in_if<T> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<T> *)nullptr;
|
||||
}
|
||||
sc_inout<T> &
|
||||
operator = (const sc_port<sc_signal_in_if<T>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<T> *)nullptr;
|
||||
}
|
||||
sc_inout<T> &
|
||||
operator = (const sc_port<sc_signal_inout_if<T>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<T> *)nullptr;
|
||||
}
|
||||
sc_inout<T> &
|
||||
operator = (const sc_inout<T> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<T> *)nullptr;
|
||||
}
|
||||
|
||||
const sc_event &
|
||||
default_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
value_changed_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
bool
|
||||
event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
sc_event_finder &
|
||||
value_changed() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
|
||||
virtual const char *kind() const { return "sc_inout"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_inout(const sc_inout<T> &) : sc_port<sc_signal_inout_if<T>, 1>() {}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
inline void
|
||||
sc_trace(sc_trace_file *, const sc_inout<T> &, const std::string &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
template <>
|
||||
class sc_inout<bool> : public sc_port<sc_signal_inout_if<bool>, 1>
|
||||
{
|
||||
public:
|
||||
sc_inout() : sc_port<sc_signal_inout_if<bool>, 1>() {}
|
||||
explicit sc_inout(const char *name) :
|
||||
sc_port<sc_signal_inout_if<bool>, 1>(name)
|
||||
{}
|
||||
virtual ~sc_inout() {}
|
||||
|
||||
void
|
||||
initialize(const bool &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
initialize(const sc_signal_in_if<bool> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void end_of_elaboration() {}
|
||||
|
||||
const bool &
|
||||
read() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(bool *)nullptr;
|
||||
}
|
||||
operator const bool& () const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(bool *)nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
write(const bool &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
sc_inout<bool> &
|
||||
operator = (const bool &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<bool> *)nullptr;
|
||||
}
|
||||
sc_inout<bool> &
|
||||
operator = (const sc_signal_in_if<bool> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<bool> *)nullptr;
|
||||
}
|
||||
sc_inout<bool> &
|
||||
operator = (const sc_port<sc_signal_in_if<bool>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<bool> *)nullptr;
|
||||
}
|
||||
sc_inout<bool> &
|
||||
operator = (const sc_port<sc_signal_inout_if<bool>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<bool> *)nullptr;
|
||||
}
|
||||
sc_inout<bool> &
|
||||
operator = (const sc_inout<bool> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<bool> *)nullptr;
|
||||
}
|
||||
|
||||
const sc_event &
|
||||
default_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
value_changed_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
posedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
negedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
posedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
negedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
sc_event_finder &
|
||||
value_changed() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
sc_event_finder &
|
||||
pos() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
sc_event_finder &
|
||||
neg() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
|
||||
virtual const char *kind() const { return "sc_inout"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_inout(const sc_inout<bool> &) :
|
||||
sc_port<sc_signal_inout_if<bool>, 1>() {}
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void sc_trace<bool>(
|
||||
sc_trace_file *, const sc_inout<bool> &, const std::string &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
template <>
|
||||
class sc_inout<sc_dt::sc_logic> :
|
||||
public sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>
|
||||
{
|
||||
public:
|
||||
sc_inout() : sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>() {}
|
||||
explicit sc_inout(const char *name) :
|
||||
sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(name)
|
||||
{}
|
||||
virtual ~sc_inout() {}
|
||||
|
||||
void
|
||||
initialize(const sc_dt::sc_logic &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
void
|
||||
initialize(const sc_signal_in_if<sc_dt::sc_logic> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void end_of_elaboration() {}
|
||||
|
||||
const sc_dt::sc_logic &
|
||||
read() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_dt::sc_logic *)nullptr;
|
||||
}
|
||||
operator const sc_dt::sc_logic& () const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_dt::sc_logic *)nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
write(const sc_dt::sc_logic &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
sc_inout<sc_dt::sc_logic> &
|
||||
operator = (const sc_dt::sc_logic &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<sc_dt::sc_logic> *)nullptr;
|
||||
}
|
||||
sc_inout<sc_dt::sc_logic> &
|
||||
operator = (const sc_signal_in_if<sc_dt::sc_logic> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<sc_dt::sc_logic> *)nullptr;
|
||||
}
|
||||
sc_inout<sc_dt::sc_logic> &
|
||||
operator = (const sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<sc_dt::sc_logic> *)nullptr;
|
||||
}
|
||||
sc_inout<sc_dt::sc_logic> &
|
||||
operator = (const sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<sc_dt::sc_logic> *)nullptr;
|
||||
}
|
||||
sc_inout<sc_dt::sc_logic> &
|
||||
operator = (const sc_inout<sc_dt::sc_logic> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_inout<sc_dt::sc_logic> *)nullptr;
|
||||
}
|
||||
|
||||
const sc_event &
|
||||
default_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
value_changed_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
posedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
const sc_event &
|
||||
negedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
posedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
bool
|
||||
negedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
sc_event_finder &
|
||||
value_changed() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
sc_event_finder &
|
||||
pos() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
sc_event_finder &
|
||||
neg() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event_finder *)nullptr;
|
||||
}
|
||||
|
||||
virtual const char *kind() const { return "sc_inout"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_inout(const sc_inout<sc_dt::sc_logic> &) :
|
||||
sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>()
|
||||
{}
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void
|
||||
sc_trace<sc_dt::sc_logic>(sc_trace_file *, const sc_inout<sc_dt::sc_logic> &,
|
||||
const std::string &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_INOUT_HH__
|
||||
75
src/systemc/ext/channel/sc_inout_resolved.hh
Normal file
75
src/systemc/ext/channel/sc_inout_resolved.hh
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_INOUT_RESOLVED_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_INOUT_RESOLVED_HH__
|
||||
|
||||
#include "sc_inout.hh"
|
||||
#include "sc_signal_in_if.hh"
|
||||
#include "sc_signal_inout_if.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
class sc_logic;
|
||||
|
||||
}
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_inout_resolved : public sc_inout<sc_dt::sc_logic>
|
||||
{
|
||||
public:
|
||||
sc_inout_resolved();
|
||||
explicit sc_inout_resolved(const char *name);
|
||||
virtual ~sc_inout_resolved();
|
||||
|
||||
virtual void end_of_elaboration();
|
||||
|
||||
sc_inout_resolved &operator = (const sc_dt::sc_logic &);
|
||||
sc_inout_resolved &operator = (const sc_signal_in_if<sc_dt::sc_logic> &);
|
||||
sc_inout_resolved &operator = (
|
||||
const sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> &);
|
||||
sc_inout_resolved &operator = (
|
||||
const sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &);
|
||||
sc_inout_resolved &operator = (const sc_inout_resolved &);
|
||||
|
||||
virtual const char *kind() const;
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_inout_resolved(const sc_inout_resolved &) :
|
||||
sc_inout<sc_dt::sc_logic>() {}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_INOUT_RESOLVED_HH__
|
||||
95
src/systemc/ext/channel/sc_inout_rv.hh
Normal file
95
src/systemc/ext/channel/sc_inout_rv.hh
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_INOUT_RV_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_INOUT_RV_HH__
|
||||
|
||||
#include "../core/sc_port.hh"
|
||||
#include "sc_signal_in_if.hh"
|
||||
#include "sc_signal_inout_if.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace sc_dt
|
||||
{
|
||||
|
||||
template <int W>
|
||||
class sc_lv;
|
||||
|
||||
} // namespace sc_dt
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
template <int W>
|
||||
class sc_inout_rv : public sc_inout<sc_dt::sc_lv<W>>
|
||||
{
|
||||
public:
|
||||
sc_inout_rv() : sc_inout<sc_dt::sc_lv<W>>() {}
|
||||
explicit sc_inout_rv(const char *name) : sc_inout<sc_dt::sc_lv<W>>(name) {}
|
||||
virtual ~sc_inout_rv() {}
|
||||
|
||||
sc_inout_rv<W> &
|
||||
operator = (const sc_dt::sc_lv<W> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_inout_rv<W> &
|
||||
operator = (const sc_signal_in_if<sc_dt::sc_lv<W>> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_inout_rv<W> &
|
||||
operator = (const sc_port<sc_signal_in_if<sc_dt::sc_lv<W>>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_inout_rv<W> &
|
||||
operator = (const sc_port<sc_signal_inout_if<sc_dt::sc_lv<W>>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_inout_rv<W> &
|
||||
operator = (const sc_inout_rv<W> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual void end_of_elaboration() {};
|
||||
|
||||
virtual const char *kind() const { return "sc_inout_rv"; }
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_INOUT_RV_HH__
|
||||
59
src/systemc/ext/channel/sc_mutex.hh
Normal file
59
src/systemc/ext/channel/sc_mutex.hh
Normal file
@@ -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
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEMC_EXT_CHANNEL_SC_MUTEX_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_MUTEX_HH__
|
||||
|
||||
#include "../core/sc_object.hh"
|
||||
#include "sc_mutex_if.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_mutex : public sc_mutex_if, public sc_object
|
||||
{
|
||||
public:
|
||||
sc_mutex();
|
||||
explicit sc_mutex(const char *name);
|
||||
|
||||
virtual int lock();
|
||||
virtual int trylock();
|
||||
virtual int unlock();
|
||||
|
||||
virtual const char *kind() const;
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_mutex(const sc_mutex &) : sc_interface(), sc_mutex_if(), sc_object() {}
|
||||
sc_mutex &operator = (const sc_mutex &) { return *this; }
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_MUTEX_HH__
|
||||
56
src/systemc/ext/channel/sc_mutex_if.hh
Normal file
56
src/systemc/ext/channel/sc_mutex_if.hh
Normal file
@@ -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_CHANNEL_SC_MUTEX_IF_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_MUTEX_IF_HH__
|
||||
|
||||
#include "../core/sc_interface.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_mutex_if : virtual public sc_interface
|
||||
{
|
||||
public:
|
||||
virtual int lock() = 0;
|
||||
virtual int trylock() = 0;
|
||||
virtual int unlock() = 0;
|
||||
|
||||
protected:
|
||||
sc_mutex_if() : sc_interface() {}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_mutex_if(const sc_mutex_if &) : sc_interface() {}
|
||||
sc_mutex_if &operator = (const sc_mutex_if &) { return *this; }
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_MUTEX_IF_HH__
|
||||
88
src/systemc/ext/channel/sc_out.hh
Normal file
88
src/systemc/ext/channel/sc_out.hh
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_OUT_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_OUT_HH__
|
||||
|
||||
#include "../core/sc_port.hh"
|
||||
#include "sc_inout.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
template <class T>
|
||||
class sc_out : public sc_inout<T>
|
||||
{
|
||||
public:
|
||||
sc_out() : sc_inout<T>() {}
|
||||
explicit sc_out(const char *name) : sc_inout<T>(name) {}
|
||||
virtual ~sc_out() {}
|
||||
|
||||
sc_out<T> &
|
||||
operator = (const T &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_out<T> *)nullptr;
|
||||
}
|
||||
sc_out<T> &
|
||||
operator = (const sc_signal_in_if<T> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_out<T> *)nullptr;
|
||||
}
|
||||
sc_out<T> &
|
||||
operator = (const sc_port<sc_signal_in_if<T>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_out<T> *)nullptr;
|
||||
}
|
||||
sc_out<T> &
|
||||
operator = (const sc_port<sc_signal_inout_if<T>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_out<T> *)nullptr;
|
||||
}
|
||||
sc_out<T> &
|
||||
operator = (const sc_out<T> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_out<T> *)nullptr;
|
||||
}
|
||||
|
||||
virtual const char *kind() const { return "sc_out"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_out(const sc_out<T> &) : sc_inout<T>() {}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_OUT_HH__
|
||||
72
src/systemc/ext/channel/sc_out_resolved.hh
Normal file
72
src/systemc/ext/channel/sc_out_resolved.hh
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_OUT_RESOLVED_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_OUT_RESOLVED_HH__
|
||||
|
||||
#include "sc_out.hh"
|
||||
#include "sc_signal_in_if.hh"
|
||||
#include "sc_signal_inout_if.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
class sc_logic;
|
||||
|
||||
}
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_out_resolved : public sc_out<sc_dt::sc_logic>
|
||||
{
|
||||
public:
|
||||
sc_out_resolved();
|
||||
explicit sc_out_resolved(const char *name);
|
||||
virtual ~sc_out_resolved();
|
||||
|
||||
sc_out_resolved &operator = (const sc_dt::sc_logic &);
|
||||
sc_out_resolved &operator = (const sc_signal_in_if<sc_dt::sc_logic> &);
|
||||
sc_out_resolved &operator = (
|
||||
const sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> &);
|
||||
sc_out_resolved &operator = (
|
||||
const sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &);
|
||||
sc_out_resolved &operator = (const sc_out_resolved &);
|
||||
|
||||
virtual const char *kind() const;
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_out_resolved(const sc_out_resolved &) : sc_out<sc_dt::sc_logic>() {}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_OUT_RESOLVED_HH__
|
||||
98
src/systemc/ext/channel/sc_out_rv.hh
Normal file
98
src/systemc/ext/channel/sc_out_rv.hh
Normal file
@@ -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_CHANNEL_SC_OUT_RV_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_OUT_RV_HH__
|
||||
|
||||
#include "../core/sc_port.hh"
|
||||
#include "sc_inout_rv.hh"
|
||||
#include "sc_signal_in_if.hh"
|
||||
#include "sc_signal_inout_if.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace sc_dt
|
||||
{
|
||||
|
||||
template <int W>
|
||||
class sc_lv;
|
||||
|
||||
} // namespace sc_dt
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
template <int W>
|
||||
class sc_out_rv : public sc_inout_rv<W>
|
||||
{
|
||||
public:
|
||||
sc_out_rv() : sc_inout_rv<W>() {}
|
||||
explicit sc_out_rv(const char *name) : sc_inout_rv<W>(name) {}
|
||||
virtual ~sc_out_rv() {};
|
||||
|
||||
sc_out_rv<W> &
|
||||
operator = (const sc_dt::sc_lv<W> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_out_rv<W> &
|
||||
operator = (const sc_signal_in_if<sc_dt::sc_lv<W>> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_out_rv<W> &
|
||||
operator = (const sc_port<sc_signal_in_if<sc_dt::sc_lv<W>>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_out_rv<W> &
|
||||
operator = (const sc_port<sc_signal_inout_if<sc_dt::sc_lv<W>>, 1> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_out_rv<W> &
|
||||
operator = (const sc_out_rv<W> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual const char *kind() const { return "sc_out_rv"; }
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_out_rv(const sc_out_rv<W> &) : sc_inout_rv<W>() {}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_OUT_RV_HH__
|
||||
63
src/systemc/ext/channel/sc_semaphore.hh
Normal file
63
src/systemc/ext/channel/sc_semaphore.hh
Normal file
@@ -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
|
||||
*/
|
||||
|
||||
#ifndef __SYSTEMC_EXT_CHANNEL_SC_SEMAPHORE_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_SEMAPHORE_HH__
|
||||
|
||||
#include "../core/sc_object.hh"
|
||||
#include "sc_semaphore_if.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_semaphore : public sc_semaphore_if, public sc_object
|
||||
{
|
||||
public:
|
||||
explicit sc_semaphore(int);
|
||||
sc_semaphore(const char *name, int);
|
||||
|
||||
virtual int wait();
|
||||
virtual int trywait();
|
||||
virtual int post();
|
||||
virtual int get_value() const;
|
||||
|
||||
virtual const char *kind() const;
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_semaphore(const sc_semaphore &) :
|
||||
sc_interface(), sc_semaphore_if(), sc_object()
|
||||
{}
|
||||
|
||||
sc_semaphore &operator = (const sc_semaphore &) { return *this; }
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_SEMAPHORE_HH__
|
||||
57
src/systemc/ext/channel/sc_semaphore_if.hh
Normal file
57
src/systemc/ext/channel/sc_semaphore_if.hh
Normal file
@@ -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_CHANNEL_SC_SEMAPHORE_IF_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_SEMAPHORE_IF_HH__
|
||||
|
||||
#include "../core/sc_interface.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_semaphore_if : virtual public sc_interface
|
||||
{
|
||||
public:
|
||||
virtual int wait() = 0;
|
||||
virtual int trywait() = 0;
|
||||
virtual int post() = 0;
|
||||
virtual int get_value() const = 0;
|
||||
|
||||
protected:
|
||||
sc_semaphore_if() : sc_interface() {}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_semaphore_if(const sc_semaphore_if &) : sc_interface() {}
|
||||
sc_semaphore_if &operator = (const sc_semaphore_if &) { return *this; }
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_SEMAPHORE_IF_HH__
|
||||
414
src/systemc/ext/channel/sc_signal.hh
Normal file
414
src/systemc/ext/channel/sc_signal.hh
Normal file
@@ -0,0 +1,414 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_SIGNAL_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_SIGNAL_HH__
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "../core/sc_module.hh" // for sc_gen_unique_name
|
||||
#include "../core/sc_prim.hh"
|
||||
#include "sc_signal_inout_if.hh"
|
||||
#include "warn_unimpl.hh" // for warn_unimpl
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_port_base;
|
||||
|
||||
template <class T, sc_writer_policy WRITER_POLICY=SC_ONE_WRITER>
|
||||
class sc_signal : public sc_signal_inout_if<T>,
|
||||
public sc_prim_channel
|
||||
{
|
||||
public:
|
||||
sc_signal() : sc_signal_inout_if<T>(),
|
||||
sc_prim_channel(sc_gen_unique_name("signal"))
|
||||
{}
|
||||
explicit sc_signal(const char *name) : sc_signal_inout_if<T>(),
|
||||
sc_prim_channel(name)
|
||||
{}
|
||||
virtual ~sc_signal() {}
|
||||
|
||||
virtual void
|
||||
register_port(sc_port_base &, const char *)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual const T&
|
||||
read() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const T *)nullptr;
|
||||
}
|
||||
operator const T&() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const T *)nullptr;
|
||||
}
|
||||
|
||||
virtual sc_writer_policy
|
||||
get_writer_policy() const
|
||||
{
|
||||
return WRITER_POLICY;
|
||||
}
|
||||
virtual void
|
||||
write(const T&)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
sc_signal<T, WRITER_POLICY> &
|
||||
operator = (const T&)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_signal<T, WRITER_POLICY> &
|
||||
operator = (const sc_signal<T, WRITER_POLICY> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual const sc_event &
|
||||
default_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
virtual const sc_event &
|
||||
value_changed_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
virtual bool
|
||||
event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void
|
||||
print(std::ostream & =std::cout) const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual void
|
||||
dump(std::ostream & =std::cout) const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual const char *kind() const { return "sc_signal"; }
|
||||
|
||||
protected:
|
||||
virtual void
|
||||
update()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_signal(const sc_signal<T, WRITER_POLICY> &) :
|
||||
sc_signal_inout_if<T>(), sc_prim_channel("")
|
||||
{}
|
||||
};
|
||||
|
||||
template <class T, sc_writer_policy WRITER_POLICY>
|
||||
inline std::ostream &
|
||||
operator << (std::ostream &os, const sc_signal<T, WRITER_POLICY> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return os;
|
||||
}
|
||||
|
||||
template <sc_writer_policy WRITER_POLICY>
|
||||
class sc_signal<bool, WRITER_POLICY> :
|
||||
public sc_signal_inout_if<bool>, public sc_prim_channel
|
||||
{
|
||||
public:
|
||||
sc_signal()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
explicit sc_signal(const char *)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual ~sc_signal()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
register_port(sc_port_base &, const char *)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual const bool &
|
||||
read() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const bool *)nullptr;
|
||||
}
|
||||
operator const bool &() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const bool *)nullptr;
|
||||
}
|
||||
|
||||
virtual sc_writer_policy
|
||||
get_writer_policy() const
|
||||
{
|
||||
return WRITER_POLICY;
|
||||
}
|
||||
virtual void
|
||||
write(const bool &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
sc_signal<bool, WRITER_POLICY> &
|
||||
operator = (const bool &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_signal<bool, WRITER_POLICY> &
|
||||
operator = (const sc_signal<bool, WRITER_POLICY> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual const sc_event &
|
||||
default_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
|
||||
virtual const sc_event &
|
||||
value_changed_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
virtual const sc_event &
|
||||
posedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
virtual const sc_event &
|
||||
negedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
|
||||
virtual bool
|
||||
event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
virtual bool
|
||||
posedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
virtual bool
|
||||
negedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void
|
||||
print(std::ostream & =std::cout) const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual void
|
||||
dump(std::ostream & =std::cout) const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual const char *kind() const { return "sc_signal"; }
|
||||
|
||||
protected:
|
||||
virtual void
|
||||
update()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_signal(const sc_signal<bool, WRITER_POLICY> &) :
|
||||
sc_signal_inout_if<bool>(), sc_prim_channel("")
|
||||
{}
|
||||
};
|
||||
|
||||
template <sc_writer_policy WRITER_POLICY>
|
||||
class sc_signal<sc_dt::sc_logic, WRITER_POLICY> :
|
||||
public sc_signal_inout_if<sc_dt::sc_logic>, public sc_prim_channel
|
||||
{
|
||||
public:
|
||||
sc_signal()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
explicit sc_signal(const char *)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual ~sc_signal()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
register_port(sc_port_base &, const char *)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual const sc_dt::sc_logic &
|
||||
read() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_dt::sc_logic *)nullptr;
|
||||
}
|
||||
operator const sc_dt::sc_logic &() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(const sc_dt::sc_logic *)nullptr;
|
||||
}
|
||||
|
||||
virtual sc_writer_policy
|
||||
get_writer_policy() const
|
||||
{
|
||||
return WRITER_POLICY;
|
||||
}
|
||||
virtual void
|
||||
write(const sc_dt::sc_logic &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
sc_signal<sc_dt::sc_logic, WRITER_POLICY> &
|
||||
operator = (const sc_dt::sc_logic &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_signal<sc_dt::sc_logic, WRITER_POLICY> &
|
||||
operator = (const sc_signal<sc_dt::sc_logic, WRITER_POLICY> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual const sc_event &
|
||||
default_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
|
||||
virtual const sc_event &
|
||||
value_changed_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
virtual const sc_event &
|
||||
posedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
virtual const sc_event &
|
||||
negedge_event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *(sc_event *)nullptr;
|
||||
}
|
||||
|
||||
virtual bool
|
||||
event() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
virtual bool
|
||||
posedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
virtual bool
|
||||
negedge() const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void
|
||||
print(std::ostream & =std::cout) const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual void
|
||||
dump(std::ostream & =std::cout) const
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
virtual const char *kind() const { return "sc_signal"; }
|
||||
|
||||
protected:
|
||||
virtual void
|
||||
update()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_signal(const sc_signal<sc_dt::sc_logic, WRITER_POLICY> &) :
|
||||
sc_signal_inout_if<sc_dt::sc_logic>(), sc_prim_channel("")
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_SIGNAL_HH__
|
||||
126
src/systemc/ext/channel/sc_signal_in_if.hh
Normal file
126
src/systemc/ext/channel/sc_signal_in_if.hh
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_SIGNAL_IN_IF_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_SIGNAL_IN_IF_HH__
|
||||
|
||||
#include "../core/sc_interface.hh"
|
||||
|
||||
namespace sc_dt
|
||||
{
|
||||
|
||||
class sc_logic;
|
||||
|
||||
};
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_event;
|
||||
|
||||
template <class T>
|
||||
class sc_signal_in_if : virtual public sc_interface
|
||||
{
|
||||
public:
|
||||
virtual const T &read() const = 0;
|
||||
virtual const sc_event &value_changed_event() const = 0;
|
||||
virtual bool event() const = 0;
|
||||
|
||||
protected:
|
||||
sc_signal_in_if() : sc_interface() {}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_signal_in_if(const sc_signal_in_if<T> &) : sc_interface() {}
|
||||
sc_signal_in_if<T> &
|
||||
operator = (const sc_signal_in_if<T> &)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
class sc_signal_in_if<bool> : virtual public sc_interface
|
||||
{
|
||||
public:
|
||||
virtual const bool &read() const = 0;
|
||||
|
||||
virtual const sc_event &value_changed_event() const = 0;
|
||||
virtual const sc_event &posedge_event() const = 0;
|
||||
virtual const sc_event &negedge_event() const = 0;
|
||||
|
||||
virtual bool event() const = 0;
|
||||
virtual bool posedge() const = 0;
|
||||
virtual bool negedge() const = 0;
|
||||
|
||||
protected:
|
||||
sc_signal_in_if() : sc_interface() {}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_signal_in_if(const sc_signal_in_if<bool> &) : sc_interface() {}
|
||||
sc_signal_in_if<bool> &
|
||||
operator = (const sc_signal_in_if<bool> &)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
class sc_signal_in_if<sc_dt::sc_logic> : virtual public sc_interface
|
||||
{
|
||||
public:
|
||||
virtual const sc_dt::sc_logic &read() const = 0;
|
||||
|
||||
virtual const sc_event &value_changed_event() const = 0;
|
||||
virtual const sc_event &posedge_event() const = 0;
|
||||
virtual const sc_event &negedge_event() const = 0;
|
||||
|
||||
virtual bool event() const = 0;
|
||||
virtual bool posedge() const = 0;
|
||||
virtual bool negedge() const = 0;
|
||||
|
||||
protected:
|
||||
sc_signal_in_if() : sc_interface() {}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_signal_in_if(const sc_signal_in_if<sc_dt::sc_logic> &) :
|
||||
sc_interface()
|
||||
{}
|
||||
sc_signal_in_if<sc_dt::sc_logic> &
|
||||
operator = (const sc_signal_in_if<sc_dt::sc_logic> &)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_SIGNAL_IN_IF_HH__
|
||||
90
src/systemc/ext/channel/sc_signal_inout_if.hh
Normal file
90
src/systemc/ext/channel/sc_signal_inout_if.hh
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_SIGNAL_INOUT_IF_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_SIGNAL_INOUT_IF_HH__
|
||||
|
||||
#include "../core/sc_interface.hh"
|
||||
#include "sc_signal_in_if.hh"
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
enum sc_writer_policy
|
||||
{
|
||||
SC_ONE_WRITER,
|
||||
SC_MANY_WRITERS
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class sc_signal_write_if : virtual public sc_interface
|
||||
{
|
||||
public:
|
||||
virtual sc_writer_policy
|
||||
get_writer_policy() const
|
||||
{
|
||||
return SC_ONE_WRITER;
|
||||
}
|
||||
virtual void write(const T &) = 0;
|
||||
|
||||
protected:
|
||||
sc_signal_write_if() : sc_interface() {}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_signal_write_if(const sc_signal_write_if<T> &) : sc_interface() {}
|
||||
sc_signal_write_if<T> &
|
||||
operator = (const sc_signal_write_if<T> &)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class sc_signal_inout_if : public sc_signal_in_if<T>,
|
||||
public sc_signal_write_if<T>
|
||||
{
|
||||
protected:
|
||||
sc_signal_inout_if() : sc_signal_in_if<T>(), sc_signal_write_if<T>() {}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_signal_inout_if(const sc_signal_inout_if<T> &) :
|
||||
sc_signal_in_if<T>(), sc_signal_write_if<T>()
|
||||
{}
|
||||
sc_signal_inout_if<T> &
|
||||
operator = (const sc_signal_inout_if<T> &)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_SIGNAL_INOUT_IF_HH__
|
||||
75
src/systemc/ext/channel/sc_signal_resolved.hh
Normal file
75
src/systemc/ext/channel/sc_signal_resolved.hh
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_SIGNAL_RESOLVED_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_SIGNAL_RESOLVED_HH__
|
||||
|
||||
#include "sc_signal.hh"
|
||||
#include "sc_signal_inout_if.hh"
|
||||
|
||||
namespace sc_dt
|
||||
{
|
||||
|
||||
class sc_logic;
|
||||
|
||||
};
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_port_base;
|
||||
|
||||
class sc_signal_resolved : public sc_signal<sc_dt::sc_logic, SC_MANY_WRITERS>
|
||||
{
|
||||
public:
|
||||
sc_signal_resolved();
|
||||
explicit sc_signal_resolved(const char *name);
|
||||
virtual ~sc_signal_resolved();
|
||||
|
||||
virtual void register_port(sc_port_base &, const char *);
|
||||
|
||||
virtual void write(const sc_dt::sc_logic &);
|
||||
sc_signal_resolved &operator = (const sc_dt::sc_logic &);
|
||||
sc_signal_resolved &operator = (const sc_signal_resolved &);
|
||||
|
||||
virtual const char *kind() const;
|
||||
|
||||
protected:
|
||||
virtual void update();
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_signal_resolved(const sc_signal_resolved &) :
|
||||
sc_interface(), sc_signal<sc_dt::sc_logic, SC_MANY_WRITERS>()
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_SIGNAL_RESOLVED_HH__
|
||||
104
src/systemc/ext/channel/sc_signal_rv.hh
Normal file
104
src/systemc/ext/channel/sc_signal_rv.hh
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* 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_CHANNEL_SC_SIGNAL_RV_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_SC_SIGNAL_RV_HH__
|
||||
|
||||
#include "../core/sc_module.hh" // for sc_gen_unique_name
|
||||
#include "sc_signal.hh"
|
||||
#include "warn_unimpl.hh"
|
||||
|
||||
namespace sc_dt
|
||||
{
|
||||
|
||||
template <int W>
|
||||
class sc_lv;
|
||||
|
||||
};
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
class sc_port_base;
|
||||
|
||||
template <int W>
|
||||
class sc_signal_rv : public sc_signal<sc_dt::sc_lv<W>, SC_MANY_WRITERS>
|
||||
{
|
||||
public:
|
||||
sc_signal_rv() : sc_signal<sc_dt::sc_lv<W>, SC_MANY_WRITERS>(
|
||||
sc_gen_unique_name("signal_rv"))
|
||||
{}
|
||||
sc_signal_rv(const char *name) :
|
||||
sc_signal<sc_dt::sc_lv<W>, SC_MANY_WRITERS>(name)
|
||||
{}
|
||||
virtual ~sc_signal_rv() {}
|
||||
|
||||
virtual void
|
||||
register_port(sc_port_base &, const char *)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
virtual void
|
||||
write(const sc_dt::sc_lv<W> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
sc_signal_rv<W> &
|
||||
operator = (const sc_dt::sc_lv<W> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
sc_signal_rv<W> &
|
||||
operator = (const sc_signal_rv<W> &)
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual const char *kind() const { return "sc_signal_rv"; }
|
||||
|
||||
protected:
|
||||
virtual void
|
||||
update()
|
||||
{
|
||||
sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
private:
|
||||
// Disabled
|
||||
sc_signal_rv(const sc_signal_rv<W> &) :
|
||||
sc_signal<sc_dt::sc_lv<W>, SC_MANY_WRITERS>()
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_SC_SIGNAL_RV_HH__
|
||||
40
src/systemc/ext/channel/warn_unimpl.hh
Normal file
40
src/systemc/ext/channel/warn_unimpl.hh
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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_CHANNEL_WARN_UNIMPL_HH__
|
||||
#define __SYSTEMC_EXT_CHANNEL_WARN_UNIMPL_HH__
|
||||
|
||||
namespace sc_core
|
||||
{
|
||||
|
||||
void sc_channel_warn_unimpl(const char *func);
|
||||
|
||||
} // namespace sc_core
|
||||
|
||||
#endif //__SYSTEMC_EXT_CHANNEL_WARN_UNIMPL_HH__
|
||||
@@ -30,6 +30,7 @@
|
||||
#ifndef __SYSTEMC_EXT_SYSTEMC__
|
||||
#define __SYSTEMC_EXT_SYSTEMC__
|
||||
|
||||
#include "channel/_channel.hh"
|
||||
#include "core/_core.hh"
|
||||
#include "dt/_dt.hh"
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "systemc"
|
||||
|
||||
// Collect "using" declarations for the various namespaces.
|
||||
#include "channel/_using.hh"
|
||||
#include "core/_using.hh"
|
||||
#include "dt/_using.hh"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user