mirror of
https://github.com/verilator/verilator.git
synced 2025-01-06 06:37:45 +00:00
Tests: Add t_dynarray_unpacked (#2314)
This commit is contained in:
parent
8e25d2c61d
commit
6061744c4d
34
test_regress/t/t_dynarray_unpacked.v
Normal file
34
test_regress/t/t_dynarray_unpacked.v
Normal file
@ -0,0 +1,34 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2020 by Wilson Snyder.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
`define stop $stop
|
||||
`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0)
|
||||
|
||||
module t (/*AUTOARG*/);
|
||||
|
||||
byte dyn [][1:0];
|
||||
|
||||
initial begin
|
||||
begin
|
||||
dyn = new [3];
|
||||
dyn[0] = '{101, 100};
|
||||
dyn[1] = '{111, 110};
|
||||
dyn[2] = '{121, 120};
|
||||
`ifndef verilator // bug2314
|
||||
`checkh(dyn[0][0], 100);
|
||||
`checkh(dyn[0][1], 101);
|
||||
`checkh(dyn[1][0], 110);
|
||||
`checkh(dyn[1][1], 111);
|
||||
`checkh(dyn[2][0], 120);
|
||||
`checkh(dyn[2][1], 121);
|
||||
`endif
|
||||
end
|
||||
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
end
|
||||
|
||||
endmodule
|
21
test_regress/t/t_queue_unpacked.pl
Executable file
21
test_regress/t/t_queue_unpacked.pl
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env perl
|
||||
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
||||
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||
#
|
||||
# Copyright 2019 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(simulator => 1);
|
||||
|
||||
compile(
|
||||
);
|
||||
|
||||
execute(
|
||||
check_finished => 1,
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
@ -7,15 +7,7 @@
|
||||
`define stop $stop
|
||||
`define checks(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='%s' exp='%s'\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0);
|
||||
|
||||
module t (/*AUTOARG*/
|
||||
// Inputs
|
||||
clk
|
||||
);
|
||||
input clk;
|
||||
|
||||
integer cyc=0;
|
||||
|
||||
integer i;
|
||||
module t (/*AUTOARG*/);
|
||||
|
||||
typedef string sarray_t[2];
|
||||
typedef sarray_t q_sarray_t[$];
|
Loading…
Reference in New Issue
Block a user