From: Anders Nordstrom (andersn@nortelnetworks.com)
Date: Fri Oct 15 1999 - 13:55:08 PDT
<x-html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#FF0000" alink="#000088">
Cliff,
<p>I have reviewed B24 - `ifndef and found a few errors, and BE39 - $value$plusargs
<br>and found that only half of it was included in the LRM. I have also
looked at
<br>the syntax for the other compiler directives and found some inconsistencies.
<br>
<p>(Draft 3 page 811, index)
<p>PROPOSED CHANGE:
<br>Add `ifndef to the index.
<br>
<p>(Draft 3 page 312, section 19)
<p>PROPOSED CHANGE:
<br>add the following line to the list of compiler directives after `ifdef:
<br>`ifndef [19.4]
<br>
<p>(Draft 3 page 730, Section A.1)
<p>PROPOSED CHANGE:
<br>Add the contents of Syntax 19-5 on page 317 to the BNF in section A.1.
<br>Note the error in Syntax 19-5
<br>WAS:
<br>[ `else another_group_of_lines `endif ]
<br>PROPOSED CHANGE:
<br>[ `else another_group_of_lines ]
<br>
<p>(Draft 3 page 731, section A.2)
<p>PROPOSED CHANGE:
<br>Add the following line from Syntax 19-1 on page 313 to section A.2:
<br><tt>default_nettype_compiler_directive ::=</tt>
<br><tt> <b> `default_nettype</b> net_type</tt>
<br>
<p>(Draft 3 page 731, Section A.2)
<p>PROPOSED CHANGE:
<br>Add the contents of Syntax 19-2 on page 314 and Syntax 19-3 on page
315 to
<br>Section A.2.
<br>
<p>(Draft 3 page 731, section A.2)
<p>PROPOSED CHANGE:
<br>Add the contents of Syntax 19-4 on page 316 to section A.2.
<br>
<p>(Draft 3 page 729, Section A.1)
<p>PROPOSED CHANGE:
<br>Add the contents of Syntax 19-6 on page 319 to section A.1
<br>
<p>(Draft 3 page 729, Section A.1)
<p>PROPOSED CHANGE:
<br>Add the contents of Syntax 19-7 on page 320 to Section A.1
<br>
<p>(Draft 3 page 740, section A.7)
<p>PROPOSED CHANGE:
<br>Add the contents of Syntax 19-8 on page 320 to Section A.7
<br>
<p>(Draft 3 page 811, index)
<p>IS:
<br><tt>`</tt>celldefine 313
<br><tt>`</tt>endcelldefine 313
<br><tt>`</tt>timescale 320
<p>'celldefine 488
<br>'endcelldefine 488
<br>'timescale 581, 582
<p>PROPOSED CHANGE:
<br><tt>`</tt>celldefine
313, 488
<br><tt>`</tt>endcelldefine
313, 488
<br><tt>`</tt>timescale
320, 581, 582
<br>
<p>(Draft 3 page 290, section 17.10)
<p>IS:
<h3>
17.10 Command line input</h3>
An alternative to reading a file to obtain information for use in the simulation
is specifying information with the com-
<br>mand to invoke the simulator. This information is in the form of a
optional argument provided to the simulation.
<br>These arguments are visually distinguished from other simulator arguments
by the starting with the plus (+) character.
<p>These arguments, referred to below as plusargs, are accessible through
the following system functions.
<h3>
17.10.1 $test$plusargs (string)</h3>
This system function searches the list of plusargs for the provided string.
The plusargs present on the command line
<br>are searched in the order provided. If one matches all characters in
the provided string, a non-zero integer is returned.
<br>If no plusarg from the command line matches the string provided, the
integer value zero (0) is returned.
<p>PROPOSED CHANGE:
<h3>
17.10 Command line input</h3>
An alternative to reading a file to obtain information for use in the simulation
is specifying information with the com-
<br>mand to invoke the simulator. This information is in the form of a
optional argument provided to the simulation.
<br>These arguments are visually distinguished from other simulator arguments
by the starting with the plus (+) character.
<p>These arguments, referred to below as plusargs, are accessible through
the following system functions.
<h3>
17.10.1 $test$plusargs (string)</h3>
This system function searches the list of plusargs for the provided string.
The plusargs present on the command line
<br>are searched in the order provided. If one matches all characters in
the provided string, a non-zero integer is returned.
<br>If no plusarg from the command line matches the string provided, the
integer value zero (0) is returned.
<p>Example:
<p><tt>Run simulator with command:</tt>
<p><tt>% +HELLO</tt>
<p><tt>Verilog code</tt>
<p><tt>initial begin</tt>
<br><tt> if ($test$plusargs("HELLO"))
$display("Hello argument found.")</tt>
<br><tt> if ($test$plusargs("HE"))
$display("The user wants male outputs.");</tt>
<br><tt> if ($test$plusargs("H"))
$display("Argument starting with H found.");</tt>
<br><tt> if ($test$plusargs("HELLO_HERE")) $display("Long
argument.");</tt>
<br><tt> if ($test$plusargs("HI"))
$display("Simple greeting.");</tt>
<br><tt>end</tt>
<p>This would produce the following output:
<p><tt>Hello argument found.</tt>
<br><tt>The user wants male outputs.</tt>
<br><tt>Argument starting with H found</tt>.
<h3>
17.10.2 $value$plusargs (user_string, variable)</h3>
This system function searches the list of plusargs (like the $test$plusargs
system function) for a user specified plusarg string.
<br>If the string is found, the remainder of the string is converted to
the type specified in the user_string and the resulting value
<br>stored in the variable provided. If a string is found the function
returns the a non-zero integer. If no string is
<br>found matching, the function returns the integer value zero and the
variable provided is not modified.
<p>The user string must be of the form: "'plusarg_string''format_string'".
The format strings are the same as the $display
<br>system tasks. These are the only valid ones (upper and lower case as
well as a leading 0 forms are valid):
<p><tt>%d - decimal conversion</tt>
<br><tt>%o - octal conversion</tt>
<br><tt>%h - hexadecimal conversion</tt>
<br><tt>%b - binary conversion</tt>
<br><tt>%e - real exponential conversion</tt>
<br><tt>%f - real decimal conversion</tt>
<br><tt>%g - real decimal or exponential conversion</tt>
<br><tt>%s - string (no conversion)</tt>
<p>The first string, from the list of plusargs provided to the simuator,
that matches the plusarg_string portion of the user_string
<br>specified will be the plusarg string available for conversion. The
remainder string of the matching plusarg (the remainder is
<br>the part of the plusarg string after the portion that matches the users
plusarg_string) will be converted
<br>from a string into the format indicated by the format string and stored
in the variable provided. If the size of the variable
<br>is larger than the value after conversion, the value stored is zero
padded to the width of the variable. If the variable can not
<br>contain the value after conversion, the value will be truncated. If
the value is negative, the value shall be considered
<br>larger than the variable provided. If characters exist in the string
available for conversion that are illegal for the specified
<br>conversion, the register should be written with the value 'bx.
<p>Examples:
<p> <tt>+FINISH=10000 +TESTNAME=this_test +FREQ+5.6666 +FREQUENCY</tt>
<br>
<p><tt>// Get clock to terminate simulation if specified.</tt>
<br><tt>if ($value$plusargs("FINISH=%d", stop_clock))</tt>
<br><tt> begin</tt>
<br><tt> repeat (stop_clock) @(posedge clk);</tt>
<br><tt> $finish;</tt>
<br><tt> end</tt>
<p><tt>// Get testname from plusarg.</tt>
<br><tt>if ($value$plusargs("TESTNAME=%s", testname[255:0]))</tt>
<br><tt> begin</tt>
<br><tt> $display("Running test %0s.", testname);</tt>
<br><tt> startTest();</tt>
<br><tt> end</tt>
<p><tt>// Get frequency from command line; set default if not specified.</tt>
<br><tt>if (!$value$plusargs("FREQ+%0F", frequency[63:0]))</tt>
<br><tt> frequency = 8.33333; // 166MHz;</tt>
<br> <tt></tt>
<p><tt>forever</tt>
<br><tt>begin</tt>
<br><tt> #frequency clk = 0;</tt>
<br><tt> #frequency clk = 1;</tt>
<br><tt>end</tt><tt></tt>
<p><tt>This code would have the following effects:</tt><tt></tt>
<p><tt>1. The variable 'stop_clock' obtains the value 10000.</tt>
<br><tt>2. The variable 'testname' obtains the value 'this_test'.</tt>
<br><tt>3. The variable 'frequency' obtains the value '5.6666'; note</tt>
<br><tt> the final plusarg +FREQUENCY does not affect the value
of</tt>
<br><tt> the variable 'frequency'</tt>
<br>
<br>
<p>Regards,
<p>
Anders
<br>
</body>
</html>
</x-html>
Attachment Converted: "C:\Documents and Settings\stefen\Application Data\Qualcomm\Eudora\andersn19.vcf"
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:53:30 PDT
and
sponsored by Boyd Technology, Inc.