Pass string to $system in SystemVerilog?

Status
Not open for further replies.

davyzhu

Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
Hi,

I want to run perl command with dynamic argument in SystemVerilog. And I use Cadence IUS583.

When I try to pass a string to $system(), the ncvlog said "Using String without index is not supported in the given context."

The code I write like below,
//---------------------
string perl_cmd_str = "";

$sformat(perl_cmd_str,"perl ./perl/test_opt_file.pl -a %0d -b 4", data_a);
$display("string is %s\n", perl_cmd_str);

$system (perl_cmd_str);
//---------------------

Any suggestion on how to input string to $system()?

Thanks!
Davy
 

Hi,
Checkout this!
Which simulator ur using??? I have ncverilog 5.6 which does not support
string construct yet!

Code:
reg[100*8:1] perl_cmd_str = "";

$sformat(perl_cmd_str,"perl ./perl/test_opt_file.pl -a %0d -b 4", data_a);
$display("string is %s\n", perl_cmd_str);

$system (perl_cmd_str);
 

    davyzhu

    Points: 2
    Helpful Answer Positive Rating
Hi nand_gates,

Thanks a lot! I will try your suggestion and tell you the result.

BTW, I use Cadence IUS583 (i.e. ncverilog 5.83 which support SystemVerilog).

Best regards,
Davy
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…