OpenASIP 2.2
Loading...
Searching...
No Matches
TestApplication.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2012 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 TestApplication.hh
26 *
27 * Declaration of TestApplication class.
28 *
29 * @author Jari Mäntyneva 2007 (jari.mantyneva-no.spam-tut.fi)
30 * @author Pekka Jääskeläinen 2012, 2025
31 * @note rating: red
32 */
33
34#ifndef TTA_TEST_APPLICATION_HH
35#define TTA_TEST_APPLICATION_HH
36
37#include <sstream>
38#include <string>
39#include <vector>
40
41#include "Exception.hh"
42#include "TCEString.hh"
43
44/**
45 * Class for handling files in test application directory.
46 */
48public:
49 typedef double Runtime;
50 typedef int ClockCycles;
51
52 TestApplication(const std::string& testApplicationPath);
53 virtual ~TestApplication();
54
55 std::vector<std::string> description() const;
56
57 bool hasApplication() const;
58 bool hasSetupSimulation() const;
59 bool hasSimulateTTASim() const;
60 bool hasCorrectOutput() const;
61 bool hasVerifySimulation() const;
62 bool hasCleanupSimulation() const;
63 bool hasFunctionsOfInterest() const;
64 bool isValid() const {
65 return hasApplication() &&
67 }
68
69 const std::string applicationPath() const;
70 void setupSimulation() const;
71 std::istream* simulateTTASim() const;
72 const std::string correctOutput() const;
73 bool verifySimulation() const;
74 void cleanupSimulation() const;
76 Runtime maxRuntime() const;
77 const std::vector<TCEString>&
80 }
81
82private:
83 /// Path of the test application directory.
84 const std::string testApplicationPath_;
85 /// Maximum runtime of the test appication in nano seconds
87 /// The names of the functions of interest (in terms of cycle count).
88 std::vector<TCEString> functionsOfInterest_;
89
90 /// File name of the description text for the application.
91 static const std::string DESCRIPTION_FILE_NAME_;
92 /// Name of the sequential program file.
93 /// Base name of the file that contains the fully linked program.
94 /// The actual file name will be formed by appending either .bc or .ll,
95 /// whichever is found first.
96 static const std::string APPLICATION_BASE_FILE_NAME_;
97 /// Name of the file that contains setup script.
98 static const std::string SETUP_FILE_NAME_;
99 /// Name of the file that runs the simulation.
100 static const std::string SIMULATE_TTASIM_FILE_NAME_;
101 /// Name of the correct simulation output file.
102 static const std::string CORRECT_OUTPUT_FILE_NAME_;
103 /// Name of the verify script file.
104 static const std::string VERIFY_FILE_NAME_;
105 /// Name of the clean up file.
106 static const std::string CLEANUP_FILE_NAME_;
107 /// Name of the file that has a comma separated list of functions of
108 /// interest for the cycle count measurements in the given app.
109 /// The exclusive profile of these functions will be used as the
110 /// cycle count in evaluation.
111 static const std::string FUNCTIONS_OF_INTEREST_FILE_NAME_;
112 /// Name of the file that contains maximum runtime.
113 static const std::string MAX_RUNTIME_;
114 /// Maximum line length in a file.
115 static const int MAX_LINE_LENGTH_;
116};
117
118
119
120
121#endif
bool hasCorrectOutput() const
const std::string correctOutput() const
static const std::string APPLICATION_BASE_FILE_NAME_
Name of the sequential program file. Base name of the file that contains the fully linked program....
bool hasCleanupSimulation() const
void cleanupSimulation() const
bool hasSimulateTTASim() const
bool hasApplication() const
static const std::string MAX_RUNTIME_
Name of the file that contains maximum runtime.
const std::string testApplicationPath_
Path of the test application directory.
std::vector< TCEString > functionsOfInterest_
The names of the functions of interest (in terms of cycle count).
static const std::string VERIFY_FILE_NAME_
Name of the verify script file.
const std::string applicationPath() const
Runtime maxRuntime() const
static const std::string CLEANUP_FILE_NAME_
Name of the clean up file.
static const int MAX_LINE_LENGTH_
Maximum line length in a file.
std::istream * simulateTTASim() const
static const std::string DESCRIPTION_FILE_NAME_
File name of the description text for the application.
static const std::string SETUP_FILE_NAME_
Name of the file that contains setup script.
virtual ~TestApplication()
bool hasVerifySimulation() const
bool hasFunctionsOfInterest() const
static const std::string SIMULATE_TTASIM_FILE_NAME_
Name of the file that runs the simulation.
std::vector< std::string > description() const
void setupSimulation() const
bool verifySimulation() const
ClockCycles cycleCount() const
static const std::string CORRECT_OUTPUT_FILE_NAME_
Name of the correct simulation output file.
bool hasSetupSimulation() const
Runtime maxRuntime_
Maximum runtime of the test appication in nano seconds.
bool isValid() const
const std::vector< TCEString > & functionsOfInterest() const
static const std::string FUNCTIONS_OF_INTEREST_FILE_NAME_
Name of the file that has a comma separated list of functions of interest for the cycle count measure...