Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracing configuration does not work #932

Closed
veripoolbot opened this issue Jun 18, 2015 · 6 comments
Closed

tracing configuration does not work #932

veripoolbot opened this issue Jun 18, 2015 · 6 comments
Labels
resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800

Comments

@veripoolbot
Copy link
Contributor


Author Name: Frederic Requin
Original Redmine Issue: 932 from https://www.veripool.org
Original Date: 2015-06-18


Hello,
before I was using /* verilator tracing_on/off */ around my modules to activate/deactivate tracing.

Starting with verilator v3.866, this stopped working. Anyway, it was not a good solution because it introduced unwanted changes in the git repository.

So, I tried some experiments with `verilator_config and tracing_off -file. It worked with some files but not with all of them.

Basically, the files found through search path can have the trace turned on or off, the files added to the project with `include cannot have their traces turned on or off.

The trace is globally on or off depending if the `verilator_config is located at the beginning or at the end of the testbench verilog file.

To summarize, the testbench file "tb_verilator.v" look like this:

`verilator_config
tracing_off -file "../../verilator/src/*.v"
tracing_off -file "../../ip_dir1/src/file1.v"
tracing_off -file "../../ip_dir1/src/file2.v"
tracing_off -file "../../ip_dir1/src/file3.v"
tracing_off -file "../../ip_dir2/src/file4.v"
tracing_off -file "../../ip_dir2/src/file5.v"
`verilog

`include "../../ip_dir1/src/file1.v"
`include "../../ip_dir1/src/file2.v"
`include "../../ip_dir1/src/file3.v"
`include "../../ip_dir2/src/file4.v"
`include "../../ip_dir2/src/file5.v"
`include "../../ip_dir2/src/file6.v"

/* verilator lint_off PINMISSING */
`include "../../altium/ProjectOutputs/tb_top.V"
/* verilator lint_on PINMISSING */

The verilator command line is:

verilator tb_verilator.v -top-module tb_top -cc -O3 -trace -I./../../verilator/src/ -CFLAGS -Wno-attributes

(the folder "../../verilator/src/" contains the FPGA primitives in synthesisable verilog)

You would expect file6 and tb_top to be traced but in fact nothing is traced.

If I put the verilator_config block at the end of the file, everything but the FPGA primitives are traced.

I started investigating the issue.

What I noticed is that the search path is even added to the filenames found through `include, i.e. :

"../../verilator/src//../../ip_dir1/src/file1.v"

I fixed this problem by searching through the m_incDirFallbacks first (in V3Options::filepath)

This did not solve the tracing issue.

I activated debug output in preprocOpen(), V3PreProcImp::getStateToken() case ps_INCNAME:, addIgnore() and applyIgnores() to see how tracing property was applied to the files.

I also added a "tracing_on" keyword in the verilator_config block but I cannot make the tracing work reliably.

Best regards,

Frederic Requin

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Frederic Requin
Original Date: 2015-06-18T13:41:20Z


I have discovered that to have a module with working tracing, the module "above" it must have its trace on.

That would explain why the tracing of primitives works as expected since they are always the leaves in the hierarchy tree.

Best regards,

Frederic Requin

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Frederic Requin
Original Date: 2015-06-18T14:07:47Z


Hello,

here are my changes in case you want to experiment with them.

the "tracing_on" is a little bit hacky :-)

Regards,

Frederic Requin

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-06-18T23:30:34Z


It seems like you figured it out. Is there any change you're still advocating? (I fixed the docs to make a note about cells under the tracing_off command; it had been only under the pragma.)

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Frederic Requin
Original Date: 2015-06-19T13:22:58Z


I like the tracing_on feature in the verilator_config.
It allow me in one glance to see which module have trace enabled.
I do not know if the change in the search path order is really useful.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-07-23T00:17:51Z


Finally got around to the tracing_on improvement, added coverage_on and lint_on also.

Fixed in git towards 3.875.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-08-13T01:43:46Z


In 3.876.

@veripoolbot veripoolbot added resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800 labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800
Projects
None yet
Development

No branches or pull requests

1 participant