Deleted Added
sdiff udiff text old ( 13270:99e1cfb8c6e8 ) new ( 13273:af60ddcf2a32 )
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

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

26 *
27 * Authors: Gabe Black
28 */
29
30#ifndef __SYSTEMC_CORE_PORT_HH__
31#define __SYSTEMC_CORE_PORT_HH__
32
33#include <list>
34#include <vector>
35
36#include "base/cprintf.hh"
37#include "systemc/ext/core/sc_interface.hh"
38#include "systemc/ext/core/sc_port.hh"
39
40namespace sc_gem5
41{

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

52{
53 private:
54 ::sc_core::sc_port_base *portBase;
55
56 bool finalized;
57 int _maxSize;
58 int _size;
59
60 void finalizePort(StaticSensitivityPort *port);
61 void finalizeFinder(StaticSensitivityFinder *finder);
62 void finalizeReset(ResetSensitivityPort *reset);
63
64 void
65 addInterface(::sc_core::sc_interface *iface)
66 {
67 for (int i = 0; i < _size; i++) {

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

75 }
76 _size++;
77 portBase->_gem5AddInterface(iface);
78 }
79
80 void
81 addInterfaces(::sc_core::sc_port_base *pb)
82 {
83 for (int i = 0; i < pb->size(); i++)
84 addInterface(pb->_gem5Interface(i));
85 }
86
87 ::sc_core::sc_interface *
88 getInterface(int i)
89 {
90 return portBase->_gem5Interface(i);

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

131 fromPort(const ::sc_core::sc_port_base *pb)
132 {
133 return pb->_gem5Port;
134 }
135
136 ::sc_core::sc_port_base *sc_port_base() { return portBase; }
137
138 Port(::sc_core::sc_port_base *port_base, int max) :
139 portBase(port_base), finalized(false), _maxSize(max), _size(0)
140 {
141 allPorts.push_front(this);
142 }
143
144 void
145 bind(::sc_core::sc_interface *interface)
146 {
147 if (bindings.empty())

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

156 bindings.push_back(new Binding(port));
157 }
158
159 void sensitive(StaticSensitivityPort *port);
160 void sensitive(StaticSensitivityFinder *finder);
161 void sensitive(ResetSensitivityPort *reset);
162
163 void finalize();
164
165 int size() { return _size; }
166 int maxSize() { return _maxSize; }
167};
168
169} // namespace sc_gem5
170
171#endif // __SYSTEMC_CORE_PORT_HH__