Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / Verilog / CodeGen / Gui.pm
CommitLineData
86530b38
AT
1package Verilog::CodeGen::Gui;
2
3use vars qw( $VERSION );
4$VERSION='0.9.4';
5
6#################################################################################
7# #
8# Copyright (C) 2002,2003 Wim Vanderbauwhede. All rights reserved. #
9# This program is free software; you can redistribute it and/or modify it #
10# under the same terms as Perl itself. #
11# #
12#################################################################################
13
14print STDOUT "//Verilog::CodeGen GUI Documentation\n";
15
16use strict;
17
18################################################################################
19
20 @Verilog::CodeGen::ISA = qw(Exporter);
21 @Verilog::CodeGen::EXPORT =qw();
22
23################################################################################
24
25=head1 NAME
26
27B<Verilog::Codegen::Gui> - Verilog code generator GUI
28
29=head1 SYNOPSIS
30
31 $ ./gui.pl [design name]
32
33The GUI and its utility scrips are in the C<scripts> folder of the distribution.
34
35The 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. You can also set the design name via the GUI.
36
37=head1 USAGE
38
39The GUI is very simple to use. A short manual:
40
41To create, test and run Verilog code using the Verilog::CodeGen GUI:
42
43=head2 0. Choose your design.
44
45In the B<Design> text entry field, type the full name of the design. Click B<Set>.
46
47If the design does not exist, it will be created, that is, an empty structure with skeleton files will be created. Otherwise, the design will be set to the entered value.
48
49=head2 1. Create or edit the Device Object.
50
51This is the Perl script that will generate the Verilog code.
52
53=over
54
55=item *
56
57If this is a new file:
58
59In the B<Device Object Code> area text entry field, type the full name of the script, I<including> the C<.pl> extension. Click B<Edit> (hitting return does not work). The GUI will create a skeleton from a template, and open it in XEmacs.
60
61=item *
62
63If the file already exists:
64
65-If this was the last file to be modified previously, just click B<Edit>. The GUI will open the file in XEmacs.
66
67-If not, type the beginning of the file in the B<Device Object Code> text entry field, then click B<Edit>. The GUI will open the first file matching the pattern in XEmacs.
68
69=back
70
71=head2 2. Test the object code
72
73In the B<Device Object Code> area, click B<Parse>. This executes the script and displays the output in the B<Output log> window. Ticking the B<Show result> tick box will cause the output to be displayed in an XEmacs window. To close this window, click B<Done>. This is a modal window, in other words it will freeze the main display as long as it stays open.
74
75=head2 3. Add the Device Object to the Device Library
76
77When the object code is bug finished, click B<Update> in the B<Device Library Module> area. This will add the device object to the device library (which is a Perl module). Ticking the B<Show module> tick box will cause the complete library module to be displayed in an XEmacs window. To close this window, click B<Done>. This is a modal window, in other words it will freeze the main display as long as it stays open.
78
79=head2 4. Create or edit the test bench code
80
81This is the Perl script that will generate the Verilog testbench code.
82
83=over
84
85=item *
86
87If this is a new file:
88
89In the B<Testbench Code> area text entry field, type the full name of the script, I<including> the C<.pl> extension, click B<Edit>. The GUI will create a skeleton from a template, and open it in XEmacs.
90
91=item *
92
93If the file already exists:
94
95-If this was the last file to be modified previously, just click B<Edit>. The GUI will open the file in XEmacs.
96
97-If not, type the beginning of the file in the B<Device Object Code> text entry field. The testbench I<must> have the name C<test_>I<[device obect file name]>. Then click B<Edit>. The GUI will open the first file matching the pattern in XEmacs.
98
99-If the B<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.
100
101=back
102
103=head2 5. Test the testbench code
104
105In the B<Testbench Code> area, click B<Parse>. This executes the script and displays the output in the B<Output log> window.
106
107-Ticking the B<Show result> tick box will cause the output to be displayed in an XEmacs window. To close this window, click B<Done>. This is a modal window, in other words it will freeze the main display as long as it stays open.
108
109-Ticking the B<Inspect code> tick box will open a browser window with pages generated by the B<v2html> Verilog to HTML convertor.
110
111-Ticking the B<Run> tick box will execute the generated testbench.
112
113-Ticking the B<Plot> tick box will plot the simulation results (if any exist).
114
115=head1 REQUIREMENTS
116
117=over
118
119=item *
120
121B<Perl-Tk> (L<http://search.cpan.org/CPAN/authors/id/N/NI/NI-S/Tk-800.024.tar.gz>)
122
123Otherwise, no GUI
124
125=item *
126
127B<XEmacs> (L<http://xemacs.org>)
128
129With B<gnuserv> enabled, i.e. put the line (gnuserv-start) in your .emacs. Without XEmacs, the GUI is rather useless.
130
131For 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.
132
133 o Choose Options->Customize->Group
134 o type gnuserv
135 o Open the "Gnuserv Frame" section (by clicking on the arrow)
136 o Tick "Use selected frame"
137
138I also use the B<auto-revert-mode> L<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.
139
140The B<Verilog-mode> (L<http://www.verilog.com/>)is (obviously) very usefull too.
141
142=item *
143
144B<v2html> (L<http://www.burbleland.com/v2html/v2html.html>)
145
146If you want to inspect the generated code, you need the v2html Verilog to HTML convertor and a controllable browser, I use galeon (L<http://galeon.sourceforge.net>).
147
148=item *
149
150B<A Verilog compiler/simulator>
151
152To run the testbench, I use Icarus Verilog L<http://icarus.com/eda/verilog/index.html>, a great open source Verilog simulator.
153
154=item *
155
156B<A VCD waveform viewer>
157
158To plot the results, I use GTkWave (L<http://www.cs.man.ac.uk/apt/tools/gtkwave/index.html>, a great open source waveform viewer.
159
160=back
161
162=head2 To use a different Verilog compiler/simulator and/or VCD viewer:
163
164In CodeGen.pm, change the following lines:
165
166 #Modify this to use different compiler/simulator/viewer
167 my $compiler="/usr/bin/iverilog";
168 my $simulator="/usr/bin/vvp";
169 my $vcdviewer="/usr/local/bin/gtkwave";
170
171
172=head1 TODO
173
174=over
175
176=item *
177
178Convert the utility scripts to functions to be called from Verilog::CodeGen.
179
180=item *
181
182Put the GUI scripts in a module Gui.pm.
183
184=back
185
186=head1 AUTHOR
187
188W. Vanderbauwhede B<wim@motherearth.org>.
189
190L<http://www.comms.eee.strath.ac.uk/~wim>
191
192=head1 COPYRIGHT
193
194Copyright (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.
195
196=cut
197