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".
Asked
Active
Viewed 545 times
2 Answers
0
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

noobuntu
- 903
- 1
- 18
- 42
0
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

Lance E.T. Compte
- 932
- 1
- 11
- 33