RE: [sv-bc] always_comb question

From: Jonathan Bromley <jonathan.bromley@doulos.com>
Date: Mon Jul 26 2004 - 01:27:26 PDT

> > Shalom Bresticker wrote:
> >
> > >Suppose I have an always_comb which uses an intermediate
> variable, like
> > >
> > >always_comb
> > >begin
> > > a = b & c ;
> > > d = a & e ;
> > >end
> > >
> > >My understanding is that "a" will not be in the implicit
> sensitivity list

[...]

> Assume for the moment that a force is legal.
> Then, since I have written d as a function of a, The Right Thing to do
> would be to trigger the always_comb again in order to update a,
> even those d is only an intermediate variable and thus not in
> the implicit sensitivity list.

I don't really follow this. Why is it any different from
the entirely reasonable example...

always @(b,c,e) begin
  a = b & c;
  d = a & e;
end

Note that, in this case, the absence of 'a' from the
sensitivity list is entirely reasonable and probably
desirable.

Granted, if I were doing this intentionally for the right
reasons, I would have declared 'a' locally; but even so,
presumably if I force 'a' then the process will not
execute, and 'd' will not follow the forced value?
And presumably I would then kick myself and say "silly
me, for trying to force the value of a local variable".
So I don't see how always_comb has changed anything here.

Forcing the value of an intermediate variable can get
you into all kinds of trouble, and perhaps should be
outlawed by tools if possible. For example, what could
it mean to force 'a' in the following example?

always @(b,c,e) begin
  a = ~b;
  a = a & c;
  d = a & e;
end

-- 
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223                   Email: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573                           Web: http://www.doulos.com
This e-mail and any  attachments are  confidential and Doulos Ltd. reserves 
all rights of privilege in  respect thereof. It is intended for the use of 
the addressee only. If you are not the intended recipient please delete it 
from  your  system, any  use, disclosure, or copying  of this  document is 
unauthorised. The contents of this message may contain personal views which 
are not the views of Doulos Ltd., unless specifically stated.
Received on Mon Jul 26 01:27:36 2004

This archive was generated by hypermail 2.1.8 : Mon Jul 26 2004 - 01:27:54 PDT