Re: errata/459: 9.2: assignment variable_lvalue evaluation order question

From: Shalom.Bresticker@motorola.com
Date: Mon Sep 15 2003 - 06:40:01 PDT

  • Next message: Shalom.Bresticker@motorola.com: "Re: errata/467: assignments on port declarations 12.3"

    Precedence: bulk

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

    From: Shalom.Bresticker@motorola.com
    To: etf-bugs@boyd.com
    Cc:
    Subject: Re: errata/459: 9.2: assignment variable_lvalue evaluation order
     question
    Date: Sun, 14 Sep 2003 17:07:57 +0300 (IDT)

     I found that 5.6.3 and 5.6.4 also discuss the time of evaluation of the RHS and
     LHS of blocking and nonblocking assignments, and cross-reference to 9.2.1 and
     9.2.2, respectively.
     
     I would add cross-references in the reverse direction as well.
     
     See below for more comments:
     
    > 9.2.1 on blocking assignments says,
    >
    > "If reg_lvalue requires an evaluation, it shall be evaluated at the time
    > specified by the intra-assignment timing control. "
    >
    >
    > 9.2.2 para. 3 on nonblocking assignments says,
    >
    > "If reg_lvalue requires an evaluation, it shall be evaluated at the same
    > time as the expression on the right-hand side. The order of evaluation
    > of the reg_lvalue and the expression on the right-hand side is undefined
    > if timing control is not specified."
    >
    > 1. If there is no timing control in a blocking assignment, is the order of
    > evaluation of the reg_lvalue and the RHS specified?
     
     5.6.3 is worded as follows:
     
     "A blocking assignment ... computes the right-hand side value using the current
     values, then causes the executing process to be suspended ...
     
     When the process is returned (or if it returns immediately if no delay is
     specified), the process performs the assignment to the left-hand side ... The
     values at the time the process resumes are used to determine the target(s)."
     
     From this, I deduce that from the letter of the LRM, first the RHS is evaluated
     and then the reg_lvalue.
     
     (Although strictly speaking, that first sentence starts off,
     "A blocking assignment statement with a delay computes the right-hand side ...")
     
     
    > 2. The NBA paragraph says that reg_lvalue and the RHS are evaluated "at the same
    > time" and also that their order of evaluation is not specified if there is no
    > timing control.
    >
    > However, if they are always evaluated "at the same time" whether or not there is
    > a timing control, then it would apparently seem that their order of evaluation
    > is ALWAYS not specified, even if there IS a timing control.
     
     5.6.4 also does not specify an order. It says,
     "The values in effect when the update is placed on the event queue are used to
     compute both the right-hand value and the left-hand target."
     
     So it seems correct to conclude that the order of evaluation of the right-hand
     value and the left-hand target is not specified even if there IS a timing control.
     
     --
     Shalom Bresticker Shalom.Bresticker@motorola.com
     Design & Reuse Methodology Tel: +972 9 9522268
     Motorola Semiconductor Israel, Ltd. Fax: +972 9 9522890
     POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 441478
     



    This archive was generated by hypermail 2.1.4 : Mon Sep 15 2003 - 06:43:01 PDT and
    sponsored by Boyd Technology, Inc.