gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
35namespace sc_core
36{
37
38class sc_event;
39class sc_event_finder;
40
41template <class T>
42class sc_fifo_in : public sc_port<sc_fifo_in_if<T>, 0>
43{
44 public:
48 explicit sc_fifo_in(const char *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 {}
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_fifo_in(sc_port< sc_fifo_in_if< T >, 0 > &parent)
Definition sc_fifo_in.hh:71
virtual ~sc_fifo_in()
Definition sc_fifo_in.hh:52
sc_event_finder & data_written() const
Definition sc_fifo_in.hh:88
sc_fifo_in(const sc_fifo_in_if< T > &interface)
Definition sc_fifo_in.hh:55
sc_fifo_in< T > & operator=(const sc_fifo_in< T > &)
Definition sc_fifo_in.hh:95
sc_fifo_in(const char *name, const sc_fifo_in_if< T > &interface)
Definition sc_fifo_in.hh:59
int num_available() const
Definition sc_fifo_in.hh:89
sc_fifo_in(sc_port_b< sc_fifo_in_if< T > > &parent)
Definition sc_fifo_in.hh:63
const sc_event & data_written_event() const
Definition sc_fifo_in.hh:84
sc_fifo_in(const char *name, sc_port_b< sc_fifo_in_if< T > > &parent)
Definition sc_fifo_in.hh:67
sc_fifo_in(const char *name, sc_port< sc_fifo_in_if< T >, 0 > &parent)
Definition sc_fifo_in.hh:75
sc_fifo_in(const char *name)
Definition sc_fifo_in.hh:48
virtual const char * kind() const
Definition sc_fifo_in.hh:90
sc_fifo_in(const sc_fifo_in< T > &)
Definition sc_fifo_in.hh:94
sc_event_finder_t< sc_fifo_in_if< T > > _dataWrittenFinder
Definition sc_fifo_in.hh:97
const std::string & name()
Definition trace.cc:48

Generated on Tue Jun 18 2024 16:24:06 for gem5 by doxygen 1.11.0