Commentary

This commit is contained in:
Wilson Snyder 2021-03-07 11:33:55 -05:00
parent 2cad22a22a
commit 8df06a9f08

View File

@ -63,18 +63,18 @@ int main(int argc, char** argv, char** env) {
// Simulate until $finish // Simulate until $finish
while (!contextp->gotFinish()) { while (!contextp->gotFinish()) {
// Historical note, older versions of Verilator used // Historical note, before Verilator 4.200 Verilated::gotFinish()
// Verilated::gotFinish() below in place of contextp->gotFinish(). // was used above in place of contextp->gotFinish().
// Most of the contextp-> calls can use Verilated:: calls instead; // Most of the contextp-> calls can use Verilated:: calls instead;
// the Verilated:: versions simply assume there's a single context // the Verilated:: versions simply assume there's a single context
// being used (per thread). It's faster and clearer to use the // being used (per thread). It's faster and clearer to use the
// newer contextp-> versions. // newer contextp-> versions.
contextp->timeInc(1); // 1 timeprecision period passes... contextp->timeInc(1); // 1 timeprecision period passes...
// Historical note, older versions of Verilator required a // Historical note, before Verilator 4.200 a sc_time_stamp()
// sc_time_stamp() function instead of using timeInc. Once // function was required instead of using timeInc. Once timeInc()
// timeInc() is called (with non-zero), the Verilated libraries // is called (with non-zero), the Verilated libraries assume the
// assume the new API, and sc_time_stamp() will no longer work. // new API, and sc_time_stamp() will no longer work.
// Toggle a fast (time/2 period) clock // Toggle a fast (time/2 period) clock
top->clk = !top->clk; top->clk = !top->clk;