Re the statement that "you cannot set a parameter value (of a function) from the outside", I think there are 2 ways that you CAN do it: 1. defparam 2. Use a parameter which is defined in the module enclosing the function. That parameter value CAN be overridden. Shalom ________________________________ From: owner-verilog-ams@eda.org [mailto:owner-verilog-ams@eda.org] On Behalf Of Marq Kole Sent: Friday, September 16, 2005 10:28 AM To: verilog-ams Subject: Re: Analog function question Oops, need to correct a small mistake below: > Sri, Arpad, > > > 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. > > In accordance with the BNF, the input declaration is mentioned as a > digital_input_declaration in Annex A, so its actual definition is in the > IEEE 1394-1995 standard. See Mantis item #870. > > For array arguments see Mantis item #869 describing the problem - it is > rather an issue of documentation (explanation + example) than a missing > item in the standard. > > > > > 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). > > Parameter arrays in functions wouldn't help you anyway, as you > cannot set them from outside the function, and once initialized, > you cannot alter them from inside the function either. > > > 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? > > You'd know the size as the above analog function declaration tells > you the size. There is at this moment no way to make an array argument > with parameter-controlled size in an analog function in Verilog-AMS -- I mean an argument-controlled size given the fact that you cannot set a parameter value from the outside. So a call: myArrayFunction(myArraySize, myArray); Where myArraySize argument carries the length of the myArray argument cannot be handled in current Verilog-AMS. > we need to check what System-Verilog does to resolve that for a future > LRM, I think. > > > begin > > ... > > ... > > end > > endfunction > > > > > > Thanks, > > > > Arpad > > Marq Kole > Competence Leader Analog Simulation, Philips ED&TReceived on Sun Sep 18 05:04:57 2005
This archive was generated by hypermail 2.1.8 : Sun Sep 18 2005 - 05:05:10 PDT