The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 4:42pm
Pages: 1
Send Topic Print
Hierarchy Parameter Passing - Multi Level (Read 4410 times)
loose-electron
Senior Fellow
******
Offline

Best Design Tool =
Capable Designers

Posts: 1638
San Diego California
Hierarchy Parameter Passing - Multi Level
Apr 22nd, 2007, 11:01pm
 
> What is the proper syntax on parameter passing thru multiple levels of
> hierarchy in Verilog-AMS structures?

> Ergo:
> Module 1 calls module 2,
> Module 2 calls module 3,
> Module 3 calls module 4,
> Module 4 calls module 5,
> You have some "parameter real Vxxxx = XXX" statements down in module
> 5, and you would like to use a parameter override up at the module 1
> level, to define the value.
> For one level:
>
> Modulename #(.varaiblename(number)) moduleinstance(port1,port2,....);
>
> That works fine for one level of overide.
>
> The question is how to pass a variable thru multiple levels???
>
> In the above example, module-1 needs to provide a parameter override
> to module-5, and a graceful way of passing this down the hierarchy is needed.
>
> Thanks,
> Jerry
Back to top
 
 

Jerry Twomey
www.effectiveelectrons.com
Read My Electronic Design Column Here
Contract IC-PCB-System Design - Analog, Mixed Signal, RF & Medical
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Hierarchy Parameter Passing - Multi Level
Reply #1 - Apr 23rd, 2007, 4:10am
 
I think the only way you can do that is with the defparam statement.

Eg, if module0 is your top level that instantiates module1, then you would do something like
defparam module1.module2.module3.module4.module5.Vxxxx = 5.0;

on the line after the instantiation of module1.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
loose-electron
Senior Fellow
******
Offline

Best Design Tool =
Capable Designers

Posts: 1638
San Diego California
Re: Hierarchy Parameter Passing - Multi Level
Reply #2 - Apr 23rd, 2007, 1:37pm
 
OK, well I ended up restruturing the models to deal with it.

Something like an option with a varaible that is recognized at all levels of the hierarchy would be nice.

Back to top
 
 

Jerry Twomey
www.effectiveelectrons.com
Read My Electronic Design Column Here
Contract IC-PCB-System Design - Analog, Mixed Signal, RF & Medical
View Profile WWW   IP Logged
chetan
New Member
*
Offline



Posts: 5

Re: Hierarchy Parameter Passing - Multi Level
Reply #3 - May 30th, 2007, 9:22am
 
You should also be able to do it without using defparam by propagating the parameter from Module 1 like this:

module module1....
parameter pass_me_down = 0 ;

module2 #(pass_me_down) inst_name ...
endmodule

module module2...
 parameter I_wanna_go_down2 = 0 ;

 module3 #(I_wanna_go_down2) inst_name ...
endmodule

so on and so forth.

Verilog(A) allows using parameters in the expression for the parameter override, using this feature does the trick.

-Chetan Chaudhari-
Back to top
 
 


View Profile   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.