The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 4th, 2024, 3:14pm
Pages: 1
Send Topic Print
problems with verilog-A generate (Read 2957 times)
danmc
Community Member
***
Offline



Posts: 35
Boston
problems with verilog-A generate
May 08th, 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
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: problems with verilog-A generate
Reply #1 - 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];

Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.