OpenASIP 2.2
Loading...
Searching...
No Matches
MachineInfo.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2015 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 MachineInfo.hh
26 *
27 * Declaration of MachineInfo class.
28 *
29 * @author Mikael Lepistö 2008 (mikael.lepisto-no.spam-tut.fi)
30 * @author Pekka Jääskeläinen 2014-2015
31 * @note rating: red
32 */
33
34#ifndef TTA_MACHINE_INFO_HH
35#define TTA_MACHINE_INFO_HH
36
38#include "CIStringSet.hh"
39
40#include <set>
41#include <vector>
42#include <climits>
43
44namespace TTAMachine {
45 class AddressSpace;
46 class Machine;
47 class HWOperation;
48 class FUPort;
49 class Port;
50 class InstructionTemplate;
51 class ControlUnit;
52 class FunctionUnit;
53}
54
55class Operand;
56class Operation;
57
59public:
61 typedef std::vector<const TTAMachine::FUPort*> ConstPortList;
62
63 static int maxLatency(const TTAMachine::Machine& mach, TCEString& opName);
65 const TTAMachine::Machine& mach);
67 const TTAMachine::ControlUnit& gcu);
69 const TTAMachine::Machine& mach,
70 const std::string& operation);
71 static const TTAMachine::FUPort* getBoundPort(
73 const std::string& opName, int operandIndex);
74 static bool supportsOperation(
75 const TTAMachine::Machine& mach, TCEString operation);
77 const TTAMachine::Machine& mach);
78 static int longestGuardLatency(
79 const TTAMachine::Machine& mach);
81 const TTAMachine::HWOperation& hwOp,
82 const TTAMachine::FUPort& port);
83 static int maxMemoryAlignment(
84 const TTAMachine::Machine &mach);
85 static bool templatesUsesSlot(
86 const TTAMachine::Machine& mach,
87 const std::string& slotName);
88 static std::set<TTAMachine::InstructionTemplate*> templatesUsingSlot(
89 const TTAMachine::Machine& mach,
90 const std::string& slotName);
91 static bool canEncodeImmediateInteger(
92 const TTAMachine::Machine& mach, int64_t imm,
93 unsigned destWidth=UINT_MAX);
94 static bool canEncodeImmediateInteger(
96 int64_t imm, unsigned destWidth=UINT_MAX);
97 static int triggerIndex(
98 const TTAMachine::Machine& machine, const Operation& op);
99 static int triggerIndex(
100 const TTAMachine::FunctionUnit& fu, const Operation& op);
101 static bool canEncodeImmediateInteger(
102 const TTAMachine::Bus& bus, int64_t imm, unsigned destWidth=UINT_MAX);
103 static unsigned findWidestOperand(
104 const TTAMachine::Machine& machine, bool vector) ;
105 static unsigned numberOfRegisters(
106 const TTAMachine::Machine& machine, unsigned width);
109 static bool supportsPortGuardedJump(
110 const TTAMachine::Machine& machine, bool inverted, const TCEString& opName);
111
112 static std::vector<const TTAMachine::FunctionUnit*> findLockUnits(
115
116private:
118 template<typename PortType>
119 static PortType& portFromOperand(
120 const TTAMachine::HWOperation& hwOp,
121 const TTAMachine::FUPort& port);
122
123 static const TCEString LOCK_READ_;
126};
127
128
129
130#endif
TTAMachine::Machine * machine
the architecture definition of the estimated processor
static PortType & portFromOperand(const TTAMachine::HWOperation &hwOp, const TTAMachine::FUPort &port)
static const TCEString LOCK_READ_
static ConstPortList getPortBindingsOfOperation(const TTAMachine::Machine &mach, const std::string &operation)
static Operand & operandFromPort(const TTAMachine::HWOperation &hwOp, const TTAMachine::FUPort &port)
static bool templatesUsesSlot(const TTAMachine::Machine &mach, const std::string &slotName)
static bool supportsPortGuardedJump(const TTAMachine::Machine &machine, bool inverted, const TCEString &opName)
static std::set< TTAMachine::InstructionTemplate * > templatesUsingSlot(const TTAMachine::Machine &mach, const std::string &slotName)
static int maxLatency(const TTAMachine::Machine &mach, TCEString &opName)
std::vector< const TTAMachine::FUPort * > ConstPortList
static unsigned numberOfRegisters(const TTAMachine::Machine &machine, unsigned width)
static TTAMachine::AddressSpace * defaultDataAddressSpace(const TTAMachine::Machine &mach)
static const TCEString UNLOCK_ADDR_
static int triggerIndex(const TTAMachine::Machine &machine, const Operation &op)
static unsigned findWidestOperand(const TTAMachine::Machine &machine, bool vector)
static const TCEString TRY_LOCK_ADDR_
static const TTAMachine::FUPort * getBoundPort(const TTAMachine::FunctionUnit &fu, const std::string &opName, int operandIndex)
TCETools::CIStringSet OperationSet
static bool supportsPortGuardedJumps(const TTAMachine::Machine &machine)
static int maxMemoryAlignment(const TTAMachine::Machine &mach)
static OperationSet getOpset(const TTAMachine::Machine &mach)
static std::vector< const TTAMachine::FunctionUnit * > findLockUnits(const TTAMachine::Machine &machine)
static bool canEncodeImmediateInteger(const TTAMachine::Machine &mach, int64_t imm, unsigned destWidth=UINT_MAX)
static bool supportsBoolRegisterGuardedJumps(const TTAMachine::Machine &machine)
static int longestGuardLatency(const TTAMachine::Machine &mach)
static Operation & osalOperation(const TTAMachine::HWOperation &hwOp)
static bool supportsOperation(const TTAMachine::Machine &mach, TCEString operation)
std::set< TCEString, CaseInsensitiveCmp > CIStringSet