RE: Analog function question

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Sun Sep 18 2005 - 04:53:11 PDT
No, it is not an oversight in 1364. It is an enhancement which exists in
SV which we decided not to put into 1364.

 

Shalom

 

________________________________

From: owner-verilog-ams@eda.org [mailto:owner-verilog-ams@eda.org] On
Behalf Of Sri Chandra
Sent: Friday, September 16, 2005 3:03 AM
To: Muranyi, Arpad
Cc: verilog-ams@eda.org
Subject: Re: Analog function question

 


In strict accordance to the BNF it cant be done yet. I think it was an
oversight/bug in the BNF and the intent was to put it in there.

regards,
Sri

Muranyi, Arpad wrote: 

Sri,
 
I just saw your 2nd reply, but since I had this almost finished,
I will send it out anyway...  So according to your 2nd message,
this can't be done (yet)?
----------------------------
Thanks for the quick answer.  Sorry, but I am still not sure
about it.  The sections you quoted from the LRM seem to allow
the array inside the function as a block item, but I still
don't see how I can pass an array into the function (and
pass it as a real variable array, not as a parameter array).
 
Would you be so kind and help me with an example?  If the
input "in1" is an array, how would you declare it in the
function?
 
analog function real myFunctionName;
input in1;
real  in1[1:5];    <--------- How would I know the size?
begin
...
...
end
endfunction
 
 
Thanks,
 
Arpad
============================================================
 
-----Original Message-----
From: Sri Chandra [mailto:srikanth.chandrasekaran@freescale.com] 
Sent: Thursday, September 15, 2005 4:36 PM
To: Muranyi, Arpad
Cc: verilog-ams@eda.org
Subject: Re: Analog function question
 
Hi Arpad,
 
Not sure why you think LRM doesnt support arrays. According to BNF (LRM 
2.2):
 
function_item_declaration ::=
input_declaration
| inout_declaration
| output_declaration
| block_item_declaration
 
block_item_declaration ::=
parameter_declaration
| integer_declaration
| real_declaration
 
And if you look at integer_declaration and real_declaration
 
integer_declaration ::= integer list_of_identifiers ;
 
real_declaration ::= real list_of_identifiers ;
 
list_of_identifiers ::= var_name { , var_name }
var_name ::= variable_identifier
                      | array_identifier array_range
 
(The above is also detailed in section 3.1)
 
cheers,
Sri
 
Muranyi, Arpad wrote:
 
  

	I am just noticing (with disbelief) that analog functions
	cannot take arrays as inputs (since I don't see any mention
	of it in LRM v2.2).  Is this observation/conclusion correct?
	 
	analog function real maxValue;
	input n1, n2 ;
	real n1, n2 ;
	begin
	// code to compare potential of two signal
	maxValue = (n1 > n2) ? n1 : n2 ;
	end
	endfunction
	 
	Is there a way to make "n1" and/or "n2" an array?
	 
	Thanks,
	 
	Arpad
	===========================================================
	 
	 
	 
	    

 
  





-- 
Srikanth Chandrasekaran
Design Technology (Adelaide)
Freescale Semiconductor
Ph: +61-(0)8-8168 3592 Fax: x3201
Received on Sun Sep 18 04:53:24 2005

This archive was generated by hypermail 2.1.8 : Sun Sep 18 2005 - 04:54:11 PDT