childs72
Member level 1
- Joined
- Apr 8, 2006
- Messages
- 33
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- 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"....
......
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"....
Last edited: