From 982138105996c4f49252118c0d57721ad0202230 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 27 Mar 2022 14:42:36 -0400 Subject: [PATCH] Tests: new t_lint_latch_5 test (#2997). --- test_regress/t/t_lint_latch_5.pl | 17 +++++++++++++++++ test_regress/t/t_lint_latch_5.v | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 test_regress/t/t_lint_latch_5.pl create mode 100644 test_regress/t/t_lint_latch_5.v diff --git a/test_regress/t/t_lint_latch_5.pl b/test_regress/t/t_lint_latch_5.pl new file mode 100755 index 000000000..629a44bbb --- /dev/null +++ b/test_regress/t/t_lint_latch_5.pl @@ -0,0 +1,17 @@ +#!/usr/bin/env perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2003-2009 by Wilson Snyder. This program is free software; you +# can redistribute it and/or modify it under the terms of either the GNU +# Lesser General Public License Version 3 or the Perl Artistic License +# Version 2.0. +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +scenarios(vlt => 1); + +lint( + ); + +ok(1); +1; diff --git a/test_regress/t/t_lint_latch_5.v b/test_regress/t/t_lint_latch_5.v new file mode 100644 index 000000000..7cf29d05c --- /dev/null +++ b/test_regress/t/t_lint_latch_5.v @@ -0,0 +1,19 @@ +// DESCRIPTION: Verilator: Verilog Test module for Issue#2863 +// +// This file ONLY is placed into the Public Domain, for any use, +// without warranty, 2021 by Julien Margetts (Originally provided by Thomas Sailer) + +module test + (input logic [1:0] a, + input logic e, + output logic [1:0] z); + + always_latch + if (e) + z[0] <= a[0]; + + always_latch + if (e) + z[1] <= a[1]; + +endmodule