简体   繁体   中英

Implementing System verilog’s $value$plusargs() system function in Specman E

What is the equivalent syntax or implementation for System verilog's $value$plusargs option in Specman E ?

I am working in converting a source code from System verilog to Specman E, I am stuck with implementing $value$plusargs() system function in Specman E. How do I pass the arguments from command line or Makefile to the source code in Specman E ?. Here is the System verilog sample code which I want to convert and implement in Specman E environment ,

    function load_testname();
        if($value$plusargs("test=%s",test_name_s)) begin 
          $display(“Running testcase is %s”,test_name_s); 
        end 
     endfunction

I may also need $test$plusargs() implementation in Specman E. Please help.

For $value$plusargs(...) , there is the sn_plusarg_value(arg: string): string method. For $test$plusargs(...) there is sn_plusarg_exists(arg: string): bool .

You pass plusargs to Specman with the +plusarg[=value] command line argument.

Examples :

var test_name := sn_plusarg_value("test");
var number_i := sn_plusarg_value("number").as_a(int);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM