sc_port.hh (13324:c8b709468e61) sc_port.hh (13332:03eec201e55a)
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

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

74};
75
76class sc_port_base : public sc_object
77{
78 public:
79 sc_port_base(const char *name, int n, sc_port_policy p);
80 virtual ~sc_port_base();
81
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

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

74};
75
76class sc_port_base : public sc_object
77{
78 public:
79 sc_port_base(const char *name, int n, sc_port_policy p);
80 virtual ~sc_port_base();
81
82 void warn_unimpl(const char *func) const;
82 void warn_port_constructor() const;
83
84 int maxSize() const;
85 int size() const;
86
87 const char *kind() const { return "sc_port_base"; }
88
89 protected:
90 // Implementation defined, but depended on by the tests.

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

253 public:
254 sc_port() : sc_port_b<IF>(N, P) {}
255 explicit sc_port(const char *name) : sc_port_b<IF>(name, N, P) {}
256 virtual ~sc_port() {}
257
258 // Deprecated binding constructors.
259 explicit sc_port(const IF &interface) : sc_port_b<IF>(N, P)
260 {
83
84 int maxSize() const;
85 int size() const;
86
87 const char *kind() const { return "sc_port_base"; }
88
89 protected:
90 // Implementation defined, but depended on by the tests.

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

253 public:
254 sc_port() : sc_port_b<IF>(N, P) {}
255 explicit sc_port(const char *name) : sc_port_b<IF>(name, N, P) {}
256 virtual ~sc_port() {}
257
258 // Deprecated binding constructors.
259 explicit sc_port(const IF &interface) : sc_port_b<IF>(N, P)
260 {
261 this->warn_unimpl(__PRETTY_FUNCTION__);
262 // Should warn that these are deprecated. See Accellera sc_port.h.
261 this->warn_port_constructor();
263 sc_port_b<IF>::bind(const_cast<IF &>(interface));
264 }
265 sc_port(const char *name, const IF &interface) : sc_port_b<IF>(name, N, P)
266 {
262 sc_port_b<IF>::bind(const_cast<IF &>(interface));
263 }
264 sc_port(const char *name, const IF &interface) : sc_port_b<IF>(name, N, P)
265 {
267 this->warn_unimpl(__PRETTY_FUNCTION__);
268 // Should warn that these are deprecated. See Accellera sc_port.h.
266 this->warn_port_constructor();
269 sc_port_b<IF>::bind(const_cast<IF &>(interface));
270 }
271 explicit sc_port(sc_port_b<IF> &parent) : sc_port_b<IF>(N, P)
272 {
267 sc_port_b<IF>::bind(const_cast<IF &>(interface));
268 }
269 explicit sc_port(sc_port_b<IF> &parent) : sc_port_b<IF>(N, P)
270 {
273 this->warn_unimpl(__PRETTY_FUNCTION__);
274 // Should warn that these are deprecated. See Accellera sc_port.h.
271 this->warn_port_constructor();
275 sc_port_b<IF>::bind(parent);
276 }
277 sc_port(const char *name, sc_port_b<IF> &parent) :
278 sc_port_b<IF>(name, N, P)
279 {
272 sc_port_b<IF>::bind(parent);
273 }
274 sc_port(const char *name, sc_port_b<IF> &parent) :
275 sc_port_b<IF>(name, N, P)
276 {
280 this->warn_unimpl(__PRETTY_FUNCTION__);
281 // Should warn that these are deprecated. See Accellera sc_port.h.
277 this->warn_port_constructor();
282 sc_port_b<IF>::bind(parent);
283 }
284 explicit sc_port(sc_port<IF, N, P> &parent) : sc_port_b<IF>(N, P)
285 {
278 sc_port_b<IF>::bind(parent);
279 }
280 explicit sc_port(sc_port<IF, N, P> &parent) : sc_port_b<IF>(N, P)
281 {
286 this->warn_unimpl(__PRETTY_FUNCTION__);
287 // Should warn that these are deprecated. See Accellera sc_port.h.
282 this->warn_port_constructor();
288 sc_port_b<IF>::bind(parent);
289 }
290 sc_port(const char *name, sc_port<IF, N, P> &parent) :
291 sc_port_b<IF>(name, N, P)
292 {
283 sc_port_b<IF>::bind(parent);
284 }
285 sc_port(const char *name, sc_port<IF, N, P> &parent) :
286 sc_port_b<IF>(name, N, P)
287 {
293 this->warn_unimpl(__PRETTY_FUNCTION__);
294 // Should warn that these are deprecated. See Accellera sc_port.h.
288 this->warn_port_constructor();
295 sc_port_b<IF>::bind(parent);
296 }
297
298 virtual const char *kind() const { return "sc_port"; }
299
300 private:
301 // Disabled
302 sc_port(const sc_port<IF, N, P> &) {}
303 sc_port<IF, N, P> &operator = (const sc_port<IF, N, P> &) { return *this; }
304
305 virtual sc_port_policy _portPolicy() const { return P; }
306};
307
308} // namespace sc_core
309
310#endif //__SYSTEMC_EXT_CORE_SC_PORT_HH__
289 sc_port_b<IF>::bind(parent);
290 }
291
292 virtual const char *kind() const { return "sc_port"; }
293
294 private:
295 // Disabled
296 sc_port(const sc_port<IF, N, P> &) {}
297 sc_port<IF, N, P> &operator = (const sc_port<IF, N, P> &) { return *this; }
298
299 virtual sc_port_policy _portPolicy() const { return P; }
300};
301
302} // namespace sc_core
303
304#endif //__SYSTEMC_EXT_CORE_SC_PORT_HH__