Timing Diagram Editing and Analysis

Appendix B: Writing Waveperl Scripts

Appendix B: Writing Waveperl Scripts

Previous topic Next topic  

Appendix B: Writing Waveperl Scripts

Previous topic Next topic  

Waveperl is an extended version of the Perl language that contains additional functions for manipulating data structures inside the timing diagram editor. Waveperl scripts are compiled and executed by a perl interpreter embedded into the product (technically it is not, strictly speaking, an interpreter since your script is really compiled on-the-fly). The functions added to Waveperl that support manipulation of objects are collectively referred to as the WaveFormer API.

In order to write a Waveperl script you will have to learn the basic syntax of the Perl language and become familiar with the functions available in SynaptiCAD’s API. The rest of this chapter is devoted to introducing Perl and hints on writing and debugging Waveperl scripts. After reading the chapter, study one of the standard scripts that is shipped with the product. One good example script to study is tvector.epl and its associated file tvector.pm. You may also find it useful to print the WaveFormer Pro API documentation (twfapi.txt) and the on-line Perl documentation. Finally to learn general Perl syntax and practical programming tips, we highly recommend the book Programming Perl, 3rd Edition by Larry Wall (Perl's creator), Tom Christiansen, and Randall Schwarz.