NCSim: controlling a top-level simulation environment from a

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
 
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.

filippo2991@virgilio.it wrote:
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
 
utku.ozcan@gmail.com ha scritto:

system "ncvlog $design.v";
system "ncelab $design";
system "ncsim $design";
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
 
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).
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@gmail.com ha scritto:
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.
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
 
then I need to write a PLI funcion (C?) and an external program
Yes. PLI is API of Verilog, in C.

(perl/python) to communicate via TCP socket. Do you know if there is
some documentation how to implement such PLI functions?
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.
 

Welcome to EDABoard.com

Sponsor

Back
Top