NCSim: controlling a top-level simulation environment from an external application

Discussion in 'Cadence' started by filippo2991, Sep 25, 2006.

  1. filippo2991

    filippo2991 Guest

    Hello,

    I have a top level design fully simulable by ncsim. I'd like to create
    an external application (C/Perl/Python) to test my project before
    making the real silicon. At the end I'd like to use a production tester
    to test my device before the silicon-out, so using only my simulable
    top-level database.

    How can I drive NCsim from C/Perl external program?

    Thanks
    Filippo
     
    filippo2991, Sep 25, 2006
    #1
  2. filippo2991

    utku.ozcan Guest

    This is extremely simple!

    Perl has a built-in function that can call any executable. It is
    "system".
    An example Perl script to start NC-Sim:

    #!/usr/bin/perl -w

    $design = "adder";

    system "ncvlog $design.v";
    system "ncelab $design";
    system "ncsim $design";

    This is a simplified example. The example above calls the complete
    NC-Sim simulation flow as though you did it on UNIX command line. With
    system function call, you can do that in Perl. The example assumes that
    you have 1 Verilog code and its name matches with its module name. You
    can make the script more complex according to your needs (parametric
    simulation etc).

    In C, it is also possible. The header stdlib.h has "system ()"
    function, exactly the same way as Perl above.

    Utku.
     
    utku.ozcan, Sep 26, 2006
    #2
  3. filippo2991

    filippo2991 Guest

    ha scritto:
    thanks Utku,

    I relize thant my question was not clear. These statement execute the
    simulator, what I need is to drive the simulation by external program.
    I.e. let's assume my design is a memory, I'd like to operate on the
    memory:

    es

    read at address xxxx
    write to address zzzz

    I want to do this with an external program, not using i.e. the TCL
    interpreter.

    Is it possible to create a perl program that drive the ncsim tcl
    interpreter?

    At the end I'd like a way to develope the testing software on testing
    machine before the silicon out, using the simulation as a device
    (virtual testing).

    Thanks,

    Filippo
     
    filippo2991, Sep 26, 2006
    #3
  4. filippo2991

    utku.ozcan Guest

    I relize thant my question was not clear. These statement execute the
    This can be done only by PLI. You must write a PLI function.
    Now you have 2 possibilities:
    - your PLI function communicates with an external program using UNIX
    system calls (POSIX IPC) or TCP/IP socket to another application.
    - your PLI function reads a text file, which includes your "read/write"
    commands, then stimulates your design.

    Utku.
     
    utku.ozcan, Sep 26, 2006
    #4
  5. filippo2991

    filippo2991 Guest

    ha scritto:
    thanks for your answer,
    then I need to write a PLI funcion (C?) and an external program
    (perl/python) to communicate via TCP socket. Do you know if there is
    some documentation how to implement such PLI functions?

    Thanks,

    Filippo
     
    filippo2991, Sep 26, 2006
    #5
  6. filippo2991

    utku.ozcan Guest

    then I need to write a PLI funcion (C?) and an external program

    Yes. PLI is API of Verilog, in C.
    Google please!
    Look Vtracer. Perl (server) -> TCP socket -> Verilog (client)
    http://vtracer.sourceforge.net/vtracer_spec_4.html

    I haven't tried it. Use your own risk.

    Utku.
     
    utku.ozcan, Sep 26, 2006
    #6
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.