OpenASIP 2.2
Loading...
Searching...
No Matches
UniversalFUPort.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 UniversalFUPort.cc
26 *
27 * Implementation of UniversalFUPort class.
28 *
29 * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30 * @note rating: yellow
31 */
32
33#include "UniversalFUPort.hh"
35
36using std::string;
37
38/**
39 * The constructor.
40 *
41 * @param name Name of the port.
42 * @param width Bit width of the port.
43 * @param parent The function unit to which the port belongs.
44 * @param isTriggering If true, writing (or reading) this port starts the
45 * execution of a new operation.
46 * @param setsOpcode If true, writing (or reading) this port selects the
47 * operation to be executed. Opcode-setting ports must
48 * be triggering.
49 * @exception ComponentAlreadyExists If the function unit already has another
50 * port by the same name.
51 * @exception OutOfRange If the given bit width is less or equal to zero.
52 * @exception IllegalParameters If setsOpcode argument is true and
53 * isTriggering false.
54 * @exception InvalidName If the given name is not a valid component name.
55 */
57 const std::string& name, int width, UniversalFunctionUnit& parent,
58 bool isTriggering, bool setsOpcode)
59 : FUPort(name, width, parent, isTriggering, setsOpcode, true, true) {}
60
61/**
62 * The destructor.
63 */
66
67
68/**
69 * Aborts the program. It is not allowed to set the name of UniversalFUPort.
70 * DO NOT CALL THIS METHOD!
71 *
72 * @param name Never used.
73 * @exception ComponentAlreadyExists Never thrown.
74 * @exception InvalidName Never thrown.
75 */
76void
77UniversalFUPort::setName(const std::string&) {
78 const string procName = "UniversalFUPort::setName";
79 const string errorMsg = "Tried to set the name of UniversalFUPort!";
80 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
82}
83
84/**
85 * Aborts the program. It is not allowed to set the width of UniversalFUPort.
86 * DO NOT CALL THIS METHOD!
87 *
88 * @param width Never used.
89 * @exception OutOfRange Never thrown.
90 */
91void
93 const string procName = "UniversalFUPort::setWidth";
94 const string errorMsg = "Tried to set width of UniversalFUPort!";
95 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
97}
98
99/**
100 * Aborts the program. It is not allowed to modify UniversalFUPort. DO NOT
101 * CALL THIS METHOD!
102 *
103 * @param triggers Never used.
104 */
105void
107 const string procName = "UniversalFUPort::setTriggering";
108 const string errorMsg =
109 "Tried to set the triggering property of UniversalFUPort!";
110 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
112}
113
114
115/**
116 * Aborts the program. It is not allowed to set the operation code setting
117 * property of UniversalFUPort. DO NOT CALL THIS METHOD!
118 *
119 * @param setsOpcode Never used.
120 * @exception ComponentAlreadyExists Never thrown.
121 */
122void
124 const string procName = "UniversalFUPort::setOpcodeSetting";
125 const string errorMsg = "Tried to set the operation code setting "
126 "property of UniversalFUPort!";
127 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
129}
130
131/**
132 * Aborts the program. It is not allowed to load the state of UniversalFUPort
133 * from an ObjectState tree. DO NOT CALL THIS METDOD!
134 *
135 * @param state Never used.
136 * @exception ObjectStateLoadingException Never thrown.
137 */
138void
140 const string procName = "UniversalFUPort::loadState";
141 const string errorMsg =
142 "Tried to load state of UniversalFUPort from an ObjectState tree!";
143 Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
145}
static void abortProgram() __attribute__((noreturn))
static void writeToErrorLog(const std::string fileName, const int lineNumber, const std::string functionName, const std::string message, const int neededVerbosity=0)
virtual ~UniversalFUPort()
virtual void loadState(const ObjectState *state)
virtual void setWidth(int width)
UniversalFUPort(const std::string &name, int width, UniversalFunctionUnit &parent, bool isTriggering, bool setsOpcode)
virtual void setOpcodeSetting(bool setsOpcode)
virtual void setTriggering(bool triggers)
virtual void setName(const std::string &name)