Verilog code generator GUI
$ ./gui.pl [design name]
The GUI and its utility scrips are in the scripts folder of the distribution.
scripts
The design name is optional. If no design name is provided, the GUI will check the .vcgrc file for one. If this file does not exists, the design library module defaults to DeviceLibs/Verilog.pm and the objects will reside directly under DeviceLibs/Objects. Otherwise, the design library module will be DeviceLibs/YourDesign.pm and the objects will reside under DeviceLibs/YourDesign/Objects.
The GUI is very simple to use. A short manual:
To create, test and run Verilog code using the Verilog::CodeGen GUI:
This is the Perl script that will generate the Verilog code.
If this is a new file:
In the Device Object Code area text entry field, type the full name of the script, including the .pl extension. Click Edit (hitting return does not work). The GUI will create a skeleton from a template, and open it in XEmacs.
.pl
If the file already exists:
-If this was the last file to be modified previously, just click Edit. The GUI will open the file in XEmacs.
-If not, type the beginning of the file in the Device Object Code text entry field, then click Edit. The GUI will open the first file matching the pattern in XEmacs.
In the Device Object Code area, click Parse. This executes the script and displays the output in the Output log window. Ticking the Show result tick box will cause the output to be displayed in an XEmacs window. To close this window, click Done. This is a modal window, in other words it will freeze the main display as long as it stays open.
When the object code is bug finished, click Update in the Device Library Module area. This will add the device object to the device library (which is a Perl module). Ticking the Show module tick box will cause the complete library module to be displayed in an XEmacs window. To close this window, click Done. This is a modal window, in other words it will freeze the main display as long as it stays open.
This is the Perl script that will generate the Verilog testbench code.
In the Testbench Code area text entry field, type the full name of the script, including the .pl extension, click Edit. The GUI will create a skeleton from a template, and open it in XEmacs.
-If not, type the beginning of the file in the Device Object Code text entry field. The testbench must have the name test_[device obect file name]. Then click Edit. The GUI will open the first file matching the pattern in XEmacs.
test_
-If the Overwrite tick box is ticked, the existing script will be overwritten with the skeleton. This is usefull in case of major changes to the device object code.
In the Testbench Code area, click Parse. This executes the script and displays the output in the Output log window.
-Ticking the Show result tick box will cause the output to be displayed in an XEmacs window. To close this window, click Done. This is a modal window, in other words it will freeze the main display as long as it stays open.
-Ticking the Inspect code tick box will open a browser window with pages generated by the v2html Verilog to HTML convertor.
-Ticking the Run tick box will execute the generated testbench.
-Ticking the Plot tick box will plot the simulation results (if any exist).
Perl-Tk (http://search.cpan.org/CPAN/authors/id/N/NI/NI-S/Tk-800.024.tar.gz)
Otherwise, no GUI
XEmacs (http://xemacs.org)
With gnuserv enabled, i.e. put the line (gnuserv-start) in your .emacs. Without XEmacs, the GUI is rather useless.
For a better user experience, customize gnuserv to open files in the active frame. By default, gnuserv will open a new frame for every new file, and you end up with lots of frames.
o Choose Options->Customize->Group o type gnuserv o Open the "Gnuserv Frame" section (by clicking on the arrow) o Tick "Use selected frame"
I also use the auto-revert-mode ftp://ftp.csd.uu.se/pub/users/andersl/emacs/autorevert.el because parsing the test bench code modifies it, and I got annoyed by XEmacs prompting me for confirmation. See the file for details on how to install.
The Verilog-mode (http://www.verilog.com/)is (obviously) very usefull too.
v2html (http://www.burbleland.com/v2html/v2html.html)
If you want to inspect the generated code, you need the v2html Verilog to HTML convertor and a controllable browser, I use galeon (http://galeon.sourceforge.net).
A Verilog compiler/simulator
To run the testbench, I use Icarus Verilog http://icarus.com/eda/verilog/index.html, a great open source Verilog simulator.
A VCD waveform viewer
To plot the results, I use GTkWave (http://www.cs.man.ac.uk/apt/tools/gtkwave/index.html, a great open source waveform viewer.
In CodeGen.pm, change the following lines:
#Modify this to use different compiler/simulator/viewer my $compiler="/usr/bin/iverilog"; my $simulator="/usr/bin/vvp"; my $vcdviewer="/usr/local/bin/gtkwave";
Convert the utility scripts to functions to be called from Verilog::CodeGen.
Put the GUI scripts in a module Gui.pm.
W. Vanderbauwhede wim@motherearth.org.
http://www.comms.eee.strath.ac.uk/~wim
Copyright (c) 2002,2003 Wim Vanderbauwhede. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Verilog::CodeGen, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Verilog::CodeGen
CPAN shell
perl -MCPAN -e shell install Verilog::CodeGen
For more information on module installation, please visit the detailed CPAN module installation guide.