Re: [sv-ac] Re: nonblocking assignment in clocking block.


Subject: Re: [sv-ac] Re: nonblocking assignment in clocking block.
From: Surrendra Dudani (Surrendra.Dudani@synopsys.com)
Date: Fri Sep 19 2003 - 12:42:35 PDT


Please see response in comments.
Surrendra
At 11:08 AM 9/18/2003 -0500, you wrote:

>Hi Surrendra.
>
>On your proposal for nonblocking assignments inside clock domains.
>
>This may need to be evaluated by sv-ec. We don't have much expertise
>in verilog clocking domains.
>
>I would not support such a limited proposal. Your examples demonstrate
>how limited it is.
>
>int in_progress;
>
>clocking clk1 @(posedge clk);
> output in_progress;
> in_progress <= !sample_not_resetting ? 0
> : ($rose(start_expr) && (in_progress == 0) && !(test_expr == 1'b1)
> ? 1 : (test_expr == 1'b1)
> ? 0 : (in_progress < max_cks) && (in_progress > 0)
> ? in_progress+1 : 0;
>
>endclocking
>
>clocking clk1 @(posedge clk);
> output head_ptr; // Should this be ova_v_head_ptr, matching the values
> below?
> head_ptr <= (reset) ? 0
> : (s_deferred_deq.ended && (ova_v_q_size > 0) )
> ? ((ova_v_head_ptr < depth-1)
> ? (ova_v_head_ptr + 16'b1) :16'b0)
> : ova_v_head_ptr;
>
>endclocking
>
>While this may actually work (this is too complex of an expression) it is
>unnecessarily complicated because there are no other constructs to make
>it simpler.

One can always use a function to encapsulate some logic.

> 1. Use of case/if statements would go a long way toward readability and
> maintainability!
> 2. Allowance of if() would provide for conditional update as possibly
> seen in the second example - only updating (ova_v_) head_ptr if
> necessary.

Use a function call as mentioned before to compute some thing complicated.
Values of temporal function results can be passed to the function.

> 3. Use of always blocks is better to model additional logic.

You can do this as long as you don't need temporal functions and ended.

>In analyzing the first example, it appears to be a translation from OVL or
>similar
>definition for a time bounded window pattern. This brings up an
>interesting need.
>The need to detect a property executing but not passing/failing.
>
>It appears the first example wants to say something like:
>
> property one_in_window
> (start, test, max_clk, clk, rst)
> ($rose(start) & !one_in_window.running // Only allow one to start!
> |-> ##[1:max_clk] test ##1 ! test)
> endproperty
>
>I would support a method call for this ability! It is a common occurrence
>that is
>difficult otherwise to do. Maybe this method call should return the number of
>currently executing threads of the property. This would provide double duty to
>allow one to:
> A. only allow one thread to start.
> B. report an error when a thread is started and another start event
> occurrs.
> C. report an error when too many threads are started.
>
Might be useful. However, it is a different request, and as such should
considered as a separate issue from the clocked nba assignment. There are
many other examples where such an assignment is needed.

>I would only support an enhanced version of this proposal as it will create
>assertion code that is as difficult to read and understand as the design code
>it is trying to validate. When the code is difficult to understand it becomes
>exponentially more difficult to make it correct.
>
>
> Thanks.
>
> Adam Krolnik
> Verification Mgr.
> LSI Logic Corp.
> Plano TX. 75074
>
>

**********************************************
Surrendra A. Dudani
Synopsys, Inc.
377 Simarano Drive, Suite 300
Marlboro, MA 01752

Tel: 508-263-8072
Fax: 508-263-8123
email: Surrendra.Dudani@synopsys.com
**********************************************



This archive was generated by hypermail 2b28 : Fri Sep 19 2003 - 12:46:24 PDT