port.cc (13288:f1c04129f709) | port.cc (13293:60c727f33e16) |
---|---|
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 --- 15 unchanged lines hidden (view full) --- 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 * Authors: Gabe Black 28 */ 29 30#include "systemc/core/port.hh" 31 | 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 --- 15 unchanged lines hidden (view full) --- 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 * Authors: Gabe Black 28 */ 29 30#include "systemc/core/port.hh" 31 |
32#include "base/logging.hh" |
|
32#include "systemc/core/process.hh" 33#include "systemc/core/sensitivity.hh" 34#include "systemc/ext/channel/sc_signal_in_if.hh" 35 36namespace sc_gem5 37{ 38 39void --- 78 unchanged lines hidden (view full) --- 118 } 119 120 sensitivities.clear(); 121 122 for (auto &r: resets) 123 finalizeReset(r); 124 125 resets.clear(); | 33#include "systemc/core/process.hh" 34#include "systemc/core/sensitivity.hh" 35#include "systemc/ext/channel/sc_signal_in_if.hh" 36 37namespace sc_gem5 38{ 39 40void --- 78 unchanged lines hidden (view full) --- 119 } 120 121 sensitivities.clear(); 122 123 for (auto &r: resets) 124 finalizeReset(r); 125 126 resets.clear(); |
127 128 switch (portBase->_portPolicy()) { 129 case sc_core::SC_ONE_OR_MORE_BOUND: 130 if (size() == 0) 131 portBase->report_error( 132 "(E109) complete binding failed", "port not bound"); 133 break; 134 case sc_core::SC_ALL_BOUND: 135 if (size() < maxSize() || size() < 1) { 136 std::stringstream ss; 137 ss << size() << " actual binds is less than required " << 138 maxSize(); 139 portBase->report_error( 140 "(E109) complete binding failed", ss.str().c_str()); 141 } 142 break; 143 case sc_core::SC_ZERO_OR_MORE_BOUND: 144 break; 145 default: 146 panic("Unrecognized port policy %d.", portBase->_portPolicy()); 147 } |
|
126} 127 128void 129Port::regPort() 130{ 131 if (!regPortNeeded) 132 return; 133 134 for (int i = 0; i < size(); i++) 135 getInterface(i)->register_port(*portBase, portBase->_ifTypeName()); 136} 137 138std::list<Port *> allPorts; 139 140} // namespace sc_gem5 | 148} 149 150void 151Port::regPort() 152{ 153 if (!regPortNeeded) 154 return; 155 156 for (int i = 0; i < size(); i++) 157 getInterface(i)->register_port(*portBase, portBase->_ifTypeName()); 158} 159 160std::list<Port *> allPorts; 161 162} // namespace sc_gem5 |