【问题标题】:Implementing System verilog’s $value$plusargs() system function in Specman E在 Specman E 中实现 System verilog 的 $value$plusargs() 系统函数
【发布时间】:2019-08-13 04:48:47
【问题描述】:

Specman E 中 System verilog 的 $value$plusargs 选项的等效语法或实现是什么?

我正在将源代码从 System verilog 转换为 Specman E,我坚持在 Specman E 中实现 $value$plusargs() 系统函数。如何将命令行或 Makefile 中的参数传递给源代码在 Specman E 中? 这是我想在 Specman E 环境中转换和实现的 System verilog 示例代码,

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

我可能还需要在 Specman E 中实现 $test$plusargs()。请帮助。

【问题讨论】:

    标签: system-verilog specman system-verilog-dpi


    【解决方案1】:

    对于$value$plusargs(...),有sn_plusarg_value(arg: string): string 方法。对于$test$plusargs(...),有sn_plusarg_exists(arg: string): bool

    您使用 +plusarg[=value] 命令行参数将 plusargs 传递给 Specman。

    示例

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-13
      • 1970-01-01
      • 1970-01-01
      • 2015-05-27
      • 2017-04-04
      • 1970-01-01
      相关资源
      最近更新 更多