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

SystemC VCD trace does not set correct precision #62

Closed
veripoolbot opened this issue Jan 27, 2009 · 3 comments
Closed

SystemC VCD trace does not set correct precision #62

veripoolbot opened this issue Jan 27, 2009 · 3 comments
Labels
resolution: wontfix Closed; work won't continue on an issue or pull request

Comments

@veripoolbot
Copy link
Contributor


Author Name: Jeremy Bennett (@jeremybennett)
Original Redmine Issue: 62 from https://www.veripool.org
Original Date: 2009-01-27


Use of the SpTraceVCD functions does not appear to set the trace precision correctly.

When creating an instance of @SpTraceVcdCFile@, the time resolution is held in the associated @SpTraceVcd@ object (private variable @m_timeRes@, which can be set by the @set_time_precision()@ function). This defaults to 10e-9 (1ns), which is inconsistent with SystemC's default of 10e-12 (1ps). It can be overridden by explicitly, e.g:

  SpTraceVcdCFile *tfp = new SpTraceVcdCFile ();
  tfp->spTrace()->set_time_resolution ("1 ps");

Really this should be set automatically in a SystemC environment by calling the underlying @sc_get_time_precision()@ function from the constructor of @SpTraceVcdCFile@. The code to do this exists in the class @SpTraceVcdFile@, but I cannot see that this class is currently used.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-01-27T17:34:56Z


SpTraceVcdCFile is for C files, while SpTraceVcdFile is for SystemC.
The latter should set the timeprecision correctly. Can you check?

I'll clarify the docs.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Jeremy Bennett (@jeremybennett)
Original Date: 2009-01-27T18:25:21Z


Ah thanks - my misunderstanding from reading the example in the distribution.

I've tried, but can't see how to use @SpTraceFile@ to assist in SystemC tracing (the class I referred to as @SpTraceVcdFile@ is in fact @SpTraceFile@). This is a subclass of the abstract class @sc_trace@ used to do SystemC tracing. However I can't see how to use it. There should be an alternative to @sc_create_vcd_trace_file@ to create instances, which I can't find. I also ran into issues when I tried including the header @"SpTraceVcd.h"@, it got upset if I included it after any of the @"Vxxxx.h"@ headers.

Really I don't really want to do SystemC tracing - it's the underlying Verilog signals I'm after, so my approach was correct, but since I'm in the C world, I need to set the precision.

From my past experience, this is the usual scenario - it's the underlying signals that need to be traced. An option to allow Verilator to do this and automatically pick up the SystemC time precision would be a nice enhancement for the future.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-05-08T18:56:33Z


I looked at doing this again, and it makes a bit as a mess as the C tracing isn't at all systemc aware, and making it so breaks compiles when there's no systemc. So until a major tracing rewrite comes I'll need to punt. Sorry.

@veripoolbot veripoolbot added the resolution: wontfix Closed; work won't continue on an issue or pull request label Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: wontfix Closed; work won't continue on an issue or pull request
Projects
None yet
Development

No branches or pull requests

1 participant