From: Clifford Wolf Date: Fri, 6 Jun 2014 15:47:20 +0000 (+0200) Subject: Added tests/simple/repwhile.v X-Git-Tag: yosys-0.3.0~10 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c82db39935e969ff95b0728dbb92231f0e9e9891;p=yosys.git Added tests/simple/repwhile.v --- diff --git a/tests/simple/repwhile.v b/tests/simple/repwhile.v new file mode 100644 index 000000000..8c5b4b371 --- /dev/null +++ b/tests/simple/repwhile.v @@ -0,0 +1,20 @@ +module test001(output [63:0] y); + function [7:0] mylog2; + input [31:0] value; + begin + mylog2 = 0; + while (value > 0) begin + value = value >> 1; + mylog2 = mylog2 + 1; + end + end + endfunction + + genvar i; + generate + for (i = 0; i < 64; i = i+1) begin + localparam tmp = mylog2(i); + assign y[i] = tmp; + end + endgenerate +endmodule