test vectors generation in Perl

July 17th, 2003 at 10:28 am

It always starts when you need to do something quickly… some boring, mechanical task, such as generating 256 similar lines with different fields, generated randomly, and some field increasing by 1 each time.

Most people in the hardware design world do this by hand, which is very sad… but we have Perl ! So yes, a Perl script is coded that does this, and it does it faster, AND can be later re-used. Great !

But then, you do want to reuse it. So, eh, the fields are different, the increments are different, 1/4th of the script must be changed. This is still far better than hand-hardwriting, especially for long sequences, but starts to get annoying.

Then you have a light bulb turn on in your head… How about writing a script which takes a template and uses it to generate vectors, controlling stuff with embedded variables ! Yippe hey, after a few hours of coding you have a 200 line script that can do everything you’ve wanted from it before, and many other things.

Then you start to wonder - people surely have done these things in Perl ! Test vectors generation, or in its more scientific name - ATPG (Automatic Test Pattern Generation) is a vast field in HW verification. But I’m not interested in the heavy tools sold by big companies for Ks of $s. I want some resources of self-cooked Perl scripts that do interesting stuff. To borrow ideas…

Related posts:

  1. Using perl for hardware verification
  2. Cool hack: creating custom subroutines on-the-fly in Perl
  3. using PAR to create a custom “hosted” Perl environment
  4. modularizing a large Perl script
  5. once again: perl, serial ports and what’s between them

Leave a Reply

To post code with preserved formatting, enclose it in `backticks` (even multiple lines)