OpenASIP 2.2
Loading...
Searching...
No Matches
ConflictDetectionCodeGenerator.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 ConflictDetectionCodeGenerator.hh
26 *
27 * Declaration of ConflictDetectionCodeGenerator class.
28 *
29 * @author Viljami Korhonen 2008 (viljami.korhonen-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef CONFLICT_DETECTION_CODE_GENERATOR_HH
34#define CONFLICT_DETECTION_CODE_GENERATOR_HH
35
36#include "BaseType.hh"
37
38#include <string>
39#include <map>
40
41namespace TTAMachine {
42 class Machine;
43 class FunctionUnit;
44 class FUPort;
45 class Port;
46 class Unit;
47 class HWOperation;
48 class Guard;
49 class RegisterFile;
50 class ControlUnit;
51}
52
53namespace TTAProgram {
54 class Instruction;
55 class Terminal;
56 class Move;
57}
58
60
61/**
62 * A class that generates C/C++ code for FU conflict detection cases
63 *
64 * Used for the compiled simulation
65 *
66 */
68public:
72 bool conflictDetectionEnabled = false);
74
75 std::string includes();
76 std::string symbolDeclaration(const TTAMachine::FunctionUnit& fu);
77 std::string extraInitialization();
78 std::string notifyOfConflicts();
79 std::string updateSymbolDeclarations();
80 std::string advanceClockCode();
81 std::string detectConflicts(const TTAMachine::HWOperation& op);
82
83 bool conflictDetectionEnabled() const;
84
85private:
86 /// Copying not allowed.
88 /// Assignment not allowed.
90
91 /// The machine
93
94 /// True, if the conflict detection is enabled
96
97 /// The FU resource conflict detector used, empty string if disabled.
99 /// The method in the resource conflict detector used to detect conflicts,
100 /// empty string if disabled.
102 /// The method to be called on the conflict detector on cycle advance.
104 /// A method to be called on the conflict detector for initialization,
105 /// empty if none.
107
108 /// 1=fu.name(), 2=conflict detector object name
109 typedef std::map<std::string, std::string> ConflictDetectorObjectNameMap;
110 /// The resource conflict detector object name for each FU if any.
112
113 /// Symbol generator
115};
116
117#endif
TTAMachine::Machine * machine
the architecture definition of the estimated processor
std::string conflictDetectorType_
The FU resource conflict detector used, empty string if disabled.
const TTAMachine::Machine & machine_
The machine.
std::string symbolDeclaration(const TTAMachine::FunctionUnit &fu)
ConflictDetectionCodeGenerator(const ConflictDetectionCodeGenerator &)
Copying not allowed.
std::string conflictDetectorMethod_
The method in the resource conflict detector used to detect conflicts, empty string if disabled.
std::string conflictDetectorAdvanceCycle_
The method to be called on the conflict detector on cycle advance.
ConflictDetectorObjectNameMap conflictDetectors_
The resource conflict detector object name for each FU if any.
std::map< std::string, std::string > ConflictDetectorObjectNameMap
1=fu.name(), 2=conflict detector object name
ConflictDetectionCodeGenerator & operator=(const ConflictDetectionCodeGenerator &)
Assignment not allowed.
std::string detectConflicts(const TTAMachine::HWOperation &op)
std::string conflictDetectorExtraInitMethod_
A method to be called on the conflict detector for initialization, empty if none.
const CompiledSimSymbolGenerator & symbolGen_
Symbol generator.
bool conflictDetectionEnabled_
True, if the conflict detection is enabled.