2016-06-18 06:09:08 +02:00
|
|
|
#ifndef _ROCKET_VERILATOR_H
|
|
|
|
#define _ROCKET_VERILATOR_H
|
|
|
|
|
2016-07-09 11:37:39 +02:00
|
|
|
#include "verilated_vcd_c.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2016-06-18 06:09:08 +02:00
|
|
|
extern bool verbose;
|
2016-09-09 19:57:10 +02:00
|
|
|
extern bool done_reset;
|
2016-06-18 06:09:08 +02:00
|
|
|
|
2016-07-09 11:37:39 +02:00
|
|
|
class VerilatedVcdFILE : public VerilatedVcdFile {
|
|
|
|
public:
|
|
|
|
VerilatedVcdFILE(FILE* file) : file(file) {}
|
|
|
|
~VerilatedVcdFILE() {}
|
2018-01-13 22:29:22 +01:00
|
|
|
bool open(const std::string& name) override {
|
2016-07-09 11:37:39 +02:00
|
|
|
// file should already be open
|
|
|
|
return file != NULL;
|
|
|
|
}
|
|
|
|
void close() override {
|
|
|
|
// file should be closed elsewhere
|
|
|
|
}
|
|
|
|
ssize_t write(const char* bufp, ssize_t len) override {
|
|
|
|
return fwrite(bufp, 1, len, file);
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
FILE* file;
|
|
|
|
};
|
|
|
|
|
2016-06-18 06:09:08 +02:00
|
|
|
#endif
|