OpenASIP 2.2
Loading...
Searching...
No Matches
RegisterQuantityCheck.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 RegisterQuantityCheck.hh
26 *
27 * Declaration of RegisterQuantityCheck class.
28 *
29 * Tests that given machine has enough registers.
30 *
31 * @author Heikki Kultala (hkultala-no.spam-cs.tut.fi)
32 * @note rating: red
33 */
34
35#ifndef TTA_REGISTER_QUANTITY_CHECK_HH
36#define TTA_REGISTER_QUANTITY_CHECK_HH
37
38#include "MachineCheck.hh"
40
41#include <set>
42#include <string>
43
44namespace TTAMachine {
45 class RegisterFile;
46}
47
49public:
51 virtual ~RegisterQuantityCheck();
52
53 virtual bool check(
54 const TTAMachine::Machine& mach) const;
55 virtual bool check(
56 const TTAMachine::Machine& mach,
57 MachineCheckResults& results) const;
58
59 bool checkWithIgnore(
60 const TTAMachine::Machine& mach,
61 const std::set<std::string>& ignoreRFs) const;
62 bool checkWithIgnore(
63 const TTAMachine::Machine& mach,
64 MachineCheckResults& results,
65 const std::set<std::string>& ignoreRFs) const;
66
67 bool checkIntRegs(const TTAMachine::Machine& mach) const;
68 bool canFixIntRegs(const TTAMachine::Machine& mach) const;
69 bool fixIntRegs(TTAMachine::Machine& mach) const;
70private:
71 typedef std::pair<const TTAMachine::RegisterFile*, int> Register;
73 const TTAMachine::Machine& mach,
74 std::set<Register>& registers,
75 const std::set<std::string>& ignoreRFs) const;
76 unsigned int countIntRegisters(
77 const TTAMachine::Machine& mach,
78 const std::set<Register>& guardRegs,
79 const std::set<std::string>& ignoreRFs) const;
80 bool checkPredRegs(
81 const unsigned int& regCount,
82 MachineCheckResults* results) const;
83 unsigned int missingIntRegs(
84 const unsigned int& regCount,
85 MachineCheckResults* results,
86 bool isFullyConnected) const;
87
89};
90
91#endif
std::pair< const TTAMachine::RegisterFile *, int > Register
bool checkWithIgnore(const TTAMachine::Machine &mach, const std::set< std::string > &ignoreRFs) const
bool checkPredRegs(const unsigned int &regCount, MachineCheckResults *results) const
FullyConnectedCheck fullyConCheck_
bool checkIntRegs(const TTAMachine::Machine &mach) const
bool canFixIntRegs(const TTAMachine::Machine &mach) const
unsigned int missingIntRegs(const unsigned int &regCount, MachineCheckResults *results, bool isFullyConnected) const
virtual bool check(const TTAMachine::Machine &mach) const
unsigned int countIntRegisters(const TTAMachine::Machine &mach, const std::set< Register > &guardRegs, const std::set< std::string > &ignoreRFs) const
bool fixIntRegs(TTAMachine::Machine &mach) const
void findGuardRegisters(const TTAMachine::Machine &mach, std::set< Register > &registers, const std::set< std::string > &ignoreRFs) const