Remove verilated vpi code, add missing includes for C++

Vortex rtlsim defines sim_trace_enabled... functions in the Verilated
C++ code for use in dpi_trace, which we don't need.
This commit is contained in:
Hansung Kim
2023-11-15 20:06:58 -08:00
parent d9cb14d6e4
commit bbacf9a25e
2 changed files with 10 additions and 8 deletions

View File

@@ -20,7 +20,7 @@
#include <rvfloats.h>
#include <util.h>
#include "svdpi.h"
#include "verilated_vpi.h"
// #include "verilated_vpi.h"
#include "VX_config.h"
extern "C" {
@@ -337,4 +337,4 @@ void dpi_fmax(bool enable, int dst_fmt, int64_t a, int64_t b, int64_t* result, s
} else {
*result = nan_box(rv_fmax_s(check_boxing(a), check_boxing(b), fflags));
}
}
}

View File

@@ -12,14 +12,16 @@
// limitations under the License.
#include <stdio.h>
#include <stdarg.h>
#include <math.h>
#include <unordered_map>
#include <vector>
#include <mutex>
#include <memory>
#include <iostream>
#include "svdpi.h"
#include "verilated_vpi.h"
// #include "verilated_vpi.h"
#include "uuid_gen.h"
@@ -191,8 +193,8 @@ void dpi_idiv(bool enable, bool is_signed, iword_t a, iword_t b, iword_t* quotie
void dpi_trace(int level, const char* format, ...) {
if (level > DEBUG_LEVEL)
return;
if (!sim_trace_enabled())
return;
// if (!sim_trace_enabled())
// return;
va_list va;
va_start(va, format);
vprintf(format, va);
@@ -200,11 +202,11 @@ void dpi_trace(int level, const char* format, ...) {
}
void dpi_trace_start() {
sim_trace_enable(true);
// sim_trace_enable(true);
}
void dpi_trace_stop() {
sim_trace_enable(false);
// sim_trace_enable(false);
}
///////////////////////////////////////////////////////////////////////////////
@@ -229,4 +231,4 @@ uint64_t dpi_uuid_gen(bool reset, int wid, uint64_t PC) {
uint32_t instr_ref = instr_uuid >> 16;
uint64_t uuid = (uint64_t(instr_ref) << 32) | (wid << 16) | instr_id;
return uuid;
}
}