Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Verilog problem with using defparam

Status
Not open for further replies.

yasser_shoukry

Full Member level 4
Joined
May 31, 2006
Messages
233
Helped
25
Reputation
54
Reaction score
5
Trophy points
1,298
Location
Cairo - Egypt
Activity points
2,749
I have a problem with using "defparam" with my modules.

I was developing a digital watch module. I developed a counter module to use it inside the digital module.

The counter has a parameter called "max_counts" which is used to define max number of counts after which the counter should overflow:

module counter (clk, reset, counts, clk_out);
.......
.......
parameter max_counts = 4'd9;
.......
endmodule;

Then in the dig_watch module, I instantiated six counters from this module :

module dig_watch(clk, reset, sec0, sec1, min0, min1, hr0, hr1);
.......
.......
defparam C0.max_counts=4'd2;
Counter C0 (...,...,...,....);
......
......
endmodule;

The problem is, when i compile this design on FPGA Advantage , an error message apears at the line of the defparam tells that "using defparam is unsynthesisable"!!!

Can any body help me??

Thanks and Best Regards.
Yasser.
 

verilog parameters

Yes, defparam is usually non-synthesisable as it uses hierarchical access. Use parameter overriding as:

module dig_module;
counter #(10) c0 ();
counter #(1) c1 ();
counter #(100) c100 ();

HTH
Ajeetha, CVC

yasser_shoukry said:
I have a problem with using "defparam" with my modules.

I was developing a digital watch module. I developed a counter module to use it inside the digital module.

The counter has a parameter called "max_counts" which is used to define max number of counts after which the counter should overflow:

module counter (clk, reset, counts, clk_out);
.......
.......
parameter max_counts = 4'd9;
.......
endmodule;

Then in the dig_watch module, I instantiated six counters from this module :

module dig_watch(clk, reset, sec0, sec1, min0, min1, hr0, hr1);
.......
.......
defparam C0.max_counts=4'd2;
Counter C0 (...,...,...,....);
......
......
endmodule;

The problem is, when i compile this design on FPGA Advantage , an error message apears at the line of the defparam tells that "using defparam is unsynthesisable"!!!

Can any body help me??

Thanks and Best Regards.
Yasser.
 
verilog paramter

defparam is synthesisable in synplify, you can try it.

but the method of aji_vlsi's is the prefered one. because the defparam construct maybe remove from the future version of systemverilog.
 

parameters verilog

defparam is non synthesiable. Moreover using defparam construct is considered to be a bad coding style. However the method suggested by aji_vlsi is quite good.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top