Backslash character in the string , used for uvm_hdl_force

Hi all

I using uvm_hdl_force dpi.

when i am providing the hdl path ( containing instance name with backslash) as string , i am hitting to hdl path not found issue.

snippet code :
string path = sformatf(“a.b.\c. \d”);
uvm_hdl_force(path,1);

for this code, the actual path its searching for is a.b.c.d instead of a.b.\c. \d

do we require any special treatment incase of backslash?

In reply to Kartheek Domakuntla:

You need to make sure any escaped name is terminated with a space. So you need to write this as

string path = sformatf("a.b.\c .\d ");

In reply to dave_59:

considering one more level of hierarchy

string path = $sformatf(“a.b.\c .\d .f”);

this is correct ? Dave