FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-22-2009, 12:20 PM
GilGr
Guest
 
Posts: n/a
Default parameter passing to array of instances

Hi,
I have a module with parameter, and I'm trying to instantiate several
of it, while using the "array" syntax. I tried using defparam for
each, but synopsys DC doesn't accept it. example:

//// my module
module modmod( input wire a,
output wire b);
parameter some_param;
..
..
..
endmodule

// it's instances:
modmod my_ins[4:0](.a(a), .b(b));

// I'm passing the params like this:
defparam my_ins[0].some_param = 3;
etc.

thanks in advance, GilGr
Reply With Quote
  #2 (permalink)  
Old 07-22-2009, 09:50 PM
gabor
Guest
 
Posts: n/a
Default Re: parameter passing to array of instances

On Jul 22, 7:20*am, GilGr <[email protected]> wrote:
> Hi,
> I have a module with parameter, and I'm trying to instantiate several
> of it, while using the "array" syntax. I tried using defparam for
> each, but synopsys DC doesn't accept it. example:
>
> //// my module
> module modmod( input wire a,
> * * * * * * * * * * * * * output wire b);
> parameter some_param;
> .
> .
> .
> endmodule
>
> // it's instances:
> modmod my_ins[4:0](.a(a), .b(b));
>
> // I'm passing the params like this:
> defparam my_ins[0].some_param = 3;
> etc.
>
> thanks in advance, GilGr


from the LRM:

An individual instance from an array of instances shall be
referenced in the same manner as referencing an element of
an array of regs.

For example:

The following declaration of nand_array declares four instances
that can be referenced by nand_array[1], nand_array[2],
nand_array[3], and nand_array[4], respectively.

nand #2 nand_array[1:4]( ... ) ;


Your syntax seems to follow the LRM. Arrays of instances was
a relatively new feature of Verilog 95, and some synthesis tools
didn't handle them at all, so I wouldn't be surprised if others
don't handle the naming of instances correctly. If you have
a way to look at nets in the translated EDIF or other output
of the synthesis, perhaps you can figure out the naming convention
used by synopsis DC and try to match that in your defparam.

Regards,
Gabor
Reply With Quote
  #3 (permalink)  
Old 07-29-2009, 08:27 AM
Alex Shot
Guest
 
Posts: n/a
Default Re: parameter passing to array of instances

Did you try something like this:
modmod #(.some_param(3)) my_ins[4:0](.a(a), .b(b);

Alex
Reply With Quote
  #4 (permalink)  
Old 07-29-2009, 02:19 PM
gabor
Guest
 
Posts: n/a
Default Re: parameter passing to array of instances

On Jul 29, 3:27*am, Alex Shot <[email protected]> wrote:
> Did you try something like this:
> modmod #(.some_param(3)) my_ins[4:0](.a(a), .b(b);
>
> Alex


Of course that method would apply the same parameter value to all
instances. Not as generally applicable as defparam. However if
that does the trick, use it. My guess is that it won't do the
trick or the parameter defaults would have been set as desired
in the module where they were defined.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
array of instances paz Verilog 3 11-30-2006 12:12 AM
array of instances paz Verilog 0 11-29-2006 06:46 PM
Parameter passing to functions John Apostol Verilog 6 02-04-2005 01:16 AM
array of module instances sridhar Verilog 3 02-27-2004 03:02 AM
Multiple Mux instances by parameter. Roy Verilog 2 10-21-2003 06:30 PM


All times are GMT +1. The time now is 12:41 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved