OpenASIP 2.2
Loading...
Searching...
No Matches
ImplementationTester.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2010 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 ImplementationTester.hh
26 *
27 * Declaration of ImplementationTester
28 *
29 * @author Pekka Jääskeläinen 2006 (pekka.jaaskelainen-no.spam-tut.fi)
30 * @author Otto Esko 2010 (otto.esko-no.spam-tut.fi)
31 * @note rating: red
32 */
33
34#ifndef TTA_IMPLEMENTATION_TESTER_HH
35#define TTA_IMPLEMENTATION_TESTER_HH
36
37#include <string>
38#include <vector>
39#include <set>
40#include "HDBManager.hh"
41#include "FUEntry.hh"
42#include "RFEntry.hh"
43#include "MachineState.hh"
45#include "TestbenchGenerator.hh"
46
51
53public:
55
56 ImplementationTester(std::string hdbFile, VhdlSim simulator);
57
59 std::string hdbFile,
60 VhdlSim simulator, bool verbose, bool leaveDirty);
61
62 virtual ~ImplementationTester();
63
64 void setVhdlSimulator(VhdlSim simulator);
65
66 void openHdb(std::string hdbFile);
67
68 bool canTestFU(const int entryID, std::string& reason);
69
70 bool canTestRF(const int entryID, std::string& reason);
71
72 bool validateFU(const int entryID, std::vector<std::string>& errors);
73
74 bool validateRF(const int entryID, std::vector<std::string>& errors);
75
76 std::set<int> fuEntryIDs() const;
77
78 std::set<int> rfEntryIDs() const;
79
80private:
81
82 bool fuHasMemoryAccess(HDB::FUEntry* fuEntry) const;
83
84 bool fuFullyPipelined(HDB::FUEntry* fuEntry) const;
85
86 bool fuHasExternalPorts(HDB::FUEntry* fuEntry) const;
87
88 bool fuHasOnePort(HDB::FUEntry* fuEntry) const;
89
90 HDB::FUEntry* fuEntryFromHdb(int entryID) const;
91
92 HDB::RFEntry* rfEntryFromHdb(int entryID) const;
93
94 bool createTempDir();
95
96 std::string fuTbName(int id) const;
97
98 std::string rfTbName(int id) const;
99
100 void openTbFile(std::ofstream& fileStream, std::string fileName) const;
101
102 void
104 const HDB::HWBlockImplementation* impl,
105 std::vector<std::string>& files) const;
106
107 void
108 createTestbench(TestbenchGenerator* tbGen, std::string tbName) const;
109
110 bool
112 std::string testbench,
114 std::vector<std::string>& errors) const;
115
116 std::string hdbFile_;
118
122
123 std::string tempDir_;
124
125};
126
127#endif
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
HDB::FUEntry * fuEntryFromHdb(int entryID) const
void createListOfSimulationFiles(const HDB::HWBlockImplementation *impl, std::vector< std::string > &files) const
bool fuHasMemoryAccess(HDB::FUEntry *fuEntry) const
void createTestbench(TestbenchGenerator *tbGen, std::string tbName) const
std::set< int > fuEntryIDs() const
bool canTestRF(const int entryID, std::string &reason)
std::string fuTbName(int id) const
bool fuHasExternalPorts(HDB::FUEntry *fuEntry) const
bool canTestFU(const int entryID, std::string &reason)
bool simulateTestbench(std::string testbench, const HDB::HWBlockImplementation *implementation, std::vector< std::string > &errors) const
bool validateRF(const int entryID, std::vector< std::string > &errors)
bool fuHasOnePort(HDB::FUEntry *fuEntry) const
void openTbFile(std::ofstream &fileStream, std::string fileName) const
void openHdb(std::string hdbFile)
void setVhdlSimulator(VhdlSim simulator)
std::string rfTbName(int id) const
HDB::RFEntry * rfEntryFromHdb(int entryID) const
std::set< int > rfEntryIDs() const
bool fuFullyPipelined(HDB::FUEntry *fuEntry) const
bool validateFU(const int entryID, std::vector< std::string > &errors)