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

0

2 Answers 2

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/

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.