OpenASIP 2.2
Loading...
Searching...
No Matches
TerminalAddress.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 TerminalAddress.cc
26 *
27 * Implementation of TerminalAddress class.
28 *
29 * @author Ari Metsähalme 2005 (ari.metsahalme-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#include "TerminalAddress.hh"
34#include "AddressSpace.hh"
35
36using namespace TTAMachine;
37
38namespace TTAProgram {
39
40/**
41 * Constructor. Creates a terminal address from a given immediate value and
42 * a reference to an address space.
43 *
44 * @param value Value of the address of the location.
45 * @param space Address space of the address.
46 */
48 SimValue value,
49 const TTAMachine::AddressSpace& space)
50 : TerminalImmediate(value), space_(space) {
51}
52
53/**
54 * The destructor.
55 */
58
59/**
60 * Tells whether the terminal is an inline immediate that refers to an
61 * address.
62 *
63 * @return true always.
64 */
65bool
67 return true;
68}
69
70/**
71 * Returns the address carried by this terminal.
72 *
73 * @return An address.
74 * @exception WrongSubclass never.
75 */
80
81/**
82 * Creates an exact copy of the terminal and returns it.
83 *
84 * @return A copy of the terminal.
85 */
90
91/**
92 * Checks if terminals are equal.
93 *
94 * @param other Terminal to compare.
95 * @return true if terminals are equal.
96 */
97bool
98TerminalAddress::equals(const Terminal& other) const {
99
100 if (other.isAddress() != true) {
101 return false;
102 }
103 return (address().location() == other.address().location() &&
104 address().space().name() == other.address().space().name());
105}
106
107
108} // namespace TTAProgram
unsigned int unsignedValue() const
Definition SimValue.cc:919
virtual TCEString name() const
const TTAMachine::AddressSpace & space() const
InstructionAddress location() const
TerminalAddress(SimValue value, const TTAMachine::AddressSpace &space)
virtual bool isAddress() const
virtual Address address() const
virtual Terminal * copy() const
virtual bool equals(const Terminal &other) const
const TTAMachine::AddressSpace & space_
Address space of the address.
virtual SimValue value() const
SimValue value_
Value of the inline immediate.
virtual bool isAddress() const
Definition Terminal.cc:75
virtual Address address() const
Definition Terminal.cc:210