The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> problems with verilog-A generate
https://designers-guide.org/forum/YaBB.pl?num=1147095025

Message started by danmc on May 8th, 2006, 6:30am

Title: problems with verilog-A generate
Post by danmc on May 8th, 2006, 6:30am

Hello,

I"m trying to use generate() to produce a bunch of filters.  I have an initial block where I use generate to initilialze the gain and banwdith of my filters and then try to do:

     generate i (1 , 10) begin
      // Transfer function for a first order low pass filter

      V(OUT[i]) <+ laplace_nd(in[i],   {gain[i]}, {1,tau[i]});
     end /

but I get back:
Error found by spectre during SpectreHDL compile.
   "/path/to/mycell/veriloga/veriloga.va", line 126: "{1,tau[i]})<<--? ;"
   "/path/to/mycell/veriloga/veriloga.va", line 126: Error: arg #2 must be an array variable or a
       constant array expression. It cannot be an array expression containing non-constant expressions. If you need
       the argument to be variable, use an array variable instead.
   "/path/to/mycell/veriloga/veriloga.va", line 126: Error: arg #3 must be an array variable or a
       constant array expression. It cannot be an array expression containing non-constant expressions. If you need
       the argument to be variable, use an array variable instead.


I want to be able to pass parameters into this model that determine the gain and bandwidth of each filter.  However, the gain and bandwidth are functions computed from a different set of user  parameters.

Any suggestions?

Thanks
-Dan

Title: Re: problems with verilog-A generate
Post by Geoffrey_Coram on May 16th, 2006, 7:27am

It sounds like you could set up two array variables, this_gain[0:0] and this_tau[1:0] and assign them values inside the generate loop, ie,
this_gain[0] = gain[i];
this_tau[0] = 1;
this_tau[1] = tau[i];


The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.