|
From: Dan M. <dan...@gm...> - 2016-02-08 20:50:07
|
I am using iverilog to learn SystemVerilog. I am following along in a
digital system design book and am having trouble building one of the
examples. The code uses a function to calculate log2:
module #(parameter AL = 8, BL = 8, QL = AL + BL) ...
logic[clog2(AL):0] count;
...
function clog2(input int n);
begin
clog2 = 0;
n--;
while(n > 0)
begin
clog2++;
n >>= 1;
end
end
endfunction
endmodule
I calling iverilog like this:
iverilog -g2012 -Wall -o booth booth.sv
It seems to get hung processing the loop or detecting n == 0 or
something. Is there an easy way
to debug this? I was thinking I'd run iverilog within gdb but maybe
there is a faster way to determine what is happening?
Regards,
Dan McLeran
|