How do I use SystemVerilog DPI to check if some string contains another string? For example, strstr() in C can detect "str" is contained within "string".
2 Answers
Not sure what you mean by DPI systemverilog? If you want to use functions similar to C functions, then I would highly suggest the svlib library by Verilab. It provides string manipulation methods using the Str
class
UVM has regexp string methods built in. It's widely supported and optimized.
You want "uvm_re_match()" to do exactly what you want.
https://dvteclipse.com/uvm-1.2_Public_API/summary-function-uvm_pkg.html#function_uvm_re_match