sc_inout.hh revision 12868
112841Sgabeblack@google.com/*
212841Sgabeblack@google.com * Copyright 2018 Google, Inc.
312841Sgabeblack@google.com *
412841Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
512841Sgabeblack@google.com * modification, are permitted provided that the following conditions are
612841Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
712841Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
812841Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
912841Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1012841Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1112841Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1212841Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1312841Sgabeblack@google.com * this software without specific prior written permission.
1412841Sgabeblack@google.com *
1512841Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1612841Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712841Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812841Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912841Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2012841Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2112841Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2212841Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2312841Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2412841Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2512841Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2612841Sgabeblack@google.com *
2712841Sgabeblack@google.com * Authors: Gabe Black
2812841Sgabeblack@google.com */
2912841Sgabeblack@google.com
3012841Sgabeblack@google.com#ifndef __SYSTEMC_EXT_CHANNEL_SC_INOUT_HH__
3112841Sgabeblack@google.com#define __SYSTEMC_EXT_CHANNEL_SC_INOUT_HH__
3212841Sgabeblack@google.com
3312841Sgabeblack@google.com#include <string>
3412841Sgabeblack@google.com
3512841Sgabeblack@google.com#include "../core/sc_port.hh"
3612841Sgabeblack@google.com#include "sc_signal_inout_if.hh"
3712841Sgabeblack@google.com#include "warn_unimpl.hh"
3812841Sgabeblack@google.com
3912841Sgabeblack@google.comnamespace sc_dt
4012841Sgabeblack@google.com{
4112841Sgabeblack@google.com
4212841Sgabeblack@google.comclass sc_logic;
4312841Sgabeblack@google.com
4412841Sgabeblack@google.com} // namespace sc_dt
4512841Sgabeblack@google.com
4612841Sgabeblack@google.comnamespace sc_core
4712841Sgabeblack@google.com{
4812841Sgabeblack@google.com
4912841Sgabeblack@google.comclass sc_event;
5012841Sgabeblack@google.comclass sc_event_finder;
5112841Sgabeblack@google.comclass sc_trace_file;
5212841Sgabeblack@google.com
5312841Sgabeblack@google.comtemplate <class T>
5412841Sgabeblack@google.comclass sc_inout : public sc_port<sc_signal_inout_if<T>, 1>
5512841Sgabeblack@google.com{
5612841Sgabeblack@google.com  public:
5712841Sgabeblack@google.com    sc_inout() : sc_port<sc_signal_inout_if<T>, 1>() {}
5812841Sgabeblack@google.com    explicit sc_inout(const char *name) :
5912841Sgabeblack@google.com            sc_port<sc_signal_inout_if<T>, 1>(name)
6012841Sgabeblack@google.com    {}
6112841Sgabeblack@google.com    virtual ~sc_inout() {}
6212841Sgabeblack@google.com
6312868Sgabeblack@google.com    // Deprecated binding constructors.
6412868Sgabeblack@google.com    explicit sc_inout(const sc_signal_inout_if<T> &interface) :
6512868Sgabeblack@google.com        sc_port<sc_signal_inout_if<T>, 1>(interface)
6612868Sgabeblack@google.com    {}
6712868Sgabeblack@google.com    sc_inout(const char *name, const sc_signal_inout_if<T> &interface) :
6812868Sgabeblack@google.com        sc_port<sc_signal_inout_if<T>, 1>(name, interface)
6912868Sgabeblack@google.com    {}
7012868Sgabeblack@google.com    explicit sc_inout(sc_port_b<sc_signal_inout_if<T> > &parent) :
7112868Sgabeblack@google.com        sc_port<sc_signal_inout_if<T>, 1>(parent)
7212868Sgabeblack@google.com    {}
7312868Sgabeblack@google.com    sc_inout(const char *name, sc_port_b<sc_signal_inout_if<T> > &parent) :
7412868Sgabeblack@google.com        sc_port<sc_signal_inout_if<T>, 1>(name, parent)
7512868Sgabeblack@google.com    {}
7612868Sgabeblack@google.com    explicit sc_inout(sc_port<sc_signal_inout_if<T>, 1> &parent) :
7712868Sgabeblack@google.com        sc_port<sc_signal_inout_if<T>, 1>(parent)
7812868Sgabeblack@google.com    {}
7912868Sgabeblack@google.com    sc_inout(const char *name, sc_port<sc_signal_inout_if<T>, 1> &parent) :
8012868Sgabeblack@google.com        sc_port<sc_signal_inout_if<T>, 1>(name, parent)
8112868Sgabeblack@google.com    {}
8212868Sgabeblack@google.com
8312841Sgabeblack@google.com    void
8412841Sgabeblack@google.com    initialize(const T &)
8512841Sgabeblack@google.com    {
8612841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
8712841Sgabeblack@google.com    }
8812841Sgabeblack@google.com    void
8912841Sgabeblack@google.com    initialize(const sc_signal_in_if<T> &)
9012841Sgabeblack@google.com    {
9112841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
9212841Sgabeblack@google.com    }
9312841Sgabeblack@google.com
9412841Sgabeblack@google.com    virtual void end_of_elaboration() {}
9512841Sgabeblack@google.com
9612841Sgabeblack@google.com    const T &
9712841Sgabeblack@google.com    read() const
9812841Sgabeblack@google.com    {
9912841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
10012841Sgabeblack@google.com        return *(const T *)nullptr;
10112841Sgabeblack@google.com    }
10212841Sgabeblack@google.com    operator const T& () const
10312841Sgabeblack@google.com    {
10412841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
10512841Sgabeblack@google.com        return *(const T *)nullptr;
10612841Sgabeblack@google.com    }
10712841Sgabeblack@google.com
10812841Sgabeblack@google.com    void
10912841Sgabeblack@google.com    write(const T &)
11012841Sgabeblack@google.com    {
11112841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
11212841Sgabeblack@google.com    }
11312841Sgabeblack@google.com    sc_inout<T> &
11412841Sgabeblack@google.com    operator = (const T &)
11512841Sgabeblack@google.com    {
11612841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
11712841Sgabeblack@google.com        return *(sc_inout<T> *)nullptr;
11812841Sgabeblack@google.com    }
11912841Sgabeblack@google.com    sc_inout<T> &
12012841Sgabeblack@google.com    operator = (const sc_signal_in_if<T> &)
12112841Sgabeblack@google.com    {
12212841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
12312841Sgabeblack@google.com        return *(sc_inout<T> *)nullptr;
12412841Sgabeblack@google.com    }
12512841Sgabeblack@google.com    sc_inout<T> &
12612841Sgabeblack@google.com    operator = (const sc_port<sc_signal_in_if<T>, 1> &)
12712841Sgabeblack@google.com    {
12812841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
12912841Sgabeblack@google.com        return *(sc_inout<T> *)nullptr;
13012841Sgabeblack@google.com    }
13112841Sgabeblack@google.com    sc_inout<T> &
13212841Sgabeblack@google.com    operator = (const sc_port<sc_signal_inout_if<T>, 1> &)
13312841Sgabeblack@google.com    {
13412841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
13512841Sgabeblack@google.com        return *(sc_inout<T> *)nullptr;
13612841Sgabeblack@google.com    }
13712841Sgabeblack@google.com    sc_inout<T> &
13812841Sgabeblack@google.com    operator = (const sc_inout<T> &)
13912841Sgabeblack@google.com    {
14012841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
14112841Sgabeblack@google.com        return *(sc_inout<T> *)nullptr;
14212841Sgabeblack@google.com    }
14312841Sgabeblack@google.com
14412841Sgabeblack@google.com    const sc_event &
14512841Sgabeblack@google.com    default_event() const
14612841Sgabeblack@google.com    {
14712841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
14812841Sgabeblack@google.com        return *(sc_event *)nullptr;
14912841Sgabeblack@google.com    }
15012841Sgabeblack@google.com    const sc_event &
15112841Sgabeblack@google.com    value_changed_event() const
15212841Sgabeblack@google.com    {
15312841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
15412841Sgabeblack@google.com        return *(sc_event *)nullptr;
15512841Sgabeblack@google.com    }
15612841Sgabeblack@google.com    bool
15712841Sgabeblack@google.com    event() const
15812841Sgabeblack@google.com    {
15912841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
16012841Sgabeblack@google.com        return false;
16112841Sgabeblack@google.com    }
16212841Sgabeblack@google.com    sc_event_finder &
16312841Sgabeblack@google.com    value_changed() const
16412841Sgabeblack@google.com    {
16512841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
16612841Sgabeblack@google.com        return *(sc_event_finder *)nullptr;
16712841Sgabeblack@google.com    }
16812841Sgabeblack@google.com
16912841Sgabeblack@google.com    virtual const char *kind() const { return "sc_inout"; }
17012841Sgabeblack@google.com
17112841Sgabeblack@google.com  private:
17212841Sgabeblack@google.com    // Disabled
17312841Sgabeblack@google.com    sc_inout(const sc_inout<T> &) : sc_port<sc_signal_inout_if<T>, 1>() {}
17412841Sgabeblack@google.com};
17512841Sgabeblack@google.com
17612841Sgabeblack@google.comtemplate <class T>
17712841Sgabeblack@google.cominline void
17812841Sgabeblack@google.comsc_trace(sc_trace_file *, const sc_inout<T> &, const std::string &)
17912841Sgabeblack@google.com{
18012841Sgabeblack@google.com    sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
18112841Sgabeblack@google.com}
18212841Sgabeblack@google.com
18312841Sgabeblack@google.comtemplate <>
18412841Sgabeblack@google.comclass sc_inout<bool> : public sc_port<sc_signal_inout_if<bool>, 1>
18512841Sgabeblack@google.com{
18612841Sgabeblack@google.com  public:
18712841Sgabeblack@google.com    sc_inout() : sc_port<sc_signal_inout_if<bool>, 1>() {}
18812841Sgabeblack@google.com    explicit sc_inout(const char *name) :
18912841Sgabeblack@google.com            sc_port<sc_signal_inout_if<bool>, 1>(name)
19012841Sgabeblack@google.com    {}
19112841Sgabeblack@google.com    virtual ~sc_inout() {}
19212841Sgabeblack@google.com
19312868Sgabeblack@google.com    // Deprecated binding constructors.
19412868Sgabeblack@google.com    explicit sc_inout(const sc_signal_inout_if<bool> &interface) :
19512868Sgabeblack@google.com        sc_port<sc_signal_inout_if<bool>, 1>(interface)
19612868Sgabeblack@google.com    {}
19712868Sgabeblack@google.com    sc_inout(const char *name, const sc_signal_inout_if<bool> &interface) :
19812868Sgabeblack@google.com        sc_port<sc_signal_inout_if<bool>, 1>(name, interface)
19912868Sgabeblack@google.com    {}
20012868Sgabeblack@google.com    explicit sc_inout(sc_port_b<sc_signal_inout_if<bool> > &parent) :
20112868Sgabeblack@google.com        sc_port<sc_signal_inout_if<bool>, 1>(parent)
20212868Sgabeblack@google.com    {}
20312868Sgabeblack@google.com    sc_inout(const char *name, sc_port_b<sc_signal_inout_if<bool> > &parent) :
20412868Sgabeblack@google.com        sc_port<sc_signal_inout_if<bool>, 1>(name, parent)
20512868Sgabeblack@google.com    {}
20612868Sgabeblack@google.com    explicit sc_inout(sc_port<sc_signal_inout_if<bool>, 1> &parent) :
20712868Sgabeblack@google.com        sc_port<sc_signal_inout_if<bool>, 1>(parent)
20812868Sgabeblack@google.com    {}
20912868Sgabeblack@google.com    sc_inout(const char *name, sc_port<sc_signal_inout_if<bool>, 1> &parent) :
21012868Sgabeblack@google.com        sc_port<sc_signal_inout_if<bool>, 1>(name, parent)
21112868Sgabeblack@google.com    {}
21212868Sgabeblack@google.com
21312841Sgabeblack@google.com    void
21412841Sgabeblack@google.com    initialize(const bool &)
21512841Sgabeblack@google.com    {
21612841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
21712841Sgabeblack@google.com    }
21812841Sgabeblack@google.com    void
21912841Sgabeblack@google.com    initialize(const sc_signal_in_if<bool> &)
22012841Sgabeblack@google.com    {
22112841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
22212841Sgabeblack@google.com    }
22312841Sgabeblack@google.com
22412841Sgabeblack@google.com    virtual void end_of_elaboration() {}
22512841Sgabeblack@google.com
22612841Sgabeblack@google.com    const bool &
22712841Sgabeblack@google.com    read() const
22812841Sgabeblack@google.com    {
22912841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
23012841Sgabeblack@google.com        return *(bool *)nullptr;
23112841Sgabeblack@google.com    }
23212841Sgabeblack@google.com    operator const bool& () const
23312841Sgabeblack@google.com    {
23412841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
23512841Sgabeblack@google.com        return *(bool *)nullptr;
23612841Sgabeblack@google.com    }
23712841Sgabeblack@google.com
23812841Sgabeblack@google.com    void
23912841Sgabeblack@google.com    write(const bool &)
24012841Sgabeblack@google.com    {
24112841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
24212841Sgabeblack@google.com    }
24312841Sgabeblack@google.com    sc_inout<bool> &
24412841Sgabeblack@google.com    operator = (const bool &)
24512841Sgabeblack@google.com    {
24612841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
24712841Sgabeblack@google.com        return *(sc_inout<bool> *)nullptr;
24812841Sgabeblack@google.com    }
24912841Sgabeblack@google.com    sc_inout<bool> &
25012841Sgabeblack@google.com    operator = (const sc_signal_in_if<bool> &)
25112841Sgabeblack@google.com    {
25212841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
25312841Sgabeblack@google.com        return *(sc_inout<bool> *)nullptr;
25412841Sgabeblack@google.com    }
25512841Sgabeblack@google.com    sc_inout<bool> &
25612841Sgabeblack@google.com    operator = (const sc_port<sc_signal_in_if<bool>, 1> &)
25712841Sgabeblack@google.com    {
25812841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
25912841Sgabeblack@google.com        return *(sc_inout<bool> *)nullptr;
26012841Sgabeblack@google.com    }
26112841Sgabeblack@google.com    sc_inout<bool> &
26212841Sgabeblack@google.com    operator = (const sc_port<sc_signal_inout_if<bool>, 1> &)
26312841Sgabeblack@google.com    {
26412841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
26512841Sgabeblack@google.com        return *(sc_inout<bool> *)nullptr;
26612841Sgabeblack@google.com    }
26712841Sgabeblack@google.com    sc_inout<bool> &
26812841Sgabeblack@google.com    operator = (const sc_inout<bool> &)
26912841Sgabeblack@google.com    {
27012841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
27112841Sgabeblack@google.com        return *(sc_inout<bool> *)nullptr;
27212841Sgabeblack@google.com    }
27312841Sgabeblack@google.com
27412841Sgabeblack@google.com    const sc_event &
27512841Sgabeblack@google.com    default_event() const
27612841Sgabeblack@google.com    {
27712841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
27812841Sgabeblack@google.com        return *(sc_event *)nullptr;
27912841Sgabeblack@google.com    }
28012841Sgabeblack@google.com    const sc_event &
28112841Sgabeblack@google.com    value_changed_event() const
28212841Sgabeblack@google.com    {
28312841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
28412841Sgabeblack@google.com        return *(sc_event *)nullptr;
28512841Sgabeblack@google.com    }
28612841Sgabeblack@google.com    const sc_event &
28712841Sgabeblack@google.com    posedge_event() const
28812841Sgabeblack@google.com    {
28912841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
29012841Sgabeblack@google.com        return *(sc_event *)nullptr;
29112841Sgabeblack@google.com    }
29212841Sgabeblack@google.com    const sc_event &
29312841Sgabeblack@google.com    negedge_event() const
29412841Sgabeblack@google.com    {
29512841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
29612841Sgabeblack@google.com        return *(sc_event *)nullptr;
29712841Sgabeblack@google.com    }
29812841Sgabeblack@google.com
29912841Sgabeblack@google.com    bool
30012841Sgabeblack@google.com    event() const
30112841Sgabeblack@google.com    {
30212841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
30312841Sgabeblack@google.com        return false;
30412841Sgabeblack@google.com    }
30512841Sgabeblack@google.com    bool
30612841Sgabeblack@google.com    posedge() const
30712841Sgabeblack@google.com    {
30812841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
30912841Sgabeblack@google.com        return false;
31012841Sgabeblack@google.com    }
31112841Sgabeblack@google.com    bool
31212841Sgabeblack@google.com    negedge() const
31312841Sgabeblack@google.com    {
31412841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
31512841Sgabeblack@google.com        return false;
31612841Sgabeblack@google.com    }
31712841Sgabeblack@google.com
31812841Sgabeblack@google.com    sc_event_finder &
31912841Sgabeblack@google.com    value_changed() const
32012841Sgabeblack@google.com    {
32112841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
32212841Sgabeblack@google.com        return *(sc_event_finder *)nullptr;
32312841Sgabeblack@google.com    }
32412841Sgabeblack@google.com    sc_event_finder &
32512841Sgabeblack@google.com    pos() const
32612841Sgabeblack@google.com    {
32712841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
32812841Sgabeblack@google.com        return *(sc_event_finder *)nullptr;
32912841Sgabeblack@google.com    }
33012841Sgabeblack@google.com    sc_event_finder &
33112841Sgabeblack@google.com    neg() const
33212841Sgabeblack@google.com    {
33312841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
33412841Sgabeblack@google.com        return *(sc_event_finder *)nullptr;
33512841Sgabeblack@google.com    }
33612841Sgabeblack@google.com
33712841Sgabeblack@google.com    virtual const char *kind() const { return "sc_inout"; }
33812841Sgabeblack@google.com
33912841Sgabeblack@google.com  private:
34012841Sgabeblack@google.com    // Disabled
34112841Sgabeblack@google.com    sc_inout(const sc_inout<bool> &) :
34212841Sgabeblack@google.com            sc_port<sc_signal_inout_if<bool>, 1>() {}
34312841Sgabeblack@google.com};
34412841Sgabeblack@google.com
34512841Sgabeblack@google.comtemplate <>
34612841Sgabeblack@google.cominline void sc_trace<bool>(
34712841Sgabeblack@google.com        sc_trace_file *, const sc_inout<bool> &, const std::string &)
34812841Sgabeblack@google.com{
34912841Sgabeblack@google.com    sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
35012841Sgabeblack@google.com}
35112841Sgabeblack@google.com
35212841Sgabeblack@google.comtemplate <>
35312841Sgabeblack@google.comclass sc_inout<sc_dt::sc_logic> :
35412841Sgabeblack@google.com        public sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>
35512841Sgabeblack@google.com{
35612841Sgabeblack@google.com  public:
35712841Sgabeblack@google.com    sc_inout() : sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>() {}
35812841Sgabeblack@google.com    explicit sc_inout(const char *name) :
35912841Sgabeblack@google.com            sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(name)
36012841Sgabeblack@google.com    {}
36112841Sgabeblack@google.com    virtual ~sc_inout() {}
36212841Sgabeblack@google.com
36312868Sgabeblack@google.com    // Deprecated binding constructors.
36412868Sgabeblack@google.com    explicit sc_inout(const sc_signal_inout_if<sc_dt::sc_logic> &interface) :
36512868Sgabeblack@google.com        sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(interface)
36612868Sgabeblack@google.com    {}
36712868Sgabeblack@google.com    sc_inout(const char *name,
36812868Sgabeblack@google.com            const sc_signal_inout_if<sc_dt::sc_logic> &interface) :
36912868Sgabeblack@google.com        sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(name, interface)
37012868Sgabeblack@google.com    {}
37112868Sgabeblack@google.com    explicit sc_inout(
37212868Sgabeblack@google.com            sc_port_b<sc_signal_inout_if<sc_dt::sc_logic> > &parent) :
37312868Sgabeblack@google.com        sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(parent)
37412868Sgabeblack@google.com    {}
37512868Sgabeblack@google.com    sc_inout(const char *name,
37612868Sgabeblack@google.com            sc_port_b<sc_signal_inout_if<sc_dt::sc_logic> > &parent) :
37712868Sgabeblack@google.com        sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(name, parent)
37812868Sgabeblack@google.com    {}
37912868Sgabeblack@google.com    explicit sc_inout(
38012868Sgabeblack@google.com            sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &parent) :
38112868Sgabeblack@google.com        sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(parent)
38212868Sgabeblack@google.com    {}
38312868Sgabeblack@google.com    sc_inout(const char *name,
38412868Sgabeblack@google.com            sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &parent) :
38512868Sgabeblack@google.com        sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>(name, parent)
38612868Sgabeblack@google.com    {}
38712868Sgabeblack@google.com
38812841Sgabeblack@google.com    void
38912841Sgabeblack@google.com    initialize(const sc_dt::sc_logic &)
39012841Sgabeblack@google.com    {
39112841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
39212841Sgabeblack@google.com    }
39312841Sgabeblack@google.com    void
39412841Sgabeblack@google.com    initialize(const sc_signal_in_if<sc_dt::sc_logic> &)
39512841Sgabeblack@google.com    {
39612841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
39712841Sgabeblack@google.com    }
39812841Sgabeblack@google.com
39912841Sgabeblack@google.com    virtual void end_of_elaboration() {}
40012841Sgabeblack@google.com
40112841Sgabeblack@google.com    const sc_dt::sc_logic &
40212841Sgabeblack@google.com    read() const
40312841Sgabeblack@google.com    {
40412841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
40512841Sgabeblack@google.com        return *(const sc_dt::sc_logic *)nullptr;
40612841Sgabeblack@google.com    }
40712841Sgabeblack@google.com    operator const sc_dt::sc_logic& () const
40812841Sgabeblack@google.com    {
40912841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
41012841Sgabeblack@google.com        return *(const sc_dt::sc_logic *)nullptr;
41112841Sgabeblack@google.com    }
41212841Sgabeblack@google.com
41312841Sgabeblack@google.com    void
41412841Sgabeblack@google.com    write(const sc_dt::sc_logic &)
41512841Sgabeblack@google.com    {
41612841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
41712841Sgabeblack@google.com    }
41812841Sgabeblack@google.com    sc_inout<sc_dt::sc_logic> &
41912841Sgabeblack@google.com    operator = (const sc_dt::sc_logic &)
42012841Sgabeblack@google.com    {
42112841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
42212841Sgabeblack@google.com        return *(sc_inout<sc_dt::sc_logic> *)nullptr;
42312841Sgabeblack@google.com    }
42412841Sgabeblack@google.com    sc_inout<sc_dt::sc_logic> &
42512841Sgabeblack@google.com    operator = (const sc_signal_in_if<sc_dt::sc_logic> &)
42612841Sgabeblack@google.com    {
42712841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
42812841Sgabeblack@google.com        return *(sc_inout<sc_dt::sc_logic> *)nullptr;
42912841Sgabeblack@google.com    }
43012841Sgabeblack@google.com    sc_inout<sc_dt::sc_logic> &
43112841Sgabeblack@google.com    operator = (const sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> &)
43212841Sgabeblack@google.com    {
43312841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
43412841Sgabeblack@google.com        return *(sc_inout<sc_dt::sc_logic> *)nullptr;
43512841Sgabeblack@google.com    }
43612841Sgabeblack@google.com    sc_inout<sc_dt::sc_logic> &
43712841Sgabeblack@google.com    operator = (const sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &)
43812841Sgabeblack@google.com    {
43912841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
44012841Sgabeblack@google.com        return *(sc_inout<sc_dt::sc_logic> *)nullptr;
44112841Sgabeblack@google.com    }
44212841Sgabeblack@google.com    sc_inout<sc_dt::sc_logic> &
44312841Sgabeblack@google.com    operator = (const sc_inout<sc_dt::sc_logic> &)
44412841Sgabeblack@google.com    {
44512841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
44612841Sgabeblack@google.com        return *(sc_inout<sc_dt::sc_logic> *)nullptr;
44712841Sgabeblack@google.com    }
44812841Sgabeblack@google.com
44912841Sgabeblack@google.com    const sc_event &
45012841Sgabeblack@google.com    default_event() const
45112841Sgabeblack@google.com    {
45212841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
45312841Sgabeblack@google.com        return *(sc_event *)nullptr;
45412841Sgabeblack@google.com    }
45512841Sgabeblack@google.com    const sc_event &
45612841Sgabeblack@google.com    value_changed_event() const
45712841Sgabeblack@google.com    {
45812841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
45912841Sgabeblack@google.com        return *(sc_event *)nullptr;
46012841Sgabeblack@google.com    }
46112841Sgabeblack@google.com    const sc_event &
46212841Sgabeblack@google.com    posedge_event() const
46312841Sgabeblack@google.com    {
46412841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
46512841Sgabeblack@google.com        return *(sc_event *)nullptr;
46612841Sgabeblack@google.com    }
46712841Sgabeblack@google.com    const sc_event &
46812841Sgabeblack@google.com    negedge_event() const
46912841Sgabeblack@google.com    {
47012841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
47112841Sgabeblack@google.com        return *(sc_event *)nullptr;
47212841Sgabeblack@google.com    }
47312841Sgabeblack@google.com
47412841Sgabeblack@google.com    bool
47512841Sgabeblack@google.com    event() const
47612841Sgabeblack@google.com    {
47712841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
47812841Sgabeblack@google.com        return false;
47912841Sgabeblack@google.com    }
48012841Sgabeblack@google.com    bool
48112841Sgabeblack@google.com    posedge() const
48212841Sgabeblack@google.com    {
48312841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
48412841Sgabeblack@google.com        return false;
48512841Sgabeblack@google.com    }
48612841Sgabeblack@google.com    bool
48712841Sgabeblack@google.com    negedge() const
48812841Sgabeblack@google.com    {
48912841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
49012841Sgabeblack@google.com        return false;
49112841Sgabeblack@google.com    }
49212841Sgabeblack@google.com
49312841Sgabeblack@google.com    sc_event_finder &
49412841Sgabeblack@google.com    value_changed() const
49512841Sgabeblack@google.com    {
49612841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
49712841Sgabeblack@google.com        return *(sc_event_finder *)nullptr;
49812841Sgabeblack@google.com    }
49912841Sgabeblack@google.com    sc_event_finder &
50012841Sgabeblack@google.com    pos() const
50112841Sgabeblack@google.com    {
50212841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
50312841Sgabeblack@google.com        return *(sc_event_finder *)nullptr;
50412841Sgabeblack@google.com    }
50512841Sgabeblack@google.com    sc_event_finder &
50612841Sgabeblack@google.com    neg() const
50712841Sgabeblack@google.com    {
50812841Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
50912841Sgabeblack@google.com        return *(sc_event_finder *)nullptr;
51012841Sgabeblack@google.com    }
51112841Sgabeblack@google.com
51212841Sgabeblack@google.com    virtual const char *kind() const { return "sc_inout"; }
51312841Sgabeblack@google.com
51412841Sgabeblack@google.com  private:
51512841Sgabeblack@google.com    // Disabled
51612841Sgabeblack@google.com    sc_inout(const sc_inout<sc_dt::sc_logic> &) :
51712841Sgabeblack@google.com            sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1>()
51812841Sgabeblack@google.com    {}
51912841Sgabeblack@google.com};
52012841Sgabeblack@google.com
52112841Sgabeblack@google.comtemplate <>
52212841Sgabeblack@google.cominline void
52312841Sgabeblack@google.comsc_trace<sc_dt::sc_logic>(sc_trace_file *, const sc_inout<sc_dt::sc_logic> &,
52412841Sgabeblack@google.com                          const std::string &)
52512841Sgabeblack@google.com{
52612841Sgabeblack@google.com    sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
52712841Sgabeblack@google.com}
52812841Sgabeblack@google.com
52912841Sgabeblack@google.com} // namespace sc_core
53012841Sgabeblack@google.com
53112841Sgabeblack@google.com#endif  //__SYSTEMC_EXT_CHANNEL_SC_INOUT_HH__
532