The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 1st, 2024, 1:54pm
Pages: 1
Send Topic Print
instantiation of arrays of modules (Read 4640 times)
xter
New Member
*
Offline



Posts: 6

instantiation of arrays of modules
Jan 17th, 2006, 5:33pm
 
Hi,

I've created a module Atemp(), and am trying to instantiate ten instances of Atemp. Here is how the book says it should be done:

Atemp tempArray[0:9] ();

The error that I get:
line 136: "Atemp tempArray[<<--? 0:9] ();
line 136: Error: syntax Error

I have tried this and many other permutations (Atemp tempArray [0:9] ();  Atemp [0:9] tempArray ();  Atemp tempArray[0:9]();  ...etc) in the off chance that that would be it, to no avail.

All lines around this error line are fine, there are no other errors. After browsing through the FAQ's here, as well as consulting the book, I seem to be at a dead end for now. I would appreciate your input as to how this syntax should be.

Thanks,
Xter

Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: instantiation of arrays of modules
Reply #1 - Jan 20th, 2006, 5:12am
 
That syntax looks OK per the Verilog-AMS LRM, but I don't see any examples in the LRM that actually use the range ([0:9]).

(I"m curious why you want 10 instances of something with no connections; I also don't see the LRM talking about how to connect to the array of instances, eg if you had a 10-wide bus and you wanted to connect bus[0] to tempArray[0], ...)
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
xter
New Member
*
Offline



Posts: 6

Re: instantiation of arrays of modules
Reply #2 - Jan 20th, 2006, 12:41pm
 
Hello,

Thanks for replying.  

>>That syntax looks OK per the Verilog-AMS LRM, but I don't see any examples in the LRM that actually use the range ([0:9]).
...
>>I also don't see the LRM talking about how to connect to the array of instances, eg if you had a 10-wide bus and you wanted to connect bus[0] to tempArray[0], ...)

I was referring to an example in the Designers Guide to Verilog AMS, page 229, the example is for multiple instantiations. That example instantiates eight resistors in an array, "resistor #(50) r[1:8] (bus,gnd)", where bus is an array of 8, bus[1:8]. I was hoping to use the same syntax to instantiate one of my own modules.

>>(I"m curious why you want 10 instances of something with no connections;
The module Atemp was just a dummy module to get the syntax right. In actuality, I am building a flash ADC module, and am creating smaller modules, such as preamplifiers. Instead of manually instantiating thirty-three preamplifiers , I would like to just instantiate an array of preamplifiers whose inputs and outputs are busses. This will allow me to easily access any of the preamplifiers by index, instead of manually calling up preamps.

If instantiating an array of modules does not work, I would appreciate it if you could point out another way of easily accessing a large number of instances of the same module without doing it manually.

Also, I am currently using Verilog-A, it is possible that the creating an array of modules is an AMS feature. I will double check this. Thanks.

-Xter

Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: instantiation of arrays of modules
Reply #3 - Jan 23rd, 2006, 4:38am
 
Looking in Annex C of the Verilog-AMS LRM, I don't see an exclusion of array of modules from the official Verilog-A definition.  (Annex C lists what is or is not supported in Verilog-A.)

You may want to take this up with your simulator vendor.
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.