Re: [sv-ac] FW: [SystemVerilog P1800 0002557]: Rules for passing automatic variables to sequence subroutines are not clear

From: ben cohen <hdlcohen@gmail.com>
Date: Mon Feb 14 2011 - 14:40:45 PST

Erik,
I want to get a better understanding of this. Below is a model, and what I
think it says. Any clarification is welcomed.
module p2557;
  logic a, b, c, clk;
  task t;
    automatic logic ta;
  endtask : t

  function automatic logic f(ref logic m);
   f= !m;
  endfunction : f
// Each argument of a subroutine call attached to a sequence shall either be
passed
// by value as an input or be passed by reference (either ref or const ref;
see 13.5.2).
// Actual argument expressions that are passed by value use sampled values
of the
// underlying variables and are consistent with the variable values used to
evaluate
// the sequence match. The variable passed by value as an input shall be of
// a type allowed in 16.6.1
// An automatic variable may be used passed as a constant input for a
subroutine call
// from an assertion statement in procedural code (see 16.15.5 16.15.6.1).
// An automatic variable shall not be passed by reference nor passed as a
// non-constant input to a subroutine call from an assertion statement in
procedural code.
// The rules for passing elements of dynamic arrays, queues and associative
// arrays as ref arguments are described in 13.5.2.
  property p1;
     logic v;
     *(a, v=f(c)); //legal*
  endproperty : p1
  property p2;
     logic v;
       *(a, v=f(t.ta)); // Illegal <-----------*
  endproperty : p2
  property p3;
     logic v;
     *(a, v=f(b0.b0_auto)); //illegal <---------*
  endproperty : p3
  property p4;
     logic v;
     *(a, v=f(b0.b0_v)); //legal *
  endproperty : p4

  always @ (posedge clk)
    begin : b0
      automatic logic b0_auto;
                logic b0_v;
    ap1: assert property(p1); // legal
    ap2: assert property(p2); // illegal
    ap_OK: assert property(p3); // illegal
    ap_OK2: assert property(p4); // legal
  end : b0

endmodule : p2557

Thanks,
Ben

On Mon, Feb 14, 2011 at 12:49 PM, Seligman, Erik <erik.seligman@intel.com>wrote:

> Note that that would involve reopening the issue: from the info below, we
> see that the current proposal was approved with the addition of the friendly
> amendment. We should probably discuss in tomorrow’s meeting if you think
> it’s important that we make this further change.
>
>
>
> *From:* ben cohen [mailto:hdlcohen@gmail.com]
> *Sent:* Monday, February 14, 2011 12:46 PM
> *To:* Seligman, Erik
> *Cc:* sv-ac@eda.org
> *Subject:* Re: [sv-ac] FW: [SystemVerilog P1800 0002557]: Rules for
> passing automatic variables to sequence subroutines are not clear
>
>
>
> Erik,
>
> I think that an example is needed.
>
> Ben
>
> On Mon, Feb 14, 2011 at 11:34 AM, Seligman, Erik <erik.seligman@intel.com>
> wrote:
>
> I have posted a new version that implements Shalom's friendly amendment.
>
> >-----Original Message-----
> >From: Accellera Mantis Bug Tracker [mailto:mantis@eda.org]
> >Sent: Saturday, February 12, 2011 8:13 PM
> >To: Seligman, Erik
> >Subject: [SystemVerilog P1800 0002557]: Rules for passing automatic
> >variables to sequence subroutines are not clear
> >
> >
> >The following issue has been REOPENED.
> >======================================================================
> >http://www.eda-twiki.org/svdb/view.php?id=2557
> >======================================================================
> >Reported By: Dmitry Korchemny
> >Assigned To: Erik_Seligman
> >======================================================================
> >Project: SystemVerilog P1800
> >Issue ID: 2557
> >Category: SV-AC
> >Reproducibility: always
> >Severity: minor
> >Priority: normal
> >Status: feedback
> >Type: Errata
> >======================================================================
> >Date Submitted: 2009-01-06 09:51 PST
> >Last Modified: 2011-02-12 20:12 PST
> >======================================================================
> >Summary: Rules for passing automatic variables to
> >sequence
> >subroutines are not clear
> >Description:
> >In "16.11 Calling subroutines on match of a sequence" it is written:
> >
> >An automatic variable shall not be passed as an argument to a subroutine
> >call either as input or ref type. An
> >automatic variable may be used as a constant input for a subroutine call
> >from an assertion statement in procedural
> >code (see 16.15.5).
> >
> >This rule is contradictory, and probably the sentence "An automatic
> >variable shall not be passed as an argument to a subroutine call either
> >as
> >input or ref type." should be deleted.
> >
> >Also note that the reference 16.15.5 is wrong, it should be 16.15.6
> >======================================================================
> >
> >----------------------------------------------------------------------
> > (0007815) Shalom Bresticker (manager) - 2009-01-07 02:27
> > http://www.eda-twiki.org/svdb/view.php?id=2557#c7815
> >----------------------------------------------------------------------
> >See thread starting at http://www.eda-stds.org/sv-ac/hm/8319.html.
> >
> >----------------------------------------------------------------------
> > (0009561) Dmitry Korchemny (manager) - 2010-07-20 12:00
> > http://www.eda-twiki.org/svdb/view.php?id=2557#c9561
> >----------------------------------------------------------------------
> >Approved by voice vote 2010-07-20: 13y/0n/0a.
> >
> >----------------------------------------------------------------------
> > (0009990) Neil Korpusik (administrator) - 2010-11-06 20:05
> > http://www.eda-twiki.org/svdb/view.php?id=2557#c9990
> >----------------------------------------------------------------------
> >The proposal was opposed by the Champions in the email vote which ended
> >on October 30, 2010.
> >
> >Shalom - Opposed
> > I don't understand the reference to 6.24.
> >
> >Dave - Friendly amendment
> > In the sentence added, should it be "nor" instead of "or"?
> >
> >----------------------------------------------------------------------
> > (0010236) Dmitry Korchemny (manager) - 2011-01-18 11:16
> > http://www.eda-twiki.org/svdb/view.php?id=2557#c10236
> >----------------------------------------------------------------------
> >The proposal ( proposal_2557.pdf) approved by the voice vote 2011-01-17:
> >7y/0n/0a.
> >
> >
> >
> >----------------------------------------------------------------------
> > (0010426) Neil Korpusik (administrator) - 2011-02-12 20:12
> > http://www.eda-twiki.org/svdb/view.php?id=2557#c10426
> >----------------------------------------------------------------------
> >The proposal was approved by the Champions with friendly amendments
> >in the email vote which ended February 7, 2011.
> >
> >Shalom
> >
> > The proposal changes "An automatic variable may be used as a constant
> > input" to "An automatic variable can be passed as a constant input".
> > I think the original "may be" is better than "can be" here.
> >
> >Issue History
> >Date Modified Username Field Change
> >======================================================================
> >2009-01-06 09:51 Dmitry KorchemnyNew Issue
> >2009-01-06 09:51 Dmitry KorchemnyType => Errata
> >2009-01-07 02:21 Shalom BrestickerIssue Monitored: Shalom Bresticker
> >
> >2009-01-07 02:27 Shalom BrestickerNote Added: 0007815
> >2009-01-07 02:50 Dmitry KorchemnyDescription Updated
> >2010-06-28 04:47 Dmitry KorchemnyStatus new =>
> >assigned
> >2010-06-28 04:47 Dmitry KorchemnyAssigned To =>
> >Erik_Seligman
> >2010-07-09 11:52 Erik_Seligman File Added: proposal_2557.docx
> >
> >2010-07-09 11:52 Erik_Seligman File Added: proposal_2557.pdf
> >
> >2010-07-16 09:26 Erik_Seligman File Deleted: proposal_2557.docx
> >
> >2010-07-16 09:26 Erik_Seligman File Deleted: proposal_2557.pdf
> >
> >2010-07-16 09:26 Erik_Seligman File Added: proposal_2557.docx
> >
> >2010-07-16 09:26 Erik_Seligman File Added: proposal_2557.pdf
> >
> >2010-07-20 12:00 Dmitry KorchemnyNote Added: 0009561
> >2010-07-20 12:00 Dmitry KorchemnyStatus assigned =>
> >resolved
> >2010-07-20 12:00 Dmitry KorchemnyResolution open => fixed
> >2010-07-20 12:00 Dmitry KorchemnyFixed in Version => 1800-2012
> >2010-11-06 20:05 Neil Korpusik Note Added: 0009990
> >2010-11-06 20:05 Neil Korpusik Status resolved =>
> >feedback
> >2010-11-06 20:05 Neil Korpusik Resolution fixed =>
> >reopened
> >2011-01-18 09:49 Erik_Seligman File Deleted: proposal_2557.docx
> >
> >2011-01-18 09:49 Erik_Seligman File Deleted: proposal_2557.pdf
> >
> >2011-01-18 09:49 Erik_Seligman File Added: proposal_2557.docx
> >
> >2011-01-18 09:49 Erik_Seligman File Added: proposal_2557.pdf
> >
> >2011-01-18 09:52 Erik_Seligman File Deleted: proposal_2557.docx
> >
> >2011-01-18 09:52 Erik_Seligman File Deleted: proposal_2557.pdf
> >
> >2011-01-18 09:53 Erik_Seligman File Added: proposal_2557.docx
> >
> >2011-01-18 09:53 Erik_Seligman File Added: proposal_2557.pdf
> >
> >2011-01-18 11:15 Dmitry KorchemnyNote Added: 0010236
> >2011-01-18 11:15 Dmitry KorchemnyStatus feedback =>
> >resolved
> >2011-01-18 11:15 Dmitry KorchemnyResolution reopened =>
> >fixed
> >2011-01-18 11:16 Dmitry KorchemnyNote Edited: 0010236
> >2011-02-12 20:12 Neil Korpusik Note Added: 0010426
> >2011-02-12 20:12 Neil Korpusik Status resolved =>
> >feedback
> >2011-02-12 20:12 Neil Korpusik Resolution fixed =>
> >reopened
> >======================================================================
> >
> >
> >--
> >This message has been scanned for viruses and
> >dangerous content by MailScanner, and is
> >believed to be clean.
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Feb 14 14:42:24 2011

This archive was generated by hypermail 2.1.8 : Mon Feb 14 2011 - 14:42:32 PST