Specman/e toolkit

Code

The e Toolkit (etk) is a free perl script that we've developed to help you analyse e code. You can use it to ask questions about a testbench, such as:

  • "what classes are there in the testbench?"
  • "what methods does class 'Foo' have?"
  • "what classes have a method called 'bar'?"
  • "where is the 'BIG' value added to the 'packet_size_t' enumerated type"
  • "where is the 'bar' method of class 'Foo' defined, and also, show me the code and any extensions?"

etk accompanies the book "Aspect Oriented Programming with the e Verification Language - A Pragmatic Guide for Testbench Developers" by Dr. David Robinson. Chapter 8 of this book describes the e Toolkit in detail.

Getting started

  1. Download the e Toolkit, untar it, and add its location to your path
  2. Change the "#!/usr/bin/perl" line if required
  3. Type "etk.pl" to get general help
  4. Type "etk.pl " to get help on a specific command

The available commands are:

  • aspects : Find code belonging to aspects
  • class : Find the declaration and extensions of classes
  • cd : Find the declaration of classes
  • ce : Find the extensions of classes
  • ch : Find the like inheritance hierarchy of classes
  • cdet : Find the determinants used by classes
  • type : Find the declaration and extensions of enumerated types
  • td : Find the declaration of enumerated types
  • te : Find the extensions of enumerated types
  • method : Find the declaration and extensions of methods
  • md : Find the declaration of methods
  • me : Find the extensions of methods
  • cover : Find the declaration and extensions of coverage groups
  • covd : Find the declaration of coverage groups
  • cove : Find the extensions of coverage groups
  • tvd : Find where a values is defined for an enumerated type
  • field : Find where a field is added to a class
  • event : Find where an event is declared

Examples


Finding all classes in a testbench :

  • etk.pl class '.*'

Finding all methods for all classes in a testbench:

  • etk.pl method '.*' '.*'

Creating a CSV file that lists all methods for all classes:

  • etk.pl --show summary method '.*' '.*' > all_methods.cvs

( David Robinson )

Created  
October 4, 2009
#SPECMAN