Added more configurability to VerilatorSimCtrl

This commit is contained in:
Simon Southwell 2024-12-15 11:32:47 +00:00
commit 301edff9e8
4 changed files with 14 additions and 10 deletions

View file

@ -35,7 +35,7 @@
#include <pthread.h>
#include <semaphore.h>
#define VERSION_STRING "VProc version 1.12.1. Copyright (c) 2004-2024 Simon Southwell."
#define VERSION_STRING "VProc version 1.12.2. Copyright (c) 2004-2024 Simon Southwell."
#ifndef VP_MAX_NODES
#define VP_MAX_NODES 64

View file

@ -278,9 +278,13 @@ static int parse_command(const std::string &command, VProc *vp, uint32_t &cyc_co
// Function to run gtkwave in a thread
// ---------------------------------------------
void rungtkwave (void)
void rungtkwave (const char* wavefnameprefix, const bool fst = false)
{
system("gtkwave -A waves.vcd > gtkwave.log 2>&1");
char sbuf[256];
sprintf(sbuf, "gtkwave -A %s.%s > gtkwave.log 2>&1", wavefnameprefix, fst ? "fst" : "vcd");
system(sbuf);
}
// ---------------------------------------------
@ -288,7 +292,7 @@ void rungtkwave (void)
// function
// ---------------------------------------------
void VerilatorSimCtrl (const uint32_t node)
void VerilatorSimCtrl (const uint32_t node, const char* wavefnameprefix, const bool usefst)
{
uint32_t clk_period_ps;
uint32_t cyc_count_now;
@ -303,7 +307,7 @@ void VerilatorSimCtrl (const uint32_t node)
vp->read(VSC_CLK_PERIOD_ADDR, &clk_period_ps); flushfst();
vp->read(VSC_CYC_COUNT_ADDR, &cyc_count_now); flushfst();
std::thread thread_obj(rungtkwave);
std::thread thread_obj(rungtkwave, wavefnameprefix, usefst);
// Print initial prompt
std::cout << std::fixed << std::showpoint << std::setprecision(3);

View file

@ -64,6 +64,6 @@
1000000000000.0))
extern void flushfst (void);
extern void VerilatorSimCtrl(const uint32_t node);
extern void VerilatorSimCtrl(const uint32_t node, const char* wavefnameprefix = "waves", const bool usefst = false);
#endif

View file

@ -115,10 +115,10 @@ if (DISABLE_SIM_CTRL == 0) begin
`endif
`ifdef VPROC_BURST_IF
// Burst count
Burst (),
BurstFirst (),
BurstLast (),
// Burst count
.Burst (),
.BurstFirst (),
.BurstLast (),
`endif
// Interrupts