CodeGen/Gui.pm untested

filter: Statementstmt 0.0% 0 / 10 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 12 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Verilog::CodeGen::Gui;
2  
3 use 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  
14 print STDOUT "//Verilog::CodeGen GUI Documentation\n";
15  
16 use strict;
17  
18 ################################################################################
19  
20 @Verilog::CodeGen::ISA = qw(Exporter);
21 @Verilog::CodeGen::EXPORT =qw();
22  
23 ################################################################################
24  
25 =head1 NAME
26  
27 B<Verilog::Codegen::Gui> - Verilog code generator GUI
28  
29 =head1 SYNOPSIS
30  
31 $ ./gui.pl [design name]
32  
33 The GUI and its utility scrips are in the C<scripts> folder of the distribution.
34  
35 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. You can also set the design name via the GUI.
36  
37 =head1 USAGE
38  
39 The GUI is very simple to use. A short manual:
40  
41 To create, test and run Verilog code using the Verilog::CodeGen GUI:
42  
43 =head2 0. Choose your design.
44  
45 In the B<Design> text entry field, type the full name of the design. Click B<Set>.
46  
47 If 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  
51 This is the Perl script that will generate the Verilog code.
52  
53 =over
54  
55 =item *
56  
57 If this is a new file:
58  
59 In 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  
63 If 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  
73 In 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  
77 When 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  
81 This is the Perl script that will generate the Verilog testbench code.
82  
83 =over
84  
85 =item *
86  
87 If this is a new file:
88  
89 In 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  
93 If 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  
105 In 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  
121 B<Perl-Tk> (L<http://search.cpan.org/CPAN/authors/id/N/NI/NI-S/Tk-800.024.tar.gz>)
122  
123 Otherwise, no GUI
124  
125 =item *
126  
127 B<XEmacs> (L<http://xemacs.org>)
128  
129 With B<gnuserv> enabled, i.e. put the line (gnuserv-start) in your .emacs. Without XEmacs, the GUI is rather useless.
130  
131 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.
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  
138 I 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  
140 The B<Verilog-mode> (L<http://www.verilog.com/>)is (obviously) very usefull too.
141  
142 =item *
143  
144 B<v2html> (L<http://www.burbleland.com/v2html/v2html.html>)
145  
146 If 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  
150 B<A Verilog compiler/simulator>
151  
152 To 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  
156 B<A VCD waveform viewer>
157  
158 To 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  
164 In 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  
178 Convert the utility scripts to functions to be called from Verilog::CodeGen.
179  
180 =item *
181  
182 Put the GUI scripts in a module Gui.pm.
183  
184 =back
185  
186 =head1 AUTHOR
187  
188 W. Vanderbauwhede B<wim@motherearth.org>.
189  
190 L<http://www.comms.eee.strath.ac.uk/~wim>
191  
192 =head1 COPYRIGHT
193  
194 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.
195  
196 =cut
197