OpenASIP  2.0
ImplementationSimulator.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 ImplementationSimulator.hh
26  *
27  * Declaration of ImplementationSimulator
28  *
29  * @author Otto Esko 2010 (otto.esko-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_IMPLEMENTATION_SIMULATOR_HH
34 #define TTA_IMPLEMENTATION_SIMULATOR_HH
35 
36 #include <string>
37 #include <vector>
38 
40 public:
42  std::string tbFile,
43  std::vector<std::string> hdlFiles,
44  bool verbose,
45  bool leaveDirty);
46 
47  virtual ~ImplementationSimulator();
48 
49  virtual bool compile(std::vector<std::string>& errors) = 0;
50 
51  virtual bool simulate(std::vector<std::string>& errors) = 0;
52 
53 protected:
54  virtual std::string createWorkDir();
55 
56  void setWorkDir(std::string dir);
57 
58  std::string workDir() const;
59 
60  std::string tbDirectory() const;
61 
62  std::string tbFile() const;
63 
64  int hdlFileCount() const;
65 
66  std::string file(int index) const;
67 
68  bool verbose();
69 
70  void
72  std::vector<std::string>& inputMsg, std::vector<std::string>& errors);
73 
74 private:
76 
77  /// Testbench file name with path
78  std::string tbFile_;
79  /// Vector containing other vhdl files needed to compile testbench
80  std::vector<std::string> hdlFiles_;
81  /// Directory path of testbench file
82  std::string baseDir_;
83  /// Working directory where testbench is compiled and simulated
84  std::string workDir_;
85  /// Old current working directory (before changing to workDir_)
86  std::string oldCwd_;
87  /// Enable verbose output
88  bool verbose_;
89  /// Don't delete work dir
91 };
92 
93 #endif
ImplementationSimulator::hdlFiles_
std::vector< std::string > hdlFiles_
Vector containing other vhdl files needed to compile testbench.
Definition: ImplementationSimulator.hh:80
ImplementationSimulator::verbose
bool verbose()
Definition: ImplementationSimulator.cc:99
ImplementationSimulator::tbDirectory
std::string tbDirectory() const
Definition: ImplementationSimulator.cc:83
ImplementationSimulator::parseErrorMessages
void parseErrorMessages(std::vector< std::string > &inputMsg, std::vector< std::string > &errors)
Definition: ImplementationSimulator.cc:104
ImplementationSimulator::file
std::string file(int index) const
Definition: ImplementationSimulator.cc:95
ImplementationSimulator::createWorkDir
virtual std::string createWorkDir()
Definition: ImplementationSimulator.cc:66
ImplementationSimulator::simulate
virtual bool simulate(std::vector< std::string > &errors)=0
ImplementationSimulator::workDir_
std::string workDir_
Working directory where testbench is compiled and simulated.
Definition: ImplementationSimulator.hh:84
ImplementationSimulator::tbFile
std::string tbFile() const
Definition: ImplementationSimulator.cc:87
ImplementationSimulator::hdlFileCount
int hdlFileCount() const
Definition: ImplementationSimulator.cc:91
ImplementationSimulator::baseDir_
std::string baseDir_
Directory path of testbench file.
Definition: ImplementationSimulator.hh:82
ImplementationSimulator::workDir
std::string workDir() const
Definition: ImplementationSimulator.cc:79
ImplementationSimulator::leaveDirty_
bool leaveDirty_
Don't delete work dir.
Definition: ImplementationSimulator.hh:90
ImplementationSimulator::oldCwd_
std::string oldCwd_
Old current working directory (before changing to workDir_)
Definition: ImplementationSimulator.hh:86
ImplementationSimulator::tbFile_
std::string tbFile_
Testbench file name with path.
Definition: ImplementationSimulator.hh:78
ImplementationSimulator::verbose_
bool verbose_
Enable verbose output.
Definition: ImplementationSimulator.hh:88
ImplementationSimulator::setWorkDir
void setWorkDir(std::string dir)
Definition: ImplementationSimulator.cc:75
ImplementationSimulator::compile
virtual bool compile(std::vector< std::string > &errors)=0
ImplementationSimulator
Definition: ImplementationSimulator.hh:39
ImplementationSimulator::~ImplementationSimulator
virtual ~ImplementationSimulator()
Definition: ImplementationSimulator.cc:55
ImplementationSimulator::ImplementationSimulator
ImplementationSimulator()