Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

error: 'VL_CPU_RELAX' was not declared in this scope.

Added by David Banas 7 days ago

I just started trying to use multi-threading and am getting this error, when attempting to compile my top-level C++ test bench separately from the main Verilator translation step (i.e. - I am not using `--exe`.):

In file included from vrltr_out/VfpMxmTile.h:12:0,
                 from verilator/fpMxmTile_tb.cpp:15:
<Verilator root>/share/verilator/include/verilated_threads.h: In member function ‘void
VlNotification::waitForNotification()’:
<Verilator root>/share/verilator/include/verilated_threads.h:65:26: error: ‘VL_CPU_RELA
X’ was not declared in this scope
             VL_CPU_RELAX();

A Google search on "VL_CPU_RELAX" turned up nothing. That combined with the "VL_" prefix leads me to suspect that this variable is defined somewhere in Verilator land. Is that correct?

Anyone know how I fix this?


Replies (4)

RE: error: 'VL_CPU_RELAX' was not declared in this scope. - Added by Wilson Snyder 7 days ago

I think you aren't passing in the flags that verilator puts into the generated makefile, specifically -DVL_THREADED

RE: error: 'VL_CPU_RELAX' was not declared in this scope. - Added by David Banas 6 days ago

Thanks, Wilson!

Does the -DVL_THREADED flag get put in the V<blkname>_classes.mk file? I'm looking in that file, but not finding it. However, I'm also noticing that, despite having identical time stamps, the V<blkname>_classes.mk and V<blkname>__stats.txt file appear to be inconsistent with each other:

-rw-r--r-- 1 dbanas 38K Jan 11 14:18 vrltr_out/V<blkname>_classes.mk
-rw-r--r-- 1 dbanas 63K Jan 11 14:18 vrltr_out/V<blkname>__stats.txt

From V<blkname>_classes.mk:

# Threaded output mode?  0/1/N threads (from --threads)
VM_THREADS = 0

From V<blkname>__stats.txt:

Verilator Statistics Report

Information:
  Verilator 4.008 2018-12-01 rev UNKNOWN_REV
  Arguments: --cc --threads 81 -Wall -Wno-fatal
{snip}

Am I interpreting things correctly?

Thanks!
-db

RE: error: 'VL_CPU_RELAX' was not declared in this scope. - Added by Wilson Snyder 6 days ago

It does seem inconsistent. If you delete your vrltr_out and rebuild is it OK?

RE: error: 'VL_CPU_RELAX' was not declared in this scope. - Added by David Banas 6 days ago

D'oh! Sorry, just me being stupid.
I forgot to refresh an Emacs buffer.
Thanks very much for your time, and very sorry for any that I wasted. :(
-db

    (1-4/4)