[sv-bc] Localparam in parameter_port_list???

From: Jonathan Bromley <jonathan.bromley_at_.....>
Date: Sun Jun 03 2007 - 18:26:15 PDT
hi sv-bc,

a recent discussion on sv-ec about places where "parameter" really
means "localparam" has reminded me of something that has always
seemed very odd to me, and the LRM merge could provide an opportunity
to fix.

Consider the following simple (and, I think, legal) example:

  module decoder(A, Y);
    parameter N_inputs = 3;
    localparam N_outputs = 1 << N_inputs;
    input [N_inputs-1:0] A;
    output [N_outputs-1:0] Y;
    ...

Now let's try to give that an ANSI-style parameter and
port list...

  module decoder
    #(parameter N_inputs = 3, localparam N_outputs = 1<<N_inputs)
    (input [N_inputs-1:0] A, output [N_outputs-1:0] Y);
    ...

But the existing BNF forbids the use of localparam in a 
parameter_port_list.  I was not around at the time this was
discussed, and it's always mystified me why it's forbidden;
I have often encountered situations where I would like to be able
to do it.  Is there some obvious objection that I have missed?

I would be fine with a restriction that all parameters must appear
before any localparams in such a port list.  Given that minor
restriction, I can't see why it would pose any 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 Sun Jun 3 18:26:55 2007

This archive was generated by hypermail 2.1.8 : Sun Jun 03 2007 - 18:27:25 PDT