2
// Copyright (C) 2008-2014 Centaur Technology
5
// Centaur Technology Formal Verification Group
6
// 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA.
7
// http://www.centtech.com/
9
// License: (An MIT/X11-style license)
11
// Permission is hereby granted, free of charge, to any person obtaining a
12
// copy of this software and associated documentation files (the "Software"),
13
// to deal in the Software without restriction, including without limitation
14
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
// and/or sell copies of the Software, and to permit persons to whom the
16
// Software is furnished to do so, subject to the following conditions:
18
// The above copyright notice and this permission notice shall be included in
19
// all copies or substantial portions of the Software.
21
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
// DEALINGS IN THE SOFTWARE.
29
// Original author: Jared Davis <jared@centtech.com>
31
`ifndef SYSTEM_VERILOG_MODE
35
initial $display("This test is for SystemVerilog only, nothing to check.");
46
wire [7:0] spec_out1, spec_out2, spec_out3, spec_out4, spec_out5;
57
wire [7:0] impl_out1, impl_out2, impl_out3, impl_out4, impl_out5;
59
\dut$size=1 impl(.in1(in1),
68
wire all_ok = (impl_out1 === spec_out1)
69
&& (impl_out2 === spec_out2)
70
&& (impl_out3 === spec_out3)
71
&& (impl_out4 === spec_out4)
72
&& (impl_out5 === spec_out5);
75
integer i0, i1, i2, i3, i4, i5, i6, i7, i8;
76
integer j0, j1, j2, j3, j4, j5, j6, j7, j8;
84
for(i0 = 0; i0 < 4; i0 = i0 + 1)
85
for(i1 = 0; i1 < 4; i1 = i1 + 1)
86
for(i2 = 0; i2 < 4; i2 = i2 + 1)
87
for(i3 = 0; i3 < 4; i3 = i3 + 1)
88
for(i4 = 0; i4 < 4; i4 = i4 + 1)
89
for(i5 = 0; i5 < 4; i5 = i5 + 1)
90
for(i6 = 0; i6 < 4; i6 = i6 + 1)
91
for(i7 = 0; i7 < 4; i7 = i7 + 1)
93
for(j0 = 0; j0 < 50; j0 = j0 + 1)
97
in1[3:0] = {Vals[i0], Vals[i1], Vals[i2], Vals[i3]};
98
in2[3:0] = {Vals[i4], Vals[i5], Vals[i6], Vals[i7]};
101
if (all_ok !== 1'b1) $display("fail for in1 = %b, in2 = %b:", in1, in2);
102
if (spec_out1 !== impl_out1) $display("out1 spec = %b vs. impl = %b", spec_out1, impl_out1);
103
if (spec_out2 !== impl_out2) $display("out2 spec = %b vs. impl = %b", spec_out2, impl_out2);
104
if (spec_out3 !== impl_out3) $display("out3 spec = %b vs. impl = %b", spec_out3, impl_out3);
105
if (spec_out4 !== impl_out4) $display("out4 spec = %b vs. impl = %b", spec_out4, impl_out4);
106
if (spec_out5 !== impl_out5) $display("out5 spec = %b vs. impl = %b", spec_out5, impl_out5);
107
if (all_ok !== 1'b1) $finish;