RE: [sv-bc] parameterized structures

From: Feldman, Yulik <yulik.feldman_at_.....>
Date: Thu Jun 15 2006 - 02:56:13 PDT
Yes. The locality has many advantages. For example, if my design needs
several parameterized structures, the ability to specify the parameters
locally to each structure makes the code more modular and readable,
avoiding the need to specify the conceptually unrelated parameters in
the parent construct or on the compilation unit level. Maybe even more
important, the ability to override the parameters locally makes it much
easier to use several parameterizations of the same structure
simultaneously.

 

--Yulik.

 

________________________________

From: Bresticker, Shalom 
Sent: Thursday, June 15, 2006 12:37 PM
To: Feldman, Yulik; sv-bc@server.verilog.org
Subject: RE: [sv-bc] parameterized structures

 

Even today, a structure can be parameterized (though I still think the
correct word would be 'parametric', but 'parameterized' sounds more
high-techy). Your idea just makes the parameter declaration local to the
structure declaration, no?

 

Shalom

 

________________________________

From: owner-sv-bc@server.eda-stds.org
[mailto:owner-sv-bc@server.eda-stds.org] On Behalf Of Feldman, Yulik
Sent: Thursday, June 15, 2006 12:23 PM
To: sv-bc@server.verilog.org
Subject: [sv-bc] parameterized structures

 

Hi,

 

I would like to get a general opinion of forum's experts on the idea to
introduce parameterized structures to SystemVerilog. Parameterized
structures are similar to regular structures, but allow
parameterization, like modules, classes and interfaces. The syntax
currently doesn't matter, but just to give a visual example:

 

typedef struct #(SIZE = 32, TYPE = integer) {

            bit [SIZE-1:0] m1;

            TYPE m2;

} parameterized_struct;

 

parameterized_struct ps1; // Default parameterization

parameterized_struct #(.SIZE(64), .TYPE(int)) ps2; // Overridden
parameterization

 

The ability to parameterize structures may be quite useful to raise the
abstraction level of the design. It is quite similar to how template
classes/structs in C++ help to raise the abstraction level of C++
programs. Parameterized structures, unlike parameterized modules and
interfaces, will be data types, which will allow their usage in wide
spectrum of coding scenarios (for example as operands of expressions).
Unlike parameterized classes, parameterized structures could be easily
used in design itself (vs. testbench code), without fear to open a can
of worms of object life time and scheduling semantics issues. And, on
top of that, there seems to be no problem to synthesize and/or formally
analyze the parameterized structures. 

 

So, please, let me know what you think about it.

 

Thanks,

            Yulik.
Received on Thu Jun 15 02:56:42 2006

This archive was generated by hypermail 2.1.8 : Thu Jun 15 2006 - 02:56:47 PDT