forked from github/verilator
Fix V3File dependency issue
This commit is contained in:
parent
29b8b24b07
commit
2b93cfb364
@ -35,7 +35,7 @@ int VerilatedReplay::init() {
|
||||
addOutputName(it->first);
|
||||
}
|
||||
openFst(m_fstName);
|
||||
searchFst("");
|
||||
searchFst(NULL);
|
||||
m_time = fstReaderGetStartTime(m_fstp);
|
||||
// TODO -- use FST timescale
|
||||
m_simTime = m_time;
|
||||
|
@ -46,9 +46,9 @@ void VerilatedReplayCommon::openFst(const string& fstName) {
|
||||
}
|
||||
}
|
||||
|
||||
void VerilatedReplayCommon::searchFst(const string& targetScope) {
|
||||
void VerilatedReplayCommon::searchFst(const char* targetScope) {
|
||||
const char* scope = "";
|
||||
string searchScope(targetScope);
|
||||
string searchScope(string(targetScope ? targetScope : ""));
|
||||
|
||||
while (fstHier* hierp = fstReaderIterateHier(m_fstp)) {
|
||||
if (hierp->htyp == FST_HT_SCOPE) {
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
VerilatedReplayCommon() {}
|
||||
~VerilatedReplayCommon() {}
|
||||
void openFst(const std::string& fstName);
|
||||
void searchFst(const std::string& targetScope);
|
||||
void searchFst(const char* targetScope);
|
||||
void addInputName(const std::string& name) { m_inputNames.insert(name); }
|
||||
void addOutputName(const std::string& name) { m_outputNames.insert(name); }
|
||||
};
|
||||
|
@ -259,8 +259,8 @@ VLCOV_OBJS = \
|
||||
# verilator_replay
|
||||
VLREPLAY_OBJS = \
|
||||
V3Error.o \
|
||||
V3File.o \
|
||||
V3Os.o \
|
||||
V3String.o \
|
||||
VlrOptions.o \
|
||||
verilated_replay_common.o \
|
||||
VlrGenerator.o \
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
void VlrGenerator::searchFst() {
|
||||
openFst(string(m_opts.fst()));
|
||||
VerilatedReplayCommon::searchFst(string(m_opts.scope()));
|
||||
VerilatedReplayCommon::searchFst(m_opts.scope());
|
||||
}
|
||||
|
||||
void VlrGenerator::emitVltCode() {
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "V3File.h"
|
||||
#include "V3Os.h"
|
||||
#include <memory>
|
||||
#include <fstream>
|
||||
|
||||
void VlrOptions::parseOptsList(int argc, char** argv) {
|
||||
// Parse parameters
|
||||
@ -122,14 +123,14 @@ bool VlrOptions::onoff(const char* sw, const char* arg, bool& flag) {
|
||||
}
|
||||
|
||||
void VlrOptions::readSignalList(const char* filename) {
|
||||
const vl_unique_ptr<std::ifstream> ifp (V3File::new_ifstream(string(filename)));
|
||||
if (ifp->fail()) {
|
||||
std::ifstream ifs(filename);
|
||||
if (ifs.fail()) {
|
||||
v3fatal("Cannot open -f command file: "+string(filename));
|
||||
return;
|
||||
}
|
||||
|
||||
while (!ifp->eof()) {
|
||||
string line = V3Os::getline(*ifp);
|
||||
while (!ifs.eof()) {
|
||||
string line = V3Os::getline(ifs);
|
||||
|
||||
// Remove comments
|
||||
size_t cmt = line.find("#");
|
||||
@ -140,11 +141,13 @@ void VlrOptions::readSignalList(const char* filename) {
|
||||
}
|
||||
|
||||
// Parse signals
|
||||
if (line.length() <= 2) continue;
|
||||
|
||||
string signalName = line.substr(2);
|
||||
|
||||
if (line[0] == 'I' && line[1] == ' ') {
|
||||
if (line.substr(0, 2) == "I ") {
|
||||
m_replayp->addInputName(signalName);
|
||||
} else if (line[0] == 'O' && line[1] == ' ') {
|
||||
} else if (line.substr(0, 2) == "O ") {
|
||||
m_replayp->addOutputName(signalName);
|
||||
} else {
|
||||
v3fatal("Invalid signal line: "+line);
|
||||
|
Loading…
Reference in New Issue
Block a user