2012-05-04 03:59:47 +02:00
|
|
|
// DESCRIPTION: Verilator: Verilog Test module
|
|
|
|
|
//
|
2026-01-27 02:24:34 +01:00
|
|
|
// This file ONLY is placed under the Creative Commons Public Domain.
|
|
|
|
|
// SPDX-FileCopyrightText: 2012 Wilson Snyder
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2012-05-04 03:59:47 +02:00
|
|
|
|
|
|
|
|
//bug505
|
|
|
|
|
|
2025-09-13 15:28:43 +02:00
|
|
|
module t;
|
2012-05-04 03:59:47 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
parameter WIDTH = 33;
|
|
|
|
|
localparam MAX_WIDTH = 11;
|
|
|
|
|
localparam NUM_OUT = num_out(WIDTH);
|
2012-05-04 03:59:47 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
wire [NUM_OUT-1:0] z;
|
2012-05-04 03:59:47 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
function integer num_out;
|
|
|
|
|
input integer width;
|
|
|
|
|
num_out = 1;
|
|
|
|
|
while ((width + num_out - 1) / num_out > MAX_WIDTH) num_out = num_out * 2;
|
|
|
|
|
endfunction
|
2012-05-04 03:59:47 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
initial begin
|
|
|
|
|
if (NUM_OUT != 4) $stop;
|
|
|
|
|
if ($bits(z) != 4) $stop;
|
|
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
2012-05-04 03:59:47 +02:00
|
|
|
endmodule
|