RE: [sv-bc] Assignment compatibility after elaboration

From: Jonathan Bromley <jonathan.bromley_at_.....>
Date: Tue Sep 11 2007 - 09:39:20 PDT
Just my preliminary "user" $0.02-worth:

If I declare a *data object* in a module, I don't
for a moment expect to be able to make use of it
other than in a specific instance of the module.

If, on the other hand, I define a *type* in a module,
I think I would be very happy to see it as something
that's not instance-specific.  Indeed, I would rather
like to be able to treat the module as something like
a package, pulling type definitions out of it with

  module_name::type_name

syntax (although I suspect this would raise all manner
of tricky issues and it's probably best ignored).  
And I certainly would like any data member of a module 
to be copy-compatible from one instance to another,
even if that data member has a rather elaborate type
definition.

Naturally, I'd expect that overriding any parameter of
a module would specialize the module, thereby rendering
types in it distinct from the same-named types in 
other specializations - even if that parameter does not
obviously affect the type definition.  However, since we
can't typedef a module, I would expect that multiple 
module instances with identical parameterization would 
count as identical specializations - this would cover
the array-of-instances issue.

I would need careful arguments to convince me that 
binding an instance into a module cannot alter the
target module's specialization, although my instinct
is that the rather conservative rules about 'bind' and
parameters probably mean that this is OK.

Finally, I think that there may be one problem that
won't go away until we either get rid of defparam
completely, or severely restrict its use.  It's
possible I've missed something obvious here, but
it worries me; please humour me.  Consider:

  module bot #(parameter N = 3);
  endmodule : bot

  module mid;
    bot B();
    typedef int A [1:B.N];  // is this legal???
  endmodule : mid

  module top;
    mid M1();
    mid M2();
    defparam M2.B.N=2;
  endmodule : top

It seems to me that I've now specialized M2.B without
directly altering M2's parameters, and plainly the
type M2.A is different from M1.A.  Is this a problem?
-- 
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

The contents of this message may contain personal views which 
are not the views of Doulos Ltd., unless specifically stated.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Sep 11 09:39:40 2007

This archive was generated by hypermail 2.1.8 : Tue Sep 11 2007 - 09:39:51 PDT