Skip Nav
Home » Forums » SystemC Forum

Icon - KMLM List KMLM List

View email archives for the history of this mailing list.

List Home All Archives Dates Threads Authors Subjects
systemc-forum - RE: [Systemc-forum] SystemC timing doubt Message Thread: Previous | Next
  • To: "Sandeep S Srinivasa" <sss@xxxxxxxxxxxxxxxxx>
  • From: "Adam Rose" <arose@xxxxxxxxxxx>
  • Date: Tue, 6 Jul 2004 16:13:10 +0100
  • Cc: <systemc-forum@xxxxxxxxxxx>
Send Email to systemc-forum@osci.kavi.com:
Send new message
Reply to this message
You haven't sent out much code, but I would guess that you can use the
request_update / update mechanism already supplied by SystemC.

This assumes that you can get the functionality you want into a
primitive channel.
Adam.

void emif::update()
{

   if(foo_var > 0)

     foo_var--;

}

void emif::issue_foo()
{

  if(foo_var  == 0) {

    issue_command();
    request_update();

  }
 
} 

>-----Original Message-----
>From: systemc-forum-admin@xxxxxxxxxxx 
>[mailto:systemc-forum-admin@xxxxxxxxxxx] On Behalf Of Sandeep 
>S Srinivasa
>Sent: 06 July 2004 16:02
>Cc: systemc-forum@xxxxxxxxxxx
>Subject: Re: [Systemc-forum] SystemC timing doubt
>
>hi,
>    Why dont you declare an event say "event1" and do 
>"event1.notify(SC_ZERO_TIME)" in update_foo, as well as a 
>"wait(event1)" in issue_foo.
>This will cause update_foo and issue_foo to be separated by 
>one delta cycle.
>regards
>Sandeep
>
>
>Sadagopan Srinivasan wrote:
>
>>Hi,
>>
>>   I have two functions which are sensitive to positive edge of clock.
>>
>>void emif::update_foo()
>>{
>>
>>   if(foo_var > 0)
>>
>>     foo_var--;
>>
>>}
>>
>> 
>>
>>void emif::issue_foo()
>>{
>>
>>  if(foo_var  == 0)
>>
>>    issue_command();
>>
>> 
>>
>>}
>>
>>The implementation requirement is that update_foo should update in
>>cycle X and issue_foo should see the change in cycle X+1. Since
>>systemC has two phases of evaluation and update is it taken care of by
>>itself normally or should I issue a dummy delay as follows.
>>
>>void emif::update_foo()
>>{
>>
>>  wait(SC_ZERO_TIME);
>>
>>   if(foo_var > 0)
>>
>>     foo_var--;
>>
>>}
>>
>>this will delay the update of the foo till the end of cycle and so the
>>issue_foo won't see the value until next cycle.
>>
>>Cheers,
>>
>>Sada
>>
>>_______________________________________________
>>Systemc-forum mailing list
>>Systemc-forum@xxxxxxxxxxx
>>https://www.systemc.org/mailman/listinfo/systemc-forum
>>
>>
>>  
>>
>
>
>-- 
>                       
>                       
>               The glass is neither half-full, nor is it half-empty. 
>       Nay, the glass itself is just twice as large as is necessary
>
>
>_______________________________________________
>Systemc-forum mailing list
>Systemc-forum@xxxxxxxxxxx
>https://www.systemc.org/mailman/listinfo/systemc-forum
>
>



By Date: Previous | Next Current Thread By Thread: Previous | Next

  Mail converted by the most-excellent MHonArc 2.6.10