RE: Are array parameters in functions allowed?

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Jun 14 2007 - 06:38:52 PDT
In digital, they are not allowed in Verilog (1364), but they are allowed
in SystemVerilog (1800).

Shalom

> -----Original Message-----
> From: owner-verilog-ams@server.eda.org [mailto:owner-verilog-
> ams@server.eda.org] On Behalf Of David Miller
> Sent: Wednesday, June 13, 2007 9:08 PM
> To: Muranyi, Arpad
> Cc: Verilog-AMS LRM Committee
> Subject: Re: Are array parameters in functions allowed?
> 
> Muranyi, Arpad wrote:
> > Hello everyone,
> >
> > Sorry for bringing this questions to this forum, but
> > the information in the v2.2 LRM doesn't answer my
> > question.
> >
> > I wonder whether arrays are allowed as parameters to
> > analog (or digital) functions.  Section 4.6 doesn't
> > give enough detail on the "function_item_declaration"
> > to answer this question, and I am getting an error
> > message from my favorite simulator when I do this:
> >
> >   analog function integer FindCursorIndex;
> >     input Wfm[1:100];
> >     ...
> >     ...
> >     ...
> >
> > Error: Illegal array parameter 'Wfm' in function 'FindCursorIndex'
> >
> > Thanks,
> >
> > Arpad
> > ======================================================
> >
> >
> Hi Arpad,
> 
> Yes array parameters are allowed as the arguments to an analog udf.
> In the latest version of the LRM currently under review, this has been
> clarified with regards to the syntax. Also array parameters were valid
> in LRM 2.2, when we introduced the output, inout direction
> declarations.
> 
> So you should be able to have:
> 
> analog function integer FindCursorIndex;
>     input [1:100]Wfm;
>     integer Wfm[1:100];
> 
> .....
> parmaeter integer P[1:100] = {.......};
> 
> analog begin
>     ... = FindCursorIndex(P);
> 
> 
> Take care where the range is specified, I think, since Wfm is a 'port'
> the range (width) is on the left, and then when you declare the local
> integer variable, it is an array so the range is on the right. At
> least
> this is the case for Analog.
> 
> Cheers....
> Dave

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Jun 14 06:43:50 2007

This archive was generated by hypermail 2.1.8 : Thu Jun 14 2007 - 06:44:02 PDT