gem5  v20.1.0.0
sc_fifo_in.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Google, Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met: redistributions of source code must retain the above copyright
7  * notice, this list of conditions and the following disclaimer;
8  * redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution;
11  * neither the name of the copyright holders nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef __SYSTEMC_EXT_CHANNEL_SC_FIFO_IN_HH__
29 #define __SYSTEMC_EXT_CHANNEL_SC_FIFO_IN_HH__
30 
31 #include "../core/sc_event.hh"
32 #include "../core/sc_port.hh"
33 #include "sc_fifo_in_if.hh"
34 
35 namespace sc_core
36 {
37 
38 class sc_event;
39 class sc_event_finder;
40 
41 template <class T>
42 class sc_fifo_in : public sc_port<sc_fifo_in_if<T>, 0>
43 {
44  public:
47  {}
48  explicit sc_fifo_in(const char *name) :
49  sc_port<sc_fifo_in_if<T>, 0>(name),
51  {}
52  virtual ~sc_fifo_in() {}
53 
54  // Deprecated binding constructors.
55  explicit sc_fifo_in(const sc_fifo_in_if<T> &interface) :
56  sc_port<sc_fifo_in_if<T>, 0>(interface),
58  {}
59  sc_fifo_in(const char *name, const sc_fifo_in_if<T> &interface) :
60  sc_port<sc_fifo_in_if<T>, 0>(name, interface),
62  {}
63  explicit sc_fifo_in(sc_port_b<sc_fifo_in_if<T> > &parent) :
64  sc_port<sc_fifo_in_if<T>, 0>(parent),
66  {}
67  sc_fifo_in(const char *name, sc_port_b<sc_fifo_in_if<T> > &parent) :
68  sc_port<sc_fifo_in_if<T>, 0>(name, parent),
70  {}
71  explicit sc_fifo_in(sc_port<sc_fifo_in_if<T>, 0> &parent) :
72  sc_port<sc_fifo_in_if<T>, 0>(parent),
74  {}
75  sc_fifo_in(const char *name, sc_port<sc_fifo_in_if<T>, 0> &parent) :
76  sc_port<sc_fifo_in_if<T>, 0>(name, parent),
78  {}
79 
80  void read(T &t) { (*this)->read(t); }
81  T read() { return (*this)->read(); }
82  bool nb_read(T &t) { return (*this)->nb_read(t); }
83  const sc_event &
85  {
86  return (*this)->data_written_event();
87  }
89  int num_available() const { return (*this)->num_available(); }
90  virtual const char *kind() const { return "sc_fifo_in"; }
91 
92  private:
93  // Disabled
95  sc_fifo_in<T> &operator = (const sc_fifo_in<T> &) { return *this; }
96 
98 };
99 
100 } // namespace sc_core
101 
102 #endif //__SYSTEMC_EXT_CHANNEL_SC_FIFO_IN_HH__
sc_core::sc_fifo_in::sc_fifo_in
sc_fifo_in(const char *name, sc_port_b< sc_fifo_in_if< T > > &parent)
Definition: sc_fifo_in.hh:67
sc_core::sc_port_b
Definition: sc_port.hh:118
sc_core::sc_fifo_in::~sc_fifo_in
virtual ~sc_fifo_in()
Definition: sc_fifo_in.hh:52
sc_core::sc_port
Definition: sc_port.hh:249
sc_core
Definition: messages.cc:31
sc_core::sc_fifo_in::read
void read(T &t)
Definition: sc_fifo_in.hh:80
sc_core::sc_fifo_in::num_available
int num_available() const
Definition: sc_fifo_in.hh:89
sc_core::sc_fifo_in::sc_fifo_in
sc_fifo_in(sc_port_b< sc_fifo_in_if< T > > &parent)
Definition: sc_fifo_in.hh:63
sc_core::sc_fifo_in::kind
virtual const char * kind() const
Definition: sc_fifo_in.hh:90
sc_core::sc_fifo_in::data_written
sc_event_finder & data_written() const
Definition: sc_fifo_in.hh:88
sc_core::sc_fifo_in::sc_fifo_in
sc_fifo_in(const char *name, const sc_fifo_in_if< T > &interface)
Definition: sc_fifo_in.hh:59
sc_core::sc_event
Definition: sc_event.hh:169
sc_core::sc_fifo_in::sc_fifo_in
sc_fifo_in()
Definition: sc_fifo_in.hh:45
sc_core::sc_fifo_in::_dataWrittenFinder
sc_event_finder_t< sc_fifo_in_if< T > > _dataWrittenFinder
Definition: sc_fifo_in.hh:97
sc_core::sc_fifo_in::read
T read()
Definition: sc_fifo_in.hh:81
sc_core::sc_fifo_in::sc_fifo_in
sc_fifo_in(const sc_fifo_in< T > &)
Definition: sc_fifo_in.hh:94
sc_core::sc_event_finder_t
Definition: sc_event.hh:224
sc_fifo_in_if.hh
sc_core::sc_fifo_in_if
Definition: sc_fifo_in_if.hh:55
sc_core::sc_fifo_in::sc_fifo_in
sc_fifo_in(const char *name)
Definition: sc_fifo_in.hh:48
sc_core::sc_fifo_in::sc_fifo_in
sc_fifo_in(const char *name, sc_port< sc_fifo_in_if< T >, 0 > &parent)
Definition: sc_fifo_in.hh:75
sc_core::sc_fifo_in::sc_fifo_in
sc_fifo_in(sc_port< sc_fifo_in_if< T >, 0 > &parent)
Definition: sc_fifo_in.hh:71
ArmISA::t
Bitfield< 5 > t
Definition: miscregs_types.hh:67
sc_core::sc_fifo_in::operator=
sc_fifo_in< T > & operator=(const sc_fifo_in< T > &)
Definition: sc_fifo_in.hh:95
sc_core::sc_fifo_in::sc_fifo_in
sc_fifo_in(const sc_fifo_in_if< T > &interface)
Definition: sc_fifo_in.hh:55
sc_core::sc_object::name
const char * name() const
Definition: sc_object.cc:44
sc_core::sc_fifo_in
Definition: sc_fifo_in.hh:42
sc_core::sc_fifo_in::nb_read
bool nb_read(T &t)
Definition: sc_fifo_in.hh:82
sc_core::sc_event_finder
Definition: sc_event.hh:212
sc_core::sc_fifo_in::data_written_event
const sc_event & data_written_event() const
Definition: sc_fifo_in.hh:84

Generated on Wed Sep 30 2020 14:02:15 for gem5 by doxygen 1.8.17