Skip to content

Commit 5f37588

Browse files
committed
Updated VerilatorSimCtrl() to take a node argument
1 parent a6beca6 commit 5f37588

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

verilator/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Verilator Simulation Control Module
22

3+
>[!WARNING]
4+
>EXPERIMENTAL
5+
36
The Verilator simulor control module is a _VProc_ wrapper that allows control of the running simulation on the console command line from where
47
the test bench with the module instnatiated is run. It consists of a SystemVerilog module defined in `verilator/verilator_sim_ctrl.sv` with a
58
single clock input (`clk`) and a clock count output (`clk_count`) for use by the test bench if desired. The only other inputs to the module are
@@ -35,15 +38,15 @@ static const int node = 0;
3538
3639
extern "C" void VUserMain0 (void)
3740
{
38-
VerilatorSimCtrl();
41+
VerilatorSimCtrl(node);
3942
4043
SLEEPFOREVER;
4144
}
4245
```
4346

4447
## Commands
4548

46-
The code above makes a simple call to a function `VerilatorSimCtrl()` that starts the Verilator Simulation Control features and prints some
49+
The code above makes a simple call to a function `VerilatorSimCtrl()`, with the _VProc_ node number, that starts the Verilator Simulation Control features and prints some
4750
information about the configuration and then a prompt. The user can then enter commands to run the simulation for a given time, relative to
4851
current time, or to a given absolute time in the future. The list below shows the form of the commands available
4952

verilator/src/VerilatorSimCtrl.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
#include "VProcClass.h"
2424
#include "VerilatorSimCtrl.h"
2525

26-
// I'm node 0
27-
static const int node = 0;
28-
2926
// ---------------------------------------------
3027
// advance_relative_cycles()
3128
// ---------------------------------------------
@@ -291,7 +288,7 @@ void rungtkwave (void)
291288
// function
292289
// ---------------------------------------------
293290

294-
void VerilatorSimCtrl (void)
291+
void VerilatorSimCtrl (const uint32_t node)
295292
{
296293
uint32_t clk_period_ps;
297294
uint32_t cyc_count_now;

verilator/src/VerilatorSimCtrl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@
6464
1000000000000.0))
6565

6666
extern void flushfst (void);
67-
extern void VerilatorSimCtrl(void);
67+
extern void VerilatorSimCtrl(const uint32_t node);
6868

6969
#endif

verilator/test/usercode/VUserMain0.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static const int node = 0;
3131

3232
extern "C" void VUserMain0 (void)
3333
{
34-
VerilatorSimCtrl();
34+
VerilatorSimCtrl(node);
3535

3636
SLEEPFOREVER;
3737
}

0 commit comments

Comments
 (0)