{Disarmed} Re: [sv-bc] setting parameters in configurations

From: Don Mills <mills_at_.....>
Date: Mon Sep 17 2007 - 10:17:16 PDT
See reply to questions below:


Alsop, Thomas R wrote:

Hi Don,

 

Two questions for you.  First, in your mantis proposal is there any difference in the config where you use a localparam and parameter.  I’m trying to understand why you are emphasizing the use of localparam in this case.

 

Localparam:

  config cfgl;

    localparam S = 24

    design rtlLib.top;

    instance top.a1 #(.W(S));

    instance top.a2 #(.W(S));

  endconfig

 

With cfg1 configuring module top.a1, the $display in adder will print:

PRINTS: Name = a1,  W=24,  D = 512

PRINTS: Name = a2,  W=24,  D = 512

 

Parameter:

 

  config cfgl;

    parameter S = 24

    design rtlLib.top;

    instance top.a1 #(.W(S));

    instance top.a2 #(.W(S));

  endconfig

 

With cfg1 configuring module top.a1, the $display in adder will print:

PRINTS: Name = a1,  W=24,  D = 512

PRINTS: Name = a2,  W=24,  D = 512

 

My intention was to provide a mechanism to allow a user to define a local constant within the configuration.  Since a configuration is not instantiated, I saw no point in using parameter, but rather used the localparam to symbolize the idea that the value is local constant.  However, in giving the ussage model more thought, I am going to change this to a parameter.  Reasoning - when a configuration is used to model a complex test environment with hundreds of parameters being set, there will be times when variations of this base configuration occur in which only a few parameters might need to change.  In this case I would want to define a second configuration in which the specified design in this second configuration would be the first configuration.  In this second configuration I would modify the few parameters that vary from the first configuration.  This is very similar a base class being extended by a child class.

 

Second, you gave examples of explicit .name() default “reset” conditions basically for overriding the instantiations back to their default values but you didn’t give an example of implicit .name.  What happens what I do this for example?

 

  config cfgl;

    design rtlLib.top;

    instance top.a1 #(.NAME(“A1”), .W(2), .D(16384) );

    instance top.a2 #(.NAME(“A2”));

    instance top.a3 #(.NAME(“A3”), .W(16), .D() );

    instance top.a4 #(.NAME, .W, .D );  ß These are all implicit .name.  What happens here? Is this the same as .name() or does it do nothing?

  endconfig

I had one example with the ".name" notation but as has been noted - that is currently illegal syntax.  I will change that example.  Using the ".name" syntax is not a feature I am looking to add this go around.

 

 

 

-----Original Message-----
From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On Behalf Of Don Mills
Sent: Thursday, September 13, 2007 5:52 PM
To: sv-bc@server.eda.org
Subject: [sv-bc] setting parameters in configurations

 

I have opened a mantis item on this subject #2037 and uploaded my first

draft of the new section.  For those of you who have looked at my

preliminary draft earlier today - you will find the uploaded draft to be

much more verbose.

 

--

==========================================================

Don Mills

mills@lcdm-eng.com

www.lcdm-eng.com

==========================================================

 

 

--

This message has been scanned for viruses and

dangerous content by MailScanner, and is

believed to be clean.

_popupControl();

-- 
==========================================================
Don Mills
mills@lcdm-eng.com
www.lcdm-eng.com
==========================================================

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean. Received on Mon Sep 17 23:15:42 2007

This archive was generated by hypermail 2.1.8 : Mon Sep 17 2007 - 23:16:46 PDT