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: x3201Received on Thu Sep 15 16:52:43 2005
This archive was generated by hypermail 2.1.8 : Thu Sep 15 2005 - 16:52:48 PDT