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.

[SOLVED] unable to assign localparam using function, why???

Status
Not open for further replies.

childs72

Member level 1
Member level 1
Joined
Apr 8, 2006
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,542
Hi guys, I would like to assign my local param using a function as below. However, I am getting Error message from QII saying "value for parameter "data_width" must be constant expression". I have no idea why it flag such error. Pls advice :(


......
localparam data_width = funclog2(8);

......

function integer funclog2;
input depth;
integer i,result;
begin
for (i = 0; 2 ** i < depth; i = i + 1)
result = i + 1;
funclog2 = result;
end
endfunction


--> Problem solved after i changed "input depth" to "input integer depth".... :p
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top