errata/566: Re: errata/566: 9.5: case item expression ambiguity

From: Shalom Bresticker (Shalom.Bresticker@motorola.com)
Date: Sun Mar 21 2004 - 06:20:01 PST

  • Next message: Clifford E. Cummings: "Generate Proposal comments and typos"

    The following reply was made to PR errata/566; it has been noted by GNATS.

    From: Shalom Bresticker <Shalom.Bresticker@motorola.com>
    To: etf-bugs@boyd.com
    Cc:
    Subject: Re: errata/566: 9.5: case item expression ambiguity
    Date: Sun, 21 Mar 2004 16:33:47 +0200

     In the implementations I checked, some returned 1 and some returned 2.
     
     But I still don't see any ambiguity in the term "case item expression".
     
     (By the way, you have an infinite loop there.)
     
     Shalom
     
    > Subclause 9.5 may not be not clear enough about what
    > a 'case item expression' is. Apparently, the case item
    > expression can include several expressions, and, if any of
    > them match, then the case item expression matches. "The case
    > item expressions shall be evaluated and compared in the exact
    > order in which they are given. During the linear search,
    > if one of the case item expressions matches the case expression
    > given in parentheses, then the statement associated with that
    > case item shall be executed and the linear search shall terminate."
    > If the comma separated list were composed of individual case item
    > expressions, then the above would mean that the following *must*
    > display 1 and could not legally display 2.
    >
    > module m ( o1, o2 ) ;
    > output [1:0] o1, o2 ;
    > reg [1:0] o1, o2 ;
    >
    > function f ;
    > input i ;
    > begin
    > o1 = o1 + 1 ;
    > f = i ;
    > end
    > endfunction
    >
    > always begin
    > o1 = 0 ;
    > o2 = 0 ;
    > case ( 1'b1 )
    > f(1'b1) , f(1'b0) : o2 = o2 + 1 ;
    > default ;
    > endcase
    > $display("couldn't this be 2? -- is %d", o1 );
    > end
    >
    > endmodule
     



    This archive was generated by hypermail 2.1.4 : Sun Mar 21 2004 - 06:20:11 PST and
    sponsored by Boyd Technology, Inc.