Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 SystemC sc_method schedule 

Last post Thu, Mar 28 2013 7:58 AM by Ahmad Obeid. 1 replies.
Started by jxker 17 Feb 2013 10:23 PM. Topic has 1 replies and 937 views
Page 1 of 1 (2 items)
Sort Posts:
  • Sun, Feb 17 2013 10:23 PM

    • jxker
    • Not Ranked
    • Joined on Wed, Mar 14 2012
    • beijing, Beijing
    • Posts 13
    • Points 140
    SystemC sc_method schedule Reply

    Hi all,

     I have a question about systemC sc_method schedule.

    In my work, event A will trigger sc_method A, event B will trigger sc_method B; and sc_method A and B both will modify a same global variable. My question is what if event A and B happens at the same time? which sc_method will be scheduled first? Can I control this schedule myself?

    • Post Points: 20
  • Thu, Mar 28 2013 7:58 AM

    • Ahmad Obeid
    • Not Ranked
    • Joined on Thu, Jun 7 2012
    • Clausthal-Zellerfeld, Lower Saxony
    • Posts 7
    • Points 95
    Re: SystemC sc_method schedule Reply

    Hi jxker,

     

    If I understood you correctly, two SC_METHODs can modify a shared variable.

    -what if event A and B happens at the same time? 

    Based on SystemC simulation kernel, these two SC_METHODs are moved from waiting state into ready state.

    -which sc_method will be scheduled first? 

    Then one by one processes are randomly taken from the ready pool by designating them as running and invoked. Although not truly random.

     -Can I control this schedule myself?

    You've to manage access to shared resources via inter-process communication. It usually involves the use of signals which may lead to "wait()" calls that aren't allowed in SC_METHOD. Thus you might have to change these processes into SC_THREAD or SC_CTHREAD based on your design requirements coupled with a sensitivity list or clock edge.

     

    Hope this helps! 

     

    Note: Global variables aren't supported by Cadence C-to-Silicon Compiler. 

    Best Regards

    Ahmad Obeid 

    • Post Points: 5
Page 1 of 1 (2 items)
Sort Posts:
Started by jxker at 17 Feb 2013 10:23 PM. Topic has 1 replies.