How to implement one component twice with different parament

Guest
I have a file (sub_mod.v) with a parameter, such as :

parameter neg_output = 1;

assign dout = (neg_output == 1) ? output_1 : output_2;


In the top, I implement it twice. such as :

sub_mod u_sub_mod(....)

sub_mod u_sub_mod1(....)
defparam top.u_sub_mod1.neg_output = 0;


Then how to deal with it in DC in botton-up flow?

If not, how to solve this kind of design to make it configurable?
Thanks in advance.
 
mpub@sohu.com wrote:
I have a file (sub_mod.v) with a parameter, such as :

parameter neg_output = 1;

assign dout = (neg_output == 1) ? output_1 : output_2;


In the top, I implement it twice. such as :

sub_mod u_sub_mod(....)

sub_mod u_sub_mod1(....)
defparam top.u_sub_mod1.neg_output = 0;
I'm not sure if I understand correctly, but are you after this?

sub_mod #(1) u_sub_mod(....);
sub_mod #(0) u_sub_mod1(....);

The value inside the parentheses is the value that gets assigned
to neg_output. If you have multiple parameters you can give them
all (or some of them) by separating them with commas.

--
Juha Turunen (turunen(at)iki.fi) elpuri@IRC | The problem with the global
Torikatu 5A4, 53900 Lappeenranta, Finland | village are all the global
GSM: 040-7092525, http://iki.fi/turunen/ | village idiots.
 
Thanks.

In fact, I hope to know how to make DC understand it.

Now I have gotten the answer.
A variable hdlin_auto_save_templates = true can solve this problem.
 

Welcome to EDABoard.com

Sponsor

Back
Top