String Split in SV

In our verification environment, we may need to do some kind of string manipulations. In scripting languages like perl, this is done by using just a method (split). In SV, we need to do it in a roundabout way by parsing all the characters by using getc method.

Below example shows how to split a string using ” : ” as delimiter.

Simulation result:

The function split_using_delimiter_fn, parses through each character in the string till it finds the delimiter.

Leave a Reply

Your email address will not be published. Required fields are marked *