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

Issue #1445

simple sample doesn't poduce trace when using systemc 2.3

Added by Martin Zaun 3 months ago. Updated 2 months ago.

Status:
NoFixNeeded
Priority:
Normal
Assignee:
-
Category:
-
% Done:

0%


Description

* 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:
test_sc_2_2.sh  # using SystemC 2.2.0 
properly producing a trace. You may view it with
gtkwave test.gtkw
but (don't forget to delete obj_dir)
test_sc_2_3.sh  # using SystemC 2.3.3
also is running seamlessly, but thre produced trace.vcd doesn't contain trace data!

configure.txt View - configuration reports of both configure and CMAKE (2.32 KB) Martin Zaun, 05/17/2019 08:27 AM

History

#1 Updated by Martin Zaun 3 months ago

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

#2 Updated by Wilson Snyder 3 months ago

  • Status changed from New to AskedReporter

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

#3 Updated by Martin Zaun 3 months ago

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.

#4 Updated by Martin Zaun 3 months ago

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.

#5 Updated by Wilson Snyder 3 months ago

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

#6 Updated by Martin Zaun 3 months ago

Martin Zaun wrote:

  • Verilator version used: 4.015

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

#7 Updated by Wilson Snyder 3 months ago

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

#8 Updated by Martin Zaun 2 months ago

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;
}

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.

#9 Updated by Wilson Snyder 2 months ago

  • Status changed from AskedReporter to NoFixNeeded

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).

#10 Updated by Martin Zaun 2 months ago

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!

Also available in: Atom