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


V

 

A very simple perl script to read all log simulation files of specman regression and generate a nice failure report.

  1. The scripts works on one file at a time. It scans each log file, generated by specman, for the following error strings (specified in regular expression) :

    1. Dut error
    2. Error:
    3. Simulation Result: [^P]

    For the Dut error, the entire group of lines between two bars are printed.

  2. The script is invoked by scanning the log directories. Two examples follow:

    1. find ELOG -type f | xargs -n1 | xargs -i= perl ~/bin/e_reg_report.pl =
    2. foreach x ( `find ELOG/*.elog` )
      perl ~/bin/e_reg_report.pl $x
      end


  3. The script is listed below:

    1. #!/bin/perl
    2. open(FPR, $ARGV[0]) || die("open fail $ARGV[0]\n");
    3. open(FPW, ">>reg_rpt.txt");
    4. @ignore_a = ();
    5. push(@ignore_a, "SEQ_WATCHDOG_TC issued on channel");
    6. $line_i=0;
    7. $dut_error=0;
    8. while(eof(FPR) != 1) {
    9.   $line=<FPR>; chomp($line);
    10.   $n=$#a;
    11.   if($line =~ /Dut error/) {
    12.     $dut_error=1;
    13.   }
    14.   if($line =~ /-----------------------/) {
    15.     if($n == -1) {
    16.       push(@a, $line);
    17.     } else {
    18.       push(@a, $line);
    19.       if($dut_error == 1) {
    20.         #shall I ignore the error
    21.         $ignore=-1;
    22.         foreach $j ( @a ) {
    23.         $len=$#ignore_a;
    24.         if($len >= 0) {
    25.           foreach $k ( @ignore_a ) {
    26.             $ignore=index($j, $k);
    27.             if($ignore >= 0) {last;};
    28.           }
    29.           if($ignore >= 0) {last;};
    30.         }
    31.         }
    32.         if($ignore < 0) {
    33.         foreach $j ( @a ) {
    34.           print FPW ("$ARGV[0] :: $j\n");
    35.         }
    36.         }
    37.         $dut_error=0;
    38.       }
    39.       @a=(); $n=0;
    40.     }
    41.   }
    42.   elsif($n >= 0) {
    43.     push(@a, $line);
    44.   }
    45.   elsif($line =~ /Error:/) {
    46.     print FPW ("$ARGV[0] :: $line\n");
    47.   }
    48.   elsif($line =~ /Simulation Result: [^P]/) {
    49.     print FPW ("$ARGV[0] :: $line\n");
    50.   }
    51.   $line_i++;
    52. }#while
    53. close FPR;
    54. close FPW;

  ...


Home

How to change the default bash internal field space separator.

A simple c-code program to read a memory array from verilog RTL, using VPI.






Search This Site


Feedback This Site




new pages on this site