sc_out.hh revision 12841:22aa7ba47bf9
16019Shines@cs.fsu.edu/*
213121Sgiacomo.travaglini@arm.com * Copyright 2018 Google, Inc.
37414SAli.Saidi@ARM.com *
47414SAli.Saidi@ARM.com * Redistribution and use in source and binary forms, with or without
57414SAli.Saidi@ARM.com * modification, are permitted provided that the following conditions are
67414SAli.Saidi@ARM.com * met: redistributions of source code must retain the above copyright
77414SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer;
87414SAli.Saidi@ARM.com * redistributions in binary form must reproduce the above copyright
97414SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer in the
107414SAli.Saidi@ARM.com * documentation and/or other materials provided with the distribution;
117414SAli.Saidi@ARM.com * neither the name of the copyright holders nor the names of its
127414SAli.Saidi@ARM.com * contributors may be used to endorse or promote products derived from
137414SAli.Saidi@ARM.com * this software without specific prior written permission.
146019Shines@cs.fsu.edu *
156019Shines@cs.fsu.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
166019Shines@cs.fsu.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
176019Shines@cs.fsu.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
186019Shines@cs.fsu.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
196019Shines@cs.fsu.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
206019Shines@cs.fsu.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
216019Shines@cs.fsu.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
226019Shines@cs.fsu.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
236019Shines@cs.fsu.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
246019Shines@cs.fsu.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
256019Shines@cs.fsu.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
266019Shines@cs.fsu.edu *
276019Shines@cs.fsu.edu * Authors: Gabe Black
286019Shines@cs.fsu.edu */
296019Shines@cs.fsu.edu
306019Shines@cs.fsu.edu#ifndef __SYSTEMC_EXT_CHANNEL_SC_OUT_HH__
316019Shines@cs.fsu.edu#define __SYSTEMC_EXT_CHANNEL_SC_OUT_HH__
326019Shines@cs.fsu.edu
336019Shines@cs.fsu.edu#include "../core/sc_port.hh"
346019Shines@cs.fsu.edu#include "sc_inout.hh"
356019Shines@cs.fsu.edu#include "warn_unimpl.hh"
366019Shines@cs.fsu.edu
376019Shines@cs.fsu.edunamespace sc_core
386019Shines@cs.fsu.edu{
396019Shines@cs.fsu.edu
406019Shines@cs.fsu.edutemplate <class T>
417414SAli.Saidi@ARM.comclass sc_out : public sc_inout<T>
426019Shines@cs.fsu.edu{
436019Shines@cs.fsu.edu  public:
4411793Sbrandon.potter@amd.com    sc_out() : sc_inout<T>() {}
4511793Sbrandon.potter@amd.com    explicit sc_out(const char *name) : sc_inout<T>(name) {}
466019Shines@cs.fsu.edu    virtual ~sc_out() {}
476019Shines@cs.fsu.edu
486019Shines@cs.fsu.edu    sc_out<T> &
496019Shines@cs.fsu.edu    operator = (const T &)
5012334Sgabeblack@google.com    {
516019Shines@cs.fsu.edu        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
528232Snate@binkert.org        return *(sc_out<T> *)nullptr;
536019Shines@cs.fsu.edu    }
5412431Sgabeblack@google.com    sc_out<T> &
5511854Sbrandon.potter@amd.com    operator = (const sc_signal_in_if<T> &)
567678Sgblack@eecs.umich.edu    {
576019Shines@cs.fsu.edu        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
5811800Sbrandon.potter@amd.com        return *(sc_out<T> *)nullptr;
596019Shines@cs.fsu.edu    }
606019Shines@cs.fsu.edu    sc_out<T> &
616019Shines@cs.fsu.edu    operator = (const sc_port<sc_signal_in_if<T>, 1> &)
626019Shines@cs.fsu.edu    {
636019Shines@cs.fsu.edu        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
6411851Sbrandon.potter@amd.com        return *(sc_out<T> *)nullptr;
6511851Sbrandon.potter@amd.com    }
6612448Sgabeblack@google.com    sc_out<T> &
6712448Sgabeblack@google.com    operator = (const sc_port<sc_signal_inout_if<T>, 1> &)
6812432Sgabeblack@google.com    {
6912448Sgabeblack@google.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
706019Shines@cs.fsu.edu        return *(sc_out<T> *)nullptr;
7112441Sgabeblack@google.com    }
7210037SARM gem5 Developers    sc_out<T> &
7310037SARM gem5 Developers    operator = (const sc_out<T> &)
7411851Sbrandon.potter@amd.com    {
7511851Sbrandon.potter@amd.com        sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
7611851Sbrandon.potter@amd.com        return *(sc_out<T> *)nullptr;
7710037SARM gem5 Developers    }
7811905SBrandon.Potter@amd.com
7911905SBrandon.Potter@amd.com    virtual const char *kind() const { return "sc_out"; }
8011905SBrandon.Potter@amd.com
8111905SBrandon.Potter@amd.com  private:
8211905SBrandon.Potter@amd.com    // Disabled
8311905SBrandon.Potter@amd.com    sc_out(const sc_out<T> &) : sc_inout<T>() {}
846019Shines@cs.fsu.edu};
8511905SBrandon.Potter@amd.com
8611905SBrandon.Potter@amd.com} // namespace sc_core
876019Shines@cs.fsu.edu
886019Shines@cs.fsu.edu#endif  //__SYSTEMC_EXT_CHANNEL_SC_OUT_HH__
8911851Sbrandon.potter@amd.com