OpenASIP 2.2
Loading...
Searching...
No Matches
UniversalFunctionUnit.hh
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 UniversalFunctionUnit.hh
26 *
27 * Declaration of UniversalFunctionUnit class.
28 *
29 * @author Lasse Laasonen 2004 (lasse.laasonen-no.spam-tut.fi)
30 * @note rating: yellow
31 */
32
33#ifndef TTA_UNIVERSAL_FUNCTION_UNIT_HH
34#define TTA_UNIVERSAL_FUNCTION_UNIT_HH
35
36#include "FunctionUnit.hh"
37
38class Operation;
39class OperationPool;
41
42namespace TTAMachine {
43 class HWOperation;
44}
45/**
46 * UniversalFunctionUnit class represents a function unit which has
47 * all the operations of an operation pool. The operations are added
48 * on demand, not at construction.
49 */
51public:
52 UniversalFunctionUnit(const std::string& name, OperationPool& opPool);
53 virtual ~UniversalFunctionUnit();
54
55 virtual bool hasOperation(const std::string& name) const;
56 virtual TTAMachine::HWOperation* operation(const std::string& name) const;
58 virtual void loadState(const ObjectState* state);
59
60 int portCountWithWidth(int width) const;
61 TTAMachine::FUPort& portWithWidth(int index, int width) const;
62
63 static bool is32BitOperation(const std::string& opName);
64
65 /// Name of the 32 bit wide opcode setting port.
66 static const std::string OC_SETTING_PORT_32;
67 /// Name of the 64 bit wide opcode setting port.
68 static const std::string OC_SETTING_PORT_64;
69
70private:
72 void ensureInputPorts(int width, int count);
73 void ensureOutputPorts(int width, int count);
74
75 /// Operation pool from which the operations are searched.
77 /// Table of names of 32 bit operations
78 static const std::string OPERATIONS_OF_32_BITS[];
79
80
81};
82
83#endif
virtual TCEString name() const
virtual TTAMachine::HWOperation * operation(const std::string &name) const
static const std::string OPERATIONS_OF_32_BITS[]
Table of names of 32 bit operations.
int portCountWithWidth(int width) const
static const std::string OC_SETTING_PORT_64
Name of the 64 bit wide opcode setting port.
virtual void addPipelineElement(TTAMachine::PipelineElement &element)
static bool is32BitOperation(const std::string &opName)
static const std::string OC_SETTING_PORT_32
Name of the 32 bit wide opcode setting port.
void ensureInputPorts(int width, int count)
OperationPool & opPool_
Operation pool from which the operations are searched.
SmartHWOperation & addSupportedOperation(const Operation &operation)
virtual bool hasOperation(const std::string &name) const
virtual void loadState(const ObjectState *state)
void ensureOutputPorts(int width, int count)
TTAMachine::FUPort & portWithWidth(int index, int width) const