• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Hardware/Software Co-Development, Verification…
  3. SystemC sc_method schedule

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 50
  • Views 13825
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SystemC sc_method schedule

jxker
jxker over 12 years ago

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?

  • Cancel
Parents
  • Ahmad Obeid
    Ahmad Obeid over 12 years ago

    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 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Ahmad Obeid
    Ahmad Obeid over 12 years ago

    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 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information