From c82db39935e969ff95b0728dbb92231f0e9e9891 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 6 Jun 2014 17:47:20 +0200 Subject: [PATCH] Added tests/simple/repwhile.v --- tests/simple/repwhile.v | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 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 -- 2.30.2