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

simple sample doesn't poduce trace when using systemc 2.3 #1445

Closed
veripoolbot opened this issue May 16, 2019 · 10 comments
Closed

simple sample doesn't poduce trace when using systemc 2.3 #1445

veripoolbot opened this issue May 16, 2019 · 10 comments

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented May 16, 2019


Author Name: Martin Zaun
Original Redmine Issue: 1445 from https://www.veripool.org


  • Verilator version used: 4.015
  • SystemC built on Linux from original reference sources by accelera.org
  • There are two bash scripts, one for SystemC Version 2.2 and one for System C Version 2.3, which generate a trace dump in "trace.vcd".
    If you want to run them, don't forget to ajust the environment variables according your systemc installation.
  • Problem:

properly producing a trace. You may view it with

but (don't forget to delete obj_dir)

also is running seamlessly, but thre produced trace.vcd doesn't contain trace data!

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented May 16, 2019


Original Redmine Comment
Author Name: Martin Zaun
Original Date: 2019-05-16T16:32:43Z


This may be same problem as Issue #1307, since I build SystemC 2.3.3 with CMAKE.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented May 16, 2019


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-05-16T21:55:18Z


Sounds same as #�. I use 2.3.3 for all testing and do not see this problem, if you can figure it out please post.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented May 17, 2019


Original Redmine Comment
Author Name: Martin Zaun
Original Date: 2019-05-17T08:36:58Z


Comparing configure vs. CMAKE (details see attached file):

  • systemc 2.3.3 build via configure is producing correct trace data.
  • systemc 2.3.3 build via CMAKE doesn't produce trace data (only header is generated - same as issue #1307).
  • additional remark: neither CMAKE_CXX_STANDARD = 98 nor CMAKE_CXX_STANDARD = 11 works.
@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented May 17, 2019


Original Redmine Comment
Author Name: Martin Zaun
Original Date: 2019-05-17T08:41:00Z


OS & compiler used in report:

  • Linux Ubuntu 16.04
  • gcc 5.4

URL to reference data/project somehow was lost as I see now. Sorry for that - here it is (feel free to use!) : https://github.com/mzau/systemcsample

One can find the files mentioned in the last comments there.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented May 28, 2019


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-05-28T11:08:50Z


Looks like you've made some good progress debugging, can you please continue and get it to a patch to fix the issue?

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jun 3, 2019


Original Redmine Comment
Author Name: Martin Zaun
Original Date: 2019-06-03T08:44:23Z


Martin Zaun wrote:

  • Verilator version used: 4.015

same behavior reproduced with verilator 4.014 (stable branch from git.veripool.org)

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jun 3, 2019


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-06-03T11:29:04Z


Note this is waiting for a patch from someone, as CMAKE isn't the standard flow.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jun 5, 2019


Original Redmine Comment
Author Name: Martin Zaun
Original Date: 2019-06-05T14:54:08Z


Simple workaround

With make edit_cache I set

  ENABLE_PHASE_CALLBACKS_TRACING = OFF

(which is set to ON by default)

Than the trace will be generated.

Basically in

sc_simcontext::do_timestep(const sc_time& t)
{
     sc_assert( m_curr_time < t );

     SC_DO_PHASE_CALLBACK_(before_timestep);

#if SC_SIMCONTEXT_TRACING_
     if( m_something_to_trace ) {
         trace_cycle( false );
     }
#endif

     m_curr_time = t;
     m_change_stamp++;
     m_initial_delta_count_at_current_time = m_delta_count;
}
</code>

SC_SIMCONTEXT_TRACING needs to be set to 1 to call trace_cycle, but is set to 0, if the default cmake configuration is used, thus not calling trace_cycle.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jun 6, 2019


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-06-06T00:49:00Z


Thanks for debugging. Not sure who gave the code to set SC_SIMCONTEXT_TRACING, recommend you feed that back upstream to who it came from.

As the SystemC building is outside of Verilator, don't think Verilator itself has anything here to fix (correct me if I missed something).

@veripoolbot veripoolbot closed this Jun 6, 2019
@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Jun 6, 2019


Original Redmine Comment
Author Name: Martin Zaun
Original Date: 2019-06-06T14:45:50Z


Wilson Snyder wrote:

As the SystemC building is outside of Verilator, don't think Verilator itself has anything here to fix (correct me if I missed something).

SC_SIMCONTEXT_TRACING_ is controlled by SC_ENABLE_SIMULATION_PHASE_CALLBACKS_TRACING which on his part is set in the in CMakeLists.txt on behalf of ENABLE_PHASE_CALLBACKS_TRACING.

Should be solved on the SystemC side on my opinion. I agree, that no fix is needed on Verilator. Thanks for this great tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.