verilator/test_regress/t/t_select_width.v

29 lines
627 B
Systemverilog
Raw Normal View History

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2024 Wilson Snyder
// SPDX-License-Identifier: CC0-1.0
2026-03-10 02:38:29 +01:00
module t ( /*AUTOARG*/
// Outputs
vlan,
// Inputs
clk,
pkt_data
);
2026-03-10 02:38:29 +01:00
parameter WIDTH = 320;
input clk;
input [2559:0] pkt_data;
output reg [15:0] vlan;
2026-03-10 02:38:29 +01:00
always @(posedge clk) begin
// verilator lint_off WIDTHCONCAT
// verilator lint_off WIDTHTRUNC
vlan <= pkt_data[{(WIDTH-12), 3'b0}-1-:16];
// verilator lint_on WIDTHCONCAT
// verilator lint_on WIDTHTRUNC
end
endmodule