Email: bknpk@hotmail.com Phone: +972-54-7649119
V

 

ASIC/FPGA Design and Verification Out Source Services

GTK wave Add Marker PERL script


  1. GTK wave is an electronic free waveform viewer. Presently there is no easy way to add multiple cursors which are constant time step apart from the very last marker.
  2. I therefor wrote a little PERL script to the job.
    The script gets three parameters:
    saved GTK file, number of cursors to add and the time step.
  3. The script modifies one line in the file namely the line of the cursors.
  4. The script and an output waveform as example are shown below.
  5. In the wave example marker A and B exist and their time interval is:
    nevo-pinik:PDH> perl ~/bin/gtk_marker_delta.pl ds2.sav
    197730000-197720000=10000
    197720000-197730000=-10000
    Add markers:
    perl ~/bin/gtk_marker_add.pl ds2.sav 10 10000
    After re-reading the file all markers are on screen.

  6. #!/bin/perl

    #file count step
    open(FPR, $ARGV[0]) || die("open fail $ARGV[0]\n");
    open(FPW, ">Tmp") || die("open fail $outputFile\n");
    $cnt=$ARGV[1];
    $add=$ARGV[2];

    while(eof(FPR) != 1) {
      $line=<FPR>; chomp($line);
      if($line =~ /^\*-/) {
        @a=split(/ /, $line);
        foreach $j ( @a ) {
        if($j == -1 && $cnt > 0) {
          while($cnt > 0) {
          $k += $add;
            print FPW ("$k ");
          $cnt--;
          }#while
        $cnt=$ARGV[1];
        while($cnt > 0) {print FPW ("-1 "); $cnt--;}
        }
        print FPW ("$j ");
        $k=$j;
      }#foreach
      print FPW ("\n");
      }
      else {
        print FPW ("$line\n");
      }
    }

    close(FPR);
    close(FPW);
    $cmd="mv -f Tmp " . $ARGV[0];

    system($cmd);




Contact me now at:

  ...


I would be happy to offer my services. Call ASAP !


Home

Download Area






Search This Site


Feedback This Site




new pages on this site