1

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".

sm535
  • 587
  • 7
  • 20
sara8d
  • 403
  • 4
  • 17
  • 32

2 Answers2

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

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

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