Re: [sv-ac] Issue #1550

From: John Havlicek <john.havlicek_at_.....>
Date: Tue Oct 03 2006 - 08:57:34 PDT
Hi Ed:

What about the following:

   $past(expression, k, @(clocking_event)) ::==
      var type(expression) sample_expr_0;
      var type(expression) sample_expr_1;      
      var type(expression) sample_expr_2;      
      ...
      var type(expression) sample_expr_k;      
      always @(clocking_event) 
      begin
         sample_expr_0 = $sample(expression);
         sample_expr_1 = $sample(sample_expr_0);
         sample_expr_2 = $sample(sample_expr_1);
         ...
         sample_expr_k = $sample(sample_expr_k-1);
      end      

   and use sample_expr_k-1 in place of the original $past.

Do you think that this gives the right meaning?

J.H.

> X-Authentication-Warning: server.eda-stds.org: majordom set sender to owner-sv-ac@eda.org using -f
> X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
> Content-class: urn:content-classes:message
> Date: Tue, 3 Oct 2006 07:23:26 -0700
> Thread-Topic: [sv-ac] Issue #1550
> Thread-Index: Acbm084n1L6de0xGQfW+kzleulorcgAIwpMQ
> From: "Eduard Cerny" <Eduard.Cerny@synopsys.com>
> X-OriginalArrivalTime: 03 Oct 2006 14:23:27.0949 (UTC) FILETIME=[7E7427D0:01C6E6F7]
> X-Virus-Status: Clean
> Sender: owner-sv-ac@eda.org
> 
> This is a multi-part message in MIME format.
> 
> ------_=_NextPart_001_01C6E6F7.7E696DF3
> Content-Type: text/plain;
> 	charset="US-ASCII"
> Content-Transfer-Encoding: quoted-printable
> 
> Hello Dmitry,
> =20
> the definition=20
> sampled(expression, clocking event) =3D (clocking event) ? expression :
> $past(expression, clocking event). The straightforward synthesis without
> a system clock is not clear in general case.
> =20
> has a problem because there is no way to detect clocking event in a
> ternary expression.
> =20
> What about something like this:
> =20
> $sampled(expression, @(clocking_event)) ::=3D=20
>    var type(expression) sample_expr;
>    always @(clocking_event) sample_expr =3D $sample(expression);
> =20
> and use sample_expr in place of the original $sampled.
> =20
> Would this work?
> =20
> ed
> =20
> 
> 
> ________________________________
> 
> 	From: owner-sv-ac@eda.org [mailto:owner-sv-ac@eda.org] On Behalf
> Of Korchemny, Dmitry
> 	Sent: Tuesday, October 03, 2006 6:08 AM
> 	To: sv-ac@eda.org
> 	Subject: [sv-ac] Issue #1550
> =09
> =09
> 
> 	Hi all,
> 
> 	=20
> 
> 	During the discussion of #1550 a question was raised whether we
> need to keep a second argument of $sampled function. The current
> definition is $sampled(expression [, clocking event])
> 
> 	=20
> 
> 	If we want to keep it then its semantics should be:
> 
> 	=20
> 
> 	$sampled(expression, clocking event) =3D (clocking event) ?
> expression : $past(expression, clocking event). The straightforward
> synthesis without a system clock is not clear in general case.
> 
> 	=20
> 
> 	E.g., always a =3D $sampled(b, @(posedge clk))
> 
> 	or
> 
> 	disable iff ($sampled(reset, @(posedge clk))
> 
> 	=20
> 
> 	 Therefore we have three options:
> 
> 	1.	Allow only one argument form, which is not backward
> compatible=20
> 	2.	Allow two argument form in trivial cases only, e.g.,
> always @(posedge clk) a =3D $sampled(b, @(posedge clk)), which is
> redundant=20
> 	3.	Allow two argument form in trivial cases or when a
> system clock is present (I have a proposal about a system clock in one
> of my presentations)=20
> 
> 	=20
> 
> 	What do you think?
> 
> 	=20
> 
> 	Thanks,
> 
> 	Dmitry
> 
> 
> ------_=_NextPart_001_01C6E6F7.7E696DF3
> Content-Type: text/html;
> 	charset="US-ASCII"
> Content-Transfer-Encoding: quoted-printable
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html; =
> charset=3Dus-ascii">
> <META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
> <STYLE>@font-face {
> 	font-family: Courier;
> }
> @font-face {
> 	font-family: TimesNewRoman;
> }
> @page Section1 {size: 595.3pt 841.9pt; margin: 1.0in 1.25in 1.0in =
> 1.25in; }
> P.MsoNormal {
> 	FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: Courier
> }
> LI.MsoNormal {
> 	FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: Courier
> }
> DIV.MsoNormal {
> 	FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: Courier
> }
> A:link {
> 	COLOR: blue; TEXT-DECORATION: underline
> }
> SPAN.MsoHyperlink {
> 	COLOR: blue; TEXT-DECORATION: underline
> }
> A:visited {
> 	COLOR: purple; TEXT-DECORATION: underline
> }
> SPAN.MsoHyperlinkFollowed {
> 	COLOR: purple; TEXT-DECORATION: underline
> }
> P.Body {
> 	FONT-SIZE: 10pt; MARGIN: 10pt 0in 0pt; COLOR: black; FONT-FAMILY: =
> TimesNewRoman; TEXT-ALIGN: justify; punctuation-wrap: simple
> }
> LI.Body {
> 	FONT-SIZE: 10pt; MARGIN: 10pt 0in 0pt; COLOR: black; FONT-FAMILY: =
> TimesNewRoman; TEXT-ALIGN: justify; punctuation-wrap: simple
> }
> DIV.Body {
> 	FONT-SIZE: 10pt; MARGIN: 10pt 0in 0pt; COLOR: black; FONT-FAMILY: =
> TimesNewRoman; TEXT-ALIGN: justify; punctuation-wrap: simple
> }
> SPAN.EmailStyle18 {
> 	FONT-WEIGHT: normal; COLOR: windowtext; FONT-STYLE: normal; =
> FONT-FAMILY: Arial; TEXT-DECORATION: none
> }
> DIV.Section1 {
> 	page: Section1
> }
> OL {
> 	MARGIN-BOTTOM: 0in
> }
> UL {
> 	MARGIN-BOTTOM: 0in
> }
> </STYLE>
> </HEAD>
> <BODY lang=3DEN-US vLink=3Dpurple link=3Dblue>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4>Hello Dmitry,</FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4></FONT></SPAN>&nbsp;</DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4>the definition </FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3DArial =
> size=3D2>sampled(expression,=20
> clocking event) =3D (clocking event) ? expression : $past(expression, =
> clocking=20
> event). The straightforward synthesis without a system clock is not =
> clear in=20
> general case.</FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4></FONT></SPAN>&nbsp;</DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4>has a problem because there is no way to detect clocking event =
> in a=20
> ternary expression.</FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4></FONT></SPAN>&nbsp;</DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4>What about something like this:</FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4></FONT></SPAN>&nbsp;</DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4>$sampled(expression, @(clocking_event)) ::=3D =
> </FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4>&nbsp;&nbsp; var type(expression) =
> sample_expr;</FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4>&nbsp;&nbsp; always @(clocking_event) </FONT></SPAN><SPAN=20
> class=3D461491814-03102006><FONT face=3D"Courier New" color=3D#0000ff=20
> size=3D4>sample_expr =3D $sample(expression);</FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4></FONT></SPAN>&nbsp;</DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4>and use sample_expr in place of the original=20
> $sampled.</FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4></FONT></SPAN>&nbsp;</DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4>Would this work?</FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4></FONT></SPAN>&nbsp;</DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4>ed</FONT></SPAN></DIV>
> <DIV><SPAN class=3D461491814-03102006><FONT face=3D"Courier New" =
> color=3D#0000ff=20
> size=3D4></FONT></SPAN>&nbsp;</DIV><BR>
> <BLOCKQUOTE dir=3Dltr=20
> style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
> solid; MARGIN-RIGHT: 0px">
>   <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
>   <HR tabIndex=3D-1>
>   <FONT face=3DTahoma size=3D2><B>From:</B> owner-sv-ac@eda.org=20
>   [mailto:owner-sv-ac@eda.org] <B>On Behalf Of </B>Korchemny,=20
>   Dmitry<BR><B>Sent:</B> Tuesday, October 03, 2006 6:08 AM<BR><B>To:</B> =
> 
>   sv-ac@eda.org<BR><B>Subject:</B> [sv-ac] Issue =
> #1550<BR></FONT><BR></DIV>
>   <DIV></DIV>
>   <DIV class=3DSection1>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi =
> all,</SPAN></FONT></P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">During the discussion of =
> #1550 a=20
>   question was raised whether we need to keep a second argument of =
> $sampled=20
>   function. The current definition is $sampled(expression [, clocking=20
>   event])</SPAN></FONT></P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">If we want to keep it =
> then its=20
>   semantics should be:</SPAN></FONT></P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">$sampled(expression, =
> clocking=20
>   event) =3D (clocking event) ? expression : $past(expression, clocking =
> event).=20
>   The straightforward synthesis without a system clock is not clear in =
> general=20
>   case.</SPAN></FONT></P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">E.g., always a =3D =
> $sampled(b,=20
>   @(posedge clk))</SPAN></FONT></P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">or</SPAN></FONT></P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">disable iff =
> ($sampled(reset,=20
>   @(posedge clk))</SPAN></FONT></P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;Therefore we have =
> three=20
>   options:</SPAN></FONT></P>
>   <OL style=3D"MARGIN-TOP: 0in" type=3D1>
>     <LI class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>     style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Allow only one =
> argument form,=20
>     which is not backward compatible</SPAN></FONT>=20
>     <LI class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>     style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Allow two argument =
> form in=20
>     trivial cases only, e.g., always @(posedge clk) a =3D $sampled(b, =
> @(posedge=20
>     clk)), which is redundant</SPAN></FONT>=20
>     <LI class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>     style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Allow two argument =
> form in=20
>     trivial cases or when a system clock is present (I have a proposal =
> about a=20
>     system clock in one of my presentations)</SPAN></FONT> </LI></OL>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">What do you=20
>   think?</SPAN></FONT></P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
> Arial">Thanks,</SPAN></FONT></P>
>   <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
>   style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
> Arial">Dmitry</SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>
> 
> ------_=_NextPart_001_01C6E6F7.7E696DF3--
Received on Tue Oct 3 08:57:45 2006

This archive was generated by hypermail 2.1.8 : Tue Oct 03 2006 - 08:57:50 PDT