IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Commit 724684dc authored by Lars Asplund's avatar Lars Asplund
Browse files

Remove illegal attribute prefixes in testbenches.

A number of testbenches contain code on the form

assert function_call(parameters)'length = 0;

The purpose is to verify that the function returns a null vector. However, the length attribute can only be applied to array objects and a function call returning an array is not an object but an expression. This is strictly enforced in
the latest versions of GHDL.

This commit updates the testbenches violating this rule.
parent 0024f735
......@@ -8,6 +8,8 @@ library ieee;
use ieee.numeric_bit.all;
use work.test_support_pkg.all;
entity numeric_bit_tb1 is
generic (
runner_cfg : string);
......@@ -846,7 +848,7 @@ begin
-- ************************************************
-- r.1, r.2 tests from Bob Flatt ::::::
elsif run("r_1 tests") then
assert RESIZE(SIGNED'("0001") , 0)'length = 0
assert is_null(RESIZE(SIGNED'("0001") , 0))
report "Test r.1.1 failing."
severity FAILURE;
assert RESIZE(SIGNED'("0001") , 1) = "0"
......@@ -906,7 +908,7 @@ begin
report "Test r.1.19 failing."
severity FAILURE;
assert RESIZE(SANULL , 0)'length = 0
assert is_null(RESIZE(SANULL , 0))
report "Test r.1.20 failing."
severity FAILURE;
assert RESIZE(SANULL , 1) = "0"
......@@ -916,7 +918,7 @@ begin
report "Test r.1.22 failing."
severity FAILURE;
assert RESIZE(SIGNED'("0") , 0)'length = 0
assert is_null(RESIZE(SIGNED'("0") , 0))
report "Test r.1.23 failing."
severity FAILURE;
assert RESIZE(SIGNED'("0") , 1) = "0"
......@@ -932,7 +934,7 @@ begin
report "Test r.1.27 failing."
severity FAILURE;
elsif run("r_2 tests") then
assert RESIZE(UNSIGNED'("0001") , 0)'length = 0
assert is_null(RESIZE(UNSIGNED'("0001") , 0))
report "Test r.2.1 failing."
severity FAILURE;
assert RESIZE(UNSIGNED'("0001") , 1) = "1"
......@@ -992,7 +994,7 @@ begin
report "Test r.2.19 failing."
severity FAILURE;
assert RESIZE(ANULL , 0)'length = 0
assert is_null(RESIZE(ANULL , 0))
report "Test r.2.20 failing."
severity FAILURE;
assert RESIZE(ANULL , 1) = "0"
......@@ -1002,7 +1004,7 @@ begin
report "Test r.2.22 failing."
severity FAILURE;
assert RESIZE(UNSIGNED'("0") , 0)'length = 0
assert is_null(RESIZE(UNSIGNED'("0") , 0))
report "Test r.2.23 failing."
severity FAILURE;
assert RESIZE(UNSIGNED'("0") , 1) = "0"
......
......@@ -9,6 +9,8 @@ library ieee;
use ieee.numeric_bit.all;
use work.test_support_pkg.all;
entity numeric_bit_tb2 is
generic (
runner_cfg : string);
......@@ -50,13 +52,13 @@ begin
while test_suite loop
if run("S.1 tests") then
assert shift_left(s_unull, 0)'length = 0
assert is_null(shift_left(s_unull, 0))
report "Test S.1.1 failing."
severity FAILURE;
assert shift_left(s_unull, 1)'length = 0
assert is_null(shift_left(s_unull, 1))
report "Test S.1.2 failing."
severity FAILURE;
assert shift_left(s_unull, 100)'length = 0
assert is_null(shift_left(s_unull, 100))
report "Test S.1.3 failing."
severity FAILURE;
......@@ -119,13 +121,13 @@ begin
report "Test S.1.21 failing."
severity FAILURE;
elsif run("S.2 tests") then
assert shift_right(s_unull, 0)'length = 0
assert is_null(shift_right(s_unull, 0))
report "Test S.2.1 failing."
severity FAILURE;
assert shift_right(s_unull, 1)'length = 0
assert is_null(shift_right(s_unull, 1))
report "Test S.2.2 failing."
severity FAILURE;
assert shift_right(s_unull, 100)'length = 0
assert is_null(shift_right(s_unull, 100))
report "Test S.2.3 failing."
severity FAILURE;
......@@ -188,13 +190,13 @@ begin
report "Test S.2.21 failing."
severity FAILURE;
elsif run("S.3 tests") then
assert shift_left(s_snull, 0)'length = 0
assert is_null(shift_left(s_snull, 0))
report "Test S.3.1 failing."
severity FAILURE;
assert shift_left(s_snull, 1)'length = 0
assert is_null(shift_left(s_snull, 1))
report "Test S.3.2 failing."
severity FAILURE;
assert shift_left(s_snull, 100)'length = 0
assert is_null(shift_left(s_snull, 100))
report "Test S.3.3 failing."
severity FAILURE;
......@@ -257,13 +259,13 @@ begin
report "Test S.3.21 failing."
severity FAILURE;
elsif run("S.4 tests") then
assert shift_right(s_snull, 0)'length = 0
assert is_null(shift_right(s_snull, 0))
report "Test S.4.1 failing."
severity FAILURE;
assert shift_right(s_snull, 1)'length = 0
assert is_null(shift_right(s_snull, 1))
report "Test S.4.2 failing."
severity FAILURE;
assert shift_right(s_snull, 100)'length = 0
assert is_null(shift_right(s_snull, 100))
report "Test S.4.3 failing."
severity FAILURE;
......@@ -326,13 +328,13 @@ begin
report "Test S.4.21 failing."
severity FAILURE;
elsif run("S.5 tests") then
assert rotate_left(s_unull, 0)'length = 0
assert is_null(rotate_left(s_unull, 0))
report "Test S.5.1 failing."
severity FAILURE;
assert rotate_left(s_unull, 1)'length = 0
assert is_null(rotate_left(s_unull, 1))
report "Test S.5.2 failing."
severity FAILURE;
assert rotate_left(s_unull, 100)'length = 0
assert is_null(rotate_left(s_unull, 100))
report "Test S.5.3 failing."
severity FAILURE;
......@@ -395,13 +397,13 @@ begin
report "Test S.5.21 failing."
severity FAILURE;
elsif run("S.6 tests") then
assert rotate_right(s_unull, 0)'length = 0
assert is_null(rotate_right(s_unull, 0))
report "Test S.6.1 failing."
severity FAILURE;
assert rotate_right(s_unull, 1)'length = 0
assert is_null(rotate_right(s_unull, 1))
report "Test S.6.2 failing."
severity FAILURE;
assert rotate_right(s_unull, 100)'length = 0
assert is_null(rotate_right(s_unull, 100))
report "Test S.6.3 failing."
severity FAILURE;
......@@ -464,13 +466,13 @@ begin
report "Test S.6.21 failing."
severity FAILURE;
elsif run("S.7 tests") then
assert rotate_left(s_snull, 0)'length = 0
assert is_null(rotate_left(s_snull, 0))
report "Test S.7.1 failing."
severity FAILURE;
assert rotate_left(s_snull, 1)'length = 0
assert is_null(rotate_left(s_snull, 1))
report "Test S.7.2 failing."
severity FAILURE;
assert rotate_left(s_snull, 100)'length = 0
assert is_null(rotate_left(s_snull, 100))
report "Test S.7.3 failing."
severity FAILURE;
......@@ -533,13 +535,13 @@ begin
report "Test S.7.21 failing."
severity FAILURE;
elsif run("S.8 tests") then
assert rotate_right(s_snull, 0)'length = 0
assert is_null(rotate_right(s_snull, 0))
report "Test S.8.1 failing."
severity FAILURE;
assert rotate_right(s_snull, 1)'length = 0
assert is_null(rotate_right(s_snull, 1))
report "Test S.8.2 failing."
severity FAILURE;
assert rotate_right(s_snull, 100)'length = 0
assert is_null(rotate_right(s_snull, 100))
report "Test S.8.3 failing."
severity FAILURE;
......
......@@ -9,6 +9,8 @@ library ieee;
use ieee.numeric_bit.all;
use work.test_support_pkg.all;
entity numeric_bit_tb4 is
generic (
runner_cfg : string);
......@@ -25,7 +27,7 @@ begin
procedure A_3 (LEFT, RIGHT: in UNSIGNED) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_3;
procedure A_4 (LEFT, RIGHT, RESULT: in SIGNED) is
......@@ -36,7 +38,7 @@ begin
procedure A_4 (LEFT, RIGHT: in SIGNED) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_4;
procedure A_5 (LEFT:in UNSIGNED; RIGHT:in NATURAL; RESULT:in UNSIGNED) is
......@@ -47,7 +49,7 @@ begin
procedure A_5 (LEFT:in UNSIGNED; RIGHT:in NATURAL) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_5;
procedure A_6 (LEFT:in NATURAL; RIGHT:in UNSIGNED; RESULT:in UNSIGNED) is
......@@ -58,7 +60,7 @@ begin
procedure A_6 (LEFT:in NATURAL; RIGHT:in UNSIGNED) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_6;
procedure A_7 (LEFT:in INTEGER; RIGHT:in SIGNED; RESULT:in SIGNED) is
......@@ -69,7 +71,7 @@ begin
procedure A_7 (LEFT:in INTEGER; RIGHT:in SIGNED) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_7;
procedure A_8 (LEFT:in SIGNED; RIGHT:in INTEGER; RESULT:in SIGNED) is
......@@ -80,7 +82,7 @@ begin
procedure A_8 (LEFT:in SIGNED; RIGHT:in INTEGER) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_8;
procedure A_9 (LEFT, RIGHT, RESULT: in UNSIGNED) is
......@@ -91,7 +93,7 @@ begin
procedure A_9 (LEFT, RIGHT: in UNSIGNED) is
begin
assert "-"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("-"(LEFT, RIGHT)) severity FAILURE;
end A_9;
procedure A_10 (LEFT, RIGHT, RESULT: in SIGNED) is
......@@ -102,7 +104,7 @@ begin
procedure A_10 (LEFT, RIGHT: in SIGNED) is
begin
assert "-"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("-"(LEFT, RIGHT)) severity FAILURE;
end A_10;
procedure A_11 (LEFT:in UNSIGNED; RIGHT:in NATURAL; RESULT: in UNSIGNED) is
......@@ -113,7 +115,7 @@ begin
procedure A_11 (LEFT:in UNSIGNED; RIGHT: in NATURAL) is
begin
assert "-"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("-"(LEFT, RIGHT)) severity FAILURE;
end A_11;
procedure A_12 (LEFT:in NATURAL; RIGHT, RESULT: in UNSIGNED) is
......@@ -124,7 +126,7 @@ begin
procedure A_12 (LEFT: in NATURAL; RIGHT:in UNSIGNED) is
begin
assert "-"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("-"(LEFT, RIGHT)) severity FAILURE;
end A_12;
procedure A_13 (LEFT:in SIGNED; RIGHT:in INTEGER; RESULT: in SIGNED) is
......@@ -135,7 +137,7 @@ begin
procedure A_13 (LEFT:in SIGNED; RIGHT:in INTEGER) is
begin
assert "-"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("-"(LEFT, RIGHT)) severity FAILURE;
end A_13;
procedure A_14 (LEFT:in INTEGER; RIGHT, RESULT: in SIGNED) is
......@@ -146,7 +148,7 @@ begin
procedure A_14 (LEFT:in INTEGER; RIGHT: in SIGNED) is
begin
assert "-"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("-"(LEFT, RIGHT)) severity FAILURE;
end A_14;
begin
......
......@@ -9,6 +9,8 @@ library IEEE;
use ieee.numeric_std.all;
use IEEE.std_logic_1164.all;
use work.test_support_pkg.all;
entity numeric_std_tb1 is
generic (
runner_cfg : string);
......@@ -989,7 +991,7 @@ begin
-- r.1, r.2 tests from Bob Flatt ::::::
elsif run("r_1 tests") then
assert RESIZE(SIGNED'("0001") , 0)'length = 0
assert is_null(RESIZE(SIGNED'("0001") , 0))
report "Test r.1.1 failing."
severity FAILURE;
assert RESIZE(SIGNED'("0001") , 1) = "0"
......@@ -1049,7 +1051,7 @@ begin
report "Test r.1.19 failing."
severity FAILURE;
assert RESIZE(SANULL , 0)'length = 0
assert is_null(RESIZE(SANULL , 0))
report "Test r.1.20 failing."
severity FAILURE;
assert RESIZE(SANULL , 1) = "0"
......@@ -1059,7 +1061,7 @@ begin
report "Test r.1.22 failing."
severity FAILURE;
assert RESIZE(SIGNED'("0") , 0)'length = 0
assert is_null(RESIZE(SIGNED'("0") , 0))
report "Test r.1.23 failing."
severity FAILURE;
assert RESIZE(SIGNED'("0") , 1) = "0"
......@@ -1075,7 +1077,7 @@ begin
report "Test r.1.27 failing."
severity FAILURE;
elsif run("r_2 tests") then
assert RESIZE(UNSIGNED'("0001") , 0)'length = 0
assert is_null(RESIZE(UNSIGNED'("0001") , 0))
report "Test r.2.1 failing."
severity FAILURE;
assert RESIZE(UNSIGNED'("0001") , 1) = "1"
......@@ -1135,7 +1137,7 @@ begin
report "Test r.2.19 failing."
severity FAILURE;
assert RESIZE(ANULL , 0)'length = 0
assert is_null(RESIZE(ANULL , 0))
report "Test r.2.20 failing."
severity FAILURE;
assert RESIZE(ANULL , 1) = "0"
......@@ -1145,7 +1147,7 @@ begin
report "Test r.2.22 failing."
severity FAILURE;
assert RESIZE(UNSIGNED'("0") , 0)'length = 0
assert is_null(RESIZE(UNSIGNED'("0") , 0))
report "Test r.2.23 failing."
severity FAILURE;
assert RESIZE(UNSIGNED'("0") , 1) = "0"
......
......@@ -10,6 +10,8 @@ library IEEE;
use ieee.numeric_std.all;
use IEEE.std_logic_1164.all;
use work.test_support_pkg.all;
entity numeric_std_tb2 is
generic (
runner_cfg : string);
......@@ -51,13 +53,13 @@ begin
while test_suite loop
if run("S.1 tests") then
assert shift_left(s_unull, 0)'length = 0
assert is_null(shift_left(s_unull, 0))
report "Test S.1.1 failing."
severity FAILURE;
assert shift_left(s_unull, 1)'length = 0
assert is_null(shift_left(s_unull, 1))
report "Test S.1.2 failing."
severity FAILURE;
assert shift_left(s_unull, 100)'length = 0
assert is_null(shift_left(s_unull, 100))
report "Test S.1.3 failing."
severity FAILURE;
......@@ -120,13 +122,13 @@ begin
report "Test S.1.21 failing."
severity FAILURE;
elsif run("S.2 tests") then
assert shift_right(s_unull, 0)'length = 0
assert is_null(shift_right(s_unull, 0))
report "Test S.2.1 failing."
severity FAILURE;
assert shift_right(s_unull, 1)'length = 0
assert is_null(shift_right(s_unull, 1))
report "Test S.2.2 failing."
severity FAILURE;
assert shift_right(s_unull, 100)'length = 0
assert is_null(shift_right(s_unull, 100))
report "Test S.2.3 failing."
severity FAILURE;
......@@ -189,13 +191,13 @@ begin
report "Test S.2.21 failing."
severity FAILURE;
elsif run("S.3 tests") then
assert shift_left(s_snull, 0)'length = 0
assert is_null(shift_left(s_snull, 0))
report "Test S.3.1 failing."
severity FAILURE;
assert shift_left(s_snull, 1)'length = 0
assert is_null(shift_left(s_snull, 1))
report "Test S.3.2 failing."
severity FAILURE;
assert shift_left(s_snull, 100)'length = 0
assert is_null(shift_left(s_snull, 100))
report "Test S.3.3 failing."
severity FAILURE;
......@@ -258,13 +260,13 @@ begin
report "Test S.3.21 failing."
severity FAILURE;
elsif run("S.4 tests") then
assert shift_right(s_snull, 0)'length = 0
assert is_null(shift_right(s_snull, 0))
report "Test S.4.1 failing."
severity FAILURE;
assert shift_right(s_snull, 1)'length = 0
assert is_null(shift_right(s_snull, 1))
report "Test S.4.2 failing."
severity FAILURE;
assert shift_right(s_snull, 100)'length = 0
assert is_null(shift_right(s_snull, 100))
report "Test S.4.3 failing."
severity FAILURE;
......@@ -327,13 +329,13 @@ begin
report "Test S.4.21 failing."
severity FAILURE;
elsif run("S.5 tests") then
assert rotate_left(s_unull, 0)'length = 0
assert is_null(rotate_left(s_unull, 0))
report "Test S.5.1 failing."
severity FAILURE;
assert rotate_left(s_unull, 1)'length = 0
assert is_null(rotate_left(s_unull, 1))
report "Test S.5.2 failing."
severity FAILURE;
assert rotate_left(s_unull, 100)'length = 0
assert is_null(rotate_left(s_unull, 100))
report "Test S.5.3 failing."
severity FAILURE;
......@@ -396,13 +398,13 @@ begin
report "Test S.5.21 failing."
severity FAILURE;
elsif run("S.6 tests") then
assert rotate_right(s_unull, 0)'length = 0
assert is_null(rotate_right(s_unull, 0))
report "Test S.6.1 failing."
severity FAILURE;
assert rotate_right(s_unull, 1)'length = 0
assert is_null(rotate_right(s_unull, 1))
report "Test S.6.2 failing."
severity FAILURE;
assert rotate_right(s_unull, 100)'length = 0
assert is_null(rotate_right(s_unull, 100))
report "Test S.6.3 failing."
severity FAILURE;
......@@ -465,13 +467,13 @@ begin
report "Test S.6.21 failing."
severity FAILURE;
elsif run("S.7 tests") then
assert rotate_left(s_snull, 0)'length = 0
assert is_null(rotate_left(s_snull, 0))
report "Test S.7.1 failing."
severity FAILURE;
assert rotate_left(s_snull, 1)'length = 0
assert is_null(rotate_left(s_snull, 1))
report "Test S.7.2 failing."
severity FAILURE;
assert rotate_left(s_snull, 100)'length = 0
assert is_null(rotate_left(s_snull, 100))
report "Test S.7.3 failing."
severity FAILURE;
......@@ -534,13 +536,13 @@ begin
report "Test S.7.21 failing."
severity FAILURE;
elsif run("S.8 tests") then
assert rotate_right(s_snull, 0)'length = 0
assert is_null(rotate_right(s_snull, 0))
report "Test S.8.1 failing."
severity FAILURE;
assert rotate_right(s_snull, 1)'length = 0
assert is_null(rotate_right(s_snull, 1))
report "Test S.8.2 failing."
severity FAILURE;
assert rotate_right(s_snull, 100)'length = 0
assert is_null(rotate_right(s_snull, 100))
report "Test S.8.3 failing."
severity FAILURE;
......
......@@ -10,6 +10,8 @@ library IEEE;
use ieee.numeric_std.all;
use IEEE.std_logic_1164.all;
use work.test_support_pkg.all;
entity numeric_std_tb4 is
generic (
runner_cfg : string);
......@@ -18,6 +20,7 @@ end entity numeric_std_tb4;
architecture t1 of numeric_std_tb4 is
begin
process
procedure A_3 (LEFT, RIGHT, RESULT: in UNSIGNED) is
begin
assert STD_LOGIC_VECTOR (LEFT+RIGHT) = STD_LOGIC_VECTOR (RESULT)
......@@ -26,7 +29,7 @@ begin
procedure A_3 (LEFT, RIGHT: in UNSIGNED) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_3;
procedure A_4 (LEFT, RIGHT, RESULT: in SIGNED) is
......@@ -37,7 +40,7 @@ begin
procedure A_4 (LEFT, RIGHT: in SIGNED) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_4;
procedure A_5 (LEFT:in UNSIGNED; RIGHT:in NATURAL; RESULT:in UNSIGNED) is
......@@ -48,7 +51,7 @@ begin
procedure A_5 (LEFT:in UNSIGNED; RIGHT:in NATURAL) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_5;
procedure A_6 (LEFT:in NATURAL; RIGHT:in UNSIGNED; RESULT:in UNSIGNED) is
......@@ -59,7 +62,7 @@ begin
procedure A_6 (LEFT:in NATURAL; RIGHT:in UNSIGNED) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_6;
procedure A_7 (LEFT:in INTEGER; RIGHT:in SIGNED; RESULT:in SIGNED) is
......@@ -70,7 +73,7 @@ begin
procedure A_7 (LEFT:in INTEGER; RIGHT:in SIGNED) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_7;
procedure A_8 (LEFT:in SIGNED; RIGHT:in INTEGER; RESULT:in SIGNED) is
......@@ -81,7 +84,7 @@ begin
procedure A_8 (LEFT:in SIGNED; RIGHT:in INTEGER) is
begin
assert "+"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("+"(LEFT, RIGHT)) severity FAILURE;
end A_8;
procedure A_9 (LEFT, RIGHT, RESULT: in UNSIGNED) is
......@@ -92,7 +95,7 @@ begin
procedure A_9 (LEFT, RIGHT: in UNSIGNED) is
begin
assert "-"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("-"(LEFT, RIGHT)) severity FAILURE;
end A_9;
procedure A_10 (LEFT, RIGHT, RESULT: in SIGNED) is
......@@ -103,7 +106,7 @@ begin
procedure A_10 (LEFT, RIGHT: in SIGNED) is
begin
assert "-"(LEFT, RIGHT)'length = 0 severity FAILURE;
assert is_null("-"(LEFT, RIGHT)) severity FAILURE;
end A_10;
procedure A_11 (LEFT:in UNSIGNED; RIGHT:in NATURAL; RESULT: in UNSIGNED) is
......@@ -114,7 +117,7 @@ begin
procedure A_11 (LEFT:in UNSIGNED; RIGHT: in NATURAL) is
begin