ARM Technical Support Knowledge Articles

How can I handle license error from within SystemC

Applies to: Fast Models

Answer

With an MI SystemC model, you can use the sc_report_handler feature to get more information on the licensing errors.

Here is how to register your report_handler to register the license error: 

    /* Ensure license missing errors do not abort() */
    sc_core::sc_report_handler::set_actions(scx::SCX_ID_LICENSE_MISSING ,
                                             sc_core::SC_DISPLAY |
                                            sc_core::SC_CACHE_REPORT);

sc_core::SC_CACHE_REPORT is used to cache the report so that you can get it later.

Once you have started your simulation, you can check for licensing errors:

     /* License missing error checks */      int license_issues = sc_core::sc_report_handler::get_count(scx::SCX_ID_LICENSE_MISSING);      if (license_issues) {
        std::cout << "got " << license_issues << " license errors" << std::endl;
        reports = sc_core::sc_report_handler::get_cached_report();
        std::cout << "got " << reports << " reports " << std::endl;
        if (reports != NULL)
            std::cout
            << " report msg "         << reports[0].get_msg()
            << " from line"           << reports[0].get_line_number()
            <<    "@"                 << reports[0].get_file_name()
            << std::endl;
    }

In case of error, you would get an error with this format:

    report msg license check failed from line859@Framework/Runtime/SCXSimulationEngine.cpp

Attachments: main.cpp

Article last edited on: 2013-08-27 13:32:20

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential