Deleted Added
sdiff udiff text old ( 14126:cbb7113b701a ) new ( 14189:a363edac6a12 )
full compact
1/*
2 * Copyright 2019 Google LLC.
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

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

80 port_.bind(beer->port());
81 } else if (auto* iface =
82 dynamic_cast<ScInterfaceWrapper<IF>*>(&peer)) {
83 port_.bind(iface->interface());
84 } else {
85 fatal("Attempt to bind sc_port %s to incompatible port %s.",
86 name(), peer.name());
87 }
88 }
89
90 private:
91 ScPort& port_;
92};
93
94template <typename IF>
95class ScInterfaceWrapper : public ::Port

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

118 fatal_if(!dynamic_cast<ScPortWrapper<IF>*>(&peer) &&
119 !dynamic_cast<ScExportWrapper<IF>*>(&peer),
120 "Attempt to bind sc_interface %s to incompatible port %s.",
121 name(), peer.name());
122
123 // Don't bind to peer otherwise we may have error messages saying that
124 // this interface has already be bound since the peer may already did
125 // that. Just let sc_port or sc_export do the binding
126 }
127
128 private:
129 IF& iface_;
130};
131
132template <typename IF>
133class ScExportWrapper : public ::Port

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

155 bind(::Port& peer) override
156 {
157 auto* iface = dynamic_cast<ScInterfaceWrapper<IF>*>(&peer);
158 fatal_if(!iface,
159 "Attempt to bind sc_export %s to incompatible port %s.",
160 name(), peer.name());
161
162 port_.bind(iface->interface());
163 }
164
165 private:
166 ScExport& port_;
167};
168
169} // namespace sc_gem5
170
171#endif // __SYSTEMC_SC_PORT_WRAPPER_HH__