Ryan Herbst

Lemmy Editor Scripts

This page contains scripts that I have written for my favorite general purpose editor, Lemmy. Lemmy is a VI like editor that runs on windows. It is very similar in function to the VIM editor available for Linux.

Lemmy allows the user to execute perl scripts from within the editor. This perl scripts are started with a special object initialized. This $Lemmy object allows the user to manipulate data in the currently open file. Information about the variables and methods available with the $Lemmy object can be found on under the help menu within Lemmy.

The perl scripts can be called from the Lemmy command shell, from the tools menu or by linking them to a function key.

Lemmy RC File

Example lemmy.rc configuration file which shows how to setup these scripts within your own copy of Lemmy.

:map VTemp :perl c:/scripts/vhdlTemp.pl
:mpmenu VTemp VTemp
:map #6 :perl c:/scripts/vhdlTemp.pl

:map VTags :perl c:/scripts/vhdlTags.pl
:mpmenu VTags VTags
:map #7 :perl c:/scripts/vhdlTags.pl

:map VUcf :perl c:/scripts/vhdlUcf.pl
:mpmenu VUcf VUcf
:map #8 :perl c:/scripts/vhdlUcf.pl

VHDL Tag Generation

vhdlTags.pl

This script will create a tags file for the VHDL files in the current directory. This tags file allows the user to access the source code file for a VHDL component from within the calling source by pressing cntrl-] while over the name of the component. This scripted is mapped to F7 in above configuration file.

VHDL Template Generation

vhdlTemp.pl

This script is used to create VHDL templates within a source file. Calling this script will create either a component template for a given module, a instantiation template for a given module or produce signal declarations for the module interface signals. This scripted is mapped to F6 in above configuration file.

The text contained on the currently select line within the source code file is read as the command to be executed. To create a component template for the module modTest enter the following on the current command line:

c modTest

To create a instantiation template for the same module enter:

i modTest

To create signal declarations for the interface signals enter:

s modTest

I have found that the use of this script can greatly reduce the amount of time spend declaring and instantiating VHDL modules in my designs. The source code file for the module must match the module name and be in the current directory. The full path to the module source can be included in the command line. For example:

c ../othersrc/modTest

VHDL UCF Generation

vhdlUcf.pl

This script is used to generate Xilinx constraint file (UCF) entries for a given module. Two commands are supported in this script. The first command will create blank IO location declarations for every interface signal in the named module. The second command will create IO type declarations for the same interface signals. Like the previous script the command is passed on the currently active line in Lemmy. This scripted is mapped to F6 in above configuration file.

To create IO location declarations for a given module the following would be entered on the command line:

l modTest

To create IO type declarations enter:

i modTest

Similar rules apply to module file naming and location as with the template script above.

Archives

All entries, chronologically...