2023-04-06 03:27: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: 2023 Wilson Snyder
|
2023-04-06 03:27:37 +02:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
|
|
|
|
|
|
|
|
|
class Packet;
|
2026-03-08 23:26:40 +01:00
|
|
|
rand int one;
|
2023-04-06 03:27:37 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
constraint a {one > 0 && one < 2;}
|
2023-04-06 03:27:37 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
constraint empty {}
|
2024-12-12 14:16:19 +01:00
|
|
|
|
2023-04-06 03:27:37 +02:00
|
|
|
endclass
|
|
|
|
|
|
2025-09-13 15:28:43 +02:00
|
|
|
module t;
|
2023-04-06 03:27:37 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
Packet p;
|
2023-04-06 03:27:37 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
int v;
|
2023-04-06 03:27:37 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
initial begin
|
|
|
|
|
p = new;
|
|
|
|
|
v = p.randomize();
|
|
|
|
|
if (v != 1) $stop;
|
|
|
|
|
if (p.one != 1) $stop;
|
2023-04-06 03:27:37 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
2023-04-06 03:27:37 +02:00
|
|
|
endmodule
|