Time replay

This commit is contained in:
Todd Strader 2020-01-22 18:05:34 -05:00
parent 505949ec54
commit 4430edf6da
2 changed files with 10 additions and 3 deletions

View File

@ -115,9 +115,6 @@ void VerilatedReplay::fstCb(uint64_t time, fstHandle facidx,
m_simTime = m_time;
}
// TODO -- remove
VL_PRINTF("%lu %u %s\n", time, facidx, valuep);
if (m_outputHandles.empty() || m_inputHandles.find(facidx) != m_inputHandles.end()) {
handleInput(facidx, valuep, len);
} else {

View File

@ -25,6 +25,12 @@
#include "verilated_replay.h"
// TODO -- I know this is C++11 . . . figure this out
#include <chrono>
#include <ctime>
#include <ratio>
using namespace std::chrono;
double simTime = 0;
double sc_time_stamp() {
@ -40,7 +46,11 @@ int main(int argc, char** argv) {
if (replay.init()) exit(-1);
high_resolution_clock::time_point start = high_resolution_clock::now();
if (replay.replay()) exit(-1);
high_resolution_clock::time_point end = high_resolution_clock::now();
VL_PRINTF("Replay took %ld ns\n",
std::chrono::duration_cast<std::chrono::nanoseconds>(end-start).count());
return 0;
}