The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Logic Simulators >> invoking a perl script from ncverilog?
https://designers-guide.org/forum/YaBB.pl?num=1242168569

Message started by joel on May 12th, 2009, 3:49pm

Title: invoking a perl script from ncverilog?
Post by joel on May 12th, 2009, 3:49pm

Hi All,
 My simulation needs to periodically regenerate its stimulus file based on current simulation conditions.  I have a perl script that generates the stimulus file based on a few parameters.  Is there a simple way to invoke a perl script from an ncverilog simulation and suspend the simulation until the perl script completes?  e.g.

always #10000
 begin
   $system("create_stim_file.pl");
   $readmemh( "stim_file.dat", stim_data);
 end
I've glanced at the PLI and VPI docs, but it seems overkill and very complex for my goal.

  Thanks,
  -Joel
 

Title: Re: invoking a perl script from ncverilog?
Post by joel on Jun 1st, 2009, 12:17pm


Hi All,
 I guess I'm the only one doing this!  But just in case anyone else is interested, here is what the Cadence AE said.

Bracketing the $system call with $display statements will define its location in the event queue.  So if you put this in your primary clock loop:

  $display("about to...");
  $system("create_stim_file.pl");
  $display("done...");

and make sure to stop your clock oscillator or whatever time-progression mechanism your sim uses while the three lines are being executed.

 Cheers,
 /jd

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.