• 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. Functional Verification
  3. How to pass arguments to ncsc_run just like you would pass...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 65
  • Views 14130
  • 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

How to pass arguments to ncsc_run just like you would pass arguments from the command line to a C program.

Matthieu P
Matthieu P over 14 years ago
Hi dear community members,

I'm trying to achieve the following:
- Just like if I were passing arguments to a C program called "myprog" and running ./myprog arguments and then parse the arguments in the code using argc and argv. I'd like to do the same when I use ncsc_run to simulate my SystemC environment.
- What I want to do is simple, I just want to give a value to one of my variables in one of my SystemC modules.

I went through cdnshelp and ncsc_run -help but I couldn't spot the answer to my problem. Any help is appreciated, thanks in advance.
  • Cancel
  • muffi
    muffi over 14 years ago
    You can use the +systemc_args option with the ncsc_run
    #include "systemc.h"
    
    int sc_main(int argc,char *argv[) {
    
    cout << "argc = " << argc << endl;
    cout << "argv[0] = " << argv[0] << endl;
    cout << "argv[1] = " << argv[1] << endl;
    cout << "argv[2] = " << argv[2] << endl;
    cout << "argv[3] = " << argv[3] << endl;
    
    return 0;
    }
    
    ncsc_run -sc_main +systemc_args+"x y z" test.cpp  
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Matthieu P
    Matthieu P over 14 years ago
    Thank you very much!
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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