2024-10-29 12:27:40 +01:00
|
|
|
// DESCRIPTION: Verilator: Demonstrate struct literal param assignment problem
|
|
|
|
|
//
|
2026-01-27 02:24:34 +01:00
|
|
|
// This file ONLY is placed under the Creative Commons Public Domain.
|
|
|
|
|
// SPDX-FileCopyrightText: 2024 Wilson Snyder
|
2024-10-29 12:27:40 +01:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
|
|
|
|
|
|
|
|
|
|
2026-03-03 13:21:24 +01:00
|
|
|
interface intf #(
|
|
|
|
|
parameter int WRITE_DATA_WIDTH
|
|
|
|
|
) ();
|
|
|
|
|
logic [WRITE_DATA_WIDTH-1:0] writedata;
|
2024-10-29 12:27:40 +01:00
|
|
|
endinterface
|
2026-03-03 13:21:24 +01:00
|
|
|
module t ( /*AUTOARG*/
|
2024-10-29 12:27:40 +01:00
|
|
|
clk
|
|
|
|
|
);
|
|
|
|
|
|
2026-03-03 13:21:24 +01:00
|
|
|
input clk;
|
|
|
|
|
generate
|
|
|
|
|
genvar num_chunks;
|
|
|
|
|
for (num_chunks = 1; num_chunks <= 2; num_chunks++) begin : gen_n
|
|
|
|
|
localparam int decoded_width = 55 * num_chunks;
|
|
|
|
|
intf #(.WRITE_DATA_WIDTH(decoded_width)) the_intf ();
|
|
|
|
|
always @(posedge clk) begin
|
|
|
|
|
for (int i = 0; i < decoded_width; i++) the_intf.writedata[i] <= '1;
|
|
|
|
|
$display("%0d", the_intf.writedata);
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
endgenerate
|
2024-10-29 12:27:40 +01:00
|
|
|
|
2026-03-03 13:21:24 +01:00
|
|
|
// finish report
|
|
|
|
|
always @(posedge clk) begin
|
|
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
2024-10-29 12:27:40 +01:00
|
|
|
endmodule
|