47 std::vector<std::string> hdlFiles,
59 errors.push_back(
"Couldn't create work dir. Are the modelsim "
60 "executables in PATH?");
65 errors.push_back(
"Couldn't change directory to " + baseDir);
87 string simulate =
"vsim -c -do \"run 300ns;quit\" work.testbench 2>&1";
91 vector<string> messages;
94 return rv == 0 && errors.size() == 0;
100 string createLib =
"vlib " + work +
" 2>&1";
102 std::cout << createLib << std::endl;
104 vector<string> messages;
108 for (
unsigned int i = 0; i < messages.size(); i++) {
109 std::cout << messages.at(i) << std::endl;
115 string mapWorkDir =
"vmap work " + work +
" 2>&1";
120 for (
unsigned int i = 0; i < messages.size(); i++) {
121 std::cout << messages.at(i) << std::endl;
133 string command =
"vcom " +
file +
" 2>&1";
135 std::cout << command << std::endl;
static int runShellCommandAndGetOutput(const std::string &command, std::vector< std::string > &outputLines, std::size_t maxOutputLines=DEFAULT_MAX_OUTPUT_LINES, bool includeStdErr=false)
static bool changeWorkingDir(const std::string &path)
static const std::string DIRECTORY_SEPARATOR
void setWorkDir(std::string dir)
std::string workDir() const
std::string tbFile() const
std::string tbDirectory() const
std::string file(int index) const
void parseErrorMessages(std::vector< std::string > &inputMsg, std::vector< std::string > &errors)
virtual bool compile(std::vector< std::string > &errors)
virtual ~ModelsimSimulator()
virtual std::string createWorkDir()
bool compileOneFile(std::string file, std::vector< std::string > &errors)
ModelsimSimulator(std::string tbFile, std::vector< std::string > hdlFiles, bool verbose, bool leaveDirty)
bool mapWorkDir(std::string file, std::vector< std::string > &errors)
virtual bool simulate(std::vector< std::string > &errors)