OpenASIP 2.2
Loading...
Searching...
No Matches
MachineValidator.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 MachineValidator.hh
26 *
27 * Declaration of MachineValidator class.
28 *
29 * @author Lasse Laasonen 2006 (lasse.laasonen-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_MACHINE_VALIDATOR_HH
34#define TTA_MACHINE_VALIDATOR_HH
35
36#include <set>
37#include <string>
38
39
40namespace TTAMachine {
41 class Machine;
42 class FunctionUnit;
43}
44
46
47/**
48 * Validator of target architecture definitions (machines). It tests a given
49 * machine against various criteria (completeness, implementation-dependent
50 * restrictions to structure, synthesisability).
51 */
53public:
54 /// Error codes for different errors.
55 enum ErrorCode {
56 /// GCU missing in machine.
58 /// Address space missing in GCU.
60 /// Pipeline uses an IO which is not bound.
62 /// JUMP and CALL uses different port in GCU.
64 /// PC port missing in GCU.
66 /// RA port missing in GCU.
68 /// RA and PC ports have unequal width.
70 /// Instruction memory address width differs from PC/RA port width.
72 /// FU has no operations with a trigger
74 /// FU is missing ports
76 };
77
79 virtual ~MachineValidator();
80
82 const std::set<ErrorCode>& errorsToCheck) const;
83
84private:
85 void checkGCUExists(MachineValidatorResults& results) const;
89 MachineValidatorResults& results) const;
93 MachineValidatorResults& results) const;
96
97 /// The machine to validate.
99};
100
101#endif
TTAMachine::Machine * machine
the architecture definition of the estimated processor
void checkProgramCounterPort(MachineValidatorResults &results) const
MachineValidatorResults * validate(const std::set< ErrorCode > &errorsToCheck) const
void checkGCUHasAddressSpace(MachineValidatorResults &results) const
void checkReturnAddressPort(MachineValidatorResults &results) const
void checkOperandBindings(MachineValidatorResults &results) const
void checkFUConnections(MachineValidatorResults &results) const
void checkRAPortHasSameWidthAsPCPort(MachineValidatorResults &results) const
void checkGCUExists(MachineValidatorResults &results) const
ErrorCode
Error codes for different errors.
@ PC_AND_RA_PORTS_HAVE_UNEQUAL_WIDTH
RA and PC ports have unequal width.
@ IMEM_ADDR_WIDTH_DIFFERS_FROM_RA_AND_PC
Instruction memory address width differs from PC/RA port width.
@ GCU_AS_MISSING
Address space missing in GCU.
@ DIFFERENT_PORT_FOR_JUMP_AND_CALL
JUMP and CALL uses different port in GCU.
@ RA_PORT_MISSING
RA port missing in GCU.
@ FU_PORT_MISSING
FU is missing ports.
@ USED_IO_NOT_BOUND
Pipeline uses an IO which is not bound.
@ FU_NO_VALID_OPERATIONS
FU has no operations with a trigger.
@ GCU_MISSING
GCU missing in machine.
@ PC_PORT_MISSING
PC port missing in GCU.
void checkIMemAddrWidth(MachineValidatorResults &results) const
void checkJumpAndCallOperandBindings(MachineValidatorResults &results) const
const TTAMachine::Machine & machine_
The machine to validate.
virtual ~MachineValidator()