【问题标题】:How to use DPI systemVerilog to detect a substring match?如何使用 DPI systemVerilog 检测子字符串匹配?
【发布时间】:2016-11-10 12:41:31
【问题描述】:

如何使用 SystemVerilog DPI 检查某个字符串是否包含另一个字符串?例如,C 中的 strstr() 可以检测“str”是否包含在“string”中。

【问题讨论】:

    标签: system-verilog system-verilog-dpi


    【解决方案1】:

    不确定您所说的 DPI systemverilog 是什么意思?如果您想使用类似于 C 函数的函数,那么我强烈建议您使用 Verilab 的 svlib 库。它使用Str 类提供字符串操作方法

    http://www.verilab.com/resources/svlib/

    【讨论】:

      【解决方案2】:

      UVM 内置了正则表达式字符串方法。它得到了广泛的支持和优化。

      您希望“uvm_re_match()”完全按照您的意愿行事。

      https://dvteclipse.com/uvm-1.2_Public_API/summary-function-uvm_pkg.html#function_uvm_re_match

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-10-12
        • 2020-08-23
        • 2022-01-19
        • 1970-01-01
        • 2015-11-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多