Subject: Re: Using iff example
From: Clifford E. Cummings (cliffc@sunburst-design.com)
Date: Tue Dec 11 2001 - 07:41:00 PST
Hi, all -
I don't think these examples work.
On a posedge clk with no load signal, nothing happens, but both should count.
Regards - Cliff
At 08:46 PM 12/10/01 -0800, Stuart Sutherland wrote:
>Peter,
>
>If I understood our conversation today correctly, the following two
>examples are a more correct way to use 'iff':
>
>always @(posedge clock iff load == 1) //synchronous reset
> if (!reset) count <= 0;
> else if (load) count <= d; //gated input
> else count <= count + 1;
>
>always @(posedge clock iff load == 1 or negedge reset) //asynchronous reset
> if (!reset) count <= 0;
> else if (load) count <= d; //gated input
> else count <= count + 1;
>
>But, I still have doubts that this will work correctly. A real counter
>should reset regardless of the value of the load input. Section 8.10 says
>'iff' has precedence over 'or', so the control input will also disable the
>ability to reset the counter.
>
>It seems to me that the only value of 'iff' is at a level of abstraction
>where there is no reset logic. This would require synthesis to infer
>reset from thin air. It also means there is no way to put simulation into
>a known state. I can only see the latter working for 2-state logic in a
>design that does not need flip-flops to be set instead of reset.
>
>Can you please enlighten me as to why some of your customers want 'iff'?
>
>Stu
//*****************************************************************//
// Cliff Cummings Phone: 503-641-8446 //
// Sunburst Design, Inc. FAX: 503-641-8486 //
// 14314 SW Allen Blvd. E-mail: cliffc@sunburst-design.com //
// PMB 501 Web: www.sunburst-design.com //
// Beaverton, OR 97005 //
// //
// Expert Verilog, Synthesis and Verification Training //
//*****************************************************************//
This archive was generated by hypermail 2b28 : Tue Dec 11 2001 - 07:41:03 PST