Deleted Added
sdiff udiff text old ( 13273:af60ddcf2a32 ) new ( 13290:1e720f971554 )
full compact
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

--- 87 unchanged lines hidden (view full) ---

96 virtual int vbind(sc_interface &) = 0;
97 virtual int vbind(sc_port_base &) = 0;
98
99 virtual void before_end_of_elaboration() = 0;
100 virtual void end_of_elaboration() = 0;
101 virtual void start_of_simulation() = 0;
102 virtual void end_of_simulation() = 0;
103
104 private:
105 friend class ::sc_gem5::Port;
106 friend class ::sc_gem5::Kernel;
107
108 virtual sc_interface *_gem5Interface(int n) const = 0;
109 virtual void _gem5AddInterface(sc_interface *i) = 0;
110
111 ::sc_gem5::Port *_gem5Port;

--- 8 unchanged lines hidden (view full) ---

120 void operator () (sc_port_b<IF> &p) { bind(p); }
121
122 virtual void bind(IF &i) { sc_port_base::bind(i); }
123 virtual void bind(sc_port_b<IF> &p) { sc_port_base::bind(p); }
124
125 IF *
126 operator -> ()
127 {
128 sc_assert(!_interfaces.empty());
129 return _interfaces[0];
130 }
131 const IF *
132 operator -> () const
133 {
134 sc_assert(!_interfaces.empty());
135 return _interfaces[0];
136 }
137
138 IF *
139 operator [] (int n)
140 {
141 sc_assert(_interfaces.size() > n);
142 return _interfaces[n];
143 }
144 const IF *
145 operator [] (int n) const
146 {
147 sc_assert(_interfaces.size() > n);
148 return _interfaces[n];
149 }
150
151 sc_interface *
152 get_interface()
153 {
154 sc_assert(!_interfaces.empty());
155 return _interfaces[0];
156 }
157 const sc_interface *
158 get_interface() const
159 {
160 sc_assert(!_interfaces.empty());
161 return _interfaces[0];
162 }
163
164 protected:
165 void before_end_of_elaboration() {}
166 void end_of_elaboration() {}
167 void start_of_simulation() {}
168 void end_of_simulation() {}

--- 27 unchanged lines hidden (view full) ---

196 }
197
198 private:
199 std::vector<IF *> _interfaces;
200
201 sc_interface *
202 _gem5Interface(int n) const
203 {
204 sc_assert(_interfaces.size() > n);
205 return _interfaces[n];
206 }
207 void
208 _gem5AddInterface(sc_interface *i)
209 {
210 IF *interface = dynamic_cast(i);
211 sc_assert(interface);
212 _interfaces.push_back(interface);
213 }
214
215 const char *_ifTypeName() const { return typeid(IF).name(); }
216
217 // Disabled
218 sc_port_b() {}
219 sc_port_b(const sc_port_b<IF> &) {}

--- 62 unchanged lines hidden ---