OpenASIP 2.2
Loading...
Searching...
No Matches
BEMValidator.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 BEMValidator.hh
26 *
27 * Declaration of BEMValidator class.
28 *
29 * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30 * @author Otto Esko 2008 (otto.esko-no.spam-tut.fi)
31 * @note rating: red
32 */
33
34#ifndef TTA_BEM_VALIDATOR_HH
35#define TTA_BEM_VALIDATOR_HH
36
37#include <vector>
38#include <string>
39
40#include "Exception.hh"
41
42namespace TTAMachine {
43 class Machine;
44 class Bus;
45 class ImmediateSlot;
46 class ControlUnit;
47}
48
49class BinaryEncoding;
50class SocketEncoding;
51class MoveSlot;
52
53/**
54 * Validates binary encoding maps against machines. Checks that the
55 * BEM contains all the required information.
56 */
58public:
60 const BinaryEncoding& bem,
63
64 bool validate();
65 int errorCount() const;
66 std::string errorMessage(int index) const;
67 int warningCount() const;
68 std::string warningMessage(int index) const;
69
70private:
71 /// Vector type for string.
72 typedef std::vector<std::string> StringVector;
73
74 void checkMoveSlot(const TTAMachine::Bus& bus);
76 void checkSourceField(const TTAMachine::Bus& bus);
77 void checkGuardField(const TTAMachine::Bus& bus);
78 void checkSocketCodeTable(const SocketEncoding& socketEnc);
83
84 bool needsSourceField(const MoveSlot& slot) const;
85 bool needsSocketCodeTable(const SocketEncoding& socketEnc) const;
86
87 /// The binary encoding map.
89 /// The machine.
91
92 /// Contains the error messages.
94 /// Contains the warning messages.
96};
97
98#endif
TTAMachine::Machine * machine
the architecture definition of the estimated processor
StringVector errorMessages_
Contains the error messages.
std::vector< std::string > StringVector
Vector type for string.
const BinaryEncoding & bem_
The binary encoding map.
void checkMoveSlot(const TTAMachine::Bus &bus)
void checkImmediateSlot(const TTAMachine::ImmediateSlot &immSlot)
void checkDestinationField(const TTAMachine::Bus &bus)
std::string errorMessage(int index) const
bool needsSocketCodeTable(const SocketEncoding &socketEnc) const
int errorCount() const
StringVector warningMessages_
Contains the warning messages.
std::string warningMessage(int index) const
void checkSocketCodeTable(const SocketEncoding &socketEnc)
bool needsSourceField(const MoveSlot &slot) const
int warningCount() const
void checkSourceField(const TTAMachine::Bus &bus)
void checkLImmDstRegisterFields()
void checkImmediateControlField()
void checkGuardField(const TTAMachine::Bus &bus)
void checkImemMauWidth(TTAMachine::ControlUnit &gcu)
const TTAMachine::Machine & machine_
The machine.