Jump to content

How can I exclude pending clock activity from my simulation?


katang

Recommended Posts

I want to run my simulation (a clocked design) event-by-event, but do not want to see the clock events.

In my design I set a flag upon receiving a clock signal, so in this way I can distinguish the "clock-only" events. However, two more events are also attached to the clock.

I have a 15 ns wait in my "design", and I have output such as

14 ns Current Pending Future Pending
14 ns Current Pending Future Pending
14 ns Time Current NOT Pending Future Pending
14050 ps Current Pending Future Pending
14050 ps Current Pending Future Pending
14050 ps Time Current NOT Pending Future Pending

As far as I understood, I can see the complete process of clock handling, which is not really interesting for me (at this moment).

1./ Is there any way to reduce the list of pending activities? Or, reject some events? Or, do I use a wrong method?

2./ How the clock influences my test?

(I mean: with sc_pending_activity_at_future_time() it runs OK, with sc_pending_activity() it represents an infinite loop.)


 

//    while( sc_pending_activity() )
    while(sc_pending_activity_at_future_time())
{
        sc_start( sc_time_to_pending_activity() );     // Run up to the next activity}/*    sc_start(10,SC_NS);
        cerr << '\n' << sc_time_stamp();
        if(MySimulator->ClockFlag_Get())
        {
            cerr << " Time";
            MySimulator->ClockFlag_Set(false);
        }
        if(sc_pending_activity_at_current_time())
            cerr << " Current Pending";
        else
            cerr << " Current NOT Pending";
        if(sc_pending_activity_at_future_time())
            cerr << " Future Pending";
        else
            cerr << " Future NOT Pending";

    }

 

Link to comment
Share on other sites

Since sc_clock is really just an ordinary SystemC citizen, there is no way to distinguish it per se. Newer versions of SystemC (2.3.3 ff) have sc_event::triggered(). So you could check clock->default_event().triggered().

Don't add a clock to your design. Simulation will be faster. If you need to wait 500 clocks use: wait( 500 * PERIOD );

You might consider looking at my design of no_clock here> https://github.com/dcblack/no_clock

 

 

Link to comment
Share on other sites

Hm. You are voting for quasi-asynchronous operation? I like the idea. Not only because of context switching. I'll learn it. Thank you.

So you say, there is no better idea, than to set a flag around notify(), and use that to distinguish the citizens?

I think I understand

 

sc_pending_activity_at_future_time()

and

sc_pending_activity_at_current_time() 

but, just for my curiosity: how can a clock influence

sc_pending_activity() 
 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...