Call Perl in Verilog or SV?

Discussion in 'Cadence' started by Shenli, Jan 11, 2007.

  1. Shenli

    Shenli Guest

    Hi all,

    Sometimes, I want to do some sophisticated text operation in Verilog or
    SystemVerilog testbench. And we all know that Verilog and SV is like
    C/C++ and not very good at text manipulation.

    Is there any method to call Perl routine in Verilog or SV? Pass
    argument to Perl routine can be better. BTW, I use Cadence NC tools.

    Best regards,
    Davy
     
    Shenli, Jan 11, 2007
    #1
  2. Shenli

    Shenli Guest

    Hi Ajeetha,

    Thanks a lot for the help :)
    I have tried your suggestion and it work OK.

    But 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 a string to $system()?

    Best regards,
    Shenli
     
    Shenli, Jan 11, 2007
    #2
  3. Shenli

    Alex Guest

    Alex, Jan 11, 2007
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.