RE: Constant initialization question

From: Muranyi, Arpad <arpad.muranyi_at_.....>
Date: Mon Nov 14 2005 - 09:15:21 PST
Sorry, I wasn't clear on the way I wrote my
message, all of the functions give the
same error (not just min/max).

Arpad
============================================

-----Original Message-----
From: geoffrey.coram@analog.com [mailto:geoffrey.coram@analog.com] 
Sent: Monday, November 14, 2005 9:11 AM
To: Muranyi, Arpad
Cc: Verilog-AMS LRM Committee
Subject: Re: Constant initialization question

Arpad -
Since built_in_function(const_arg_list) is a "constant_expression"
(as is constant_array_expression) per the LRM, I think the compiler
is wrong to give you an error.  It's curious that min gives you a
problem whereas ceil does not ...

1364-2005 spent some time looking at various functions -- including
user-defined ones -- as to which ones, when operating on constant
expressions, would return constant expressions.  I think they went
as far as to define a list of functions allowed in parameter
declarations.

-Geoffrey


"Muranyi, Arpad" wrote:
> 
> Hello everyone,
> 
> I would like to ask a question about initializing
> constants.
> 
> I am getting compiler errors when I write something
> like this:
> 
> parameter real Min_t = min(min(min(Tr1[1], Tr2[1]), Tf1[1]), Tf2[1]);
> 
> Where Tr1, Tr2, Tf1, Tf2 are array parameters, i.e.
> constants.  The error complains that the initialization
> is not static.  I have other similar statements in which
> I use ceil, arithmetic, etc..., but all with constant
> arguments.
> 
> In my opinion, the result of all these math functions
> should be constants, since the arguments are also all
> constant.  Is this allowed according to the LRM?  Is
> this a compiler bug?
> 
> Thanks,
> 
> Arpad
Received on Mon Nov 14 09:15:52 2005

This archive was generated by hypermail 2.1.8 : Mon Nov 14 2005 - 09:15:54 PST