2024-05-01 00:38:37 +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: 2024 Wilson Snyder
|
2024-05-01 00:38:37 +02:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
|
|
|
|
|
2025-09-13 15:28:43 +02:00
|
|
|
module t;
|
2024-05-01 00:38:37 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
parameter int ZERO = 0;
|
2024-05-01 00:38:37 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
initial begin
|
|
|
|
|
automatic bit [31:0] val = '1;
|
|
|
|
|
automatic int left = 4;
|
2024-05-01 00:38:37 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
automatic int part = val[left+:ZERO];
|
|
|
|
|
$display(part);
|
|
|
|
|
part = val[left-:ZERO];
|
|
|
|
|
$display(part);
|
2024-05-01 00:38:37 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
2024-05-01 00:38:37 +02:00
|
|
|
|
|
|
|
|
endmodule
|