Re: errata/93: PROPOSAL - Section 17.10.2 errors in the example

From: Gordon Vreugdenhil (gvreugde@synopsys.com)
Date: Mon Dec 16 2002 - 13:20:35 PST

  • Next message: etf@boyd.com: "Re: errata/177: PROPOSAL - 12.1.3.4, Example 8 (again): ba instead of ba[0]"

    Precedence: bulk

    I disagree with the expected output.

    The matching rules at the beginning of the LRM talk about the
    return value being non-zero if the "string" is found -- it says
    nothing about a zero value if the string is found and there
    is a conversion error.

    The provided output makes that assumption.

    The example run with "+TEST=5" should produce:

    value was 5
    frequency = 8.333330
    Running test number x.

    since the string "TEST" is found and it is only
    the conversion that fails.

    If we want to differentiate between a string search
    failure and a conversion failure, we should specify
    additional status codes.

    Gord.

    etf@boyd.com wrote:
    >
    > Precedence: bulk
    >
    > Replace the entire example, including the command line args
    > and expected output with the following:
    >
    > Examples:
    >
    > Given the following Verilog HDL:
    >
    > `define STRING reg [1024 * 8:0]
    >
    > module goodtasks;
    > `STRING str;
    > integer int;
    > reg [31:0] vect;
    > real realvar;
    >
    > initial
    > begin
    > if ($value$plusargs("TEST=%d",int))
    > $display("value was %d",int);
    > else
    > $display("+TEST= not found");
    > #100 $finish;
    > end
    >
    > endmodule
    >
    > module ieee1354_example;
    > real frequency;
    > reg [8*32:1] testname;
    > reg [64*8:1] pstring;
    > reg clk;
    >
    > initial
    > begin
    > if ($value$plusargs("TESTNAME=%s",testname))
    > begin
    > $display(" TESTNAME= %s.",testname);
    > $finish;
    > end
    >
    > if (!($value$plusargs("FREQ+%0F",frequency)))
    > frequency = 8.33333; // 166 MHz
    > $display("frequency = %f",frequency);
    >
    > pstring = "TEST%d";
    > if ($value$plusargs(pstring, testname))
    > $display("Running test number %0d.",testname);
    > end
    >
    > endmodule
    >
    > Adding the following plusarg to the tool's command line:
    >
    > +TEST=5
    >
    > will result in the following output:
    >
    > value was 5
    > frequency = 8.333330
    >
    > Adding the following plusarg to the tool's command line:
    >
    > +TESTNAME=bar
    >
    > will result in the following output:
    >
    > +TEST= not found
    > TESTNAME= bar.
    >
    > Adding the following plusarg to the tool's command line:
    >
    > +FREQ+9.234
    >
    > will result in the following output:
    >
    > +TEST= not found
    > frequency = 9.234000
    >
    > Adding the following plusarg to the tool's command line:
    >
    > +TEST23
    >
    > will result in the following output:
    >
    > +TEST= not found
    > frequency = 8.333330
    > Running test number 23.
    >
    > http://boydtechinc.com/cgi-bin/issueproposal.pl?cmd=view&pr=93

    -- 
    ----------------------------------------------------------------------
    Gord Vreugdenhil                                 gvreugde@synopsys.com
    Staff Engineer, VCS (Verification Tech. Group)   (503) 547-6054
    Synopsys Inc., Beaverton OR
    


    This archive was generated by hypermail 2.1.4 : Mon Dec 16 2002 - 13:27:43 PST and
    sponsored by Boyd Technology, Inc.