OpenASIP 2.2
Loading...
Searching...
No Matches
BusState.cc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file BusState.cc
26 *
27 * Definition of BusState class.
28 *
29 * @author Jussi Nyk�nen 2004 (nykanen-no.spam-cs.tut.fi)
30 * @author Pekka J��skel�inen 2005 (pjaaskel-no.spam-cs.tut.fi)
31 * @note rating: red
32 */
33
34#include "BusState.hh"
35#include "Application.hh"
36#include "SimValue.hh"
37#include "BaseType.hh"
38
39using std::string;
40
41//////////////////////////////////////////////////////////////////////////////
42// BusState
43//////////////////////////////////////////////////////////////////////////////
44
45/**
46 * Constructor.
47 *
48 * @param width Bit width of the bus.
49 */
50BusState::BusState(int width) :
51 RegisterState(width), squashed_(false) {
52}
53
54/**
55 * Destructor.
56 */
59
60/**
61 * Sets the value of the bus.
62 *
63 * Does not extend the value.
64 *
65 * @param value New value.
66 */
67void
71
72/**
73 * Sets whether the last executed move scheduled to this bus was squashed.
74 *
75 * @param isSquashed True in case this bus was squashed.
76 */
77void
78BusState::setSquashed(bool isSquashed) {
80}
81
82/**
83 * Returns true if the last executed move scheduled to this bus was squashed.
84 *
85 * @param isSquashed True in case this bus was squashed.
86 */
87bool
89 return squashed_;
90}
91
92/**
93 * Returns width of the modeled bus.
94 */
95int
97 return value().width();
98}
99
100//////////////////////////////////////////////////////////////////////////////
101// NullBusState
102//////////////////////////////////////////////////////////////////////////////
103
105
106/**
107 * Returns the instance of NullBusState.
108 *
109 * @return The instance of NullBusState.
110 */
113 if (instance_ == NULL) {
114 instance_ = new NullBusState();
115 }
116 return *instance_;
117}
118
119/**
120 * Constructor.
121 */
124
125/**
126 * Destructor.
127 */
130
131/**
132 * Aborts the program with error message.
133 */
134void
136 Application::abortWithError("setValue()");
137}
138
139/**
140 * Aborts the program with error message.
141 *
142 * @return Never returns.
143 */
144const SimValue&
146 Application::abortWithError("value()");
147 return NullSimValue::instance();
148}
find Finds info of the inner loops in the false
bool isSquashed() const
Definition BusState.cc:88
bool squashed_
True in case this bus was squashed the last time a move was executed in this bus.
Definition BusState.hh:75
virtual ~BusState()
Definition BusState.cc:57
void setSquashed(bool isSquashed)
Definition BusState.cc:78
BusState(int width)
Definition BusState.cc:50
virtual void setValue(const SimValue &value)
Definition BusState.cc:68
int width() const
Definition BusState.cc:96
static NullBusState * instance_
Unique instance of NullBusState.
Definition BusState.hh:102
virtual ~NullBusState()
Definition BusState.cc:128
virtual const SimValue & value() const
Definition BusState.cc:145
static NullBusState & instance()
Definition BusState.cc:112
virtual void setValue(const SimValue &value)
Definition BusState.cc:135
static SimValue & instance()
Definition SimValue.cc:1642
virtual void setValue(const SimValue &value)
virtual const SimValue & value() const
int width() const
Definition SimValue.cc:103