1 /* $Id: PortProfile.java 203 2010-10-11 08:59:47Z dchokshi $ */
\r
2 package dol.helper.profiler;
\r
5 * Functional simulation profile information for a port.
\r
7 public class PortProfile {
\r
12 * @param name name of the port this profile belongs to
\r
14 public PortProfile(String name, ProcessProfile processProfile) {
\r
16 _processProfile = processProfile;
\r
17 _accesses = new Range();
\r
18 _tokenSize = new Range();
\r
19 _currentTokenSize = new Range();
\r
23 * Return the name of the channel this profile belongs to.
\r
25 * @return name of the channel this profile belongs to
\r
27 public String getName() {
\r
32 * Add a read or write access to this port.
\r
34 * @param tokenSize number of bytes communicated in this access
\r
36 public void addAccess(int tokenSize) {
\r
38 _currentTokenSize.merge(tokenSize);
\r
42 * Add an initial read or write access to this port (access happened
\r
43 * during init() phase).
\r
45 * @param tokenSize number of bytes communicated in this access
\r
47 public void addInitialAccess(int tokenSize) {
\r
49 if (_initialTokenSize == null) {
\r
50 _initialTokenSize = new Range(tokenSize);
\r
52 _initialTokenSize.merge(tokenSize);
\r
59 public void update() {
\r
60 _accesses.merge(_currentAccesses);
\r
61 _tokenSize.merge(_currentTokenSize);
\r
63 _currentAccesses = 0;
\r
64 _currentTokenSize.reset();
\r
67 public int getInitialAccesses() {
\r
68 return _initialAccesses;
\r
71 public Range getInitialTokenSize() {
\r
72 if (_initialTokenSize == null) {
\r
73 return new Range(0);
\r
75 return _initialTokenSize;
\r
79 public Range getAccesses() {
\r
83 public Range getTokenSize() {
\r
90 int _currentAccesses;
\r
91 Range _currentTokenSize;
\r
92 int _initialAccesses;
\r
93 Range _initialTokenSize = null;
\r
94 ProcessProfile _processProfile;
\r