repo_name
stringlengths
6
79
path
stringlengths
5
236
copies
stringclasses
54 values
size
stringlengths
1
8
content
stringlengths
0
1.04M
license
stringclasses
15 values
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1340.vhd
4
1775
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1340.vhd,v 1.2 2001-10-26 16:29:40 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s04b01x00p04n01i01340ent IS END c08s04b01x00p04n01i01340ent; ARCHITECTURE c08s04b01x00p04n01i01340arch OF c08s04b01x00p04n01i01340ent IS signal X : integer := 0; BEGIN TESTING: PROCESS BEGIN X <= 15 after 10 ms; wait for 10 ms; assert NOT( X=15 ) report "***PASSED TEST: c08s04b01x00p04n01i01340" severity NOTE; assert ( X=15 ) report "***FAILED TEST: c08s04b01x00p04n01i01340 - Predefined TIME unit ms as the base type of the time expression test failed." severity ERROR; wait; END PROCESS TESTING; END c08s04b01x00p04n01i01340arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/scalar-data/inline_01a.vhd
4
15616
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA entity inline_01a is end entity inline_01a; ---------------------------------------------------------------- architecture test of inline_01a is begin section_1_a : process is -- code from book: constant number_of_bytes : integer := 4; constant number_of_bits : integer := 8 * number_of_bytes; constant e : real := 2.718281828; constant prop_delay : time := 3 ns; constant q : real := 1.60218E-19; constant resistivity : real := 2.5E5; -- variable index : integer := 0; variable temperature : real; variable start, finish : time := 0 ns; -- end of code from book begin wait; end process section_1_a; ---------------- section_1_b : process is -- code from book: variable start : time := 0 ns; variable finish : time := 0 ns; -- end of code from book variable program_counter : integer; variable index : integer; variable resonance_frequency : real; constant L, C : real := 0.0; begin -- code from book: program_counter := 0; index := index + 1; resonance_frequency := L * C; -- end of code from book wait; end process section_1_b; ---------------- section_2_a : process is -- code from book: type apples is range 0 to 100; type oranges is range 0 to 100; -- type day_of_month is range 0 to 31; type year is range 0 to 2100; variable today : day_of_month := 9; variable start_year : year := 1987; -- constant number_of_bits : integer := 32; type bit_index is range 0 to number_of_bits - 1; -- type set_index_range is range 21 downto 11; type mode_pos_range is range 5 to 7; variable set_index : set_index_range; variable mode_pos : mode_pos_range; -- type input_level is range -10.0 to +10.0; type probability is range 0.0 to 1.0; -- variable input_A : input_level; -- end of code from book begin -- code from book: -- error: Incompatible types for assignment -- start_year := today; -- end of code from book wait; end process section_2_a; ---------------- section_2_b : process is -- code from book: type resistance is range 0 to 1E9 units ohm; end units resistance; -- end of code from book begin wait; end process section_2_b; ---------------- section_2_c : process is -- code from book: type resistance is range 0 to 1E9 units ohm; kohm = 1000 ohm; Mohm = 1000 kohm; end units resistance; -- end of code from book begin wait; end process section_2_c; ---------------- section_2_d : process is -- code from book: type length is range 0 to 1E9 units um; -- primary unit: micron mm = 1000 um; -- metric units m = 1000 mm; inch = 25400 um; -- imperial units foot = 12 inch; end units length; -- end of code from book begin wait; end process section_2_d; ---------------- section_2_e : process is -- code from book: -- type time is range implementation_defined type time is range integer'low to integer'high units fs; ps = 1000 fs; ns = 1000 ps; us = 1000 ns; ms = 1000 us; sec = 1000 ms; min = 60 sec; hr = 60 min; end units; -- end of code from book begin wait; end process section_2_e; ---------------- section_2_f : process is -- code from book: type transistor_region is (linear, saturation); -- type octal_digit is ('0', '1', '2', '3', '4', '5', '6', '7'); -- variable transistor_state : transistor_region; variable last_digit : octal_digit := '0'; -- type logic_level is (unknown, low, undriven, high); variable control : logic_level; type water_level is (dangerously_low, low, ok); variable water_sensor : water_level; -- end of code from book begin -- code from book: transistor_state := linear; last_digit := '7'; -- control := low; water_sensor := low; -- end of code from book wait; end process section_2_f; ---------------- section_2_g : process is -- code from book: type severity_level is (note, warning, error, failure); type file_open_status is (open_ok, status_error, name_error, mode_error); type file_open_kind is (read_mode, write_mode, append_mode); type domain_type is (quiescent_domain, time_domain, frequency_domain); -- end of code from book begin wait; end process section_2_g; ---------------- section_2_g1 : process is -- code from book: type character is ( nul, soh, stx, etx, eot, enq, ack, bel, bs, ht, lf, vt, ff, cr, so, si, dle, dc1, dc2, dc3, dc4, nak, syn, etb, can, em, sub, esc, fsp, gsp, rsp, usp, ' ', '!', '"', '#', '$', '%', '&', ''', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', DEL, c128, c129, c130, c131, c132, c133, c134, c135, c136, c137, c138, c139, c140, c141, c142, c143, c144, c145, c146, c147, c148, c149, c150, c151, c152, c153, c154, c155, c156, c157, c158, c159, ' ', '¡', '¢', '£', '¤', '¥', '¦', '§', '¨', '©', 'ª', '«', '¬', '­', '®', '¯', '°', '±', '²', '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', '½', '¾', '¿', 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'Þ', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ'); -- end of code from book begin wait; end process section_2_g1; ---------------- section_2_h : process is -- code from book: variable cmd_char, terminator : character; -- end of code from book begin -- code from book: cmd_char := 'P'; terminator := cr; -- end of code from book wait; end process section_2_h; ---------------- section_2_i : process is -- code from book: type boolean is (false, true); -- type bit is ('0', '1'); -- end of code from book begin wait; end process section_2_i; ---------------- section_2_j : process is variable write_enable_n, select_reg_n, write_reg_n : bit; begin -- code from book: write_reg_n := not ( not write_enable_n and not select_reg_n ); -- end of code from book wait; end process section_2_j; ---------------- section_2_k : process is -- code from book: type std_ulogic is ( 'U', -- Uninitialized 'X', -- Forcing Unknown '0', -- Forcing zero '1', -- Forcing one 'Z', -- High Impedance 'W', -- Weak Unknown 'L', -- Weak zero 'H', -- Weak one '-' ); -- Don't care -- end of code from book begin wait; end process section_2_k; ---------------- section_3_a : process is -- code from book: subtype small_int is integer range -128 to 127; -- variable deviation : small_int; variable adjustment : integer; -- subtype bit_index is integer range 31 downto 0; -- end of code from book begin deviation := 0; adjustment := 0; -- code from book: deviation := deviation + adjustment; -- end of code from book wait; end process section_3_a; ---------------- section_3_b : process is constant highest_integer : integer := integer'high; constant highest_time : time := time'high; -- code from book: subtype pressure is real tolerance "default_pressure"; -- subtype natural is integer range 0 to highest_integer; subtype positive is integer range 1 to highest_integer; -- subtype delay_length is time range 0 fs to highest_time; -- end of code from book begin wait; end process section_3_b; ---------------- section_3_c : process is -- code from book: type logic_level is (unknown, low, undriven, high); type transistor_state is (unknown, unsaturated, saturated); -- subtype valid_level is logic_level range low to high; -- end of code from book begin wait; end process section_3_c; ---------------- section_4_a : block is -- code from book: subtype voltage is real tolerance "default_voltage"; subtype current is real tolerance "default_current"; nature electrical is voltage across current through electrical_ref reference; -- terminal in_plus, in_minus, preamp_out : electrical; -- quantity signal_level across in_plus to in_minus; quantity output_level across output_current through preamp_out; -- end of code from book begin end block section_4_a; ---------------- section_4_b : block is -- code from book: subtype temperature is real tolerance "default_temperature"; subtype heat_flow is real tolerance "default_heat_flow"; subtype cryo_temp is real tolerance "default_temperature"; subtype cryo_flow is real tolerance "default_heat_flow"; nature thermal is temperature across heat_flow through thermal_ref reference; nature cryogenic is cryo_temp across cryo_flow through cryo_ref reference; -- subtype illuminance is real tolerance "default_illuminance"; subtype optic_flux is real tolerance "default_optic_flux"; nature radiant is illuminance across optic_flux through radiant_ref reference; -- end of code from book begin end block section_4_b; ---------------- section_4_c : block is subtype voltage is real tolerance "default_voltage"; subtype current is real tolerance "default_current"; nature electrical is voltage across current through electrical_ref reference; -- code from book: subnature coarse_electrical is electrical tolerance "coarse_voltage" across "coarse_current" through; terminal supply_plus, supply_minus : coarse_electrical; terminal bias : electrical; quantity bias_pullup_v across supply_plus to bias; quantity bias_pulldown_v across bias to supply_minus; -- end of code from book begin end block section_4_c; ---------------- section_5_a : process is -- code from book: type resistance is range 0 to 1E9 units ohm; kohm = 1000 ohm; Mohm = 1000 kohm; end units resistance; type set_index_range is range 21 downto 11; type logic_level is (unknown, low, undriven, high); -- end of code from book begin -- output from vsim: "2000" report resistance'image(2 kohm); -- code from book: assert resistance'left = 0 ohm; assert resistance'right = 1E9 ohm; assert resistance'low = 0 ohm; assert resistance'high = 1E9 ohm; assert resistance'ascending = true; assert resistance'image(2 kohm) = "2000 ohm"; assert resistance'value("5 Mohm") = 5_000_000 ohm; assert set_index_range'left = 21; assert set_index_range'right = 11; assert set_index_range'low = 11; assert set_index_range'high = 21; assert set_index_range'ascending = false; assert set_index_range'image(14) = "14"; assert set_index_range'value("20") = 20; assert logic_level'left = unknown; assert logic_level'right = high; assert logic_level'low = unknown; assert logic_level'high = high; assert logic_level'ascending = true; assert logic_level'image(undriven) = "undriven"; assert logic_level'value("Low") = low; -- assert logic_level'pos(unknown) = 0; assert logic_level'val(3) = high; assert logic_level'succ(unknown) = low; assert logic_level'pred(undriven) = low; -- assert time'pos(4 ns) = 4_000_000; -- end of code from book wait; end process section_5_a; ---------------- section_5_b : process is -- code from book: type length is range integer'low to integer'high units mm; end units length; type area is range integer'low to integer'high units square_mm; end units area; -- variable L1, L2 : length; variable A : area; -- end of code from book begin -- code from book: -- error: No feasible entries for infix op: "*" -- A := L1 * L2; -- this is incorrect -- A := area'val( length'pos(L1) * length'pos(L2) ); -- end of code from book wait; end process section_5_b; ---------------- section_5_c : process is -- code from book: subtype voltage is real tolerance "default_voltage"; subtype high_current is real tolerance "coarse_current"; -- type gear is (unknown, park, reverse, neutral, first, second, third, fourth, fifth); subtype forward is gear range first to fifth; -- end of code from book begin -- code from book: assert voltage'tolerance = "default_voltage"; assert high_current'tolerance = "coarse_current"; -- assert forward'base'left = unknown; assert forward'base'succ(reverse) = neutral; -- end of code from book wait; end process section_5_c; ---------------- section_5_d : block is -- code from book: subtype displacement is real tolerance "default_displacement"; subtype force is real tolerance "default_force"; nature translational is displacement across force through translational_ref reference; -- quantity qdisp : translational'across; -- declares quantity of type displacement quantity qforce : translational'through; -- declares quantity of type force -- end of code from book begin end block section_5_d; end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc227.vhd
4
1817
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc227.vhd,v 1.2 2001-10-26 16:30:17 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s01b01x00p07n01i00227ent IS END c03s01b01x00p07n01i00227ent; ARCHITECTURE c03s01b01x00p07n01i00227arch OF c03s01b01x00p07n01i00227ent IS type ENUM1 is (FF, GG); type ENUM2 is (GG, HH); type ENUM3 is (FALSE); type ENUM4 is ('A', 'Z'); BEGIN TESTING: PROCESS BEGIN for X in FALSE to FALSE loop k := 5; end loop; assert NOT( k=5 ) report "***PASSED TEST: c03s01b01x00p07n01i00227" severity NOTE; assert ( k=5 ) report "***FAILED TEST: c03s01b01x00p07n01i00227 - Literal cannot be determined." severity ERROR; wait; END PROCESS TESTING; END c03s01b01x00p07n01i00227arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/analog-modeling/inline_14a.vhd
4
1381
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA library ieee_proposed; use ieee_proposed.electrical_systems.all; entity inline_14a is end entity inline_14a; architecture test of inline_14a is terminal p : electrical; quantity v across i through p; constant R : resistance := 10_000.0; type modeling_mode_type is (ideal, non_ideal); constant modeling_mode : modeling_mode_type := ideal; begin -- code from book if modeling_mode = ideal use v == i * R; else null; -- still need to include resistor with thermal effects! end use; -- end code from book end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2434.vhd
4
1977
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2434.vhd,v 1.2 2001-10-26 16:30:18 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s03b02x02p01n01i02434ent IS END c07s03b02x02p01n01i02434ent; ARCHITECTURE c07s03b02x02p01n01i02434arch OF c07s03b02x02p01n01i02434ent IS BEGIN TESTING: PROCESS type BIT_VECTOR is array (natural range <>, positive range <>) of BIT; variable NUM1 : BIT_VECTOR(0 to 1) := ( ('0', '0'), ('1', '1'), ('0', '1'), ('1', '1'), ('0', '1'), ('0', '1'), ('1', '0'), ('1', '0') ); BEGIN assert FALSE report "***FAILED TEST: c07s03b02x02p01n01i02434 - The elements of the aggregate of the one-dimensional array type do not specify values of the index type." severity ERROR; wait; END PROCESS TESTING; END c07s03b02x02p01n01i02434arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/clifton-labs/compliant/functional/signals/assign/simple-integer-assign.vhdl
4
325
entity test_bench is end test_bench; architecture only of test_bench is signal sig : integer := 0; begin -- only p: process begin -- process p sig <= 1; wait for 1 fs; assert sig = 1 report "TEST FAILED" severity FAILURE; report "TEST PASSED" severity NOTE; wait; end process p; end only;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc133.vhd
4
2169
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc133.vhd,v 1.2 2001-10-26 16:29:40 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c04s03b02x02p08n01i00133ent IS END c04s03b02x02p08n01i00133ent; ARCHITECTURE c04s03b02x02p08n01i00133arch OF c04s03b02x02p08n01i00133ent IS type RT1 is record a : INTEGER; b : INTEGER; end record; BEGIN TESTING: PROCESS procedure Proc1(P : inout RT1; ref : in RT1; set : in RT1) is begin if (P = ref) then P := set; end if; end; variable V : RT1 := (1, 2); BEGIN V := (1, 2); Proc1(P.a => V.b, P.b => V.a, ref => (2, 1), set => (2, 3)); -- test here assert V = (3, 2) report "FAIL: P didn't get set right"; assert NOT( V = (3,2) ) report "***PASSED TEST: c04s03b02x02p08n01i00133" severity NOTE; assert ( V = (3,2) ) report "***FAILED TEST: c04s03b02x02p08n01i00133 - Association element in an association list test failed." severity ERROR; wait; END PROCESS TESTING; END c04s03b02x02p08n01i00133arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2531.vhd
4
1767
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2531.vhd,v 1.2 2001-10-26 16:29:48 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s03b05x00p06n02i02531ent IS END c07s03b05x00p06n02i02531ent; ARCHITECTURE c07s03b05x00p06n02i02531arch OF c07s03b05x00p06n02i02531ent IS BEGIN TESTING: PROCESS variable k1 : integer := 5; variable k2 : real := 1.1; BEGIN k2 := real (k1); assert NOT( k2=5.0 ) report "***PASSED TEST: c07s03b05x00p06n02i02531" severity NOTE; assert ( k2=5.0 ) report "***FAILED TEST: c07s03b05x00p06n02i02531 - The type conversion from integer to real failed." severity ERROR; wait; END PROCESS TESTING; END c07s03b05x00p06n02i02531arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc474.vhd
4
12120
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc474.vhd,v 1.2 2001-10-26 16:29:55 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY model IS PORT ( F1: OUT integer := 3; F2: INOUT integer := 3; F3: IN integer ); END model; architecture model of model is begin process begin wait for 1 ns; assert F3= 3 report"wrong initialization of F3 through type conversion" severity failure; assert F2 = 3 report"wrong initialization of F2 through type conversion" severity failure; wait; end process; end; ENTITY c03s02b01x01p19n01i00474ent IS END c03s02b01x01p19n01i00474ent; ARCHITECTURE c03s02b01x01p19n01i00474arch OF c03s02b01x01p19n01i00474ent IS type boolean_vector is array (natural range <>) of boolean; type severity_level_vector is array (natural range <>) of severity_level; type integer_vector is array (natural range <>) of integer; type real_vector is array (natural range <>) of real; type time_vector is array (natural range <>) of time; type natural_vector is array (natural range <>) of natural; type positive_vector is array (natural range <>) of positive; type boolean_cons_vector is array (15 downto 0) of boolean; type severity_level_cons_vector is array (15 downto 0) of severity_level; type integer_cons_vector is array (15 downto 0) of integer; type real_cons_vector is array (15 downto 0) of real; type time_cons_vector is array (15 downto 0) of time; type natural_cons_vector is array (15 downto 0) of natural; type positive_cons_vector is array (15 downto 0) of positive; type column is range 1 to 2; type row is range 1 to 8; type s2boolean_cons_vector is array (row,column) of boolean; type s2bit_cons_vector is array (row,column) of bit; type s2char_cons_vector is array (row,column) of character; type s2severity_level_cons_vector is array (row,column) of severity_level; type s2integer_cons_vector is array (row,column) of integer; type s2real_cons_vector is array (row,column) of real; type s2time_cons_vector is array (row,column) of time; type s2natural_cons_vector is array (row,column) of natural; type s2positive_cons_vector is array (row,column) of positive; type s2boolean_vector is array (natural range <>,natural range <>) of boolean; type s2bit_vector is array (natural range<>,natural range <>) of bit; type s2char_vector is array (natural range<>,natural range <>) of character; type s2severity_level_vector is array (natural range <>,natural range <>) of severity_level; type s2integer_vector is array (natural range <>,natural range <>) of integer; type s2real_vector is array (natural range <>,natural range <>) of real; type s2time_vector is array (natural range <>,natural range <>) of time; type s2natural_vector is array (natural range <>,natural range <>) of natural; type s2positive_vector is array (natural range <>,natural range <>) of positive; type boolean_cons_vectorofvector is array (0 to 15) of boolean_cons_vector; type severity_level_cons_vectorofvector is array (0 to 15) of severity_level_cons_vector; type integer_cons_vectorofvector is array (0 to 15) of integer_cons_vector ; type real_cons_vectorofvector is array (0 to 15) of real_cons_vector; type time_cons_vectorofvector is array (0 to 15) of time_cons_vector; type natural_cons_vectorofvector is array (0 to 15) of natural_cons_vector; type positive_cons_vectorofvector is array (0 to 15) of positive_cons_vector; subtype boolean_vector_st is boolean_vector(0 to 15); subtype severity_level_vector_st is severity_level_vector(0 to 15); subtype integer_vector_st is integer_vector(0 to 15); subtype real_vector_st is real_vector(0 to 15); subtype time_vector_st is time_vector(0 to 15); subtype natural_vector_st is natural_vector(0 to 15); subtype positive_vector_st is positive_vector(0 to 15); type record_std_package is record a:boolean; b:bit; c:character; d:severity_level; e:integer; f:real; g:time; h:natural; i:positive; end record; type record_cons_array is record a:boolean_cons_vector; b:severity_level_cons_vector; c:integer_cons_vector; d:real_cons_vector; e:time_cons_vector; f:natural_cons_vector; g:positive_cons_vector; end record; type record_2cons_array is record a:s2boolean_cons_vector; b:s2bit_cons_vector; c:s2char_cons_vector; d:s2severity_level_cons_vector; e:s2integer_cons_vector; f:s2real_cons_vector; g:s2time_cons_vector; h:s2natural_cons_vector; i:s2positive_cons_vector; end record; type record_cons_arrayofarray is record a:boolean_cons_vectorofvector; b:severity_level_cons_vectorofvector; c:integer_cons_vectorofvector; d:real_cons_vectorofvector; e:time_cons_vectorofvector; f:natural_cons_vectorofvector; g:positive_cons_vectorofvector; end record; type record_array_st is record a:boolean_vector_st; b:severity_level_vector_st; c:integer_vector_st; d:real_vector_st; e:time_vector_st; f:natural_vector_st; g:positive_vector_st; end record; type record_of_records is record a: record_std_package; c: record_cons_array; e: record_2cons_array; g: record_cons_arrayofarray; i: record_array_st; end record; type array_rec_rec is array (integer range <>) of record_of_records; constant C1 : boolean := true; constant C2 : bit := '1'; constant C3 : character := 's'; constant C4 : severity_level := note; constant C5 : integer := 3; constant C6 : real := 3.0; constant C7 : time := 3 ns; constant C8 : natural := 1; constant C9 : positive := 1; constant C19 : boolean_cons_vector := (others => C1); constant C20 : severity_level_cons_vector := (others => C4); constant C21 : integer_cons_vector := (others => C5); constant C22 : real_cons_vector := (others => C6); constant C23 : time_cons_vector := (others => C7); constant C24 : natural_cons_vector := (others => C8); constant C25 : positive_cons_vector := (others => C9); constant C26 : boolean_cons_vectorofvector := (others => (others => C1)); constant C27 : severity_level_cons_vectorofvector := (others => (others => C4)); constant C28 : integer_cons_vectorofvector := (others => (others => C5)); constant C29 : real_cons_vectorofvector := (others => (others => C6)); constant C30 : time_cons_vectorofvector := (others => (others => C7)); constant C31 : natural_cons_vectorofvector := (others => (others => C8)); constant C32 : positive_cons_vectorofvector := (others => (others => C9)); constant C41 : s2boolean_cons_vector := (others => (others => C1)); constant C42 : s2bit_cons_vector := (others => (others => C2)); constant C43 : s2char_cons_vector := (others => (others => C3)); constant C44 : s2severity_level_cons_vector := (others => (others => C4)); constant C45 : s2integer_cons_vector := (others => (others => C5)); constant C46 : s2real_cons_vector := (others => (others => C6)); constant C47 : s2time_cons_vector := (others => (others => C7)); constant C48 : s2natural_cons_vector := (others => (others => C8)); constant C49 : s2positive_cons_vector := (others => (others => C9)); constant C50 : record_std_package := (C1,C2,C3,C4,C5,C6,C7,C8,C9); constant C51 : record_cons_array := (C19,C20,C21,C22,C23,C24,C25); constant C52 : record_2cons_array := (C41,C42,C43,C44,C45,C46,C47,C48,C49); constant C53 : record_cons_arrayofarray := (C26,C27,C28,C29,C30,C31,C32); constant C70 : boolean_vector_st := (others => C1); constant C71 : severity_level_vector_st := (others => C4); constant C72 : integer_vector_st := (others => C5); constant C73 : real_vector_st := (others => C6); constant C74 : time_vector_st := (others => C7); constant C75 : natural_vector_st := (others => C8); constant C76 : positive_vector_st := (others => C9); constant C77 : record_array_st := (C70,C71,C72,C73,C74,C75,C76); constant C55 : record_of_records := (C50,C51,C52,C53,C77); constant C66 : array_rec_rec(0 to 7) := (others => C55); function complex_scalar(s : array_rec_rec(0 to 7)) return integer is begin return 3; end complex_scalar; function scalar_complex(s : integer) return array_rec_rec is begin return C66; end scalar_complex; component model1 PORT ( F1: OUT integer; F2: INOUT integer; F3: IN integer ); end component; for T1 : model1 use entity work.model(model); signal S1 : array_rec_rec(0 to 7); signal S2 : array_rec_rec(0 to 7); signal S3 : array_rec_rec(0 to 7):= C66; BEGIN T1: model1 port map ( scalar_complex(F1) => S1, scalar_complex(F2) => complex_scalar(S2), F3 => complex_scalar(S3) ); TESTING: PROCESS BEGIN wait for 1 ns; assert NOT((S1 = C66) and (S2 = C66)) report "***PASSED TEST: c03s02b01x01p19n01i00474" severity NOTE; assert ((S1 = C66) and (S2 = C66)) report "***FAILED TEST: c03s02b01x01p19n01i00474 - For an interface object of mode out, buffer, inout, or linkage, if the formal part includes a type conversion function, then the parameter subtype of that function must be a constrained array subtype." severity ERROR; wait; END PROCESS TESTING; END c03s02b01x01p19n01i00474arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/ashenden/compliant/ch_03_ch_03_10.vhd
4
1789
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ch_03_ch_03_10.vhd,v 1.3 2001-10-26 16:29:33 paw Exp $ -- $Revision: 1.3 $ -- -- --------------------------------------------------------------------- entity ch_03_10 is end entity ch_03_10; architecture test of ch_03_10 is type opcode_type is (nop, add, subtract); signal opcode : opcode_type := nop; begin process_3_3_a : process (opcode) is variable Acc : integer := 0; constant operand : integer := 1; begin -- code from book: case opcode is when add => Acc := Acc + operand; when subtract => Acc := Acc - operand; when nop => null; end case; -- end of code from book end process process_3_3_a; stimulus : process is begin opcode <= add after 10 ns, subtract after 20 ns, nop after 30 ns; wait; end process stimulus; end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/ashenden/compliant/ch_05_ch_05_08.vhd
4
2027
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ch_05_ch_05_08.vhd,v 1.3 2001-10-26 16:29:33 paw Exp $ -- $Revision: 1.3 $ -- -- --------------------------------------------------------------------- entity ch_05_08 is end entity ch_05_08; library stimulus; architecture test of ch_05_08 is constant T_pd : delay_length := 5 ns; signal a, b : bit := '0'; signal test_inputs : bit_vector(1 to 2); use stimulus.stimulus_generators.all; begin block_05_3_f : block is signal sum, carry : bit; begin -- code from book: half_add : process is begin sum <= a xor b after T_pd; carry <= a and b after T_pd; wait on a, b; end process half_add; -- end of code from book end block block_05_3_f; block_05_3_g : block is signal sum, carry : bit; begin -- code from book: half_add : process (a, b) is begin sum <= a xor b after T_pd; carry <= a and b after T_pd; end process half_add; -- end of code from book end block block_05_3_g; stimulus_05_3_f_g : all_possible_values(test_inputs, 20 ns); (a, b) <= test_inputs; end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/ashenden/compliant/ch_07_fg_07_20.vhd
3
2194
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ch_07_fg_07_20.vhd,v 1.3 2001-10-26 16:29:34 paw Exp $ -- $Revision: 1.3 $ -- -- --------------------------------------------------------------------- -- code from book library ieee; use ieee.std_logic_1164.all; entity reg_ctrl is port ( reg_addr_decoded, rd, wr, io_en, cpu_clk : in std_ulogic; reg_rd, reg_wr : out std_ulogic ); end entity reg_ctrl; architecture bool_eqn of reg_ctrl is begin rd_ctrl : reg_rd <= reg_addr_decoded and rd and io_en; rw_ctrl : reg_wr <= reg_addr_decoded and wr and io_en and not cpu_clk; end architecture bool_eqn; -- end code from book entity fg_07_20 is end entity fg_07_20; library ieee; use ieee.std_logic_1164.all; library stimulus; architecture test of fg_07_20 is signal reg_addr_decoded, rd, wr, io_en, cpu_clk, reg_rd, reg_wr : std_ulogic := '0'; signal test_vector : std_ulogic_vector(1 to 5); use stimulus.stimulus_generators.all; begin dut : entity work.reg_ctrl port map ( reg_addr_decoded, rd, wr, io_en, cpu_clk, reg_rd, reg_wr ); stimulus_proc : process is begin all_possible_values( bv => test_vector, delay_between_values => 10 ns ); wait; end process stimulus_proc; (reg_addr_decoded, rd, wr, io_en, cpu_clk) <= test_vector; end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-low.vhdl
4
276
entity test is end test; architecture only of test is type small is range 1 to 3; begin -- only p: process begin -- process p assert small'low = 1 report "TEST FAILED T low" severity FAILURE; report "TEST PASSED T low" severity NOTE; wait; end process p; end only;
gpl-2.0
emogenet/ghdl
testsuite/gna/ticket74/bug.vhdl
3
250
entity ent is end entity; architecture a of ent is function fun(s : string) return integer is begin return 0; end; begin main : process begin assert fun(s(4 to 15) => "Hello world!") = 0; wait; end process; end architecture;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1369.vhd
4
6565
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1369.vhd,v 1.2 2001-10-26 16:29:40 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s05b00x00p03n01i01369ent IS END c08s05b00x00p03n01i01369ent; ARCHITECTURE c08s05b00x00p03n01i01369arch OF c08s05b00x00p03n01i01369ent IS BEGIN TESTING: PROCESS -- -- Define constants for package -- constant lowb : integer := 1 ; constant highb : integer := 5 ; constant lowb_i2 : integer := 0 ; constant highb_i2 : integer := 1000 ; constant lowb_p : integer := -100 ; constant highb_p : integer := 1000 ; constant lowb_r : real := 0.0 ; constant highb_r : real := 1000.0 ; constant lowb_r2 : real := 8.0 ; constant highb_r2 : real := 80.0 ; constant c_boolean_1 : boolean := false ; constant c_boolean_2 : boolean := true ; -- -- bit constant c_bit_1 : bit := '0' ; constant c_bit_2 : bit := '1' ; -- severity_level constant c_severity_level_1 : severity_level := NOTE ; constant c_severity_level_2 : severity_level := WARNING ; -- -- character constant c_character_1 : character := 'A' ; constant c_character_2 : character := 'a' ; -- integer types -- predefined constant c_integer_1 : integer := lowb ; constant c_integer_2 : integer := highb ; -- -- user defined integer type type t_int1 is range 0 to 100 ; constant c_t_int1_1 : t_int1 := 0 ; constant c_t_int1_2 : t_int1 := 10 ; subtype st_int1 is t_int1 range 8 to 60 ; constant c_st_int1_1 : st_int1 := 8 ; constant c_st_int1_2 : st_int1 := 9 ; -- -- physical types -- predefined constant c_time_1 : time := 1 ns ; constant c_time_2 : time := 2 ns ; -- -- -- floating point types -- predefined constant c_real_1 : real := 0.0 ; constant c_real_2 : real := 1.0 ; -- -- simple record type t_rec1 is record f1 : integer range lowb_i2 to highb_i2 ; f2 : time ; f3 : boolean ; f4 : real ; end record ; constant c_t_rec1_1 : t_rec1 := (c_integer_1, c_time_1, c_boolean_1, c_real_1) ; constant c_t_rec1_2 : t_rec1 := (c_integer_2, c_time_2, c_boolean_2, c_real_2) ; subtype st_rec1 is t_rec1 ; constant c_st_rec1_1 : st_rec1 := c_t_rec1_1 ; constant c_st_rec1_2 : st_rec1 := c_t_rec1_2 ; -- -- more complex record type t_rec2 is record f1 : boolean ; f2 : st_rec1 ; f3 : time ; end record ; constant c_t_rec2_1 : t_rec2 := (c_boolean_1, c_st_rec1_1, c_time_1) ; constant c_t_rec2_2 : t_rec2 := (c_boolean_2, c_st_rec1_2, c_time_2) ; subtype st_rec2 is t_rec2 ; constant c_st_rec2_1 : st_rec2 := c_t_rec2_1 ; constant c_st_rec2_2 : st_rec2 := c_t_rec2_2 ; -- -- simple array type t_arr1 is array (integer range <>) of st_int1 ; subtype t_arr1_range1 is integer range lowb to highb ; subtype st_arr1 is t_arr1 (t_arr1_range1) ; constant c_st_arr1_1 : st_arr1 := (others => c_st_int1_1) ; constant c_st_arr1_2 : st_arr1 := (others => c_st_int1_2) ; constant c_t_arr1_1 : st_arr1 := c_st_arr1_1 ; constant c_t_arr1_2 : st_arr1 := c_st_arr1_2 ; -- -- more complex array type t_arr2 is array (integer range <>, boolean range <>) of st_arr1 ; subtype t_arr2_range1 is integer range lowb to highb ; subtype t_arr2_range2 is boolean range false to true ; subtype st_arr2 is t_arr2 (t_arr2_range1, t_arr2_range2); constant c_st_arr2_1 : st_arr2 := (others => (others => c_st_arr1_1)) ; constant c_st_arr2_2 : st_arr2 := (others => (others => c_st_arr1_2)) ; constant c_t_arr2_1 : st_arr2 := c_st_arr2_1 ; constant c_t_arr2_2 : st_arr2 := c_st_arr2_2 ; -- -- most complex record type t_rec3 is record f1 : boolean ; f2 : st_rec2 ; f3 : st_arr2 ; end record ; constant c_t_rec3_1 : t_rec3 := (c_boolean_1, c_st_rec2_1, c_st_arr2_1) ; constant c_t_rec3_2 : t_rec3 := (c_boolean_2, c_st_rec2_2, c_st_arr2_2) ; subtype st_rec3 is t_rec3 ; constant c_st_rec3_1 : st_rec3 := c_t_rec3_1 ; constant c_st_rec3_2 : st_rec3 := c_t_rec3_2 ; -- -- most complex array type t_arr3 is array (integer range <>, boolean range <>) of st_rec3 ; subtype t_arr3_range1 is integer range lowb to highb ; subtype t_arr3_range2 is boolean range true downto false ; subtype st_arr3 is t_arr3 (t_arr3_range1, t_arr3_range2) ; constant c_st_arr3_1 : st_arr3 := (others => (others => c_st_rec3_1)) ; constant c_st_arr3_2 : st_arr3 := (others => (others => c_st_rec3_2)) ; constant c_t_arr3_1 : st_arr3 := c_st_arr3_1 ; constant c_t_arr3_2 : st_arr3 := c_st_arr3_2 ; -- variable v_st_arr2 : st_arr2 := c_st_arr2_1 ; -- BEGIN v_st_arr2(st_arr2'Left(1),st_arr2'Left(2)) := c_st_arr2_2(st_arr2'Right(1),st_arr2'Right(2)) ; assert NOT(v_st_arr2(st_arr2'Left(1),st_arr2'Left(2)) = c_st_arr1_2) report "***PASSED TEST: c08s05b00x00p03n01i01369" severity NOTE; assert (v_st_arr2(st_arr2'Left(1),st_arr2'Left(2)) = c_st_arr1_2) report "***FAILED TEST: c08s05b00x00p03n01i01369 - The types of the variable and the assigned variable must match." severity ERROR; wait; END PROCESS TESTING; END c08s05b00x00p03n01i01369arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/ashenden/compliant/ch_13_fg_13_01.vhd
4
3158
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ch_13_fg_13_01.vhd,v 1.2 2001-10-26 16:29:35 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- entity edge_triggered_Dff is generic ( Tprop, Tsetup, Thold : delay_length ); port ( clk : in bit; clr : in bit; d : in bit; q : out bit ); end entity edge_triggered_Dff; architecture basic of edge_triggered_Dff is begin state_change : process (clk, clr) is begin if clr = '1' then q <= '0' after Tprop; elsif clk'event and clk = '1' then q <= d after Tprop; end if; end process state_change; end architecture basic; architecture hi_fanout of edge_triggered_Dff is begin state_change : process (clk, clr) is begin if clr = '1' then q <= '0' after Tprop; elsif clk'event and clk = '1' then q <= d after Tprop; end if; end process state_change; end architecture hi_fanout; -- code from book entity reg4 is port ( clk, clr : in bit; d : in bit_vector(0 to 3); q : out bit_vector(0 to 3) ); end entity reg4; -------------------------------------------------- architecture struct of reg4 is component flipflop is generic ( Tprop, Tsetup, Thold : delay_length ); port ( clk : in bit; clr : in bit; d : in bit; q : out bit ); end component flipflop; begin bit0 : component flipflop generic map ( Tprop => 2 ns, Tsetup => 2 ns, Thold => 1 ns ) port map ( clk => clk, clr => clr, d => d(0), q => q(0) ); bit1 : component flipflop generic map ( Tprop => 2 ns, Tsetup => 2 ns, Thold => 1 ns ) port map ( clk => clk, clr => clr, d => d(1), q => q(1) ); bit2 : component flipflop generic map ( Tprop => 2 ns, Tsetup => 2 ns, Thold => 1 ns ) port map ( clk => clk, clr => clr, d => d(2), q => q(2) ); bit3 : component flipflop generic map ( Tprop => 2 ns, Tsetup => 2 ns, Thold => 1 ns ) port map ( clk => clk, clr => clr, d => d(3), q => q(3) ); end architecture struct; -- end code from book configuration fg_13_01 of reg4 is for struct -- code from book (in text) for bit0, bit1 : flipflop use entity work.edge_triggered_Dff(basic); end for; -- end code from book end for; end configuration fg_13_01;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/ashenden/compliant/ch_10_chkdiv.vhd
4
2270
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ch_10_chkdiv.vhd,v 1.3 2001-10-26 16:29:35 paw Exp $ -- $Revision: 1.3 $ -- -- --------------------------------------------------------------------- entity check_div is end entity check_div; library bv_utilities; use bv_utilities.bv_arithmetic.all; architecture behav of check_div is begin checker : process is variable bv_a, bv_b, bv_quotient, bv_remainder : bit_vector(3 downto 0); variable div_by_zero : boolean; begin for a in 0 to 15 loop for b in 0 to 15 loop bv_a := natural_to_bv(a, bv_a'length); bv_b := natural_to_bv(b, bv_b'length); bv_divu(bv_a, bv_b, bv_quotient, bv_remainder, div_by_zero); if b = 0 then assert div_by_zero report integer'image(a) & '/' & integer'image(b) & ": div_by_zero not true"; else assert not div_by_zero report integer'image(a) & '/' & integer'image(b) & ": div_by_zero not false"; assert bv_to_natural(bv_quotient) = a / b report integer'image(a) & '/' & integer'image(b) & ": quotient = " & integer'image(bv_to_natural(bv_quotient)); assert bv_to_natural(bv_remainder) = a rem b report integer'image(a) & '/' & integer'image(b) & ": remainder = " & integer'image(bv_to_natural(bv_remainder)); end if; end loop; end loop; wait; end process checker; end architecture behav;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc3017.vhd
4
2047
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3017.vhd,v 1.2 2001-10-26 16:30:24 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- library lib01; use lib01.c11s02b00x00p05n03i03017pkg.all; ENTITY c11s02b00x00p05n03i03017ent IS assert my_bool report "Library clause preceeding entity is valid in entity scope." severity note; END c11s02b00x00p05n03i03017ent; use lib01.c11s02b00x00p05n03i03017pkg.all; -- lib01 unknown Failed_here ENTITY c11s02b00x00p05n03i03017ent IS assert my_bool report "Library clause is valid outside entity scope - test fails." severity note ; END c11s02b00x00p05n03i03017ent; ARCHITECTURE c11s02b00x00p05n03i03017arch OF c11s02b00x00p05n03i03017ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c11s02b00x00p05n03i03017 - Library clause only extends to the end of the declatative region associated with the design unit" severity ERROR; wait; END PROCESS TESTING; END c11s02b00x00p05n03i03017arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1573.vhd
4
1820
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1573.vhd,v 1.2 2001-10-26 16:29:42 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s10b00x00p04n01i01573ent IS END c08s10b00x00p04n01i01573ent; ARCHITECTURE c08s10b00x00p04n01i01573arch OF c08s10b00x00p04n01i01573ent IS BEGIN TESTING: PROCESS variable k : integer := 0; BEGIN for i in 1 to 10 loop next when i > 5; k := k + 1; end loop; assert NOT( k=5 ) report "***PASSED TEST: c08s10b00x00p04n01i01573" severity NOTE; assert ( k=5 ) report "***FAILED TEST: c08s10b00x00p04n01i01573 - The current iteration of the loop is terminated if the value of the condition is TRUE" severity ERROR; wait; END PROCESS TESTING; END c08s10b00x00p04n01i01573arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-leftof.vhdl
4
432
entity test is end test; architecture only of test is type small is range 1 to 3; begin -- only p: process begin -- process p assert small'leftof(2) = 1 report "TEST FAILED. leftof 2 = 1" severity FAILURE; report "TEST PASSED leftof 2 = 1" severity NOTE; assert small'leftof(3) = 2 report "TEST FAILED. leftof 3 = 2" severity FAILURE; report "TEST PASSED leftof 3 = 2" severity NOTE; wait; end process p; end only;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS1_Mixed_Sig/switch_dig_2in.vhd
4
2582
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA library ieee; use ieee.std_logic_1164.all; library ieee_proposed; use ieee_proposed.electrical_systems.all; entity switch_dig_2in is port ( sw_state : in std_ulogic; -- Digital control input terminal p_in1, p_in2, p_out : electrical ); -- Analog output end entity switch_dig_2in; ---------------------------------------------------------------- architecture ideal of switch_dig_2in is constant r_open : resistance := 1.0e6; -- Open switch resistance constant r_closed : resistance := 0.001; -- Closed switch resistance constant trans_time : real := 0.00001; -- Transition time to each position signal r_sig1 : resistance := r_closed; -- Closed switch resistance variable signal r_sig2 : resistance := r_open; -- Open switch resistance variable quantity v1 across i1 through p_in1 to p_out; -- V & I for in1 to out quantity v2 across i2 through p_in2 to p_out; -- V & I for in2 to out quantity r1 : resistance; -- Time-varying resistance for in1 to out quantity r2 : resistance; -- Time-varying resistance for in2 to out begin process (sw_state) is -- Sensitivity to digital control input begin if sw_state = '0' or sw_state = 'L' then -- Close sig1, open sig2 r_sig1 <= r_closed; r_sig2 <= r_open; elsif sw_state = '1' or sw_state = 'H' then -- Open sig1, close sig2 r_sig1 <= r_open; r_sig2 <= r_closed; end if; end process; r1 == r_sig1'ramp(trans_time, trans_time); -- Ensure resistance continuity r2 == r_sig2'ramp(trans_time, trans_time); -- Ensure resistance continuity v1 == r1 * i1; -- Apply Ohm's law to in1 v2 == r2 * i2; -- Apply Ohm's law to in2 end architecture ideal;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/ashenden/non_compliant/ch_04_ch_04_09.vhd
4
2329
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ch_04_ch_04_09.vhd,v 1.2 2001-10-26 16:29:37 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- entity ch_04_09 is end entity ch_04_09; ---------------------------------------------------------------- architecture test of ch_04_09 is begin process_04_3_c : process is -- code from book: subtype name is string(1 to 20); type display_string is array (integer range 0 to 19) of character; variable item_name : name; variable display : display_string; -- subtype big_endian_upper_halfword is bit_vector(0 to 15); subtype little_endian_upper_halfword is bit_vector(31 downto 16); variable big : big_endian_upper_halfword; variable little : little_endian_upper_halfword; -- end of code from book begin -- error: Incompatible types for assignment -- display := item_name; -- ilegal item_name := (others => 'A'); little := x"AAAA"; -- code from book: display := display_string(item_name); -- big := little; little := big; -- end of code from book wait; end process process_04_3_c; ---------------- end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/gna/perf02/compressed.vhd
3
1406
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity compressed is port ( clk : in std_logic; ra0_data : out std_logic_vector(31 downto 0); wa0_addr : in std_logic_vector(6 downto 0); wa0_en : in std_logic; ra0_addr : in std_logic_vector(6 downto 0); wa0_data : in std_logic_vector(31 downto 0) ); end compressed; architecture augh of compressed is -- Embedded RAM type ram_type is array (0 to 127) of std_logic_vector(31 downto 0); signal ram : ram_type := (others => (others => '0')); -- Little utility functions to make VHDL syntactically correct -- with the syntax to_integer(unsigned(vector)) when 'vector' is a std_logic. -- This happens when accessing arrays with <= 2 cells, for example. function to_integer(B: std_logic) return integer is variable V: std_logic_vector(0 to 0); begin V(0) := B; return to_integer(unsigned(V)); end; function to_integer(V: std_logic_vector) return integer is begin return to_integer(unsigned(V)); end; begin -- Sequential process -- It handles the Writes process (clk) begin if rising_edge(clk) then -- Write to the RAM -- Note: there should be only one port. if wa0_en = '1' then ram( to_integer(wa0_addr) ) <= wa0_data; end if; end if; end process; -- The Read side (the outputs) ra0_data <= ram( to_integer(ra0_addr) ); end architecture;
gpl-2.0
emogenet/ghdl
testsuite/gna/issue50/idct.d/sub_593.vhd
2
800
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity sub_593 is port ( result : out std_logic_vector(31 downto 0); in_a : in std_logic_vector(31 downto 0); in_b : in std_logic_vector(31 downto 0) ); end sub_593; architecture augh of sub_593 is signal carry_inA : std_logic_vector(33 downto 0); signal carry_inB : std_logic_vector(33 downto 0); signal carry_res : std_logic_vector(33 downto 0); begin -- To handle the CI input, the operation is '0' - CI -- If CI is not present, the operation is '0' - '0' carry_inA <= '0' & in_a & '0'; carry_inB <= '0' & in_b & '0'; -- Compute the result carry_res <= std_logic_vector(unsigned(carry_inA) - unsigned(carry_inB)); -- Set the outputs result <= carry_res(32 downto 1); end architecture;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2783.vhd
4
1774
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2783.vhd,v 1.2 2001-10-26 16:30:22 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- entity BLOCK is end BLOCK; ENTITY c13s09b00x00p99n01i02783ent IS END c13s09b00x00p99n01i02783ent; ARCHITECTURE c13s09b00x00p99n01i02783arch OF c13s09b00x00p99n01i02783ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c13s09b00x00p99n01i02783 - Reserved word BLOCK can not be used as an entity name." severity ERROR; wait; END PROCESS TESTING; END c13s09b00x00p99n01i02783arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/ashenden/compliant/ch_17_ch_17_04.vhd
4
1878
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ch_17_ch_17_04.vhd,v 1.2 2001-10-26 16:29:36 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- entity ch_17_04 is end entity ch_17_04; ---------------------------------------------------------------- architecture test of ch_17_04 is begin process is -- code from book: type stimulus_record is record stimulus_time : time; stimulus_value : bit_vector(0 to 3); end record stimulus_record; type stimulus_ptr is access stimulus_record; variable bus_stimulus : stimulus_ptr; -- end of code from book begin bus_stimulus := new stimulus_record; bus_stimulus.all := stimulus_record'(20 ns, B"0011"); report time'image(bus_stimulus.all.stimulus_time); report time'image(bus_stimulus.stimulus_time); wait; end process; end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc430.vhd
4
3212
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc430.vhd,v 1.2 2001-10-26 16:29:54 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY model IS PORT ( F1: OUT integer := 3; F2: INOUT integer := 3; F3: IN integer ); END model; architecture model of model is begin process begin wait for 1 ns; assert F3= 3 report"wrong initialization of F3 through type conversion" severity failure; assert F2 = 3 report"wrong initialization of F2 through type conversion" severity failure; wait; end process; end; ENTITY c03s02b01x01p19n01i00430ent IS END c03s02b01x01p19n01i00430ent; ARCHITECTURE c03s02b01x01p19n01i00430arch OF c03s02b01x01p19n01i00430ent IS type column is range 1 to 2; type row is range 1 to 8; type s2bit_cons_vector is array (row,column) of bit; constant C1 : s2bit_cons_vector := (others => (others => '1')); function complex_scalar(s : s2bit_cons_vector) return integer is begin return 3; end complex_scalar; function scalar_complex(s : integer) return s2bit_cons_vector is begin return C1; end scalar_complex; component model1 PORT ( F1: OUT integer; F2: INOUT integer; F3: IN integer ); end component; for T1 : model1 use entity work.model(model); signal S1 : s2bit_cons_vector; signal S2 : s2bit_cons_vector; signal S3 : s2bit_cons_vector := C1; BEGIN T1: model1 port map ( scalar_complex(F1) => S1, scalar_complex(F2) => complex_scalar(S2), F3 => complex_scalar(S3) ); TESTING: PROCESS BEGIN wait for 1 ns; assert NOT((S1 = C1) and (S2 = C1)) report "***PASSED TEST: c03s02b01x01p19n01i00430" severity NOTE; assert ((S1 = C1) and (S2 = C1)) report "***FAILED TEST: c03s02b01x01p19n01i00430 - For an interface object of mode out, buffer, inout, or linkage, if the formal part includes a type conversion function, then the parameter subtype of that function must be a constrained array subtype." severity ERROR; wait; END PROCESS TESTING; END c03s02b01x01p19n01i00430arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1280.vhd
4
1684
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1280.vhd,v 1.2 2001-10-26 16:30:08 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s04b00x00p04n01i01280ent IS END c08s04b00x00p04n01i01280ent; ARCHITECTURE c08s04b00x00p04n01i01280arch OF c08s04b00x00p04n01i01280ent IS type ENUM_1 is (ONE,TWO,THREE); signal S1 : integer ; BEGIN TESTING: PROCESS BEGIN TWO - ONE <= S1; assert FALSE report "***FAILED TEST: c08s04b00x00p04n01i01280 - Literal expressions are not allowed on the left-hand side of a signal assignment." severity ERROR; wait; END PROCESS TESTING; END c08s04b00x00p04n01i01280arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc6.vhd
4
1822
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc6.vhd,v 1.2 2001-10-26 16:30:26 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c04s01b00x00p08n01i00006ent IS END c04s01b00x00p08n01i00006ent; ARCHITECTURE c04s01b00x00p08n01i00006arch OF c04s01b00x00p08n01i00006ent IS BEGIN TESTING: PROCESS type REAL1 is range 1.0 to 1.0; type REAL2 is range 1.0 to 1.0; variable V3: REAL1; variable V4: REAL2; BEGIN if V3 = V4 then -- Failure_here -- ERROR - SEMANTIC ERROR: OPERANDS OF = INCOMPATIBLE IN TYPE null ; end if; assert FALSE report "***FAILED TEST:c04s01b00x00p08n01i00006 - Types are different and hence incompatible." severity ERROR; wait; END PROCESS TESTING; END c04s01b00x00p08n01i00006arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2765.vhd
4
1815
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2765.vhd,v 1.2 2001-10-26 16:29:49 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s07b00x00p06n02i02765ent IS END c13s07b00x00p06n02i02765ent; ARCHITECTURE c13s07b00x00p06n02i02765arch OF c13s07b00x00p06n02i02765ent IS BEGIN TESTING: PROCESS constant clear : bit_vector := O"123_67_34"; -- no_failure_here BEGIN assert NOT(clear = O"123_67_34") report "***PASSED TEST: c13s07b00x00p06n02i02765" severity NOTE; assert (clear = O"123_67_34") report "***FAILED TEST: c13s07b00x00p06n02i02765 - For the base specifier `O', the extended digits are restricted to the digits 0 through 7." severity ERROR; wait; END PROCESS TESTING; END c13s07b00x00p06n02i02765arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc419.vhd
4
3125
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc419.vhd,v 1.2 2001-10-26 16:29:54 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY model IS PORT ( F1: OUT integer := 3; F2: INOUT integer := 3; F3: IN integer ); END model; architecture model of model is begin process begin wait for 1 ns; assert F3= 3 report"wrong initialization of F3 through type conversion" severity failure; assert F2 = 3 report"wrong initialization of F2 through type conversion" severity failure; wait; end process; end; ENTITY c03s02b01x01p19n01i00419ent IS END c03s02b01x01p19n01i00419ent; ARCHITECTURE c03s02b01x01p19n01i00419arch OF c03s02b01x01p19n01i00419ent IS type time_cons_vector is array (15 downto 0) of time; constant C1 : time_cons_vector := (others => 3 ns); function complex_scalar(s : time_cons_vector) return integer is begin return 3; end complex_scalar; function scalar_complex(s : integer) return time_cons_vector is begin return C1; end scalar_complex; component model1 PORT ( F1: OUT integer; F2: INOUT integer; F3: IN integer ); end component; for T1 : model1 use entity work.model(model); signal S1 : time_cons_vector; signal S2 : time_cons_vector; signal S3 : time_cons_vector := C1; BEGIN T1: model1 port map ( scalar_complex(F1) => S1, scalar_complex(F2) => complex_scalar(S2), F3 => complex_scalar(S3) ); TESTING: PROCESS BEGIN wait for 1 ns; assert NOT((S1 = C1) and (S2 = C1)) report "***PASSED TEST: c03s02b01x01p19n01i00419" severity NOTE; assert ((S1 = C1) and (S2 = C1)) report "***FAILED TEST: c03s02b01x01p19n01i00419 - For an interface object of mode out, buffer, inout, or linkage, if the formal part includes a type conversion function, then the parameter subtype of that function must be a constrained array subtype." severity ERROR; wait; END PROCESS TESTING; END c03s02b01x01p19n01i00419arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc146.vhd
4
2366
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc146.vhd,v 1.2 2001-10-26 16:29:41 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c04s03b02x02p12n01i00146pkg is procedure P1 (a : in integer; b: out integer); function F1 (I : in integer) return real; end c04s03b02x02p12n01i00146pkg; package body c04s03b02x02p12n01i00146pkg is procedure P1 (a: in integer; b: out integer) is begin b := a; end; function F1 (I: in integer) return real is variable y : real := 1.0; begin return (y * 10.0); end; end c04s03b02x02p12n01i00146pkg; use work.c04s03b02x02p12n01i00146pkg.all; ENTITY c04s03b02x02p12n01i00146ent IS END c04s03b02x02p12n01i00146ent; ARCHITECTURE c04s03b02x02p12n01i00146arch OF c04s03b02x02p12n01i00146ent IS BEGIN TESTING: PROCESS variable x : real := 1.0; variable y : real ; BEGIN P1 (10, F1(b) => x ); -- no_failure_here -- b and x have the same type. y := x; assert NOT(y=10.0) report "***PASSED TEST: c04s03b02x02p12n01i00146" severity NOTE; assert (y=10.0) report "***FAILED TEST: c04s03b02x02p12n01i00146 - Element of an association list has a function act on it within the association list test failed." severity ERROR; wait; END PROCESS TESTING; END c04s03b02x02p12n01i00146arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1790.vhd
4
1792
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1790.vhd,v 1.2 2001-10-26 16:30:12 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c09s07b00x00p02n01i01790ent IS END c09s07b00x00p02n01i01790ent; ARCHITECTURE c09s07b00x00p02n01i01790arch OF c09s07b00x00p02n01i01790ent IS signal TS,SS: bit_vector(1 to 3); BEGIN GEN: for I in 1 to 3 generate TS(I) <= SS(I); end generate -- Failure_here -- Semicolon missing before 'end' TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c09s07b00x00p02n01i01790 - In the generate statement, the reserved word end generate must be followed by a semicolon." severity ERROR; wait; END PROCESS TESTING; END c09s07b00x00p02n01i01790arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc3002.vhd
4
1774
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3002.vhd,v 1.2 2001-10-26 16:30:24 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c02s06b00x00p05n02i03002pkg is end c02s06b00x00p05n02i03002pkg; package body c02s06b00x00p05n02i03002pkg is end c02s06b00x00p05n02i03002; --Failure here ENTITY c02s06b00x00p05n02i03002ent IS END c02s06b00x00p05n02i03002ent; ARCHITECTURE c02s06b00x00p05n02i03002arch OF c02s06b00x00p05n02i03002ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c02s06b00x00p05n02i03002- The simple name at the end of a package body must be the same as the package identifier." severity ERROR; wait; END PROCESS TESTING; END c02s06b00x00p05n02i03002arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2569.vhd
4
1728
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2569.vhd,v 1.2 2001-10-26 16:29:48 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s05b00x00p16n02i02569ent IS END c07s05b00x00p16n02i02569ent; ARCHITECTURE c07s05b00x00p16n02i02569arch OF c07s05b00x00p16n02i02569ent IS BEGIN TESTING: PROCESS BEGIN assert NOT(2E6 = (2E3*1E3)) report "***PASSED TEST: c07s05b00x00p16n02i02569" severity NOTE; assert ( 2E6 = (2E3*1E3) ) report "***FAILED TEST: c07s05b00x00p16n02i02569 - The values of the operands and the result lie within the range of the integer type." severity ERROR; wait; END PROCESS TESTING; END c07s05b00x00p16n02i02569arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2724.vhd
4
4657
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2724.vhd,v 1.2 2001-10-26 16:29:49 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s04b02x00p06n04i02724ent IS END c13s04b02x00p06n04i02724ent; ARCHITECTURE c13s04b02x00p06n04i02724arch OF c13s04b02x00p06n04i02724ent IS constant a1 :integer:=16#A#; constant b1 :integer:=16#a#; constant a2 :integer:=16#B#; constant b2 :integer:=16#b#; constant a3 :integer:=16#C#; constant b3 :integer:=16#c#; constant a4 :integer:=16#D#; constant b4 :integer:=16#d#; constant a5 :integer:=16#E#; constant b5 :integer:=16#e#; constant a6 :integer:=16#F#; constant b6 :integer:=16#f#; constant a7 :real:=16#A.A#; constant b7 :real:=16#a.a#; constant a8 :real:=16#B.B#; constant b8 :real:=16#b.b#; constant a9 :real:=16#C.C#; constant b9 :real:=16#c.c#; constant a10 :real:=16#D.D#; constant b10 :real:=16#d.d#; constant a11 :real:=16#E.E#; constant b11 :real:=16#e.e#; constant a12 :real:=16#F.F#; constant b12 :real:=16#f.f#; BEGIN TESTING: PROCESS BEGIN assert (a1=b1) report "A & a not the same for an extended digit in an integer based literal" severity failure; assert (a2=b2) report "B & b not the same for an extended digit in an integer based literal" severity failure; assert (a3=b3) report "C & c not the same for an extended digit in an integer based literal" severity failure; assert (a4=b4) report "D & d not the same for an extended digit in an integer based literal" severity failure; assert (a5=b5) report "E & e not the same for an extended digit in an integer based literal" severity failure; assert (a6=b6) report "F & f not the same for an extended digit in an integer based literal" severity failure; assert (a7=b7) report "A & a not the same for an extended digit in a real based literal" severity failure; assert (a8=b8) report "B & b not the same for an extended digit in a real based literal" severity failure; assert (a9=b9) report "C & c not the same for an extended digit in a real based literal" severity failure; assert (a10=b10) report "D & d not the same for an extended digit in a real based literal" severity failure; assert (a11=b11) report "E & e not the same for an extended digit in a real based literal" severity failure; assert (a12=b12) report "F & f not the same for an extended digit in a real based literal" severity failure; assert NOT( a1 = b1 and a2 = b2 and a3 = b3 and a4 = b4 and a5 = b5 and a6 = b6 and a7 = b7 and a8 = b8 and a9 = b9 and a10 = b10 and a11 = b11 and a12 = b12 ) report "***PASSED TEST: c13s04b02x00p06n04i02724" severity NOTE; assert ( a1 = b1 and a2 = b2 and a3 = b3 and a4 = b4 and a5 = b5 and a6 = b6 and a7 = b7 and a8 = b8 and a9 = b9 and a10 = b10 and a11 = b11 and a12 = b12 ) report "***FAILED TEST: c13s04b02x00p06n04i02724 - Upper and lower case should be allowed for a letter in integer and real based literal with the came meaning." severity ERROR; wait; END PROCESS TESTING; END c13s04b02x00p06n04i02724arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1183.vhd
4
1681
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1183.vhd,v 1.2 2001-10-26 16:29:39 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s01b00x00p02n01i01183ent IS END c08s01b00x00p02n01i01183ent; ARCHITECTURE c08s01b00x00p02n01i01183arch OF c08s01b00x00p02n01i01183ent IS BEGIN TESTING: PROCESS variable k : integer := 0; BEGIN assert FALSE report "***PASSED TEST: c08s01b00x00p02n01i01183" severity NOTE; wait; assert FALSE report "***FAILED TEST: c08s01b00x00p02n01i01183 - A wait statement with no argument" severity ERROR; END PROCESS TESTING; END c08s01b00x00p02n01i01183arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/disputed/tc1021.vhd
4
1959
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1021.vhd,v 1.2 2001-10-26 16:30:03 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s03b00x00p10n01i01021ent IS END c06s03b00x00p10n01i01021ent; ARCHITECTURE c06s03b00x00p10n01i01021arch OF c06s03b00x00p10n01i01021ent IS BEGIN B1:Block signal s1 : BIT; begin TESTING: PROCESS BEGIN wait for 1 ns; END PROCESS TESTING; B2:Block signal s2 : BIT; begin TEST : PROCESS BEGIN s2 <= B1.s1; wait for 2 ns; assert NOT(s2='0') report "***PASSED TEST: c06s03b00x00p10n01i01021" severity NOTE; assert (s2='0') report "***FAILED TEST: c06s03b00x00p10n01i01021 - Entity declaration does not occur in construct specifed by the prefix." severity ERROR; END PROCESS TEST; end block B2; end block B1; END c06s03b00x00p10n01i01021arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/clifton-labs/compliant/functional/attributes/type/simple-integer-test-image.vhdl
4
533
entity test is end test; architecture only of test is type small is range 1 to 3; begin -- only p: process begin -- process p assert small'image(1) = "1" report "TEST FAILED image 1" severity FAILURE; report "TEST PASSED image 1" severity NOTE; assert small'image(2) = "2" report "TEST FAILED image 2" severity FAILURE; report "TEST PASSED image 2" severity NOTE; assert small'image(3) = "3" report "TEST FAILED image 3" severity FAILURE; report "TEST PASSED image 3" severity NOTE; wait; end process p; end only;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1828.vhd
4
1892
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1828.vhd,v 1.2 2001-10-26 16:30:13 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s01b00x00p08n01i01828ent IS type small_int is range 0 to 7; END c07s01b00x00p08n01i01828ent; ARCHITECTURE c07s01b00x00p08n01i01828arch OF c07s01b00x00p08n01i01828ent IS signal sm_int : small_int := 0; BEGIN B: block ( sm_int = c07s01b00x00p08n01i01828ent ) -- entity name illegal here begin assert false report "Entity name accepted in block guard expression." severity note ; end block B; TESTING : PROCESS BEGIN wait for 5 ns; assert FALSE report "***FAILED TEST: c07s01b00x00p08n01i01828 - Entity name are not permitted as primaries in a block guard expression." severity ERROR; wait; END PROCESS TESTING; END c07s01b00x00p08n01i01828arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc28.vhd
4
1848
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc28.vhd,v 1.2 2001-10-26 16:30:22 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c04s02b00x00p11n01i00028ent IS END c04s02b00x00p11n01i00028ent; ARCHITECTURE c04s02b00x00p11n01i00028arch OF c04s02b00x00p11n01i00028ent IS type MVL is ('0', '1', 'Z') ; type MVL_VEC is array (positive range <>) of MVL; function tristate (X:MVL_VEC) return MVL is begin return '1'; end tristate ; type T1 is access MVL ; subtype ST1 is tristate T1; -- Failure_here BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c04s02b00x00p11n01i00028- Subtype indication denoting an access type can not contain a resolution function." severity ERROR; wait; END PROCESS TESTING; END c04s02b00x00p11n01i00028arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/clifton-labs/compliant/functional/aliases/objects/simple-string-alias.vhdl
4
358
entity test is end test; architecture only of test is begin -- only only: process variable string_variable : string(1 to 5) := "Hello"; alias string_alias : string(1 to 5) is string_variable; begin -- process assert string_alias = "Hello" report "TEST FAILED" severity FAILURE; report "TEST PASSED"; wait; end process; end only;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2649.vhd
4
1590
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2649.vhd,v 1.2 2001-10-26 16:30:21 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s03b01x00p02n01i02649ent IS END c13s03b01x00p02n01i02649ent; ARCHITECTURE c13s03b01x00p02n01i02649arch OF c13s03b01x00p02n01i02649ent IS BEGIN TESTING: PROCESS variable )k : integer; BEGIN assert FALSE report "***FAILED TEST: c13s03b01x00p02n01i02649 - Identifier can only begin with a letter." severity ERROR; wait; END PROCESS TESTING; END c13s03b01x00p02n01i02649arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc912.vhd
4
1864
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc912.vhd,v 1.2 2001-10-26 16:30:02 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c10s03b00x00p07n01i00912pkg is constant x : integer := 2; end c10s03b00x00p07n01i00912pkg; ENTITY c10s03b00x00p07n01i00912ent IS END c10s03b00x00p07n01i00912ent; ARCHITECTURE c10s03b00x00p07n01i00912arch OF c10s03b00x00p07n01i00912ent IS -- selected use of package element use work.c10s03b00x00p07n01i00912pkg.x; BEGIN TESTING: PROCESS BEGIN assert NOT( x=2 ) report "***PASSED TEST: c10s03b00x00p07n01i00912" severity NOTE; assert ( x=2 ) report "***FAILED TEST: c10s03b00x00p07n01i00912 - A primary unit of a library can be made visible by selection." severity ERROR; wait; END PROCESS TESTING; END c10s03b00x00p07n01i00912arch;
gpl-2.0
emogenet/ghdl
testsuite/gna/bug040/cmp_975.vhd
2
383
library ieee; use ieee.std_logic_1164.all; entity cmp_975 is port ( ne : out std_logic; in1 : in std_logic_vector(31 downto 0); in0 : in std_logic_vector(31 downto 0) ); end cmp_975; architecture augh of cmp_975 is signal tmp : std_logic; begin -- Compute the result tmp <= '0' when in1 /= in0 else '1'; -- Set the outputs ne <= not(tmp); end architecture;
gpl-2.0
emogenet/ghdl
testsuite/gna/issue238/call5.vhdl
2
398
entity call5 is end; use work.pkg.all; architecture behav of call5 is procedure p2 (s : string) is begin report natural'image (s'left); report natural'image (s'right); assert s'left = 1; assert s'right = 4; end; procedure p1 (r : rec) is begin p2 (r.s); end p1; begin process variable v : rec_4dyn; begin p1 (v); wait; end process; end behav;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1036.vhd
4
1665
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1036.vhd,v 1.2 2001-10-26 16:30:05 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s04b00x00p02n01i01036ent IS END c06s04b00x00p02n01i01036ent; ARCHITECTURE c06s04b00x00p02n01i01036arch OF c06s04b00x00p02n01i01036ent IS BEGIN TESTING: PROCESS type T2 is array (0 to 31) of BIT; variable V1 : T2 ; BEGIN V1(2 := '1' ; -- Failure_here assert FALSE report "***FAILED TEST: c06s04b00x00p02n01i01036 - Missing parentheses." severity ERROR; wait; END PROCESS TESTING; END c06s04b00x00p02n01i01036arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc389.vhd
4
1642
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc389.vhd,v 1.2 2001-10-26 16:30:26 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s02b01x01p04n03i00389ent IS END c03s02b01x01p04n03i00389ent; ARCHITECTURE c03s02b01x01p04n03i00389arch OF c03s02b01x01p04n03i00389ent IS type M1 is array (0 to 1, 0 to 2) of bit; BEGIN TESTING: PROCESS variable M2 : M1 := (('1','0'),('1','0','1')); BEGIN assert FALSE report "***FAILED TEST: c03s02b01x01p04n03i00389 - Different index ranges" severity ERROR; wait; END PROCESS TESTING; END c03s02b01x01p04n03i00389arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/access-types/inline_03.vhd
4
1789
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA entity inline_03 is end entity inline_03; ---------------------------------------------------------------- architecture test of inline_03 is begin process is type natural_ptr is access natural; -- code from book: variable count1, count2 : natural_ptr; -- end of code from book begin -- code from book: count1 := new natural'(5); count2 := new natural'(10); count2 := count1; count1.all := 20; -- end of code from book assert -- code from book: count1 = count2 -- end of code from book ; -- code from book: count1 := new natural'(30); count2 := new natural'(30); -- end of code from book assert count1 = count2; assert -- code from book: count1.all = count2.all -- end of code from book ; -- code from book: if count1 /= null then count1.all := count1.all + 1; end if; -- end of code from book wait; end process; end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/gna/bug050/tarith.vhdl
2
66
library ieee; use ieee.std_logic_arith.all; entity tb is end tb;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2665.vhd
4
1590
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2665.vhd,v 1.2 2001-10-26 16:30:21 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s03b01x00p02n01i02665ent IS END c13s03b01x00p02n01i02665ent; ARCHITECTURE c13s03b01x00p02n01i02665arch OF c13s03b01x00p02n01i02665ent IS BEGIN TESTING: PROCESS variable @k : integer; BEGIN assert FALSE report "***FAILED TEST: c13s03b01x00p02n01i02665 - Identifier can only begin with a letter." severity ERROR; wait; END PROCESS TESTING; END c13s03b01x00p02n01i02665arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/integer-types/resolved-integer-type.vhdl
4
830
entity test is end test; architecture only of test is type integer_array is array ( natural range <> ) of integer; function return_biggest ( inputs : integer_array ) return integer is variable retval : integer := integer'left; begin for i in inputs'range loop if inputs(i) > retval then retval := inputs(i); end if; end loop; -- i return retval; end return_biggest; subtype biggest_wins is return_biggest integer; signal common : biggest_wins; begin -- only p1 : process begin common <= 1 after 1 ns; wait; end process; p2 : process begin common <= 1 after 1 ns; wait; end process; test: process begin wait for 2 ns; assert common = 1 report "TEST FAILED" severity failure; wait; end process; end only;
gpl-2.0
emogenet/ghdl
testsuite/gna/bug18659/crash.vhd
3
557
entity crash is end entity crash; library ieee; use ieee.std_logic_1164.all; architecture test of crash is type t_mem2D is array (natural range <>, -- Address, specifies one word natural range <> -- Bit positions within a word ) of std_logic; begin -- architecture test process is variable var_array : t_mem2D(0 to 5, 7 downto 0); begin -- process assert var_array = t_mem2D'(X"DEAD", X"BEEF") report "var array error" severity error; wait; end process; end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/ashenden/compliant/ch_06_accr.vhd
4
1373
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ch_06_accr.vhd,v 1.2 2001-10-26 16:29:34 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; entity accumulator_reg is port ( clk : in std_ulogic; clr : in std_ulogic; d : in std_ulogic_vector(21 downto 0); q : out std_ulogic_vector(21 downto 0) ); end entity accumulator_reg;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc3076.vhd
4
4169
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3076.vhd,v 1.2 2001-10-26 16:29:51 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c12s06b02x00p06n01i03076pkg is type integer_cons_vector is array (15 downto 0) of integer; type integer_cons_vectorofvector is array (0 to 15) of integer_cons_vector; constant C19 : integer_cons_vectorofvector := (others => (others => 3)); end c12s06b02x00p06n01i03076pkg; use work.c12s06b02x00p06n01i03076pkg.all; ENTITY c12s06b02x00p06n01i03076ent_a IS PORT ( F1: OUT integer ; F3: IN integer_cons_vectorofvector; FF: OUT integer := 0 ); END c12s06b02x00p06n01i03076ent_a; ARCHITECTURE c12s06b02x00p06n01i03076arch_a OF c12s06b02x00p06n01i03076ent_a IS BEGIN TESTING: PROCESS begin F1 <= 3; wait for 0 ns; assert F3'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3'active = true)) then F1 <= 11; end if; assert F3(0)'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3(0)'active = true)) then F1 <= 11; end if; assert F3(15)'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3(15)'active = true)) then F1 <= 11; end if; wait; END PROCESS; END c12s06b02x00p06n01i03076arch_a; use work.c12s06b02x00p06n01i03076pkg.all; ENTITY c12s06b02x00p06n01i03076ent IS END c12s06b02x00p06n01i03076ent; ARCHITECTURE c12s06b02x00p06n01i03076arch OF c12s06b02x00p06n01i03076ent IS function scalar_complex(s : integer) return integer_cons_vectorofvector is begin return C19; end scalar_complex; component model PORT ( F1: OUT integer; F3: IN integer_cons_vectorofvector; FF: OUT integer ); end component; for T1 : model use entity work.c12s06b02x00p06n01i03076ent_a(c12s06b02x00p06n01i03076arch_a); signal S1 : integer_cons_vectorofvector; signal S3 : integer; signal SS : integer := 0; BEGIN T1: model port map ( scalar_complex(F1) => S1, F3 => scalar_complex(S3), FF => SS ); TESTING: PROCESS BEGIN S3 <= 3; wait for 0 ns; assert S1'active = true report"no activity on F3 when there is activity on actual" severity failure; assert S1(0)'active = true report"no activity on F3 when there is activity on actual" severity failure; assert S1(15)'active = true report"no activity on F3 when there is activity on actual" severity failure; assert NOT(S1'active = true and S1(0)'active = true and S1(15)'active = true and SS = 0) report "***PASSED TEST: c12s06b02x00p06n01i03076" severity NOTE; assert (S1'active = true and S1(0)'active = true and S1(15)'active = true and SS = 0) report "***FAILED TEST: c12s06b02x00p06n01i03076 - Not every scalar subelement is active if the source itself is active." severity ERROR; wait; END PROCESS TESTING; END c12s06b02x00p06n01i03076arch;
gpl-2.0
emogenet/ghdl
libraries/ieee/std_logic_1164_body.vhdl
4
34617
-- -------------------------------------------------------------------- -- -- Title : std_logic_1164 multi-value logic system -- Library : This package shall be compiled into a library -- : symbolically named IEEE. -- : -- Developers: IEEE model standards group (par 1164) -- Purpose : This packages defines a standard for designers -- : to use in describing the interconnection data types -- : used in vhdl modeling. -- : -- Limitation: The logic system defined in this package may -- : be insufficient for modeling switched transistors, -- : since such a requirement is out of the scope of this -- : effort. Furthermore, mathematics, primitives, -- : timing standards, etc. are considered orthogonal -- : issues as it relates to this package and are therefore -- : beyond the scope of this effort. -- : -- Note : No declarations or definitions shall be included in, -- : or excluded from this package. The "package declaration" -- : defines the types, subtypes and declarations of -- : std_logic_1164. The std_logic_1164 package body shall be -- : considered the formal definition of the semantics of -- : this package. Tool developers may choose to implement -- : the package body in the most efficient manner available -- : to them. -- : -- -------------------------------------------------------------------- -- modification history : -- -------------------------------------------------------------------- -- version | mod. date:| -- v4.200 | 01/02/91 | -- -------------------------------------------------------------------- PACKAGE BODY std_logic_1164 IS ------------------------------------------------------------------- -- local types ------------------------------------------------------------------- TYPE stdlogic_1d IS ARRAY (std_ulogic) OF std_ulogic; TYPE stdlogic_table IS ARRAY(std_ulogic, std_ulogic) OF std_ulogic; ------------------------------------------------------------------- -- resolution function ------------------------------------------------------------------- CONSTANT resolution_table : stdlogic_table := ( -- --------------------------------------------------------- -- | U X 0 1 Z W L H - | | -- --------------------------------------------------------- ( 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U' ), -- | U | ( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ), -- | X | ( 'U', 'X', '0', 'X', '0', '0', '0', '0', 'X' ), -- | 0 | ( 'U', 'X', 'X', '1', '1', '1', '1', '1', 'X' ), -- | 1 | ( 'U', 'X', '0', '1', 'Z', 'W', 'L', 'H', 'X' ), -- | Z | ( 'U', 'X', '0', '1', 'W', 'W', 'W', 'W', 'X' ), -- | W | ( 'U', 'X', '0', '1', 'L', 'W', 'L', 'W', 'X' ), -- | L | ( 'U', 'X', '0', '1', 'H', 'W', 'W', 'H', 'X' ), -- | H | ( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ) -- | - | ); FUNCTION resolved ( s : std_ulogic_vector ) RETURN std_ulogic IS VARIABLE result : std_ulogic := 'Z'; -- weakest state default BEGIN -- the test for a single driver is essential otherwise the -- loop would return 'X' for a single driver of '-' and that -- would conflict with the value of a single driver unresolved -- signal. IF (s'LENGTH = 1) THEN RETURN s(s'LOW); ELSE FOR i IN s'RANGE LOOP result := resolution_table(result, s(i)); END LOOP; END IF; RETURN result; END resolved; ------------------------------------------------------------------- -- tables for logical operations ------------------------------------------------------------------- -- truth table for "and" function CONSTANT and_table : stdlogic_table := ( -- ---------------------------------------------------- -- | U X 0 1 Z W L H - | | -- ---------------------------------------------------- ( 'U', 'U', '0', 'U', 'U', 'U', '0', 'U', 'U' ), -- | U | ( 'U', 'X', '0', 'X', 'X', 'X', '0', 'X', 'X' ), -- | X | ( '0', '0', '0', '0', '0', '0', '0', '0', '0' ), -- | 0 | ( 'U', 'X', '0', '1', 'X', 'X', '0', '1', 'X' ), -- | 1 | ( 'U', 'X', '0', 'X', 'X', 'X', '0', 'X', 'X' ), -- | Z | ( 'U', 'X', '0', 'X', 'X', 'X', '0', 'X', 'X' ), -- | W | ( '0', '0', '0', '0', '0', '0', '0', '0', '0' ), -- | L | ( 'U', 'X', '0', '1', 'X', 'X', '0', '1', 'X' ), -- | H | ( 'U', 'X', '0', 'X', 'X', 'X', '0', 'X', 'X' ) -- | - | ); -- truth table for "or" function CONSTANT or_table : stdlogic_table := ( -- ---------------------------------------------------- -- | U X 0 1 Z W L H - | | -- ---------------------------------------------------- ( 'U', 'U', 'U', '1', 'U', 'U', 'U', '1', 'U' ), -- | U | ( 'U', 'X', 'X', '1', 'X', 'X', 'X', '1', 'X' ), -- | X | ( 'U', 'X', '0', '1', 'X', 'X', '0', '1', 'X' ), -- | 0 | ( '1', '1', '1', '1', '1', '1', '1', '1', '1' ), -- | 1 | ( 'U', 'X', 'X', '1', 'X', 'X', 'X', '1', 'X' ), -- | Z | ( 'U', 'X', 'X', '1', 'X', 'X', 'X', '1', 'X' ), -- | W | ( 'U', 'X', '0', '1', 'X', 'X', '0', '1', 'X' ), -- | L | ( '1', '1', '1', '1', '1', '1', '1', '1', '1' ), -- | H | ( 'U', 'X', 'X', '1', 'X', 'X', 'X', '1', 'X' ) -- | - | ); -- truth table for "xor" function CONSTANT xor_table : stdlogic_table := ( -- ---------------------------------------------------- -- | U X 0 1 Z W L H - | | -- ---------------------------------------------------- ( 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U' ), -- | U | ( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ), -- | X | ( 'U', 'X', '0', '1', 'X', 'X', '0', '1', 'X' ), -- | 0 | ( 'U', 'X', '1', '0', 'X', 'X', '1', '0', 'X' ), -- | 1 | ( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ), -- | Z | ( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ), -- | W | ( 'U', 'X', '0', '1', 'X', 'X', '0', '1', 'X' ), -- | L | ( 'U', 'X', '1', '0', 'X', 'X', '1', '0', 'X' ), -- | H | ( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ) -- | - | ); -- truth table for "not" function CONSTANT not_table: stdlogic_1d := -- ------------------------------------------------- -- | U X 0 1 Z W L H - | -- ------------------------------------------------- ( 'U', 'X', '1', '0', 'X', 'X', '1', '0', 'X' ); ------------------------------------------------------------------- -- overloaded logical operators ( with optimizing hints ) ------------------------------------------------------------------- FUNCTION "and" ( l : std_ulogic; r : std_ulogic ) RETURN UX01 IS BEGIN RETURN (and_table(l, r)); END "and"; FUNCTION "nand" ( l : std_ulogic; r : std_ulogic ) RETURN UX01 IS BEGIN RETURN (not_table ( and_table(l, r))); END "nand"; FUNCTION "or" ( l : std_ulogic; r : std_ulogic ) RETURN UX01 IS BEGIN RETURN (or_table(l, r)); END "or"; FUNCTION "nor" ( l : std_ulogic; r : std_ulogic ) RETURN UX01 IS BEGIN RETURN (not_table ( or_table( l, r ))); END "nor"; FUNCTION "xor" ( l : std_ulogic; r : std_ulogic ) RETURN UX01 IS BEGIN RETURN (xor_table(l, r)); END "xor"; --START-!V87 FUNCTION "xnor" ( l : std_ulogic; r : std_ulogic ) RETURN UX01 IS BEGIN RETURN not_table(xor_table(l, r)); END "xnor"; --END-!V87 FUNCTION "not" ( l : std_ulogic ) RETURN UX01 IS BEGIN RETURN (not_table(l)); END "not"; ------------------------------------------------------------------- -- and ------------------------------------------------------------------- FUNCTION "and" ( l,r : std_logic_vector ) RETURN std_logic_vector IS ALIAS lv : std_logic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_logic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_logic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'and' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := and_table (lv(i), rv(i)); END LOOP; END IF; RETURN result; END "and"; --------------------------------------------------------------------- FUNCTION "and" ( l,r : std_ulogic_vector ) RETURN std_ulogic_vector IS ALIAS lv : std_ulogic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_ulogic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_ulogic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'and' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := and_table (lv(i), rv(i)); END LOOP; END IF; RETURN result; END "and"; ------------------------------------------------------------------- -- nand ------------------------------------------------------------------- FUNCTION "nand" ( l,r : std_logic_vector ) RETURN std_logic_vector IS ALIAS lv : std_logic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_logic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_logic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'nand' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := not_table(and_table (lv(i), rv(i))); END LOOP; END IF; RETURN result; END "nand"; --------------------------------------------------------------------- FUNCTION "nand" ( l,r : std_ulogic_vector ) RETURN std_ulogic_vector IS ALIAS lv : std_ulogic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_ulogic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_ulogic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'nand' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := not_table(and_table (lv(i), rv(i))); END LOOP; END IF; RETURN result; END "nand"; ------------------------------------------------------------------- -- or ------------------------------------------------------------------- FUNCTION "or" ( l,r : std_logic_vector ) RETURN std_logic_vector IS ALIAS lv : std_logic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_logic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_logic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'or' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := or_table (lv(i), rv(i)); END LOOP; END IF; RETURN result; END "or"; --------------------------------------------------------------------- FUNCTION "or" ( l,r : std_ulogic_vector ) RETURN std_ulogic_vector IS ALIAS lv : std_ulogic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_ulogic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_ulogic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'or' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := or_table (lv(i), rv(i)); END LOOP; END IF; RETURN result; END "or"; ------------------------------------------------------------------- -- nor ------------------------------------------------------------------- FUNCTION "nor" ( l,r : std_logic_vector ) RETURN std_logic_vector IS ALIAS lv : std_logic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_logic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_logic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'nor' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := not_table(or_table (lv(i), rv(i))); END LOOP; END IF; RETURN result; END "nor"; --------------------------------------------------------------------- FUNCTION "nor" ( l,r : std_ulogic_vector ) RETURN std_ulogic_vector IS ALIAS lv : std_ulogic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_ulogic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_ulogic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'nor' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := not_table(or_table (lv(i), rv(i))); END LOOP; END IF; RETURN result; END "nor"; --------------------------------------------------------------------- -- xor ------------------------------------------------------------------- FUNCTION "xor" ( l,r : std_logic_vector ) RETURN std_logic_vector IS ALIAS lv : std_logic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_logic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_logic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'xor' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := xor_table (lv(i), rv(i)); END LOOP; END IF; RETURN result; END "xor"; --------------------------------------------------------------------- FUNCTION "xor" ( l,r : std_ulogic_vector ) RETURN std_ulogic_vector IS ALIAS lv : std_ulogic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_ulogic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_ulogic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'xor' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := xor_table (lv(i), rv(i)); END LOOP; END IF; RETURN result; END "xor"; -- ------------------------------------------------------------------- -- -- xnor -- ------------------------------------------------------------------- -- ----------------------------------------------------------------------- -- Note : The declaration and implementation of the "xnor" function is -- specifically commented until at which time the VHDL language has been -- officially adopted as containing such a function. At such a point, -- the following comments may be removed along with this notice without -- further "official" ballotting of this std_logic_1164 package. It is -- the intent of this effort to provide such a function once it becomes -- available in the VHDL standard. -- ----------------------------------------------------------------------- --START-!V87 FUNCTION "xnor" ( l,r : std_logic_vector ) RETURN std_logic_vector IS ALIAS lv : std_logic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_logic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_logic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'xnor' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := not_table(xor_table (lv(i), rv(i))); END LOOP; END IF; RETURN result; END "xnor"; --------------------------------------------------------------------- FUNCTION "xnor" ( l,r : std_ulogic_vector ) RETURN std_ulogic_vector IS ALIAS lv : std_ulogic_vector ( 1 TO l'LENGTH ) IS l; ALIAS rv : std_ulogic_vector ( 1 TO r'LENGTH ) IS r; VARIABLE result : std_ulogic_vector ( 1 TO l'LENGTH ); BEGIN IF ( l'LENGTH /= r'LENGTH ) THEN ASSERT FALSE REPORT "arguments of overloaded 'xnor' operator are not of the same length" SEVERITY FAILURE; ELSE FOR i IN result'RANGE LOOP result(i) := not_table(xor_table (lv(i), rv(i))); END LOOP; END IF; RETURN result; END "xnor"; --END-!V87 ------------------------------------------------------------------- -- not ------------------------------------------------------------------- FUNCTION "not" ( l : std_logic_vector ) RETURN std_logic_vector IS ALIAS lv : std_logic_vector ( 1 TO l'LENGTH ) IS l; VARIABLE result : std_logic_vector ( 1 TO l'LENGTH ) := (OTHERS => 'X'); BEGIN FOR i IN result'RANGE LOOP result(i) := not_table( lv(i) ); END LOOP; RETURN result; END; --------------------------------------------------------------------- FUNCTION "not" ( l : std_ulogic_vector ) RETURN std_ulogic_vector IS ALIAS lv : std_ulogic_vector ( 1 TO l'LENGTH ) IS l; VARIABLE result : std_ulogic_vector ( 1 TO l'LENGTH ) := (OTHERS => 'X'); BEGIN FOR i IN result'RANGE LOOP result(i) := not_table( lv(i) ); END LOOP; RETURN result; END; ------------------------------------------------------------------- -- conversion tables ------------------------------------------------------------------- TYPE logic_x01_table IS ARRAY (std_ulogic'LOW TO std_ulogic'HIGH) OF X01; TYPE logic_x01z_table IS ARRAY (std_ulogic'LOW TO std_ulogic'HIGH) OF X01Z; TYPE logic_ux01_table IS ARRAY (std_ulogic'LOW TO std_ulogic'HIGH) OF UX01; ---------------------------------------------------------- -- table name : cvt_to_x01 -- -- parameters : -- in : std_ulogic -- some logic value -- returns : x01 -- state value of logic value -- purpose : to convert state-strength to state only -- -- example : if (cvt_to_x01 (input_signal) = '1' ) then ... -- ---------------------------------------------------------- CONSTANT cvt_to_x01 : logic_x01_table := ( 'X', -- 'U' 'X', -- 'X' '0', -- '0' '1', -- '1' 'X', -- 'Z' 'X', -- 'W' '0', -- 'L' '1', -- 'H' 'X' -- '-' ); ---------------------------------------------------------- -- table name : cvt_to_x01z -- -- parameters : -- in : std_ulogic -- some logic value -- returns : x01z -- state value of logic value -- purpose : to convert state-strength to state only -- -- example : if (cvt_to_x01z (input_signal) = '1' ) then ... -- ---------------------------------------------------------- CONSTANT cvt_to_x01z : logic_x01z_table := ( 'X', -- 'U' 'X', -- 'X' '0', -- '0' '1', -- '1' 'Z', -- 'Z' 'X', -- 'W' '0', -- 'L' '1', -- 'H' 'X' -- '-' ); ---------------------------------------------------------- -- table name : cvt_to_ux01 -- -- parameters : -- in : std_ulogic -- some logic value -- returns : ux01 -- state value of logic value -- purpose : to convert state-strength to state only -- -- example : if (cvt_to_ux01 (input_signal) = '1' ) then ... -- ---------------------------------------------------------- CONSTANT cvt_to_ux01 : logic_ux01_table := ( 'U', -- 'U' 'X', -- 'X' '0', -- '0' '1', -- '1' 'X', -- 'Z' 'X', -- 'W' '0', -- 'L' '1', -- 'H' 'X' -- '-' ); ------------------------------------------------------------------- -- conversion functions ------------------------------------------------------------------- FUNCTION To_bit ( s : std_ulogic; xmap : BIT := '0') RETURN BIT IS BEGIN CASE s IS WHEN '0' | 'L' => RETURN ('0'); WHEN '1' | 'H' => RETURN ('1'); WHEN OTHERS => RETURN xmap; END CASE; END; -------------------------------------------------------------------- FUNCTION To_bitvector ( s : std_logic_vector ; xmap : BIT := '0') RETURN BIT_VECTOR IS ALIAS sv : std_logic_vector ( s'LENGTH-1 DOWNTO 0 ) IS s; VARIABLE result : BIT_VECTOR ( s'LENGTH-1 DOWNTO 0 ); BEGIN FOR i IN result'RANGE LOOP CASE sv(i) IS WHEN '0' | 'L' => result(i) := '0'; WHEN '1' | 'H' => result(i) := '1'; WHEN OTHERS => result(i) := xmap; END CASE; END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_bitvector ( s : std_ulogic_vector; xmap : BIT := '0') RETURN BIT_VECTOR IS ALIAS sv : std_ulogic_vector ( s'LENGTH-1 DOWNTO 0 ) IS s; VARIABLE result : BIT_VECTOR ( s'LENGTH-1 DOWNTO 0 ); BEGIN FOR i IN result'RANGE LOOP CASE sv(i) IS WHEN '0' | 'L' => result(i) := '0'; WHEN '1' | 'H' => result(i) := '1'; WHEN OTHERS => result(i) := xmap; END CASE; END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_StdULogic ( b : BIT ) RETURN std_ulogic IS BEGIN CASE b IS WHEN '0' => RETURN '0'; WHEN '1' => RETURN '1'; END CASE; END; -------------------------------------------------------------------- FUNCTION To_StdLogicVector ( b : BIT_VECTOR ) RETURN std_logic_vector IS ALIAS bv : BIT_VECTOR ( b'LENGTH-1 DOWNTO 0 ) IS b; VARIABLE result : std_logic_vector ( b'LENGTH-1 DOWNTO 0 ); BEGIN FOR i IN result'RANGE LOOP CASE bv(i) IS WHEN '0' => result(i) := '0'; WHEN '1' => result(i) := '1'; END CASE; END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_StdLogicVector ( s : std_ulogic_vector ) RETURN std_logic_vector IS ALIAS sv : std_ulogic_vector ( s'LENGTH-1 DOWNTO 0 ) IS s; VARIABLE result : std_logic_vector ( s'LENGTH-1 DOWNTO 0 ); BEGIN FOR i IN result'RANGE LOOP result(i) := sv(i); END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_StdULogicVector ( b : BIT_VECTOR ) RETURN std_ulogic_vector IS ALIAS bv : BIT_VECTOR ( b'LENGTH-1 DOWNTO 0 ) IS b; VARIABLE result : std_ulogic_vector ( b'LENGTH-1 DOWNTO 0 ); BEGIN FOR i IN result'RANGE LOOP CASE bv(i) IS WHEN '0' => result(i) := '0'; WHEN '1' => result(i) := '1'; END CASE; END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_StdULogicVector ( s : std_logic_vector ) RETURN std_ulogic_vector IS ALIAS sv : std_logic_vector ( s'LENGTH-1 DOWNTO 0 ) IS s; VARIABLE result : std_ulogic_vector ( s'LENGTH-1 DOWNTO 0 ); BEGIN FOR i IN result'RANGE LOOP result(i) := sv(i); END LOOP; RETURN result; END; ------------------------------------------------------------------- -- strength strippers and type convertors ------------------------------------------------------------------- -- to_x01 ------------------------------------------------------------------- FUNCTION To_X01 ( s : std_logic_vector ) RETURN std_logic_vector IS ALIAS sv : std_logic_vector ( 1 TO s'LENGTH ) IS s; VARIABLE result : std_logic_vector ( 1 TO s'LENGTH ); BEGIN FOR i IN result'RANGE LOOP result(i) := cvt_to_x01 (sv(i)); END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_X01 ( s : std_ulogic_vector ) RETURN std_ulogic_vector IS ALIAS sv : std_ulogic_vector ( 1 TO s'LENGTH ) IS s; VARIABLE result : std_ulogic_vector ( 1 TO s'LENGTH ); BEGIN FOR i IN result'RANGE LOOP result(i) := cvt_to_x01 (sv(i)); END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_X01 ( s : std_ulogic ) RETURN X01 IS BEGIN RETURN (cvt_to_x01(s)); END; -------------------------------------------------------------------- FUNCTION To_X01 ( b : BIT_VECTOR ) RETURN std_logic_vector IS ALIAS bv : BIT_VECTOR ( 1 TO b'LENGTH ) IS b; VARIABLE result : std_logic_vector ( 1 TO b'LENGTH ); BEGIN FOR i IN result'RANGE LOOP CASE bv(i) IS WHEN '0' => result(i) := '0'; WHEN '1' => result(i) := '1'; END CASE; END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_X01 ( b : BIT_VECTOR ) RETURN std_ulogic_vector IS ALIAS bv : BIT_VECTOR ( 1 TO b'LENGTH ) IS b; VARIABLE result : std_ulogic_vector ( 1 TO b'LENGTH ); BEGIN FOR i IN result'RANGE LOOP CASE bv(i) IS WHEN '0' => result(i) := '0'; WHEN '1' => result(i) := '1'; END CASE; END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_X01 ( b : BIT ) RETURN X01 IS BEGIN CASE b IS WHEN '0' => RETURN('0'); WHEN '1' => RETURN('1'); END CASE; END; -------------------------------------------------------------------- -- to_x01z ------------------------------------------------------------------- FUNCTION To_X01Z ( s : std_logic_vector ) RETURN std_logic_vector IS ALIAS sv : std_logic_vector ( 1 TO s'LENGTH ) IS s; VARIABLE result : std_logic_vector ( 1 TO s'LENGTH ); BEGIN FOR i IN result'RANGE LOOP result(i) := cvt_to_x01z (sv(i)); END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_X01Z ( s : std_ulogic_vector ) RETURN std_ulogic_vector IS ALIAS sv : std_ulogic_vector ( 1 TO s'LENGTH ) IS s; VARIABLE result : std_ulogic_vector ( 1 TO s'LENGTH ); BEGIN FOR i IN result'RANGE LOOP result(i) := cvt_to_x01z (sv(i)); END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_X01Z ( s : std_ulogic ) RETURN X01Z IS BEGIN RETURN (cvt_to_x01z(s)); END; -------------------------------------------------------------------- FUNCTION To_X01Z ( b : BIT_VECTOR ) RETURN std_logic_vector IS ALIAS bv : BIT_VECTOR ( 1 TO b'LENGTH ) IS b; VARIABLE result : std_logic_vector ( 1 TO b'LENGTH ); BEGIN FOR i IN result'RANGE LOOP CASE bv(i) IS WHEN '0' => result(i) := '0'; WHEN '1' => result(i) := '1'; END CASE; END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_X01Z ( b : BIT_VECTOR ) RETURN std_ulogic_vector IS ALIAS bv : BIT_VECTOR ( 1 TO b'LENGTH ) IS b; VARIABLE result : std_ulogic_vector ( 1 TO b'LENGTH ); BEGIN FOR i IN result'RANGE LOOP CASE bv(i) IS WHEN '0' => result(i) := '0'; WHEN '1' => result(i) := '1'; END CASE; END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_X01Z ( b : BIT ) RETURN X01Z IS BEGIN CASE b IS WHEN '0' => RETURN('0'); WHEN '1' => RETURN('1'); END CASE; END; -------------------------------------------------------------------- -- to_ux01 ------------------------------------------------------------------- FUNCTION To_UX01 ( s : std_logic_vector ) RETURN std_logic_vector IS ALIAS sv : std_logic_vector ( 1 TO s'LENGTH ) IS s; VARIABLE result : std_logic_vector ( 1 TO s'LENGTH ); BEGIN FOR i IN result'RANGE LOOP result(i) := cvt_to_ux01 (sv(i)); END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_UX01 ( s : std_ulogic_vector ) RETURN std_ulogic_vector IS ALIAS sv : std_ulogic_vector ( 1 TO s'LENGTH ) IS s; VARIABLE result : std_ulogic_vector ( 1 TO s'LENGTH ); BEGIN FOR i IN result'RANGE LOOP result(i) := cvt_to_ux01 (sv(i)); END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_UX01 ( s : std_ulogic ) RETURN UX01 IS BEGIN RETURN (cvt_to_ux01(s)); END; -------------------------------------------------------------------- FUNCTION To_UX01 ( b : BIT_VECTOR ) RETURN std_logic_vector IS ALIAS bv : BIT_VECTOR ( 1 TO b'LENGTH ) IS b; VARIABLE result : std_logic_vector ( 1 TO b'LENGTH ); BEGIN FOR i IN result'RANGE LOOP CASE bv(i) IS WHEN '0' => result(i) := '0'; WHEN '1' => result(i) := '1'; END CASE; END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_UX01 ( b : BIT_VECTOR ) RETURN std_ulogic_vector IS ALIAS bv : BIT_VECTOR ( 1 TO b'LENGTH ) IS b; VARIABLE result : std_ulogic_vector ( 1 TO b'LENGTH ); BEGIN FOR i IN result'RANGE LOOP CASE bv(i) IS WHEN '0' => result(i) := '0'; WHEN '1' => result(i) := '1'; END CASE; END LOOP; RETURN result; END; -------------------------------------------------------------------- FUNCTION To_UX01 ( b : BIT ) RETURN UX01 IS BEGIN CASE b IS WHEN '0' => RETURN('0'); WHEN '1' => RETURN('1'); END CASE; END; ------------------------------------------------------------------- -- edge detection ------------------------------------------------------------------- FUNCTION rising_edge (SIGNAL s : std_ulogic) RETURN BOOLEAN IS BEGIN RETURN (s'EVENT AND (To_X01(s) = '1') AND (To_X01(s'LAST_VALUE) = '0')); END; FUNCTION falling_edge (SIGNAL s : std_ulogic) RETURN BOOLEAN IS BEGIN RETURN (s'EVENT AND (To_X01(s) = '0') AND (To_X01(s'LAST_VALUE) = '1')); END; ------------------------------------------------------------------- -- object contains an unknown ------------------------------------------------------------------- FUNCTION Is_X ( s : std_ulogic_vector ) RETURN BOOLEAN IS BEGIN FOR i IN s'RANGE LOOP CASE s(i) IS WHEN 'U' | 'X' | 'Z' | 'W' | '-' => RETURN TRUE; WHEN OTHERS => NULL; END CASE; END LOOP; RETURN FALSE; END; -------------------------------------------------------------------- FUNCTION Is_X ( s : std_logic_vector ) RETURN BOOLEAN IS BEGIN FOR i IN s'RANGE LOOP CASE s(i) IS WHEN 'U' | 'X' | 'Z' | 'W' | '-' => RETURN TRUE; WHEN OTHERS => NULL; END CASE; END LOOP; RETURN FALSE; END; -------------------------------------------------------------------- FUNCTION Is_X ( s : std_ulogic ) RETURN BOOLEAN IS BEGIN CASE s IS WHEN 'U' | 'X' | 'Z' | 'W' | '-' => RETURN TRUE; WHEN OTHERS => NULL; END CASE; RETURN FALSE; END; END std_logic_1164;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/ashenden/compliant/ch_05_fg_05_04.vhd
4
2166
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ch_05_fg_05_04.vhd,v 1.2 2001-10-26 16:29:34 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- entity fg_05_04 is end entity fg_05_04; architecture test of fg_05_04 is constant prop_delay : time := 5 ns; signal a, b, sel, z : bit; begin -- code from book mux : process (a, b, sel) is begin case sel is when '0' => z <= a after prop_delay; when '1' => z <= b after prop_delay; end case; end process mux; -- end code from book stimulus : process is subtype stim_vector_type is bit_vector(0 to 3); type stim_vector_array is array ( natural range <> ) of stim_vector_type; constant stim_vector : stim_vector_array := ( "0000", "0010", "0100", "0111", "1001", "1010", "1101", "1111" ); begin for i in stim_vector'range loop (a, b, sel) <= stim_vector(i)(0 to 2); wait for 10 ns; assert z = stim_vector(i)(3); end loop; wait; end process stimulus; end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc991.vhd
4
1905
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc991.vhd,v 1.2 2001-10-26 16:30:29 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s03b00x00p07n02i00991ent IS END c06s03b00x00p07n02i00991ent; ARCHITECTURE c06s03b00x00p07n02i00991arch OF c06s03b00x00p07n02i00991ent IS BEGIN TESTING: PROCESS type A1 is array (BOOLEAN) of BOOLEAN; function F return BOOLEAN is begin return TRUE; end F; variable B1 : BOOLEAN; variable V1 : BOOLEAN; variable V2 : A1 ; BEGIN V2 := V2(F.B1); -- ERROR: the prefix of an expanded name -- cannot be a functon call. assert FALSE report "***FAILED TEST: c06s03b00x00p07n02i00991 - The prefix of an expanded name cannot be a function call.(Expanded name used as array index)" severity ERROR; wait; END PROCESS TESTING; END c06s03b00x00p07n02i00991arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc3020.vhd
4
1589
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3020.vhd,v 1.2 2001-10-26 16:30:25 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- library ; --- Failure_here ENTITY c11s02b00x00p02n01i03020ent IS END c11s02b00x00p02n01i03020ent; ARCHITECTURE c11s02b00x00p02n01i03020arch OF c11s02b00x00p02n01i03020ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c11s02b00x00p02n01i03020 - Missing library logical name list." severity ERROR; wait; END PROCESS TESTING; END c11s02b00x00p02n01i03020arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/guards-and-blocks/example_entity.vhd
4
2001
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- not in book entity example_entity is end entity example_entity; -- end not in book architecture contrived of example_entity is constant sig_width : positive := 16; signal s1, s2, s3 : bit_vector (0 to sig_width - 1); signal sel : bit; -- . . . begin mux : block is generic ( width : positive ); generic map ( width => sig_width ); port ( d0, d1 : in bit_vector(0 to width - 1); y : out bit_vector(0 to width - 1); sel : in bit); port map ( d0 => s1, d1=> s2, y => s3, sel => sel ); constant zero : bit_vector(0 to width - 1) := ( others => '0' ); signal gated_d0, gated_d1 : bit_vector(0 to width - 1); begin gated_d0 <= d0 when sel = '0' else zero; gated_d1 <= d1 when sel = '1' else zero; y <= gated_d0 or gated_d1; end block mux; -- . . . -- not in book stimulus : process is begin s1 <= X"1111"; s2 <= X"2222"; sel <= '0'; wait for 10 ns; s1 <= X"0101"; wait for 10 ns; s2 <= X"0202"; wait for 10 ns; sel <= '1'; wait for 10 ns; s1 <= X"0001"; wait for 10 ns; s2 <= X"0002"; wait for 10 ns; wait; end process stimulus; -- end not in book end architecture contrived;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc160.vhd
4
2233
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc160.vhd,v 1.2 2001-10-26 16:30:11 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c04s03b02x02p19n04i00160pkg is type rec_type is record a, b, c : integer; end record; procedure P1 (p : in rec_type; q: in integer; r: out integer); end c04s03b02x02p19n04i00160pkg; package body c04s03b02x02p19n04i00160pkg is procedure P1 (p : in rec_type; q: in integer; r: out integer) is begin r := (p.a + p.b + p.c)/3 * q; end; end c04s03b02x02p19n04i00160pkg; use work.c04s03b02x02p19n04i00160pkg.all; ENTITY c04s03b02x02p19n04i00160ent IS END c04s03b02x02p19n04i00160ent; ARCHITECTURE c04s03b02x02p19n04i00160arch OF c04s03b02x02p19n04i00160ent IS BEGIN TESTING: PROCESS variable x : integer := 1; BEGIN P1 (p.a => 1, p.b => 2, p.a => 3, p.c => 4, q => 12); -- Failure_here -- p.a named twice. assert FALSE report "***FAILED TEST: c04s03b02x02p19n04i00160 - Subelements of an association list may only be assigned once." severity ERROR; wait; END PROCESS TESTING; END c04s03b02x02p19n04i00160arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc375.vhd
4
1668
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc375.vhd,v 1.2 2001-10-26 16:30:26 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s02b01x01p03n03i00375ent IS END c03s02b01x01p03n03i00375ent; ARCHITECTURE c03s02b01x01p03n03i00375arch OF c03s02b01x01p03n03i00375ent IS type it is array (bit_vector range bit_vector'range) of bit; BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c03s02b01x01p03n03i00375 - The index constraint must provide a discrete range for each index of the array type." severity ERROR; wait; END PROCESS TESTING; END c03s02b01x01p03n03i00375arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/digital-modeling/inline_11.vhd
4
1559
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA entity inline_11 is end entity inline_11; ---------------------------------------------------------------- architecture test of inline_11 is signal line_in, line_out : bit := '0'; begin -- code from book: transmission_line : process (line_in) is begin line_out <= transport line_in after 500 ps; end process transmission_line; -- end of code from book ---------------- stimulus : process is begin line_in <= '1' after 2000 ps, '0' after 4000 ps, '1' after 6000 ps, '0' after 6200 ps, '1' after 8000 ps, '0' after 8200 ps, '1' after 8300 ps, '0' after 8400 ps; wait; end process stimulus; end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/ashenden/compliant/ch_15_dlxtstb.vhd
4
1616
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ch_15_dlxtstb.vhd,v 1.1.1.1 2001-08-22 18:20:48 paw Exp $ -- $Revision: 1.1.1.1 $ -- -- --------------------------------------------------------------------- configuration dlx_test_behavior of dlx_test is for bench for cg : clock_gen use entity work.clock_gen(behavior) generic map ( Tpw => 8 ns, Tps => 2 ns ); end for; for mem : memory use entity work.memory(preloaded) generic map ( mem_size => 65536, Tac_first => 95 ns, Tac_burst => 35 ns, Tpd_clk_out => 2 ns ); end for; for proc : dlx use entity work.dlx(behavior) generic map ( Tpd_clk_out => 2 ns, debug => trace_each_step ); end for; end for; end configuration dlx_test_behavior;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS5_RC_Airplane/tb_CS5_Prop.vhd
4
35957
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------------- -- Copyright (c) 2001 Mentor Graphics Corporation -- -- This model is a component of the Mentor Graphics VHDL-AMS educational open -- source model library, and is covered by this license agreement. This model, -- including any updates, modifications, revisions, copies, and documentation -- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR -- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH -- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive -- license to use, reproduce, modify and distribute this model, provided that: -- (a) no fee or other consideration is charged for any distribution except -- compilations distributed in accordance with Section (d) of this license -- agreement; (b) the comment text embedded in this model is included verbatim -- in each copy of this model made or distributed by you, whether or not such -- version is modified; (c) any modified version must include a conspicuous -- notice that this model has been modified and the date of modification; and -- (d) any compilations sold by you that include this model must include a -- conspicuous notice that this model is available from Mentor Graphics in its -- original form at no charge. -- -- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR -- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL -- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. ------------------------------------------------------------------------------- -- File : DC_Motor.vhd -- Author : Mentor Graphics -- Created : 2001/06/16 -- Last update: 2002/05/21 ------------------------------------------------------------------------------- -- Description: Basic DC Motor ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description -- 2001/06/16 1.0 Mentor Graphics Created ------------------------------------------------------------------------------- -- Use proposed IEEE natures and packages library IEEE_proposed; use IEEE_proposed.mechanical_systems.all; use IEEE_proposed.electrical_systems.all; entity DC_Motor is generic ( r_wind : resistance; -- Motor winding resistance [Ohm] kt : real; -- Torque coefficient [N*m/Amp] l : inductance; -- Winding inductance [Henrys] d : real; -- Damping coefficient [N*m/(rad/sec)] j : mmoment_i); -- Moment of inertia [kg*meter**2] port (terminal p1, p2 : electrical; terminal shaft_rotv : rotational_v); end entity DC_Motor; ------------------------------------------------------------------------------- -- Basic Architecture -- Motor equations: V = Kt*W + I*Rwind + L*dI/dt -- T = -Kt*I + D*W + J*dW/dt ------------------------------------------------------------------------------- architecture basic of DC_Motor is quantity v across i through p1 to p2; quantity w across torq through shaft_rotv to rotational_v_ref; begin torq == -1.0*kt*i + d*w + j*w'dot; v == kt*w + i*r_wind + l*i'dot; end architecture basic; ------------------------------------------------------------------------------- -- Copyright (c) 2001 Mentor Graphics Corporation ------------------------------------------------------------------------------- -- Copyright Mentor Graphics Corporation 2001 -- Confidential Information Provided Under License Agreement for Internal Use Only -- Constant Voltage Source (Includes Frequency Domain settings) LIBRARY IEEE; USE IEEE.MATH_REAL.ALL; -- Use proposed IEEE natures and packages LIBRARY IEEE_proposed; USE IEEE_proposed.ELECTRICAL_SYSTEMS.ALL; ENTITY v_constant IS -- Initialize parameters GENERIC ( level : VOLTAGE; -- Constant voltage value (V) ac_mag : VOLTAGE := 1.0; -- AC magnitude (V) ac_phase : real := 0.0); -- AC phase (degrees) -- Define ports as electrical terminals PORT ( TERMINAL pos, neg : ELECTRICAL); END ENTITY v_constant; -- Ideal Architecture (I = constant) ARCHITECTURE ideal OF v_constant IS -- Declare Branch Quantities QUANTITY v ACROSS i THROUGH pos TO neg; -- Declare quantity in frequency domain for AC analysis QUANTITY ac_spec : real SPECTRUM ac_mag, math_2_pi*ac_phase/360.0; BEGIN IF DOMAIN = QUIESCENT_DOMAIN or DOMAIN = TIME_DOMAIN USE v == level; ELSE v == ac_spec; -- used for Frequency (AC) analysis END USE; END ARCHITECTURE ideal; -- -- C:\Rehan\Cs5\design_definition\hdl\vhdl\switch_dig_log.vhd library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.math_real.all; library IEEE_proposed; use IEEE_proposed.electrical_systems.all; entity switch_dig_log is generic ( trans_time : real := 1.0e-9; r_closed : resistance := 1.0e-3; r_open : resistance := 1.0e6 ); port ( terminal p1 : electrical ; sw_state : in std_logic ; terminal p2 : electrical ); begin end switch_dig_log ; ----------------------------------------------------------------------------------------- architecture linear of switch_dig_log is signal r_sig : resistance := r_open; -- create internal signal for CreateState process quantity v across i through p1 to p2; quantity r : resistance; begin -- purpose: Detect Switch state and assign resistance value to r_sig -- type : combinational -- inputs : sw_state -- outputs: r_sig DetectState: process (sw_state) begin -- process DetectState if (sw_state'event and sw_state = '0') then r_sig <= r_open; elsif (sw_state'event and sw_state = '1') then r_sig <= r_closed; end if; end process DetectState; -- Characteristic equations r == r_sig'ramp(trans_time, trans_time); v == r*i; end architecture linear; ------------------------------------------------------------------------------------------- architecture log of switch_dig_log is constant log10_r_open : real := log10(r_open); constant log10_r_closed : real := log10(r_closed); signal log10_r_sig : resistance := log10_r_open; -- create internal signal for CreateState process quantity v across i through p1 to p2; quantity r : resistance; quantity log10_r : real; begin -- purpose: Detect Switch state and assign resistance value to r_sig -- type : combinational -- inputs : sw_state -- outputs: r_sig DetectState: process (sw_state) begin -- process DetectState if (sw_state'event and sw_state = '0') then log10_r_sig <= log10_r_open; elsif (sw_state'event and sw_state = '1') then log10_r_sig <= log10_r_closed; end if; end process DetectState; -- Characteristic equations log10_r == log10_r_sig'ramp(trans_time, trans_time); r == 10**log10_r; v == r*i; end architecture log; -- ------------------------------------------------------------------------------- -- Copyright (c) 2001 Mentor Graphics Corporation -- -- This model is a component of the Mentor Graphics VHDL-AMS educational open -- source model library, and is covered by this license agreement. This model, -- including any updates, modifications, revisions, copies, and documentation -- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR -- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH -- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive -- license to use, reproduce, modify and distribute this model, provided that: -- (a) no fee or other consideration is charged for any distribution except -- compilations distributed in accordance with Section (d) of this license -- agreement; (b) the comment text embedded in this model is included verbatim -- in each copy of this model made or distributed by you, whether or not such -- version is modified; (c) any modified version must include a conspicuous -- notice that this model has been modified and the date of modification; and -- (d) any compilations sold by you that include this model must include a -- conspicuous notice that this model is available from Mentor Graphics in its -- original form at no charge. -- -- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR -- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL -- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. ------------------------------------------------------------------------------- -- File : opamp.vhd -- Author : Mentor Graphics -- Created : 2001/06/16 -- Last update: 2001/06/16 ------------------------------------------------------------------------------- -- Description: 3-pin OpAmp model with behavioral architecture -- Uses Q'LTF function to define open-loop response ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description -- 2001/06/16 1.0 Mentor Graphics Created ------------------------------------------------------------------------------- library IEEE; use IEEE.math_real.all; -- Use proposed IEEE natures and packages library IEEE_proposed; use IEEE_proposed.electrical_systems.all; entity opamp is -- Initialize parameters generic (rin : resistance := 1.0e6; -- Input resistance [Ohms] rout : resistance := 100.0; -- Output resistance (Ohms] avol : real := 100.0e3; -- Open loop gain f_0dB : real := 1.0e6 -- Unity Gain Frequency [Hz] ); -- Define ports as electrical terminals port ( terminal in_pos, in_neg, output : electrical); end entity opamp; ------------------------------------------------------------------------------- -- Basic Architecture -- Characteristics modeled: -- 1. Open loop gain -- 2. Frequency characteristics (single pole response) -- 3. Input and output resistance -- Uses Q'Ltf function to create open loop gain and roll off ------------------------------------------------------------------------------- architecture basic of opamp is -- Declare constants constant f_3db : real := f_0db / avol; -- -3dB frequency constant w_3dB : real := math_2_pi*f_3dB; -- -3dB freq in radians -- Numerator and denominator for Q'LTF function constant num : real_vector := (0 => avol); constant den : real_vector := (1.0, 1.0/w_3dB); -- Declare input and output quantities quantity v_in across i_in through in_pos to in_neg; quantity v_out across i_out through output; begin -- ARCHITECTURE basic i_in == v_in / rin; -- input current v_out == v_in'ltf(num, den) + i_out*rout; -- output voltage end architecture basic; ------------------------------------------------------------------------------- -- Copyright (c) 2001 Mentor Graphics Corporation ------------------------------------------------------------------------------- -- Copyright Mentor Graphics Corporation 2001 -- Confidential Information Provided Under License Agreement for Internal Use Only -- Electrical Resistor Model -- Use proposed IEEE natures and packages LIBRARY IEEE_proposed; USE IEEE_proposed.ELECTRICAL_SYSTEMS.ALL; ENTITY resistor IS -- Initialize parameters GENERIC ( res : RESISTANCE); -- resistance (no initial value) -- Define ports as electrical terminals PORT ( TERMINAL p1, p2 : ELECTRICAL); END ENTITY resistor; -- Ideal Architecture (V = I*R) ARCHITECTURE ideal OF resistor IS -- Declare Branch Quantities QUANTITY v ACROSS i THROUGH p1 TO p2; BEGIN -- Characteristic equations v == i*res; END ARCHITECTURE ideal; -- ------------------------------------------------------------------------------- -- Copyright (c) 2001 Mentor Graphics Corporation -- -- This model is a component of the Mentor Graphics VHDL-AMS educational open -- source model library, and is covered by this license agreement. This model, -- including any updates, modifications, revisions, copies, and documentation -- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR -- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH -- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive -- license to use, reproduce, modify and distribute this model, provided that: -- (a) no fee or other consideration is charged for any distribution except -- compilations distributed in accordance with Section (d) of this license -- agreement; (b) the comment text embedded in this model is included verbatim -- in each copy of this model made or distributed by you, whether or not such -- version is modified; (c) any modified version must include a conspicuous -- notice that this model has been modified and the date of modification; and -- (d) any compilations sold by you that include this model must include a -- conspicuous notice that this model is available from Mentor Graphics in its -- original form at no charge. -- -- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR -- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL -- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. ------------------------------------------------------------------------------- -- File : comparator_d.vhd -- Author : Mentor Graphics -- Created : 2001/08/03 -- Last update: 2001/08/03 ------------------------------------------------------------------------------- -- Description: Voltage comparator with digital output ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description -- 2001/08/03 1.0 Mentor Graphics Created ------------------------------------------------------------------------------- -- Use IEEE natures and packages library IEEE; use ieee.std_logic_1164.all; -- Use proposed IEEE natures and packages library IEEE_proposed; use IEEE_proposed.ELECTRICAL_SYSTEMS.all; use IEEE_proposed.ENERGY_SYSTEMS.all; entity comparator_d is port ( terminal in_pos : electrical; terminal in_neg : electrical; signal output : out std_logic := '1' -- Digital output ); end comparator_d; ------------------------------------------------------------------------------- -- Behavioral architecture ------------------------------------------------------------------------------- architecture behavioral of comparator_d is quantity Vin across in_pos; quantity Vref across in_neg; begin -- behavioral -- purpose: Detect threshold crossing and assign event on output -- type : combinational -- inputs : vin'above(thres) -- outputs: pulse_signal process (Vin'above(Vref)) is begin -- PROCESS if Vin'above(Vref) then output <= '1' after 1us; else output <= '0' after 1us; end if; end process; end behavioral; ------------------------------------------------------------------------------- -- Copyright (c) 2001 Mentor Graphics Corporation ------------------------------------------------------------------------------- -- ------------------------------------------------------------------------------- -- Copyright (c) 2001 Mentor Graphics Corporation -- -- This model is a component of the Mentor Graphics VHDL-AMS educational open -- source model library, and is covered by this license agreement. This model, -- including any updates, modifications, revisions, copies, and documentation -- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR -- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH -- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive -- license to use, reproduce, modify and distribute this model, provided that: -- (a) no fee or other consideration is charged for any distribution except -- compilations distributed in accordance with Section (d) of this license -- agreement; (b) the comment text embedded in this model is included verbatim -- in each copy of this model made or distributed by you, whether or not such -- version is modified; (c) any modified version must include a conspicuous -- notice that this model has been modified and the date of modification; and -- (d) any compilations sold by you that include this model must include a -- conspicuous notice that this model is available from Mentor Graphics in its -- original form at no charge. -- -- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR -- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL -- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. ------------------------------------------------------------------------------- -- File : v_pulse.vhd -- Author : Mentor Graphics -- Created : 2001/06/16 -- Last update: 2001/07/09 ------------------------------------------------------------------------------- -- Description: Voltage Pulse Source -- Includes Frequency Domain settings ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description -- 2001/06/16 1.0 Mentor Graphics Created -- 2001/07/09 1.1 Mentor Graphics Changed input parameters to type -- time. Uses time2real function. -- Pulsewidth no longer includes -- rise and fall times. ------------------------------------------------------------------------------- library IEEE; use IEEE.MATH_REAL.all; -- Use proposed IEEE natures and packages library IEEE_proposed; use IEEE_proposed.electrical_systems.all; entity v_pulse is generic ( initial : voltage := 0.0; -- initial value [Volts] pulse : voltage; -- pulsed value [Volts] ti2p : time := 1ns; -- initial to pulse [Sec] tp2i : time := 1ns; -- pulse to initial [Sec] delay : time := 0ms; -- delay time [Sec] width : time; -- duration of pulse [Sec] period : time; -- period [Sec] ac_mag : voltage := 1.0; -- AC magnitude [Volts] ac_phase : real := 0.0); -- AC phase [Degrees] port ( terminal pos, neg : electrical); end entity v_pulse; ------------------------------------------------------------------------------- -- Ideal Architecture ------------------------------------------------------------------------------- architecture ideal of v_pulse is -- Declare Through and Across Branch Quantities quantity v across i through pos to neg; -- Declare quantity in frequency domain for AC analysis quantity ac_spec : real spectrum ac_mag, math_2_pi*ac_phase/360.0; -- Signal used in CreateEvent process below signal pulse_signal : voltage := initial; -- Convert ti2p and tp2i generics to type REAL (needed for 'RAMP attribute) -- Note: these lines gave an error during simulation. Had to use a -- function call instead. -- constant ri2p : real := time'pos(ti2p) * 1.0e-15; -- constant rp2i : real := time'pos(tp2i) * 1.0e-15; -- Function to convert numbers of type TIME to type REAL function time2real(tt : time) return real is begin return time'pos(tt) * 1.0e-15; end time2real; -- Convert ti2p and tp2i generics to type REAL (needed for 'RAMP attribute) constant ri2p : real := time2real(ti2p); constant rp2i : real := time2real(tp2i); begin if domain = quiescent_domain or domain = time_domain use v == pulse_signal'ramp(ri2p, rp2i); -- create rise and fall transitions else v == ac_spec; -- used for Frequency (AC) analysis end use; -- purpose: Create events to define pulse shape -- type : combinational -- inputs : -- outputs: pulse_signal CreateEvent : process begin wait for delay; loop pulse_signal <= pulse; wait for (width + ti2p); pulse_signal <= initial; wait for (period - width - ti2p); end loop; end process CreateEvent; end architecture ideal; ------------------------------------------------------------------------------- -- Copyright (c) 2001 Mentor Graphics Corporation ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; library IEEE_proposed; use IEEE_proposed.electrical_systems.all; use IEEE_proposed.mechanical_systems.all; entity pwm_mac is port( terminal inp : electrical; terminal inm : electrical; dig_out : out std_logic ); end pwm_mac; architecture pwm_mac of pwm_mac is -- Component declarations -- Signal declarations terminal cmp_in : electrical; terminal plse_in : electrical; terminal XSIG010002 : electrical; terminal XSIG010003 : electrical; begin -- Signal assignments -- Component instances U1 : entity work.opamp(basic) port map( in_neg => XSIG010002, in_pos => inm, output => cmp_in ); R1 : entity work.resistor(ideal) generic map( res => 10.0e3 ) port map( p1 => XSIG010002, p2 => cmp_in ); v2 : entity work.v_constant(ideal) generic map( level => 0.0 ) port map( pos => XSIG010003, neg => ELECTRICAL_REF ); R2 : entity work.resistor(ideal) generic map( res => 10.0e3 ) port map( p1 => plse_in, p2 => XSIG010002 ); R3 : entity work.resistor(ideal) generic map( res => 10.0e3 ) port map( p1 => inp, p2 => XSIG010002 ); XCMP4 : entity work.comparator_d(behavioral) port map( output => dig_out, in_pos => XSIG010003, in_neg => cmp_in ); v9 : entity work.v_pulse(ideal) generic map( initial => -4.7, pulse => 4.7, ti2p => 200 us, tp2i => 200 us, delay => 1 us, width => 1 us, period => 405 us ) port map( pos => plse_in, neg => ELECTRICAL_REF ); end pwm_mac; -- ------------------------------------------------------------------------------- -- Copyright (c) 2001 Mentor Graphics Corporation -- -- This model is a component of the Mentor Graphics VHDL-AMS educational open -- source model library, and is covered by this license agreement. This model, -- including any updates, modifications, revisions, copies, and documentation -- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR -- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH -- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive -- license to use, reproduce, modify and distribute this model, provided that: -- (a) no fee or other consideration is charged for any distribution except -- compilations distributed in accordance with Section (d) of this license -- agreement; (b) the comment text embedded in this model is included verbatim -- in each copy of this model made or distributed by you, whether or not such -- version is modified; (c) any modified version must include a conspicuous -- notice that this model has been modified and the date of modification; and -- (d) any compilations sold by you that include this model must include a -- conspicuous notice that this model is available from Mentor Graphics in its -- original form at no charge. -- -- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR -- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL -- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. ------------------------------------------------------------------------------- -- File : prop_pwl.vhd -- Author : Mentor Graphics -- Created : 2001/06/16 -- Last update: 2001/06/16 ------------------------------------------------------------------------------- -- Description: Propeller Load (Rotational_V domain) ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description -- 2001/06/16 1.0 Mentor Graphics Created ------------------------------------------------------------------------------- library ieee; use ieee.math_real.all; package pwl_functions is function pwl_dim1_extrap (x : in real; xdata, ydata : in real_vector ) return real; function interpolate (x,y2,y1,x2,x1 : in real) return real; function extrapolate (x,y2,y1,x2,x1 : in real) return real; end package pwl_functions; package body pwl_functions is function interpolate (x,y2,y1,x2,x1 : in real) return real is variable m, yvalue : real; begin assert (x1 /= x2) report "interpolate: x1 cannot be equal to x2" severity error; assert (x >= x1) and (x <= x2) report "interpolate: x must be between x1 and x2, inclusively " severity error; m := (y2 - y1)/(x2 - x1); yvalue := y1 + m*(x - x1); return yvalue; end function interpolate; function extrapolate (x,y2,y1,x2,x1 : in real) return real is variable m, yvalue : real; begin assert (x1 /= x2) report "extrapolate: x1 cannot be equal to x2" severity error; assert (x <= x1) or (x >= x2) report "extrapolate: x is within x1, x2 bounds; interpolation will be performed" severity warning; m := (y2 - y1)/(x2 - x1); yvalue := y1 + m*(x - x1); return yvalue; end function extrapolate; -- Created a new pwl_dim1_extrap function that returns extrapolated yvalue for "out-of-range" x value. function pwl_dim1_extrap (x : in real; xdata, ydata : in real_vector ) return real is variable xvalue, yvalue, m : real; variable start, fin, mid: integer; begin if x <= xdata(0) then yvalue := extrapolate(x,ydata(1),ydata(0),xdata(1),xdata(0)); return yvalue; end if; if x >= xdata(xdata'right) then yvalue := extrapolate(x,ydata(ydata'right),ydata(ydata'right-1),xdata(xdata'right),xdata(xdata'right-1)); return yvalue; end if; start:=0; fin:=xdata'right; -- I assume that the valid elements are from xdata(0) to xdata(fin), inclusive. -- so fin==n-1 in C terms (where n is the size of the array). while start <=fin loop mid:=(start+fin)/2; if xdata(mid) < x then start:=mid+1; else fin:=mid-1; end if; end loop; if xdata(mid) > x then mid:=mid-1; end if; yvalue := interpolate(x,ydata(mid+1),ydata(mid),xdata(mid+1),xdata(mid)); return yvalue; end function pwl_dim1_extrap; end package body pwl_functions; library IEEE_proposed; use IEEE_proposed.mechanical_systems.all; library ieee; use ieee.math_real.all; use work.pwl_functions.all; entity prop_pwl is generic ( ydata : real_vector; -- torque data xdata : real_vector -- velocity data ); port (terminal shaft1 : rotational_v); end entity prop_pwl; architecture ideal of prop_pwl is quantity w across torq through shaft1 to rotational_v_ref; begin torq == pwl_dim1_extrap(w, xdata, ydata); end architecture ideal; -- ------------------------------------------------------------------------------- -- Copyright (c) 2001 Mentor Graphics Corporation -- -- This model is a component of the Mentor Graphics VHDL-AMS educational open -- source model library, and is covered by this license agreement. This model, -- including any updates, modifications, revisions, copies, and documentation -- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR -- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH -- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive -- license to use, reproduce, modify and distribute this model, provided that: -- (a) no fee or other consideration is charged for any distribution except -- compilations distributed in accordance with Section (d) of this license -- agreement; (b) the comment text embedded in this model is included verbatim -- in each copy of this model made or distributed by you, whether or not such -- version is modified; (c) any modified version must include a conspicuous -- notice that this model has been modified and the date of modification; and -- (d) any compilations sold by you that include this model must include a -- conspicuous notice that this model is available from Mentor Graphics in its -- original form at no charge. -- -- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR -- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL -- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. ------------------------------------------------------------------------------- -- File : diode_pwl.vhd -- Author : Mentor Graphics -- Created : 2001/06/16 -- Last update: 2001/06/16 ------------------------------------------------------------------------------- -- Description: Diode model with ideal architecture -- Currently no Generics due to bug in DV ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description -- 2001/06/16 1.0 Mentor Graphics Created ------------------------------------------------------------------------------- library IEEE; use IEEE.math_real.all; -- Use proposed IEEE natures and packages library IEEE_proposed; use IEEE_proposed.electrical_systems.all; -- energy_systems package needed for Boltzmann constant (K = Joules/Kelvin) use IEEE_proposed.energy_systems.all; ENTITY diode_pwl IS GENERIC ( ron : real; -- equivalent series resistance roff : real); -- leakage resistance PORT ( TERMINAL p, -- positive pin m : electrical); -- minus pin END ENTITY diode_pwl; ARCHITECTURE simple OF diode_pwl IS QUANTITY v across i through p TO m; BEGIN -- simple ARCHITECTURE if v'Above(0.0) use i == v/ron; elsif not v'Above(0.0) use i == v/roff; else i == 0.0; end use; break on v'Above(0.0); END ARCHITECTURE simple; -- Copyright Mentor Graphics Corporation 2001 -- Confidential Information Provided Under License Agreement for Internal Use Only -- Electrical sinusoidal voltage source (v_sine.vhd) LIBRARY IEEE; USE IEEE.MATH_REAL.ALL; -- Use proposed IEEE natures and packages LIBRARY IEEE_proposed; USE IEEE_proposed.ELECTRICAL_SYSTEMS.ALL; ENTITY v_sine IS -- Initialize parameters GENERIC ( freq : real; -- frequency, [Hertz] amplitude : real; -- amplitude, [Volt] phase : real := 0.0; -- initial phase, [Degree] offset : real := 0.0; -- DC value, [Volt] df : real := 0.0; -- damping factor, [1/second] ac_mag : real := 1.0; -- AC magnitude, [Volt] ac_phase : real := 0.0); -- AC phase, [Degree] -- Define ports as electrical terminals PORT ( TERMINAL pos, neg : ELECTRICAL); END ENTITY v_sine; -- Ideal Architecture ARCHITECTURE ideal OF v_sine IS -- Declare Branch Quantities QUANTITY v ACROSS i THROUGH pos TO neg; -- Declare Quantity for Phase in radians (calculated below) QUANTITY phase_rad : real; -- Declare Quantity in frequency domain for AC analysis QUANTITY ac_spec : real SPECTRUM ac_mag, math_2_pi*ac_phase/360.0; BEGIN -- Convert phase to radians phase_rad == math_2_pi *(freq * NOW + phase / 360.0); IF DOMAIN = QUIESCENT_DOMAIN OR DOMAIN = TIME_DOMAIN USE v == offset + amplitude * sin(phase_rad) * EXP(-NOW * df); ELSE v == ac_spec; -- used for Frequency (AC) analysis END USE; END ARCHITECTURE ideal; library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; library IEEE_proposed; use IEEE_proposed.electrical_systems.all; use IEEE_proposed.mechanical_systems.all; entity tb_CS5_Prop is end tb_CS5_Prop; architecture TB_CS5_Prop of tb_CS5_Prop is -- Component declarations -- Signal declarations terminal prop : rotational_v; terminal prop_amp_in : electrical; terminal prop_mtr_in : electrical; terminal prop_pwr : electrical; signal pwm_out : std_logic; begin -- Signal assignments -- Component instances motor2 : entity work.DC_Motor(basic) generic map( kt => 30.1e-3, l => 40.0e-6, d => 5.63e-12, j => 315.0e-6, r_wind => 0.16 ) port map( p1 => prop_mtr_in, p2 => ELECTRICAL_REF, shaft_rotv => prop ); v4 : entity work.v_constant(ideal) generic map( level => 42.0 ) port map( pos => prop_pwr, neg => ELECTRICAL_REF ); sw2 : entity work.switch_dig_log port map( sw_state => pwm_out, p2 => prop_mtr_in, p1 => prop_pwr ); pwm1 : entity work.pwm_mac port map( inp => prop_amp_in, dig_out => pwm_out, inm => ELECTRICAL_REF ); XCMP37 : entity work.prop_pwl(ideal) generic map( ydata => (0.233, 0.2865, 0.347, 0.4138, 0.485, 0.563, 0.645, 0.735, 0.830, 0.93, 1.08), xdata => (471.2, 523.6, 576.0, 628.3, 680.7, 733.0, 785.4, 837.7, 890.0, 942.5, 994.8) ) port map( shaft1 => prop ); D4 : entity work.diode_pwl(simple) generic map( ron => 0.001, roff => 100.0e3 ) port map( p => ELECTRICAL_REF, m => prop_mtr_in ); v8 : entity work.v_sine(ideal) generic map( freq => 1.0, amplitude => 2.3, phase => 0.0, offset => 2.3 ) port map( pos => prop_amp_in, neg => ELECTRICAL_REF ); end TB_CS5_Prop; --
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2232.vhd
4
1757
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2232.vhd,v 1.2 2001-10-26 16:30:16 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s02b06x00p01n01i02232ent IS END c07s02b06x00p01n01i02232ent; ARCHITECTURE c07s02b06x00p01n01i02232arch OF c07s02b06x00p01n01i02232ent IS BEGIN TESTING: PROCESS type POSITIVE_R is range 0.0 to REAL'HIGH; variable REALV : REAL; variable POSRV : POSITIVE_R; variable k : integer; BEGIN k := POSRV mod REALV; assert FALSE report "***FAILED TEST: c07s02b06x00p01n01i02232 - Operators mod and rem are predefined for any integer type only." severity ERROR; wait; END PROCESS TESTING; END c07s02b06x00p01n01i02232arch;
gpl-2.0
emogenet/ghdl
testsuite/gna/bug018/repro.vhdl
2
183
ENTITY repro_ent IS port( S : string := "abcdef"); END repro_ent; ARCHITECTURE repro_arch OF repro_ent IS constant C : string := "abcdef"; BEGIN assert S = C; END repro_arch;
gpl-2.0
emogenet/ghdl
testsuite/gna/issue50/idct.d/sub_599.vhd
2
800
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity sub_599 is port ( result : out std_logic_vector(31 downto 0); in_a : in std_logic_vector(31 downto 0); in_b : in std_logic_vector(31 downto 0) ); end sub_599; architecture augh of sub_599 is signal carry_inA : std_logic_vector(33 downto 0); signal carry_inB : std_logic_vector(33 downto 0); signal carry_res : std_logic_vector(33 downto 0); begin -- To handle the CI input, the operation is '0' - CI -- If CI is not present, the operation is '0' - '0' carry_inA <= '0' & in_a & '0'; carry_inB <= '0' & in_b & '0'; -- Compute the result carry_res <= std_logic_vector(unsigned(carry_inA) - unsigned(carry_inB)); -- Set the outputs result <= carry_res(32 downto 1); end architecture;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/analog-modeling/triangle_waveform_wa.vhd
4
1725
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA library ieee_proposed; use ieee_proposed.electrical_systems.all; entity triangle_waveform_wa is port ( terminal pos, neg : electrical ); end entity triangle_waveform_wa; ---------------------------------------------------------------- architecture ideal of triangle_waveform_wa is constant freq : real := 10_000.0; -- in Hz constant period : real := 1.0 / freq; constant amplitude : voltage := 5.0; constant offset : voltage := 0.0; signal square_wave : real := 0.0; quantity v across i through pos to neg; -- limit v : voltage with period / 10.0; begin process is variable state : bit := '0'; begin if state = '1' then square_wave <= 1.0; else square_wave <= 0.0; end if; state := not state; wait for period / 2.0; end process; v == offset + amplitude * square_wave'ramp(period / 2.0); end architecture ideal;
gpl-2.0
emogenet/ghdl
testsuite/gna/issue50/idct.d/add_296.vhd
2
800
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity add_296 is port ( result : out std_logic_vector(19 downto 0); in_a : in std_logic_vector(19 downto 0); in_b : in std_logic_vector(19 downto 0) ); end add_296; architecture augh of add_296 is signal carry_inA : std_logic_vector(21 downto 0); signal carry_inB : std_logic_vector(21 downto 0); signal carry_res : std_logic_vector(21 downto 0); begin -- To handle the CI input, the operation is '1' + CI -- If CI is not present, the operation is '1' + '0' carry_inA <= '0' & in_a & '1'; carry_inB <= '0' & in_b & '0'; -- Compute the result carry_res <= std_logic_vector(unsigned(carry_inA) + unsigned(carry_inB)); -- Set the outputs result <= carry_res(20 downto 1); end architecture;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc506.vhd
4
1699
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc506.vhd,v 1.2 2001-10-26 16:30:26 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s02b02x00p06n02i00506ent IS END c03s02b02x00p06n02i00506ent; ARCHITECTURE c03s02b02x00p06n02i00506arch OF c03s02b02x00p06n02i00506ent IS type rec_type is record x : bit; y : integer; x : boolean; -- Failure_here end record; BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c03s02b02x00p06n02i00506 -dentifiers of all elements of a record type must be distinct. " severity ERROR; wait; END PROCESS TESTING; END c03s02b02x00p06n02i00506arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc679.vhd
4
2126
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc679.vhd,v 1.3 2001-10-29 02:12:46 paw Exp $ -- $Revision: 1.3 $ -- -- --------------------------------------------------------------------- -- **************************** -- -- Ported to VHDL 93 by port93.pl - Tue Nov 5 16:38:00 1996 -- -- **************************** -- ENTITY c03s04b01x00p23n01i00679ent IS END c03s04b01x00p23n01i00679ent; ARCHITECTURE c03s04b01x00p23n01i00679arch OF c03s04b01x00p23n01i00679ent IS BEGIN TESTING: PROCESS -- Declare the type and the file. type FT is file of INTEGER; -- Declare the actual file to write. file FILEV : FT open write_mode is "iofile.08"; -- Declare a variable. constant CON : INTEGER := 1; variable VAR : INTEGER := CON; BEGIN -- Write out the file. for I in 1 to 100 loop WRITE( FILEV,VAR ); end loop; assert FALSE report "***PASSED TEST: c03s04b01x00p23n01i00679 - The output file will tested by test file s010412.vhd" severity NOTE; wait; END PROCESS TESTING; END c03s04b01x00p23n01i00679arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1641.vhd
4
1805
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1641.vhd,v 1.2 2001-10-26 16:29:42 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s12b00x00p06n01i01641ent IS END c08s12b00x00p06n01i01641ent; ARCHITECTURE c08s12b00x00p06n01i01641arch OF c08s12b00x00p06n01i01641ent IS BEGIN TESTING: PROCESS function ts (x1:bit) return integer is begin return (5); end ts; variable k : integer := 0; BEGIN k := ts('1'); assert NOT(k=5) report "***PASSED TEST: c08s12b00x00p06n01i01641" severity NOTE; assert (k=5) report "***FAILED TEST: c08s12b00x00p06n01i01641 - Value of the expression is of different subtype." severity ERROR; wait; END PROCESS TESTING; END c08s12b00x00p06n01i01641arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc512.vhd
4
2266
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc512.vhd,v 1.2 2001-10-26 16:29:55 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s02b02x00p07n01i00512ent IS END c03s02b02x00p07n01i00512ent; ARCHITECTURE c03s02b02x00p07n01i00512arch OF c03s02b02x00p07n01i00512ent IS type DATE is record DAY,D1,D2 : Integer; MONTH : Integer; YEAR : Integer; end record; type DAT is record DAY : Integer; D1 : Integer; D2 : Integer; MONTH : Integer; YEAR : Integer; end record; BEGIN TESTING: PROCESS variable V1 : DATE := (5,5,5,10,15) ; variable V2 : DAT := (5,5,5,10,15); BEGIN assert NOT(V1.D1 = V2.D1 and V1.D2 = V2.D2 and V1.DAY = V2.DAY and V1.Month = V2.Month and V1.Year = V2.Year ) report "***PASSED TEST: c03s02b02x00p07n01i00512" severity NOTE; assert (V1.D1 = V2.D1 and V1.D2 = V2.D2 and V1.DAY = V2.DAY and V1.Month = V2.Month and V1.Year = V2.Year ) report "***FAILED TEST: c03s02b02x00p07n01i00512 - An element declaration with several identifiers is equivalent to a sequence of single element declarations." severity ERROR; wait; END PROCESS TESTING; END c03s02b02x00p07n01i00512arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1204.vhd
4
1655
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1204.vhd,v 1.2 2001-10-26 16:30:07 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s01b00x00p08n03i01204ent IS port ( signal O : out BIT ); END c08s01b00x00p08n03i01204ent; ARCHITECTURE c08s01b00x00p08n03i01204arch OF c08s01b00x00p08n03i01204ent IS BEGIN TESTING: PROCESS variable k : integer; BEGIN O <= '1'; wait on O; assert FALSE report "***FAILED TEST: c08s01b00x00p08n03i01204 - Signal name in the ON expression is not static." severity ERROR; wait; END PROCESS TESTING; END c08s01b00x00p08n03i01204arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/analog-modeling/transmission_line_wa.vhd
4
1366
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA library ieee_proposed; use ieee_proposed.electrical_systems.all; entity transmission_line_wa is port ( quantity vin : in voltage; quantity vout : out voltage); end entity transmission_line_wa; ---------------------------------------------------------------- architecture abstract of transmission_line_wa is constant propagation_time : real := 2.5E-9; constant attenuation : real := 0.8; quantity vin_temp : real; begin vin_temp == vin; vout == attenuation * vin_temp'delayed(propagation_time); end architecture abstract;
gpl-2.0
emogenet/ghdl
testsuite/gna/ticket14/test_case.vhd
3
821
library ieee; use ieee.std_logic_1164.all; -- use ieee.numeric_std.all; entity scrambler is generic ( BUS_WIDTH : integer := 8; ARRAY_WIDTH : integer := 2); port ( clk, en, reset, seed : in std_logic; d_in : in std_logic; d_out : out std_logic); end entity scrambler; architecture behavioural of scrambler is type test_array_type is array (ARRAY_WIDTH-1 downto 0) of std_logic_vector (BUS_WIDTH-1 downto 0); signal test_array : test_array_type := (others => (others => '0')); signal test_vec : std_logic_vector (BUS_WIDTH-1 downto 0) := (others => '0'); begin failing_process : process (clk) begin if clk'event and clk = '1' then test_array <= test_array (ARRAY_WIDTH-2 downto 0) & test_vec; end if; end process failing_process; end architecture behavioural;
gpl-2.0
emogenet/ghdl
testsuite/gna/issue106/case1.vhdl
2
447
library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity ent is end entity ent; architecture arch of ent is signal test: natural; constant e : natural := 3; begin LL: case e generate when 0 => when 1 to 4 => test <= 1; when l5: 5 | 7=> test <= 2; when others => end generate ll; process begin wait for 0 ns; assert test = 2; wait; end process; end architecture arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2693.vhd
4
1701
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2693.vhd,v 1.2 2001-10-26 16:30:21 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s04b01x00p04n01i02693ent IS --ERROR: only 1 (+) in exponent allowed in real literal constant A1: REAL:=123E++45; -- failure_here END c13s04b01x00p04n01i02693ent; ARCHITECTURE c13s04b01x00p04n01i02693arch OF c13s04b01x00p04n01i02693ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c13s04b01x00p04n01i02693 - Exponents of decimal literals can have a single plus or minus (optional)." severity ERROR; wait; END PROCESS TESTING; END c13s04b01x00p04n01i02693arch;
gpl-2.0
emogenet/ghdl
testsuite/gna/issue50/vector.d/w_split7.vhd
2
1359
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity w_split7 is port ( clk : in std_logic; ra0_data : out std_logic_vector(7 downto 0); wa0_data : in std_logic_vector(7 downto 0); wa0_addr : in std_logic; wa0_en : in std_logic; ra0_addr : in std_logic ); end w_split7; architecture augh of w_split7 is -- Embedded RAM type ram_type is array (0 to 1) of std_logic_vector(7 downto 0); signal ram : ram_type := ( "00000111", "00000111" ); -- Little utility functions to make VHDL syntactically correct -- with the syntax to_integer(unsigned(vector)) when 'vector' is a std_logic. -- This happens when accessing arrays with <= 2 cells, for example. function to_integer(B: std_logic) return integer is variable V: std_logic_vector(0 to 0); begin V(0) := B; return to_integer(unsigned(V)); end; function to_integer(V: std_logic_vector) return integer is begin return to_integer(unsigned(V)); end; begin -- Sequential process -- It handles the Writes process (clk) begin if rising_edge(clk) then -- Write to the RAM -- Note: there should be only one port. if wa0_en = '1' then ram( to_integer(wa0_addr) ) <= wa0_data; end if; end if; end process; -- The Read side (the outputs) ra0_data <= ram( to_integer(ra0_addr) ); end architecture;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc312.vhd
4
1927
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc312.vhd,v 1.2 2001-10-26 16:29:51 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s01b04x00p07n03i00312ent IS END c03s01b04x00p07n03i00312ent; ARCHITECTURE c03s01b04x00p07n03i00312arch OF c03s01b04x00p07n03i00312ent IS type R1 is range -10.0 to 10.0; type R2 is range REAL'LOW to REAL'HIGH; BEGIN TESTING: PROCESS variable V1 : real := 0.000001; variable V2 : real := 0.000002; variable V3 : real ; BEGIN V3 := V2 - V1; assert NOT(V3 = 0.000001) report "***PASSED TEST: c03s01b04x00p07n03i00312" severity NOTE; assert ( V3 = 0.000001 ) report "***FAILED TEST: c03s01b04x00p07n03i00312 - A minimum of six digits of precision is included in the representation of floating point types." severity ERROR; wait; END PROCESS TESTING; END c03s01b04x00p07n03i00312arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1136.vhd
4
1876
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1136.vhd,v 1.2 2001-10-26 16:30:06 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s05b00x00p04n02i01136ent IS type idx is range 1 to 10; type aray1 is array (idx range <>) of bit; END c06s05b00x00p04n02i01136ent; ARCHITECTURE c06s05b00x00p04n02i01136arch OF c06s05b00x00p04n02i01136ent IS BEGIN TESTING: PROCESS variable v1, v2 : aray1(idx); -- default is all '0' BEGIN -- -- Test the range direction -- v1 := "1111111111"; v2 := v1(10 downto 1); -- range is opposite assert FALSE report "***FAILED TEST: c06s05b00x00p04n02i01136 - The direction of the discrete range must be the same as that of the prefix of the slice name." severity ERROR; wait; END PROCESS TESTING; END c06s05b00x00p04n02i01136arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc517.vhd
4
50622
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc517.vhd,v 1.2 2001-10-26 16:29:55 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- PACKAGE c03s03b00x00p03n04i00517pkg IS -- -- Index types for array declarations -- SUBTYPE st_ind1 IS INTEGER RANGE 1 TO 8; -- index from 1 (POSITIVE) SUBTYPE st_ind2 IS INTEGER RANGE 0 TO 3; -- index from 0 (NATURAL) SUBTYPE st_ind3 IS CHARACTER RANGE 'a' TO 'd'; -- non-INTEGER index SUBTYPE st_ind4 IS INTEGER RANGE 0 DOWNTO -3; -- descending range -- -- Scalar type for subelements -- SUBTYPE st_scl1 IS CHARACTER ; SUBTYPE st_scl3 IS INTEGER RANGE 1 TO INTEGER'HIGH; SUBTYPE st_scl4 IS REAL RANGE 0.0 TO 1024.0; -- ----------------------------------------------------------------------------------------- -- Composite type declarations -- ----------------------------------------------------------------------------------------- -- -- Records of scalars -- TYPE t_scre_1 IS RECORD left : st_scl1; second : TIME; third : st_scl3; right : st_scl4; END RECORD; -- -- Unconstrained arrays of scalars -- TYPE t_usa1_1 IS ARRAY (st_ind1 RANGE <>) OF st_scl1; TYPE t_usa1_2 IS ARRAY (st_ind2 RANGE <>) OF TIME; TYPE t_usa1_3 IS ARRAY (st_ind3 RANGE <>) OF st_scl3; TYPE t_usa1_4 IS ARRAY (st_ind4 RANGE <>) OF st_scl4; TYPE t_usa2_1 IS ARRAY (st_ind2 RANGE <>, st_ind1 RANGE <>) OF st_scl1; TYPE t_usa3_1 IS ARRAY (st_ind3 RANGE <>, st_ind2 RANGE <>, st_ind1 RANGE <>) OF st_scl1; TYPE t_usa4_1 IS ARRAY (st_ind4 RANGE <>, st_ind3 RANGE <>, st_ind2 RANGE <>, st_ind1 RANGE <>) OF st_scl1; -- -- -- Constrained arrays of scalars (make compatable with unconstrained types -- SUBTYPE t_csa1_1 IS t_usa1_1 (st_ind1 ); SUBTYPE t_csa1_2 IS t_usa1_2 (st_ind2 ); SUBTYPE t_csa1_3 IS t_usa1_3 (st_ind3 ); SUBTYPE t_csa1_4 IS t_usa1_4 (st_ind4 ); SUBTYPE t_csa2_1 IS t_usa2_1 (st_ind2 , -- ( i2, i1 ) of CHAR st_ind1 ); SUBTYPE t_csa3_1 IS t_usa3_1 (st_ind3 , -- ( i3, i2, i1) of CHAR st_ind2 , st_ind1 ); SUBTYPE t_csa4_1 IS t_usa4_1 (st_ind4 , -- ( i4, i3, i2, i1 ) of CHAR st_ind3 , st_ind2 , st_ind1 ); -- -- -- constrained arrays of composites -- TYPE t_cca1_1 IS ARRAY (st_ind1) OF t_scre_1; -- ( i1 ) is RECORD of scalar TYPE t_cca1_2 IS ARRAY (st_ind2) OF t_csa1_1; -- ( i2 )( i1 ) is CHAR TYPE t_cca1_3 IS ARRAY (st_ind3) OF t_cca1_2; -- ( i3 )( i2 )( i1 ) is CHAR TYPE t_cca1_4 IS ARRAY (st_ind4) OF t_cca1_3; -- ( i4 )( i3 )( i2 )( i1 ) is CHAR TYPE t_cca2_1 IS ARRAY (st_ind3) OF t_csa2_1; -- ( i3 )( i2, i1 ) is CHAR TYPE t_cca2_2 IS ARRAY (st_ind4, -- ( i4, i3 )( i2, i1 ) of CHAR st_ind3) OF t_csa2_1; TYPE t_cca3_1 IS ARRAY (st_ind4, -- ( i4, i3, i2 )( i1 ) of CHAR st_ind3, st_ind2) OF t_csa1_1; TYPE t_cca3_2 IS ARRAY (st_ind4) OF t_csa3_1; -- ( i4 )( i3, i2, i1 ) is CHAR -- -- Records of composites -- TYPE t_cmre_1 IS RECORD left : t_csa1_1; -- .fN(i1) is CHAR second : t_scre_1; -- .fN.fN END RECORD; TYPE t_cmre_2 IS RECORD left , second , third , right : t_csa1_1; -- .fN(i1) is CHAR END RECORD; -- -- Mixed Records/arrays -- TYPE t_cca1_7 IS ARRAY (st_ind3) OF t_cmre_2; -- (i3).fN(i1) is CHAR TYPE t_cmre_3 IS RECORD left , second , third , right : t_cca1_7; -- .fN(i3).fN(i1) is CHAR END RECORD; -- -- TYPE declarations for resolution function (Constrained types only) -- TYPE t_scre_1_vct IS ARRAY (POSITIVE RANGE <>) OF t_scre_1; TYPE t_csa1_1_vct IS ARRAY (POSITIVE RANGE <>) OF t_csa1_1; TYPE t_csa1_2_vct IS ARRAY (POSITIVE RANGE <>) OF t_csa1_2; TYPE t_csa1_3_vct IS ARRAY (POSITIVE RANGE <>) OF t_csa1_3; TYPE t_csa1_4_vct IS ARRAY (POSITIVE RANGE <>) OF t_csa1_4; TYPE t_csa2_1_vct IS ARRAY (POSITIVE RANGE <>) OF t_csa2_1; TYPE t_csa3_1_vct IS ARRAY (POSITIVE RANGE <>) OF t_csa3_1; TYPE t_csa4_1_vct IS ARRAY (POSITIVE RANGE <>) OF t_csa4_1; TYPE t_cca1_1_vct IS ARRAY (POSITIVE RANGE <>) OF t_cca1_1; TYPE t_cca1_2_vct IS ARRAY (POSITIVE RANGE <>) OF t_cca1_2; TYPE t_cca1_3_vct IS ARRAY (POSITIVE RANGE <>) OF t_cca1_3; TYPE t_cca1_4_vct IS ARRAY (POSITIVE RANGE <>) OF t_cca1_4; TYPE t_cca2_1_vct IS ARRAY (POSITIVE RANGE <>) OF t_cca2_1; TYPE t_cca2_2_vct IS ARRAY (POSITIVE RANGE <>) OF t_cca2_2; TYPE t_cca3_1_vct IS ARRAY (POSITIVE RANGE <>) OF t_cca3_1; TYPE t_cca3_2_vct IS ARRAY (POSITIVE RANGE <>) OF t_cca3_2; TYPE t_cmre_1_vct IS ARRAY (POSITIVE RANGE <>) OF t_cmre_1; TYPE t_cmre_2_vct IS ARRAY (POSITIVE RANGE <>) OF t_cmre_2; TYPE t_cca1_7_vct IS ARRAY (POSITIVE RANGE <>) OF t_cca1_7; TYPE t_cmre_3_vct IS ARRAY (POSITIVE RANGE <>) OF t_cmre_3; -- -- Declaration of Resolution Functions -- FUNCTION rf_scre_1 ( v: t_scre_1_vct ) RETURN t_scre_1; FUNCTION rf_csa1_1 ( v: t_csa1_1_vct ) RETURN t_csa1_1; FUNCTION rf_csa1_2 ( v: t_csa1_2_vct ) RETURN t_csa1_2; FUNCTION rf_csa1_3 ( v: t_csa1_3_vct ) RETURN t_csa1_3; FUNCTION rf_csa1_4 ( v: t_csa1_4_vct ) RETURN t_csa1_4; FUNCTION rf_csa2_1 ( v: t_csa2_1_vct ) RETURN t_csa2_1; FUNCTION rf_csa3_1 ( v: t_csa3_1_vct ) RETURN t_csa3_1; FUNCTION rf_csa4_1 ( v: t_csa4_1_vct ) RETURN t_csa4_1; FUNCTION rf_cca1_1 ( v: t_cca1_1_vct ) RETURN t_cca1_1; FUNCTION rf_cca1_2 ( v: t_cca1_2_vct ) RETURN t_cca1_2; FUNCTION rf_cca1_3 ( v: t_cca1_3_vct ) RETURN t_cca1_3; FUNCTION rf_cca1_4 ( v: t_cca1_4_vct ) RETURN t_cca1_4; FUNCTION rf_cca2_1 ( v: t_cca2_1_vct ) RETURN t_cca2_1; FUNCTION rf_cca2_2 ( v: t_cca2_2_vct ) RETURN t_cca2_2; FUNCTION rf_cca3_1 ( v: t_cca3_1_vct ) RETURN t_cca3_1; FUNCTION rf_cca3_2 ( v: t_cca3_2_vct ) RETURN t_cca3_2; FUNCTION rf_cmre_1 ( v: t_cmre_1_vct ) RETURN t_cmre_1; FUNCTION rf_cmre_2 ( v: t_cmre_2_vct ) RETURN t_cmre_2; FUNCTION rf_cca1_7 ( v: t_cca1_7_vct ) RETURN t_cca1_7; FUNCTION rf_cmre_3 ( v: t_cmre_3_vct ) RETURN t_cmre_3; -- -- Resolved SUBTYPE declaration -- SUBTYPE rst_scre_1 IS rf_scre_1 t_scre_1 ; SUBTYPE rst_csa1_1 IS rf_csa1_1 t_csa1_1 ; SUBTYPE rst_csa1_2 IS rf_csa1_2 t_csa1_2 ; SUBTYPE rst_csa1_3 IS rf_csa1_3 t_csa1_3 ; SUBTYPE rst_csa1_4 IS rf_csa1_4 t_csa1_4 ; SUBTYPE rst_csa2_1 IS rf_csa2_1 t_csa2_1 ; SUBTYPE rst_csa3_1 IS rf_csa3_1 t_csa3_1 ; SUBTYPE rst_csa4_1 IS rf_csa4_1 t_csa4_1 ; SUBTYPE rst_cca1_1 IS rf_cca1_1 t_cca1_1 ; SUBTYPE rst_cca1_2 IS rf_cca1_2 t_cca1_2 ; SUBTYPE rst_cca1_3 IS rf_cca1_3 t_cca1_3 ; SUBTYPE rst_cca1_4 IS rf_cca1_4 t_cca1_4 ; SUBTYPE rst_cca2_1 IS rf_cca2_1 t_cca2_1 ; SUBTYPE rst_cca2_2 IS rf_cca2_2 t_cca2_2 ; SUBTYPE rst_cca3_1 IS rf_cca3_1 t_cca3_1 ; SUBTYPE rst_cca3_2 IS rf_cca3_2 t_cca3_2 ; SUBTYPE rst_cmre_1 IS rf_cmre_1 t_cmre_1 ; SUBTYPE rst_cmre_2 IS rf_cmre_2 t_cmre_2 ; SUBTYPE rst_cca1_7 IS rf_cca1_7 t_cca1_7 ; SUBTYPE rst_cmre_3 IS rf_cmre_3 t_cmre_3 ; -- -- Functions declarations for multi-dimensional comosite values -- FUNCTION F_csa2_1 ( v0,v2 : IN st_scl1 ) RETURN t_csa2_1 ; FUNCTION F_csa3_1 ( v0,v2 : IN st_scl1 ) RETURN t_csa3_1 ; FUNCTION F_csa4_1 ( v0,v2 : IN st_scl1 ) RETURN t_csa4_1 ; FUNCTION F_cca2_2 ( v0,v2 : IN t_csa2_1 ) RETURN t_cca2_2 ; FUNCTION F_cca3_1 ( v0,v2 : IN t_csa1_1 ) RETURN t_cca3_1 ; -- ------------------------------------------------------------------------------------------- -- Data values for Composite Types -- ------------------------------------------------------------------------------------------- CONSTANT CX_scl1 : st_scl1 := 'X' ; CONSTANT C0_scl1 : st_scl1 := st_scl1'LEFT ; CONSTANT C1_scl1 : st_scl1 := 'A' ; CONSTANT C2_scl1 : st_scl1 := 'Z' ; CONSTANT CX_scl2 : TIME := 99 fs ; CONSTANT C0_scl2 : TIME := TIME'LEFT ; CONSTANT C1_scl2 : TIME := 0 fs; CONSTANT C2_scl2 : TIME := 2 ns; CONSTANT CX_scl3 : st_scl3 := 15 ; CONSTANT C0_scl3 : st_scl3 := st_scl3'LEFT ; CONSTANT C1_scl3 : st_scl3 := 6 ; CONSTANT C2_scl3 : st_scl3 := 8 ; CONSTANT CX_scl4 : st_scl4 := 99.9 ; CONSTANT C0_scl4 : st_scl4 := st_scl4'LEFT ; CONSTANT C1_scl4 : st_scl4 := 1.0 ; CONSTANT C2_scl4 : st_scl4 := 2.1 ; CONSTANT CX_scre_1 : t_scre_1 := ( CX_scl1, CX_scl2, CX_scl3, CX_scl4 ); CONSTANT C0_scre_1 : t_scre_1 := ( C0_scl1, C0_scl2, C0_scl3, C0_scl4 ); CONSTANT C1_scre_1 : t_scre_1 := ( C1_scl1, C1_scl2, C1_scl3, C1_scl4 ); CONSTANT C2_scre_1 : t_scre_1 := ( C2_scl1, C0_scl2, C0_scl3, C2_scl4 ); CONSTANT CX_csa1_1 : t_csa1_1 := ( OTHERS=>CX_scl1); CONSTANT C0_csa1_1 : t_csa1_1 := ( OTHERS=>C0_scl1); CONSTANT C1_csa1_1 : t_csa1_1 := ( OTHERS=>C1_scl1); CONSTANT C2_csa1_1 : t_csa1_1 := ( t_csa1_1'LEFT|t_csa1_1'RIGHT=>C2_scl1, OTHERS =>C0_scl1); CONSTANT CX_csa1_2 : t_csa1_2 := ( OTHERS=>CX_scl2); CONSTANT C0_csa1_2 : t_csa1_2 := ( OTHERS=>C0_scl2); CONSTANT C1_csa1_2 : t_csa1_2 := ( OTHERS=>C1_scl2); CONSTANT C2_csa1_2 : t_csa1_2 := ( t_csa1_2'LEFT|t_csa1_2'RIGHT=>C2_scl2, OTHERS =>C0_scl2); CONSTANT CX_csa1_3 : t_csa1_3 := ( OTHERS=>CX_scl3); CONSTANT C0_csa1_3 : t_csa1_3 := ( OTHERS=>C0_scl3); CONSTANT C1_csa1_3 : t_csa1_3 := ( OTHERS=>C1_scl3); CONSTANT C2_csa1_3 : t_csa1_3 := ( t_csa1_3'LEFT|t_csa1_3'RIGHT=>C2_scl3, OTHERS =>C0_scl3); CONSTANT CX_csa1_4 : t_csa1_4 := ( OTHERS=>CX_scl4); CONSTANT C0_csa1_4 : t_csa1_4 := ( OTHERS=>C0_scl4); CONSTANT C1_csa1_4 : t_csa1_4 := ( OTHERS=>C1_scl4); CONSTANT C2_csa1_4 : t_csa1_4 := ( t_csa1_4'LEFT|t_csa1_4'RIGHT=>C2_scl4, OTHERS =>C0_scl4); -- CONSTANT CX_csa2_1 : t_csa2_1 ; CONSTANT C0_csa2_1 : t_csa2_1 ; CONSTANT C1_csa2_1 : t_csa2_1 ; CONSTANT C2_csa2_1 : t_csa2_1 ; CONSTANT CX_csa3_1 : t_csa3_1 ; CONSTANT C0_csa3_1 : t_csa3_1 ; CONSTANT C1_csa3_1 : t_csa3_1 ; CONSTANT C2_csa3_1 : t_csa3_1 ; CONSTANT CX_csa4_1 : t_csa4_1 ; CONSTANT C0_csa4_1 : t_csa4_1 ; CONSTANT C1_csa4_1 : t_csa4_1 ; CONSTANT C2_csa4_1 : t_csa4_1 ; -- CONSTANT CX_cca1_1 : t_cca1_1 := ( OTHERS=>CX_scre_1 ); CONSTANT C0_cca1_1 : t_cca1_1 := ( OTHERS=>C0_scre_1 ); CONSTANT C1_cca1_1 : t_cca1_1 := ( OTHERS=>C1_scre_1 ); CONSTANT C2_cca1_1 : t_cca1_1 := ( C2_scre_1, C0_scre_1, C0_scre_1, C0_scre_1, C0_scre_1, C0_scre_1, C0_scre_1, C2_scre_1 ); CONSTANT CX_cca1_2 : t_cca1_2 := ( OTHERS=>CX_csa1_1 ); CONSTANT C0_cca1_2 : t_cca1_2 := ( OTHERS=>C0_csa1_1 ); CONSTANT C1_cca1_2 : t_cca1_2 := ( OTHERS=>C1_csa1_1 ); CONSTANT C2_cca1_2 : t_cca1_2 := ( C2_csa1_1, C0_csa1_1, C0_csa1_1, C2_csa1_1 ); CONSTANT CX_cca1_3 : t_cca1_3 := ( OTHERS=>CX_cca1_2 ); CONSTANT C0_cca1_3 : t_cca1_3 := ( OTHERS=>C0_cca1_2 ); CONSTANT C1_cca1_3 : t_cca1_3 := ( OTHERS=>C1_cca1_2 ); CONSTANT C2_cca1_3 : t_cca1_3 := ( C2_cca1_2, C0_cca1_2, C0_cca1_2, C2_cca1_2 ); CONSTANT CX_cca1_4 : t_cca1_4 := ( OTHERS=>CX_cca1_3 ); CONSTANT C0_cca1_4 : t_cca1_4 := ( OTHERS=>C0_cca1_3 ); CONSTANT C1_cca1_4 : t_cca1_4 := ( OTHERS=>C1_cca1_3 ); CONSTANT C2_cca1_4 : t_cca1_4 := ( C2_cca1_3, C0_cca1_3, C0_cca1_3, C2_cca1_3 ); CONSTANT CX_cca2_1 : t_cca2_1 ; CONSTANT C0_cca2_1 : t_cca2_1 ; CONSTANT C1_cca2_1 : t_cca2_1 ; CONSTANT C2_cca2_1 : t_cca2_1 ; -- CONSTANT CX_cca2_2 : t_cca2_2 ; CONSTANT C0_cca2_2 : t_cca2_2 ; CONSTANT C1_cca2_2 : t_cca2_2 ; CONSTANT C2_cca2_2 : t_cca2_2 ; CONSTANT CX_cca3_1 : t_cca3_1 ; CONSTANT C0_cca3_1 : t_cca3_1 ; CONSTANT C1_cca3_1 : t_cca3_1 ; CONSTANT C2_cca3_1 : t_cca3_1 ; -- CONSTANT CX_cca3_2 : t_cca3_2 ; CONSTANT C0_cca3_2 : t_cca3_2 ; CONSTANT C1_cca3_2 : t_cca3_2 ; CONSTANT C2_cca3_2 : t_cca3_2 ; CONSTANT CX_cmre_1 : t_cmre_1 := ( CX_csa1_1, CX_scre_1 ); CONSTANT C0_cmre_1 : t_cmre_1 := ( C0_csa1_1, C0_scre_1 ); CONSTANT C1_cmre_1 : t_cmre_1 := ( C1_csa1_1, C1_scre_1 ); CONSTANT C2_cmre_1 : t_cmre_1 := ( C2_csa1_1, C0_scre_1 ); CONSTANT CX_cmre_2 : t_cmre_2 := ( OTHERS=>CX_csa1_1 ); CONSTANT C0_cmre_2 : t_cmre_2 := ( OTHERS=>C0_csa1_1 ); CONSTANT C1_cmre_2 : t_cmre_2 := ( OTHERS=>C1_csa1_1 ); CONSTANT C2_cmre_2 : t_cmre_2 := ( left|right=>C2_csa1_1, OTHERS=>C0_csa1_1 ); CONSTANT CX_cca1_7 : t_cca1_7 := ( OTHERS=>CX_cmre_2 ); CONSTANT C0_cca1_7 : t_cca1_7 := ( OTHERS=>C0_cmre_2 ); CONSTANT C1_cca1_7 : t_cca1_7 := ( OTHERS=>C1_cmre_2 ); CONSTANT C2_cca1_7 : t_cca1_7 := ( C2_cmre_2, C0_cmre_2, C0_cmre_2, C2_cmre_2 ); CONSTANT CX_cmre_3 : t_cmre_3 := ( OTHERS=>CX_cca1_7 ); CONSTANT C0_cmre_3 : t_cmre_3 := ( OTHERS=>C0_cca1_7 ); CONSTANT C1_cmre_3 : t_cmre_3 := ( OTHERS=>C1_cca1_7 ); CONSTANT C2_cmre_3 : t_cmre_3 := ( left|right=>C2_cca1_7, OTHERS=>C0_cca1_7 ); -- -------------------------------------------------------------------------------------------- -- Functions for mapping from integer test values to/from values of the Test types -- -------------------------------------------------------------------------------------------- FUNCTION val_t ( i : INTEGER ) RETURN st_scl1; FUNCTION val_t ( i : INTEGER ) RETURN TIME; FUNCTION val_t ( i : INTEGER ) RETURN st_scl3; FUNCTION val_t ( i : INTEGER ) RETURN st_scl4; FUNCTION val_t ( i : INTEGER ) RETURN t_scre_1; FUNCTION val_t ( i : INTEGER ) RETURN t_csa1_1; FUNCTION val_t ( i : INTEGER ) RETURN t_csa1_2; FUNCTION val_t ( i : INTEGER ) RETURN t_csa1_3; FUNCTION val_t ( i : INTEGER ) RETURN t_csa1_4; FUNCTION val_t ( i : INTEGER ) RETURN t_csa2_1; FUNCTION val_t ( i : INTEGER ) RETURN t_csa3_1; FUNCTION val_t ( i : INTEGER ) RETURN t_csa4_1; FUNCTION val_t ( i : INTEGER ) RETURN t_cca1_1; FUNCTION val_t ( i : INTEGER ) RETURN t_cca1_2; FUNCTION val_t ( i : INTEGER ) RETURN t_cca1_3; FUNCTION val_t ( i : INTEGER ) RETURN t_cca1_4; FUNCTION val_t ( i : INTEGER ) RETURN t_cca2_1; FUNCTION val_t ( i : INTEGER ) RETURN t_cca2_2; FUNCTION val_t ( i : INTEGER ) RETURN t_cca3_1; FUNCTION val_t ( i : INTEGER ) RETURN t_cca3_2; FUNCTION val_t ( i : INTEGER ) RETURN t_cmre_1; FUNCTION val_t ( i : INTEGER ) RETURN t_cmre_2; FUNCTION val_t ( i : INTEGER ) RETURN t_cca1_7; FUNCTION val_t ( i : INTEGER ) RETURN t_cmre_3; FUNCTION val_i ( i : st_scl1 ) RETURN INTEGER; FUNCTION val_i ( i : TIME ) RETURN INTEGER; FUNCTION val_i ( i : st_scl3 ) RETURN INTEGER; FUNCTION val_i ( i : st_scl4 ) RETURN INTEGER; FUNCTION val_i ( i : t_scre_1 ) RETURN INTEGER; FUNCTION val_i ( i : t_csa1_1 ) RETURN INTEGER; FUNCTION val_i ( i : t_csa1_2 ) RETURN INTEGER; FUNCTION val_i ( i : t_csa1_3 ) RETURN INTEGER; FUNCTION val_i ( i : t_csa1_4 ) RETURN INTEGER; FUNCTION val_i ( i : t_csa2_1 ) RETURN INTEGER; FUNCTION val_i ( i : t_csa3_1 ) RETURN INTEGER; FUNCTION val_i ( i : t_csa4_1 ) RETURN INTEGER; FUNCTION val_i ( i : t_cca1_1 ) RETURN INTEGER; FUNCTION val_i ( i : t_cca1_2 ) RETURN INTEGER; FUNCTION val_i ( i : t_cca1_3 ) RETURN INTEGER; FUNCTION val_i ( i : t_cca1_4 ) RETURN INTEGER; FUNCTION val_i ( i : t_cca2_1 ) RETURN INTEGER; FUNCTION val_i ( i : t_cca2_2 ) RETURN INTEGER; FUNCTION val_i ( i : t_cca3_1 ) RETURN INTEGER; FUNCTION val_i ( i : t_cca3_2 ) RETURN INTEGER; FUNCTION val_i ( i : t_cmre_1 ) RETURN INTEGER; FUNCTION val_i ( i : t_cmre_2 ) RETURN INTEGER; FUNCTION val_i ( i : t_cca1_7 ) RETURN INTEGER; FUNCTION val_i ( i : t_cmre_3 ) RETURN INTEGER; FUNCTION val_s ( i : st_scl1 ) RETURN STRING; FUNCTION val_s ( i : TIME ) RETURN STRING; FUNCTION val_s ( i : st_scl3 ) RETURN STRING; FUNCTION val_s ( i : st_scl4 ) RETURN STRING; FUNCTION val_s ( i : t_scre_1 ) RETURN STRING; FUNCTION val_s ( i : t_csa1_1 ) RETURN STRING; FUNCTION val_s ( i : t_csa1_2 ) RETURN STRING; FUNCTION val_s ( i : t_csa1_3 ) RETURN STRING; FUNCTION val_s ( i : t_csa1_4 ) RETURN STRING; FUNCTION val_s ( i : t_csa2_1 ) RETURN STRING; FUNCTION val_s ( i : t_csa3_1 ) RETURN STRING; FUNCTION val_s ( i : t_csa4_1 ) RETURN STRING; FUNCTION val_s ( i : t_cca1_1 ) RETURN STRING; FUNCTION val_s ( i : t_cca1_2 ) RETURN STRING; FUNCTION val_s ( i : t_cca1_3 ) RETURN STRING; FUNCTION val_s ( i : t_cca1_4 ) RETURN STRING; FUNCTION val_s ( i : t_cca2_1 ) RETURN STRING; FUNCTION val_s ( i : t_cca2_2 ) RETURN STRING; FUNCTION val_s ( i : t_cca3_1 ) RETURN STRING; FUNCTION val_s ( i : t_cca3_2 ) RETURN STRING; FUNCTION val_s ( i : t_cmre_1 ) RETURN STRING; FUNCTION val_s ( i : t_cmre_2 ) RETURN STRING; FUNCTION val_s ( i : t_cca1_7 ) RETURN STRING; FUNCTION val_s ( i : t_cmre_3 ) RETURN STRING; END; PACKAGE BODY c03s03b00x00p03n04i00517pkg IS CONSTANT CX_csa2_1 : t_csa2_1 := F_csa2_1 ( CX_scl1, CX_scl1 ); CONSTANT C0_csa2_1 : t_csa2_1 := F_csa2_1 ( C0_scl1, C0_scl1 ); CONSTANT C1_csa2_1 : t_csa2_1 := F_csa2_1 ( C1_scl1, C1_scl1 ); CONSTANT C2_csa2_1 : t_csa2_1 := F_csa2_1 ( C0_scl1, C2_scl1 ); CONSTANT CX_csa3_1 : t_csa3_1 := F_csa3_1 ( CX_scl1, CX_scl1 ); CONSTANT C0_csa3_1 : t_csa3_1 := F_csa3_1 ( C0_scl1, C0_scl1 ); CONSTANT C1_csa3_1 : t_csa3_1 := F_csa3_1 ( C1_scl1, C1_scl1 ); CONSTANT C2_csa3_1 : t_csa3_1 := F_csa3_1 ( C0_scl1, C2_scl1 ); CONSTANT CX_csa4_1 : t_csa4_1 := F_csa4_1 ( CX_scl1, CX_scl1 ); CONSTANT C0_csa4_1 : t_csa4_1 := F_csa4_1 ( C0_scl1, C0_scl1 ); CONSTANT C1_csa4_1 : t_csa4_1 := F_csa4_1 ( C1_scl1, C1_scl1 ); CONSTANT C2_csa4_1 : t_csa4_1 := F_csa4_1 ( C0_scl1, C2_scl1 ); CONSTANT CX_cca2_1 : t_cca2_1 := ( OTHERS=>CX_csa2_1 ); CONSTANT C0_cca2_1 : t_cca2_1 := ( OTHERS=>C0_csa2_1 ); CONSTANT C1_cca2_1 : t_cca2_1 := ( OTHERS=>C1_csa2_1 ); CONSTANT C2_cca2_1 : t_cca2_1 := ( C2_csa2_1, C0_csa2_1, C0_csa2_1, C2_csa2_1 ); CONSTANT CX_cca2_2 : t_cca2_2 := F_cca2_2 ( CX_csa2_1, CX_csa2_1 ); CONSTANT C0_cca2_2 : t_cca2_2 := F_cca2_2 ( C0_csa2_1, C0_csa2_1 ); CONSTANT C1_cca2_2 : t_cca2_2 := F_cca2_2 ( C1_csa2_1, C1_csa2_1 ); CONSTANT C2_cca2_2 : t_cca2_2 := F_cca2_2 ( C0_csa2_1, C2_csa2_1 ); CONSTANT CX_cca3_1 : t_cca3_1 := F_cca3_1 ( CX_csa1_1, CX_csa1_1 ); CONSTANT C0_cca3_1 : t_cca3_1 := F_cca3_1 ( C0_csa1_1, C0_csa1_1 ); CONSTANT C1_cca3_1 : t_cca3_1 := F_cca3_1 ( C1_csa1_1, C1_csa1_1 ); CONSTANT C2_cca3_1 : t_cca3_1 := F_cca3_1 ( C0_csa1_1, C2_csa1_1 ); CONSTANT CX_cca3_2 : t_cca3_2 := ( OTHERS=>CX_csa3_1 ); CONSTANT C0_cca3_2 : t_cca3_2 := ( OTHERS=>C0_csa3_1 ); CONSTANT C1_cca3_2 : t_cca3_2 := ( OTHERS=>C1_csa3_1 ); CONSTANT C2_cca3_2 : t_cca3_2 := ( C2_csa3_1, C0_csa3_1, C0_csa3_1, C2_csa3_1 ); -- -- Functions to provide values for multi-dimensional composites -- FUNCTION F_csa2_1 ( v0,v2 : IN st_scl1 ) RETURN t_csa2_1 IS VARIABLE res : t_csa2_1; BEGIN FOR i IN res'RANGE(1) LOOP FOR j IN res'RANGE(2) LOOP res(i,j) := v0; END LOOP; END LOOP; res(res'left (1),res'left (2)) := v2; res(res'left (1),res'right(2)) := v2; res(res'right(1),res'left (2)) := v2; res(res'right(1),res'right(2)) := v2; RETURN res; END; FUNCTION F_csa3_1 ( v0,v2 : IN st_scl1 ) RETURN t_csa3_1 IS VARIABLE res : t_csa3_1; BEGIN FOR i IN res'RANGE(1) LOOP FOR j IN res'RANGE(2) LOOP FOR k IN res'RANGE(3) LOOP res(i,j,k) := v0; END LOOP; END LOOP; END LOOP; res(res'left (1),res'left (2),res'left (3)) := v2; res(res'right(1),res'left (2),res'left (3)) := v2; res(res'left (1),res'right(2),res'left (3)) := v2; res(res'right(1),res'right(2),res'left (3)) := v2; res(res'left (1),res'left (2),res'right(3)) := v2; res(res'right(1),res'left (2),res'right(3)) := v2; res(res'left (1),res'right(2),res'right(3)) := v2; res(res'right(1),res'right(2),res'right(3)) := v2; RETURN res; END; FUNCTION F_csa4_1 ( v0,v2 : IN st_scl1 ) RETURN t_csa4_1 IS VARIABLE res : t_csa4_1; BEGIN FOR i IN res'RANGE(1) LOOP FOR j IN res'RANGE(2) LOOP FOR k IN res'RANGE(3) LOOP FOR l IN res'RANGE(4) LOOP res(i,j,k,l) := v0; END LOOP; END LOOP; END LOOP; END LOOP; res(res'left (1),res'left (2),res'left (3),res'left (4)) := v2; res(res'right(1),res'left (2),res'left (3),res'left (4)) := v2; res(res'left (1),res'right(2),res'left (3),res'left (4)) := v2; res(res'right(1),res'right(2),res'left (3),res'left (4)) := v2; res(res'left (1),res'left (2),res'right(3),res'left (4)) := v2; res(res'right(1),res'left (2),res'right(3),res'left (4)) := v2; res(res'left (1),res'right(2),res'right(3),res'left (4)) := v2; res(res'right(1),res'right(2),res'right(3),res'left (4)) := v2; res(res'left (1),res'left (2),res'left (3),res'right(4)) := v2; res(res'right(1),res'left (2),res'left (3),res'right(4)) := v2; res(res'left (1),res'right(2),res'left (3),res'right(4)) := v2; res(res'right(1),res'right(2),res'left (3),res'right(4)) := v2; res(res'left (1),res'left (2),res'right(3),res'right(4)) := v2; res(res'right(1),res'left (2),res'right(3),res'right(4)) := v2; res(res'left (1),res'right(2),res'right(3),res'right(4)) := v2; res(res'right(1),res'right(2),res'right(3),res'right(4)) := v2; RETURN res; END; FUNCTION F_cca2_2 ( v0,v2 : IN t_csa2_1 ) RETURN t_cca2_2 IS VARIABLE res : t_cca2_2; BEGIN FOR i IN res'RANGE(1) LOOP FOR j IN res'RANGE(2) LOOP res(i,j) := v0; END LOOP; END LOOP; res(res'left (1),res'left (2)) := v2; res(res'left (1),res'right(2)) := v2; res(res'right(1),res'left (2)) := v2; res(res'right(1),res'right(2)) := v2; RETURN res; END; FUNCTION F_cca3_1 ( v0,v2 : IN t_csa1_1 ) RETURN t_cca3_1 IS VARIABLE res : t_cca3_1; BEGIN FOR i IN res'RANGE(1) LOOP FOR j IN res'RANGE(2) LOOP FOR k IN res'RANGE(3) LOOP res(i,j,k) := v0; END LOOP; END LOOP; END LOOP; res(res'left (1),res'left (2),res'left (3)) := v2; res(res'right(1),res'left (2),res'left (3)) := v2; res(res'left (1),res'right(2),res'left (3)) := v2; res(res'right(1),res'right(2),res'left (3)) := v2; res(res'left (1),res'left (2),res'right(3)) := v2; res(res'right(1),res'left (2),res'right(3)) := v2; res(res'left (1),res'right(2),res'right(3)) := v2; res(res'right(1),res'right(2),res'right(3)) := v2; RETURN res; END; -- -- Resolution Functions -- FUNCTION rf_scre_1 ( v: t_scre_1_vct ) RETURN t_scre_1 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_scre_1; ELSE RETURN v(1); END IF; END; FUNCTION rf_csa1_1 ( v: t_csa1_1_vct ) RETURN t_csa1_1 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_csa1_1; ELSE RETURN v(1); END IF; END; FUNCTION rf_csa1_2 ( v: t_csa1_2_vct ) RETURN t_csa1_2 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_csa1_2; ELSE RETURN v(1); END IF; END; FUNCTION rf_csa1_3 ( v: t_csa1_3_vct ) RETURN t_csa1_3 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_csa1_3; ELSE RETURN v(1); END IF; END; FUNCTION rf_csa1_4 ( v: t_csa1_4_vct ) RETURN t_csa1_4 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_csa1_4; ELSE RETURN v(1); END IF; END; FUNCTION rf_csa2_1 ( v: t_csa2_1_vct ) RETURN t_csa2_1 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_csa2_1; ELSE RETURN v(1); END IF; END; FUNCTION rf_csa3_1 ( v: t_csa3_1_vct ) RETURN t_csa3_1 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_csa3_1; ELSE RETURN v(1); END IF; END; FUNCTION rf_csa4_1 ( v: t_csa4_1_vct ) RETURN t_csa4_1 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_csa4_1; ELSE RETURN v(1); END IF; END; FUNCTION rf_cca1_1 ( v: t_cca1_1_vct ) RETURN t_cca1_1 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cca1_1; ELSE RETURN v(1); END IF; END; FUNCTION rf_cca1_2 ( v: t_cca1_2_vct ) RETURN t_cca1_2 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cca1_2; ELSE RETURN v(1); END IF; END; FUNCTION rf_cca1_3 ( v: t_cca1_3_vct ) RETURN t_cca1_3 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cca1_3; ELSE RETURN v(1); END IF; END; FUNCTION rf_cca1_4 ( v: t_cca1_4_vct ) RETURN t_cca1_4 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cca1_4; ELSE RETURN v(1); END IF; END; FUNCTION rf_cca2_1 ( v: t_cca2_1_vct ) RETURN t_cca2_1 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cca2_1; ELSE RETURN v(1); END IF; END; FUNCTION rf_cca2_2 ( v: t_cca2_2_vct ) RETURN t_cca2_2 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cca2_2; ELSE RETURN v(1); END IF; END; FUNCTION rf_cca3_1 ( v: t_cca3_1_vct ) RETURN t_cca3_1 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cca3_1; ELSE RETURN v(1); END IF; END; FUNCTION rf_cca3_2 ( v: t_cca3_2_vct ) RETURN t_cca3_2 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cca3_2; ELSE RETURN v(1); END IF; END; FUNCTION rf_cmre_1 ( v: t_cmre_1_vct ) RETURN t_cmre_1 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cmre_1; ELSE RETURN v(1); END IF; END; FUNCTION rf_cmre_2 ( v: t_cmre_2_vct ) RETURN t_cmre_2 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cmre_2; ELSE RETURN v(1); END IF; END; FUNCTION rf_cca1_7 ( v: t_cca1_7_vct ) RETURN t_cca1_7 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cca1_7; ELSE RETURN v(1); END IF; END; FUNCTION rf_cmre_3 ( v: t_cmre_3_vct ) RETURN t_cmre_3 IS BEGIN IF v'LENGTH=0 THEN RETURN CX_cmre_3; ELSE RETURN v(1); END IF; END; -- -- FUNCTION val_t ( i : INTEGER ) RETURN st_scl1 IS BEGIN IF i = 0 THEN RETURN C0_scl1; END IF; IF i = 1 THEN RETURN C1_scl1; END IF; IF i = 2 THEN RETURN C2_scl1; END IF; RETURN CX_scl1; END; FUNCTION val_t ( i : INTEGER ) RETURN TIME IS BEGIN IF i = 0 THEN RETURN C0_scl2; END IF; IF i = 1 THEN RETURN C1_scl2; END IF; IF i = 2 THEN RETURN C2_scl2; END IF; RETURN CX_scl2; END; FUNCTION val_t ( i : INTEGER ) RETURN st_scl3 IS BEGIN IF i = 0 THEN RETURN C0_scl3; END IF; IF i = 1 THEN RETURN C1_scl3; END IF; IF i = 2 THEN RETURN C2_scl3; END IF; RETURN CX_scl3; END; FUNCTION val_t ( i : INTEGER ) RETURN st_scl4 IS BEGIN IF i = 0 THEN RETURN C0_scl4; END IF; IF i = 1 THEN RETURN C1_scl4; END IF; IF i = 2 THEN RETURN C2_scl4; END IF; RETURN CX_scl4; END; FUNCTION val_t ( i : INTEGER ) RETURN t_scre_1 IS BEGIN IF i = 0 THEN RETURN C0_scre_1; END IF; IF i = 1 THEN RETURN C1_scre_1; END IF; IF i = 2 THEN RETURN C2_scre_1; END IF; RETURN CX_scre_1; END; FUNCTION val_t ( i : INTEGER ) RETURN t_csa1_1 IS BEGIN IF i = 0 THEN RETURN C0_csa1_1; END IF; IF i = 1 THEN RETURN C1_csa1_1; END IF; IF i = 2 THEN RETURN C2_csa1_1; END IF; RETURN CX_csa1_1; END; FUNCTION val_t ( i : INTEGER ) RETURN t_csa1_2 IS BEGIN IF i = 0 THEN RETURN C0_csa1_2; END IF; IF i = 1 THEN RETURN C1_csa1_2; END IF; IF i = 2 THEN RETURN C2_csa1_2; END IF; RETURN CX_csa1_2; END; FUNCTION val_t ( i : INTEGER ) RETURN t_csa1_3 IS BEGIN IF i = 0 THEN RETURN C0_csa1_3; END IF; IF i = 1 THEN RETURN C1_csa1_3; END IF; IF i = 2 THEN RETURN C2_csa1_3; END IF; RETURN CX_csa1_3; END; FUNCTION val_t ( i : INTEGER ) RETURN t_csa1_4 IS BEGIN IF i = 0 THEN RETURN C0_csa1_4; END IF; IF i = 1 THEN RETURN C1_csa1_4; END IF; IF i = 2 THEN RETURN C2_csa1_4; END IF; RETURN CX_csa1_4; END; FUNCTION val_t ( i : INTEGER ) RETURN t_csa2_1 IS BEGIN IF i = 0 THEN RETURN C0_csa2_1; END IF; IF i = 1 THEN RETURN C1_csa2_1; END IF; IF i = 2 THEN RETURN C2_csa2_1; END IF; RETURN CX_csa2_1; END; FUNCTION val_t ( i : INTEGER ) RETURN t_csa3_1 IS BEGIN IF i = 0 THEN RETURN C0_csa3_1; END IF; IF i = 1 THEN RETURN C1_csa3_1; END IF; IF i = 2 THEN RETURN C2_csa3_1; END IF; RETURN CX_csa3_1; END; FUNCTION val_t ( i : INTEGER ) RETURN t_csa4_1 IS BEGIN IF i = 0 THEN RETURN C0_csa4_1; END IF; IF i = 1 THEN RETURN C1_csa4_1; END IF; IF i = 2 THEN RETURN C2_csa4_1; END IF; RETURN CX_csa4_1; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cca1_1 IS BEGIN IF i = 0 THEN RETURN C0_cca1_1; END IF; IF i = 1 THEN RETURN C1_cca1_1; END IF; IF i = 2 THEN RETURN C2_cca1_1; END IF; RETURN CX_cca1_1; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cca1_2 IS BEGIN IF i = 0 THEN RETURN C0_cca1_2; END IF; IF i = 1 THEN RETURN C1_cca1_2; END IF; IF i = 2 THEN RETURN C2_cca1_2; END IF; RETURN CX_cca1_2; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cca1_3 IS BEGIN IF i = 0 THEN RETURN C0_cca1_3; END IF; IF i = 1 THEN RETURN C1_cca1_3; END IF; IF i = 2 THEN RETURN C2_cca1_3; END IF; RETURN CX_cca1_3; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cca1_4 IS BEGIN IF i = 0 THEN RETURN C0_cca1_4; END IF; IF i = 1 THEN RETURN C1_cca1_4; END IF; IF i = 2 THEN RETURN C2_cca1_4; END IF; RETURN CX_cca1_4; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cca2_1 IS BEGIN IF i = 0 THEN RETURN C0_cca2_1; END IF; IF i = 1 THEN RETURN C1_cca2_1; END IF; IF i = 2 THEN RETURN C2_cca2_1; END IF; RETURN CX_cca2_1; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cca2_2 IS BEGIN IF i = 0 THEN RETURN C0_cca2_2; END IF; IF i = 1 THEN RETURN C1_cca2_2; END IF; IF i = 2 THEN RETURN C2_cca2_2; END IF; RETURN CX_cca2_2; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cca3_1 IS BEGIN IF i = 0 THEN RETURN C0_cca3_1; END IF; IF i = 1 THEN RETURN C1_cca3_1; END IF; IF i = 2 THEN RETURN C2_cca3_1; END IF; RETURN CX_cca3_1; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cca3_2 IS BEGIN IF i = 0 THEN RETURN C0_cca3_2; END IF; IF i = 1 THEN RETURN C1_cca3_2; END IF; IF i = 2 THEN RETURN C2_cca3_2; END IF; RETURN CX_cca3_2; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cmre_1 IS BEGIN IF i = 0 THEN RETURN C0_cmre_1; END IF; IF i = 1 THEN RETURN C1_cmre_1; END IF; IF i = 2 THEN RETURN C2_cmre_1; END IF; RETURN CX_cmre_1; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cmre_2 IS BEGIN IF i = 0 THEN RETURN C0_cmre_2; END IF; IF i = 1 THEN RETURN C1_cmre_2; END IF; IF i = 2 THEN RETURN C2_cmre_2; END IF; RETURN CX_cmre_2; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cca1_7 IS BEGIN IF i = 0 THEN RETURN C0_cca1_7; END IF; IF i = 1 THEN RETURN C1_cca1_7; END IF; IF i = 2 THEN RETURN C2_cca1_7; END IF; RETURN CX_cca1_7; END; FUNCTION val_t ( i : INTEGER ) RETURN t_cmre_3 IS BEGIN IF i = 0 THEN RETURN C0_cmre_3; END IF; IF i = 1 THEN RETURN C1_cmre_3; END IF; IF i = 2 THEN RETURN C2_cmre_3; END IF; RETURN CX_cmre_3; END; -- -- FUNCTION val_i ( i : st_scl1 ) RETURN INTEGER IS BEGIN IF i = C0_scl1 THEN RETURN 0; END IF; IF i = C1_scl1 THEN RETURN 1; END IF; IF i = C2_scl1 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : TIME ) RETURN INTEGER IS BEGIN IF i = C0_scl2 THEN RETURN 0; END IF; IF i = C1_scl2 THEN RETURN 1; END IF; IF i = C2_scl2 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : st_scl3 ) RETURN INTEGER IS BEGIN IF i = C0_scl3 THEN RETURN 0; END IF; IF i = C1_scl3 THEN RETURN 1; END IF; IF i = C2_scl3 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : st_scl4 ) RETURN INTEGER IS BEGIN IF i = C0_scl4 THEN RETURN 0; END IF; IF i = C1_scl4 THEN RETURN 1; END IF; IF i = C2_scl4 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_scre_1 ) RETURN INTEGER IS BEGIN IF i = C0_scre_1 THEN RETURN 0; END IF; IF i = C1_scre_1 THEN RETURN 1; END IF; IF i = C2_scre_1 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_csa1_1 ) RETURN INTEGER IS BEGIN IF i = C0_csa1_1 THEN RETURN 0; END IF; IF i = C1_csa1_1 THEN RETURN 1; END IF; IF i = C2_csa1_1 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_csa1_2 ) RETURN INTEGER IS BEGIN IF i = C0_csa1_2 THEN RETURN 0; END IF; IF i = C1_csa1_2 THEN RETURN 1; END IF; IF i = C2_csa1_2 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_csa1_3 ) RETURN INTEGER IS BEGIN IF i = C0_csa1_3 THEN RETURN 0; END IF; IF i = C1_csa1_3 THEN RETURN 1; END IF; IF i = C2_csa1_3 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_csa1_4 ) RETURN INTEGER IS BEGIN IF i = C0_csa1_4 THEN RETURN 0; END IF; IF i = C1_csa1_4 THEN RETURN 1; END IF; IF i = C2_csa1_4 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_csa2_1 ) RETURN INTEGER IS BEGIN IF i = C0_csa2_1 THEN RETURN 0; END IF; IF i = C1_csa2_1 THEN RETURN 1; END IF; IF i = C2_csa2_1 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_csa3_1 ) RETURN INTEGER IS BEGIN IF i = C0_csa3_1 THEN RETURN 0; END IF; IF i = C1_csa3_1 THEN RETURN 1; END IF; IF i = C2_csa3_1 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_csa4_1 ) RETURN INTEGER IS BEGIN IF i = C0_csa4_1 THEN RETURN 0; END IF; IF i = C1_csa4_1 THEN RETURN 1; END IF; IF i = C2_csa4_1 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cca1_1 ) RETURN INTEGER IS BEGIN IF i = C0_cca1_1 THEN RETURN 0; END IF; IF i = C1_cca1_1 THEN RETURN 1; END IF; IF i = C2_cca1_1 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cca1_2 ) RETURN INTEGER IS BEGIN IF i = C0_cca1_2 THEN RETURN 0; END IF; IF i = C1_cca1_2 THEN RETURN 1; END IF; IF i = C2_cca1_2 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cca1_3 ) RETURN INTEGER IS BEGIN IF i = C0_cca1_3 THEN RETURN 0; END IF; IF i = C1_cca1_3 THEN RETURN 1; END IF; IF i = C2_cca1_3 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cca1_4 ) RETURN INTEGER IS BEGIN IF i = C0_cca1_4 THEN RETURN 0; END IF; IF i = C1_cca1_4 THEN RETURN 1; END IF; IF i = C2_cca1_4 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cca2_1 ) RETURN INTEGER IS BEGIN IF i = C0_cca2_1 THEN RETURN 0; END IF; IF i = C1_cca2_1 THEN RETURN 1; END IF; IF i = C2_cca2_1 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cca2_2 ) RETURN INTEGER IS BEGIN IF i = C0_cca2_2 THEN RETURN 0; END IF; IF i = C1_cca2_2 THEN RETURN 1; END IF; IF i = C2_cca2_2 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cca3_1 ) RETURN INTEGER IS BEGIN IF i = C0_cca3_1 THEN RETURN 0; END IF; IF i = C1_cca3_1 THEN RETURN 1; END IF; IF i = C2_cca3_1 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cca3_2 ) RETURN INTEGER IS BEGIN IF i = C0_cca3_2 THEN RETURN 0; END IF; IF i = C1_cca3_2 THEN RETURN 1; END IF; IF i = C2_cca3_2 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cmre_1 ) RETURN INTEGER IS BEGIN IF i = C0_cmre_1 THEN RETURN 0; END IF; IF i = C1_cmre_1 THEN RETURN 1; END IF; IF i = C2_cmre_1 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cmre_2 ) RETURN INTEGER IS BEGIN IF i = C0_cmre_2 THEN RETURN 0; END IF; IF i = C1_cmre_2 THEN RETURN 1; END IF; IF i = C2_cmre_2 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cca1_7 ) RETURN INTEGER IS BEGIN IF i = C0_cca1_7 THEN RETURN 0; END IF; IF i = C1_cca1_7 THEN RETURN 1; END IF; IF i = C2_cca1_7 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_i ( i : t_cmre_3 ) RETURN INTEGER IS BEGIN IF i = C0_cmre_3 THEN RETURN 0; END IF; IF i = C1_cmre_3 THEN RETURN 1; END IF; IF i = C2_cmre_3 THEN RETURN 2; END IF; RETURN -1; END; FUNCTION val_s ( i : st_scl1 ) RETURN STRING IS BEGIN IF i = C0_scl1 THEN RETURN "C0_scl1"; END IF; IF i = C1_scl1 THEN RETURN "C1_scl1"; END IF; IF i = C2_scl1 THEN RETURN "C2_scl1"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : TIME ) RETURN STRING IS BEGIN IF i = C0_scl2 THEN RETURN "C0_scl2"; END IF; IF i = C1_scl2 THEN RETURN "C1_scl2"; END IF; IF i = C2_scl2 THEN RETURN "C2_scl2"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : st_scl3 ) RETURN STRING IS BEGIN IF i = C0_scl3 THEN RETURN "C0_scl3"; END IF; IF i = C1_scl3 THEN RETURN "C1_scl3"; END IF; IF i = C2_scl3 THEN RETURN "C2_scl3"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : st_scl4 ) RETURN STRING IS BEGIN IF i = C0_scl4 THEN RETURN "C0_scl4"; END IF; IF i = C1_scl4 THEN RETURN "C1_scl4"; END IF; IF i = C2_scl4 THEN RETURN "C2_scl4"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_scre_1 ) RETURN STRING IS BEGIN IF i = C0_scre_1 THEN RETURN "C0_scre_1"; END IF; IF i = C1_scre_1 THEN RETURN "C1_scre_1"; END IF; IF i = C2_scre_1 THEN RETURN "C2_scre_1"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_csa1_1 ) RETURN STRING IS BEGIN IF i = C0_csa1_1 THEN RETURN "C0_csa1_1"; END IF; IF i = C1_csa1_1 THEN RETURN "C1_csa1_1"; END IF; IF i = C2_csa1_1 THEN RETURN "C2_csa1_1"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_csa1_2 ) RETURN STRING IS BEGIN IF i = C0_csa1_2 THEN RETURN "C0_csa1_2"; END IF; IF i = C1_csa1_2 THEN RETURN "C1_csa1_2"; END IF; IF i = C2_csa1_2 THEN RETURN "C2_csa1_2"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_csa1_3 ) RETURN STRING IS BEGIN IF i = C0_csa1_3 THEN RETURN "C0_csa1_3"; END IF; IF i = C1_csa1_3 THEN RETURN "C1_csa1_3"; END IF; IF i = C2_csa1_3 THEN RETURN "C2_csa1_3"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_csa1_4 ) RETURN STRING IS BEGIN IF i = C0_csa1_4 THEN RETURN "C0_csa1_4"; END IF; IF i = C1_csa1_4 THEN RETURN "C1_csa1_4"; END IF; IF i = C2_csa1_4 THEN RETURN "C2_csa1_4"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_csa2_1 ) RETURN STRING IS BEGIN IF i = C0_csa2_1 THEN RETURN "C0_csa2_1"; END IF; IF i = C1_csa2_1 THEN RETURN "C1_csa2_1"; END IF; IF i = C2_csa2_1 THEN RETURN "C2_csa2_1"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_csa3_1 ) RETURN STRING IS BEGIN IF i = C0_csa3_1 THEN RETURN "C0_csa3_1"; END IF; IF i = C1_csa3_1 THEN RETURN "C1_csa3_1"; END IF; IF i = C2_csa3_1 THEN RETURN "C2_csa3_1"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_csa4_1 ) RETURN STRING IS BEGIN IF i = C0_csa4_1 THEN RETURN "C0_csa4_1"; END IF; IF i = C1_csa4_1 THEN RETURN "C1_csa4_1"; END IF; IF i = C2_csa4_1 THEN RETURN "C2_csa4_1"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cca1_1 ) RETURN STRING IS BEGIN IF i = C0_cca1_1 THEN RETURN "C0_cca1_1"; END IF; IF i = C1_cca1_1 THEN RETURN "C1_cca1_1"; END IF; IF i = C2_cca1_1 THEN RETURN "C2_cca1_1"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cca1_2 ) RETURN STRING IS BEGIN IF i = C0_cca1_2 THEN RETURN "C0_cca1_2"; END IF; IF i = C1_cca1_2 THEN RETURN "C1_cca1_2"; END IF; IF i = C2_cca1_2 THEN RETURN "C2_cca1_2"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cca1_3 ) RETURN STRING IS BEGIN IF i = C0_cca1_3 THEN RETURN "C0_cca1_3"; END IF; IF i = C1_cca1_3 THEN RETURN "C1_cca1_3"; END IF; IF i = C2_cca1_3 THEN RETURN "C2_cca1_3"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cca1_4 ) RETURN STRING IS BEGIN IF i = C0_cca1_4 THEN RETURN "C0_cca1_4"; END IF; IF i = C1_cca1_4 THEN RETURN "C1_cca1_4"; END IF; IF i = C2_cca1_4 THEN RETURN "C2_cca1_4"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cca2_1 ) RETURN STRING IS BEGIN IF i = C0_cca2_1 THEN RETURN "C0_cca2_1"; END IF; IF i = C1_cca2_1 THEN RETURN "C1_cca2_1"; END IF; IF i = C2_cca2_1 THEN RETURN "C2_cca2_1"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cca2_2 ) RETURN STRING IS BEGIN IF i = C0_cca2_2 THEN RETURN "C0_cca2_2"; END IF; IF i = C1_cca2_2 THEN RETURN "C1_cca2_2"; END IF; IF i = C2_cca2_2 THEN RETURN "C2_cca2_2"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cca3_1 ) RETURN STRING IS BEGIN IF i = C0_cca3_1 THEN RETURN "C0_cca3_1"; END IF; IF i = C1_cca3_1 THEN RETURN "C1_cca3_1"; END IF; IF i = C2_cca3_1 THEN RETURN "C2_cca3_1"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cca3_2 ) RETURN STRING IS BEGIN IF i = C0_cca3_2 THEN RETURN "C0_cca3_2"; END IF; IF i = C1_cca3_2 THEN RETURN "C1_cca3_2"; END IF; IF i = C2_cca3_2 THEN RETURN "C2_cca3_2"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cmre_1 ) RETURN STRING IS BEGIN IF i = C0_cmre_1 THEN RETURN "C0_cmre_1"; END IF; IF i = C1_cmre_1 THEN RETURN "C1_cmre_1"; END IF; IF i = C2_cmre_1 THEN RETURN "C2_cmre_1"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cmre_2 ) RETURN STRING IS BEGIN IF i = C0_cmre_2 THEN RETURN "C0_cmre_2"; END IF; IF i = C1_cmre_2 THEN RETURN "C1_cmre_2"; END IF; IF i = C2_cmre_2 THEN RETURN "C2_cmre_2"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cca1_7 ) RETURN STRING IS BEGIN IF i = C0_cca1_7 THEN RETURN "C0_cca1_7"; END IF; IF i = C1_cca1_7 THEN RETURN "C1_cca1_7"; END IF; IF i = C2_cca1_7 THEN RETURN "C2_cca1_7"; END IF; RETURN "UNKNOWN"; END; FUNCTION val_s ( i : t_cmre_3 ) RETURN STRING IS BEGIN IF i = C0_cmre_3 THEN RETURN "C0_cmre_3"; END IF; IF i = C1_cmre_3 THEN RETURN "C1_cmre_3"; END IF; IF i = C2_cmre_3 THEN RETURN "C2_cmre_3"; END IF; RETURN "UNKNOWN"; END; END c03s03b00x00p03n04i00517pkg; USE work.c03s03b00x00p03n04i00517pkg.ALL; ENTITY c03s03b00x00p03n04i00517ent IS END c03s03b00x00p03n04i00517ent; ARCHITECTURE c03s03b00x00p03n04i00517arch OF c03s03b00x00p03n04i00517ent IS -- -- Access type declarations -- TYPE at_scre_1 IS ACCESS t_scre_1 ; TYPE at_cca1_1 IS ACCESS t_cca1_1 ; TYPE at_cca1_2 IS ACCESS t_cca1_2 ; TYPE at_cca1_3 IS ACCESS t_cca1_3 ; TYPE at_cca1_4 IS ACCESS t_cca1_4 ; TYPE at_cmre_1 IS ACCESS t_cmre_1 ; TYPE at_cmre_2 IS ACCESS t_cmre_2 ; TYPE at_cca1_7 IS ACCESS t_cca1_7 ; TYPE at_cmre_3 IS ACCESS t_cmre_3 ; -- -- BEGIN TESTING: PROCESS -- -- ACCESS VARIABLE declarations -- VARIABLE AV0_scre_1 : at_scre_1 ; VARIABLE AV2_scre_1 : at_scre_1 ; VARIABLE AV0_cca1_1 : at_cca1_1 ; VARIABLE AV2_cca1_1 : at_cca1_1 ; VARIABLE AV0_cca1_2 : at_cca1_2 ; VARIABLE AV2_cca1_2 : at_cca1_2 ; VARIABLE AV0_cca1_3 : at_cca1_3 ; VARIABLE AV2_cca1_3 : at_cca1_3 ; VARIABLE AV0_cca1_4 : at_cca1_4 ; VARIABLE AV2_cca1_4 : at_cca1_4 ; VARIABLE AV0_cmre_1 : at_cmre_1 ; VARIABLE AV2_cmre_1 : at_cmre_1 ; VARIABLE AV0_cmre_2 : at_cmre_2 ; VARIABLE AV2_cmre_2 : at_cmre_2 ; VARIABLE AV0_cca1_7 : at_cca1_7 ; VARIABLE AV2_cca1_7 : at_cca1_7 ; VARIABLE AV0_cmre_3 : at_cmre_3 ; VARIABLE AV2_cmre_3 : at_cmre_3 ; -- -- BEGIN -- -- Allocation of access values -- AV0_scre_1 := NEW t_scre_1 ; AV0_cca1_1 := NEW t_cca1_1 ; AV0_cca1_2 := NEW t_cca1_2 ; AV0_cca1_3 := NEW t_cca1_3 ; AV0_cca1_4 := NEW t_cca1_4 ; AV0_cmre_1 := NEW t_cmre_1 ; AV0_cmre_2 := NEW t_cmre_2 ; AV0_cca1_7 := NEW t_cca1_7 ; AV0_cmre_3 := NEW t_cmre_3 ; --- AV2_scre_1 := NEW t_scre_1 ' ( C2_scre_1 ) ; AV2_cca1_1 := NEW t_cca1_1 ' ( C2_cca1_1 ) ; AV2_cca1_2 := NEW t_cca1_2 ' ( C2_cca1_2 ) ; AV2_cca1_3 := NEW t_cca1_3 ' ( C2_cca1_3 ) ; AV2_cca1_4 := NEW t_cca1_4 ' ( C2_cca1_4 ) ; AV2_cmre_1 := NEW t_cmre_1 ' ( C2_cmre_1 ) ; AV2_cmre_2 := NEW t_cmre_2 ' ( C2_cmre_2 ) ; AV2_cca1_7 := NEW t_cca1_7 ' ( C2_cca1_7 ) ; AV2_cmre_3 := NEW t_cmre_3 ' ( C2_cmre_3 ) ; -- -- ASSERT AV0_scre_1.all = C0_scre_1 REPORT "Improper initialization of AV0_scre_1" SEVERITY FAILURE; ASSERT AV2_scre_1.all = C2_scre_1 REPORT "Improper initialization of AV2_scre_1" SEVERITY FAILURE; ASSERT AV0_cca1_1.all = C0_cca1_1 REPORT "Improper initialization of AV0_cca1_1" SEVERITY FAILURE; ASSERT AV2_cca1_1.all = C2_cca1_1 REPORT "Improper initialization of AV2_cca1_1" SEVERITY FAILURE; ASSERT AV0_cca1_2.all = C0_cca1_2 REPORT "Improper initialization of AV0_cca1_2" SEVERITY FAILURE; ASSERT AV2_cca1_2.all = C2_cca1_2 REPORT "Improper initialization of AV2_cca1_2" SEVERITY FAILURE; ASSERT AV0_cca1_3.all = C0_cca1_3 REPORT "Improper initialization of AV0_cca1_3" SEVERITY FAILURE; ASSERT AV2_cca1_3.all = C2_cca1_3 REPORT "Improper initialization of AV2_cca1_3" SEVERITY FAILURE; ASSERT AV0_cca1_4.all = C0_cca1_4 REPORT "Improper initialization of AV0_cca1_4" SEVERITY FAILURE; ASSERT AV2_cca1_4.all = C2_cca1_4 REPORT "Improper initialization of AV2_cca1_4" SEVERITY FAILURE; ASSERT AV0_cmre_1.all = C0_cmre_1 REPORT "Improper initialization of AV0_cmre_1" SEVERITY FAILURE; ASSERT AV2_cmre_1.all = C2_cmre_1 REPORT "Improper initialization of AV2_cmre_1" SEVERITY FAILURE; ASSERT AV0_cmre_2.all = C0_cmre_2 REPORT "Improper initialization of AV0_cmre_2" SEVERITY FAILURE; ASSERT AV2_cmre_2.all = C2_cmre_2 REPORT "Improper initialization of AV2_cmre_2" SEVERITY FAILURE; ASSERT AV0_cca1_7.all = C0_cca1_7 REPORT "Improper initialization of AV0_cca1_7" SEVERITY FAILURE; ASSERT AV2_cca1_7.all = C2_cca1_7 REPORT "Improper initialization of AV2_cca1_7" SEVERITY FAILURE; ASSERT AV0_cmre_3.all = C0_cmre_3 REPORT "Improper initialization of AV0_cmre_3" SEVERITY FAILURE; ASSERT AV2_cmre_3.all = C2_cmre_3 REPORT "Improper initialization of AV2_cmre_3" SEVERITY FAILURE; -- -- assert NOT( ( AV0_scre_1.all = C0_scre_1 ) and ( AV2_scre_1.all = C2_scre_1 ) and ( AV0_cca1_1.all = C0_cca1_1 ) and ( AV2_cca1_1.all = C2_cca1_1 ) and ( AV0_cca1_2.all = C0_cca1_2 ) and ( AV2_cca1_2.all = C2_cca1_2 ) and ( AV0_cca1_3.all = C0_cca1_3 ) and ( AV2_cca1_3.all = C2_cca1_3 ) and ( AV0_cca1_4.all = C0_cca1_4 ) and ( AV2_cca1_4.all = C2_cca1_4 ) and ( AV0_cmre_1.all = C0_cmre_1 ) and ( AV2_cmre_1.all = C2_cmre_1 ) and ( AV0_cmre_2.all = C0_cmre_2 ) and ( AV2_cmre_2.all = C2_cmre_2 ) and ( AV0_cca1_7.all = C0_cca1_7 ) and ( AV2_cca1_7.all = C2_cca1_7 ) and ( AV0_cmre_3.all = C0_cmre_3 ) and ( AV2_cmre_3.all = C2_cmre_3 )) report "***PASSED TEST: c03s03b00x00p03n04i00517" severity NOTE; assert ( ( AV0_scre_1.all = C0_scre_1 ) and ( AV2_scre_1.all = C2_scre_1 ) and ( AV0_cca1_1.all = C0_cca1_1 ) and ( AV2_cca1_1.all = C2_cca1_1 ) and ( AV0_cca1_2.all = C0_cca1_2 ) and ( AV2_cca1_2.all = C2_cca1_2 ) and ( AV0_cca1_3.all = C0_cca1_3 ) and ( AV2_cca1_3.all = C2_cca1_3 ) and ( AV0_cca1_4.all = C0_cca1_4 ) and ( AV2_cca1_4.all = C2_cca1_4 ) and ( AV0_cmre_1.all = C0_cmre_1 ) and ( AV2_cmre_1.all = C2_cmre_1 ) and ( AV0_cmre_2.all = C0_cmre_2 ) and ( AV2_cmre_2.all = C2_cmre_2 ) and ( AV0_cca1_7.all = C0_cca1_7 ) and ( AV2_cca1_7.all = C2_cca1_7 ) and ( AV0_cmre_3.all = C0_cmre_3 ) and ( AV2_cmre_3.all = C2_cmre_3 )) report "***FAILED TEST: c03s03b00x00p03n04i00517 - Each access value designates an object of the subtype defined by the subtype indication of the access type definition." severity ERROR; wait; END PROCESS TESTING; END c03s03b00x00p03n04i00517arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1393.vhd
4
2019
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1393.vhd,v 1.2 2001-10-26 16:29:41 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s05b00x00p04n01i01393ent IS END c08s05b00x00p04n01i01393ent; ARCHITECTURE c08s05b00x00p04n01i01393arch OF c08s05b00x00p04n01i01393ent IS BEGIN TESTING: PROCESS type RT is record a : CHARACTER; b : CHARACTER; end record; variable v1, v2 : CHARACTER := NUL; variable rv : RT := ('1', '2'); BEGIN assert v1 = NUL; assert v2 = NUL; (v1, v2) := rv; assert v1 = '1'; assert v2 = '2'; wait for 1 ns; assert NOT( v1 = '1' and v2 = '2' ) report "***PASSED TEST: c08s05b00x00p04n01i01393" severity NOTE; assert ( v1 = '1' and v2 = '2' ) report "***FAILED TEST: c08s05b00x00p04n01i01393 - Aggregate (record type) assignment for variable test failed." severity ERROR; wait; END PROCESS TESTING; END c08s05b00x00p04n01i01393arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/disputed/tc3018.vhd
4
1285
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3018.vhd,v 1.2 2001-10-26 16:30:04 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c11s02b00x00p05n03i03018pkg IS constant my_bool : boolean := false; END c11s02b00x00p05n03i03018pkg;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1256.vhd
4
1592
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1256.vhd,v 1.2 2001-10-26 16:29:39 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s02b00x00p04n02i01256ent IS END c08s02b00x00p04n02i01256ent; ARCHITECTURE c08s02b00x00p04n02i01256arch OF c08s02b00x00p04n02i01256ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "Report this Note" severity NOTE; assert FALSE report "***PASSED TEST: c08s02b00x00p04n02i01256" severity NOTE; wait; END PROCESS TESTING; END c08s02b00x00p04n02i01256arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2520.vhd
4
1894
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2520.vhd,v 1.2 2001-10-26 16:29:48 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s03b05x00p03n04i02520ent IS END c07s03b05x00p03n04i02520ent; ARCHITECTURE c07s03b05x00p03n04i02520arch OF c07s03b05x00p03n04i02520ent IS BEGIN TESTING: PROCESS type century is range 1 to 10; function f return century is begin return (century'(3)); end; variable hundreds : century ; type millenia is range 1 to 10; variable thousand : millenia ; BEGIN thousand := millenia (f); assert NOT( thousand = 3 ) report "***PASSED TEST: c07s03b05x00p03n04i02520" severity NOTE; assert ( thousand = 3 ) report "***FAILED TEST: c07s03b05x00p03n04i02520 - " severity ERROR; wait; END PROCESS TESTING; END c07s03b05x00p03n04i02520arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc236.vhd
4
1655
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc236.vhd,v 1.2 2001-10-26 16:30:18 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s01b02x00p04n01i00236ent IS END c03s01b02x00p04n01i00236ent; ARCHITECTURE c03s01b02x00p04n01i00236arch OF c03s01b02x00p04n01i00236ent IS type t3 is range (1+1) to (10.0 + 2.0); BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c03s01b02x00p04n01i00236 - The right bound in the range constraint is not a locally static expression of type integer." severity ERROR; wait; END PROCESS TESTING; END c03s01b02x00p04n01i00236arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc743.vhd
4
3730
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc743.vhd,v 1.2 2001-10-26 16:29:59 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c01s01b01x01p04n01i00743pkg is type arrtype is array (1 to 5) of bit; constant defcon1 : bit; constant defcon2 : integer; constant defcon3 : arrtype; constant defcon4 : boolean; component comp1 generic ( constant dgc1 : bit := defcon1; constant dgc2 : integer := defcon2; constant dgc3 : arrtype := defcon3; constant dgc4 : boolean := defcon4 ); port ( signal dcent1 : inout bit := dgc1; signal dcent2 : inout integer := dgc2; signal dcent3 : inout arrtype := dgc3; signal dcent4 : inout boolean := dgc4 ); end component; end c01s01b01x01p04n01i00743pkg; package body c01s01b01x01p04n01i00743pkg is constant defcon1 : bit := '1'; constant defcon2 : integer := 113; constant defcon3 : arrtype := ('1','0','1','0','1'); constant defcon4 : boolean := TRUE; end c01s01b01x01p04n01i00743pkg; use work.c01s01b01x01p04n01i00743pkg.all; entity c01s01b01x01p04n01i00743ent_a is generic ( constant gc1 : bit; constant gc2 : integer; constant gc3 : arrtype; constant gc4 : boolean ); port ( signal cent1 : inout bit; signal cent2 : inout integer; signal cent3 : inout arrtype; signal cent4 : inout boolean ); end c01s01b01x01p04n01i00743ent_a; architecture c01s01b01x01p04n01i00743arch_a of c01s01b01x01p04n01i00743ent_a is begin p0: process begin wait for 1 ns; if (gc1='1') and (gc2=113) and (gc3=('1','0','1','0','1')) and (gc4) then assert FALSE report "***PASSED TEST: c01s01b01x01p04n01i00743" severity NOTE; else assert FALSE report "***FAILED TEST: c01s01b01x01p04n01i00743 - Generic default to deferred constants." severity ERROR; end if; wait; end process; end c01s01b01x01p04n01i00743arch_a; use work.c01s01b01x01p04n01i00743pkg.all; ENTITY c01s01b01x01p04n01i00743ent IS generic ( constant gen_con : integer := 1334 ); port ( signal ee1 : inout boolean := TRUE; signal ee2 : inout bit; signal ee3 : inout integer; signal ee4 : inout arrtype ); END c01s01b01x01p04n01i00743ent; ARCHITECTURE c01s01b01x01p04n01i00743arch OF c01s01b01x01p04n01i00743ent IS for u1 : comp1 use entity work.c01s01b01x01p04n01i00743ent_a(c01s01b01x01p04n01i00743arch_a) generic map ( dgc1, dgc2, dgc3, dgc4 ) port map ( dcent1, dcent2, dcent3, dcent4 ); BEGIN u1 : comp1; END c01s01b01x01p04n01i00743arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc533.vhd
4
1734
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc533.vhd,v 1.2 2001-10-26 16:30:26 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s03b00x00p04n01i00533ent IS END c03s03b00x00p04n01i00533ent; ARCHITECTURE c03s03b00x00p04n01i00533arch OF c03s03b00x00p04n01i00533ent IS type T is record a:integer; b:integer; end record; type A is access T; constant B1, B2: A := new T'(0, 0); BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c03s03b00x00p04n01i00533 - The object declared to be of an access type must be an object of class variable." severity ERROR; wait; END PROCESS TESTING; END c03s03b00x00p04n01i00533arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2097.vhd
4
2143
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2097.vhd,v 1.2 2001-10-26 16:29:45 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s02b04x00p20n01i02097ent IS END c07s02b04x00p20n01i02097ent; ARCHITECTURE c07s02b04x00p20n01i02097arch OF c07s02b04x00p20n01i02097ent IS TYPE boolean_v is array (integer range <>) of boolean; SUBTYPE boolean_4 is boolean_v (1 to 4); SUBTYPE boolean_8 is boolean_v (1 to 8); BEGIN TESTING : PROCESS variable result : boolean_8; variable l_operand : boolean_4 := (true,false,true,false); variable r_operand : boolean_4 := (false,false,true,true); BEGIN result := l_operand & r_operand; wait for 5 ns; assert NOT(result = (true,false,true,false,false,false,true,true)) report "***PASSED TEST: c07s02b04x00p20n01i02097" severity NOTE; assert (result = (true,false,true,false,false,false,true,true)) report "***FAILED TEST: c07s02b04x00p20n01i02097 - Variable concatenation did not succeed." severity ERROR; wait; END PROCESS TESTING; END c07s02b04x00p20n01i02097arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2061.vhd
4
1869
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2061.vhd,v 1.2 2001-10-26 16:29:45 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s02b04x00p01n02i02061ent IS END c07s02b04x00p01n02i02061ent; ARCHITECTURE c07s02b04x00p01n02i02061arch OF c07s02b04x00p01n02i02061ent IS signal S1 : Integer; signal S2 : Integer; signal S3 : BIT_VECTOR(0 to 7); BEGIN TESTING: PROCESS variable V1,V2 : Integer := 10; variable V3,V4 : BIT_VECTOR(0 to 3) := "0101" ; BEGIN S1 <= V1 + V2; wait for 1 ns; assert NOT(S1 = 20) report "***PASSED TEST: c07s02b04x00p01n02i02061" severity NOTE; assert (S1 = 20) report "***FAILED TEST: c07s02b04x00p01n02i02061 - Operands must be of the same type." severity ERROR; wait; END PROCESS TESTING; END c07s02b04x00p01n02i02061arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1447.vhd
4
1867
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1447.vhd,v 1.2 2001-10-26 16:29:41 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s07b00x00p02n01i01447ent IS END c08s07b00x00p02n01i01447ent; ARCHITECTURE c08s07b00x00p02n01i01447arch OF c08s07b00x00p02n01i01447ent IS begin transmit: process procedure ARITH(z : out integer) is begin z := 5; end ARITH; variable k : integer ; variable m : integer := 6; begin if m > 5 then ARITH(k); end if; assert (k = 5) report "***FAILED TEST: c08s07b00x00p02n01i01447 - Procedure Call statement to be sequence statements of IF statement" severity ERROR; assert NOT(k = 5) report "***PASSED TEST: c08s07b00x00p02n01i01447" severity NOTE; wait; end process; END c08s07b00x00p02n01i01447arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2319.vhd
4
1657
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2319.vhd,v 1.2 2001-10-26 16:30:17 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s02b07x00p01n01i02319ent IS END c07s02b07x00p01n01i02319ent; ARCHITECTURE c07s02b07x00p01n01i02319arch OF c07s02b07x00p01n01i02319ent IS BEGIN TESTING: PROCESS variable BITSTRV : BIT_VECTOR( 0 to 7 ); BEGIN BITSTRV := ABS BITSTRV; assert FALSE report "***FAILED TEST: c07s02b07x00p01n01i02319 - Unary operator abs is predefined for any numeric type only." severity ERROR; wait; END PROCESS TESTING; END c07s02b07x00p01n01i02319arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc801.vhd
4
1659
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc801.vhd,v 1.2 2001-10-26 16:30:27 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c01s01b03x00p03n01i00801ent IS begin next; -- illegal location for next statement END c01s01b03x00p03n01i00801ent; ARCHITECTURE c01s01b03x00p03n01i00801arch OF c01s01b03x00p03n01i00801ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c01s01b03x00p03n01i00801 - Next statement can not appear in entity statement." severity ERROR; wait; END PROCESS TESTING; END c01s01b03x00p03n01i00801arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/analog-modeling/inline_08a.vhd
4
1680
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA library ieee_proposed; use ieee_proposed.electrical_systems.all; entity inline_08a is end entity inline_08a; architecture test of inline_08a is -- code from book terminal bias_node : electrical; -- subnature accurate_electrical is electrical tolerance "accurate_voltage" across "accurate_current" through; -- terminal n1, n2 : accurate_electrical; -- quantity n1_n2_voltage across n1_n2_current through n1 to n2; -- quantity internal_voltage : voltage tolerance n1_n2_voltage'tolerance; quantity internal_current : current tolerance n1_n2_current'tolerance; -- terminal bus_a_end, bus_b_end : electrical_vector(15 downto 0); quantity bus_currents through bus_a_end to bus_b_end; -- end code from book begin -- code from book bias_node'reference == 0.5; -- end code from book end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2415.vhd
4
1948
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc2415.vhd,v 1.2 2001-10-26 16:29:47 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s03b02x00p10n01i02415ent IS END c07s03b02x00p10n01i02415ent; ARCHITECTURE c07s03b02x00p10n01i02415arch OF c07s03b02x00p10n01i02415ent IS type sigrec1 is record B1 : bit; B2 : integer; B3 : bit; end record; signal S1 : bit; signal S2 : integer; signal S3 : bit; BEGIN TESTING: PROCESS BEGIN (S1, S2, S3) <= sigrec1'('0', 2, '1'); wait for 1 ns; assert NOT(S1='0' and S2=2 and S3='1') report "***PASSED TEST: c07s03b02x00p10n01i02415" severity NOTE; assert (S1='0' and S2=2 and S3='1') report "***FAILED TEST: c07s03b02x00p10n01i02415 - Type of the aggregate must be determinable from the context." severity ERROR; wait; END PROCESS TESTING; END c07s03b02x00p10n01i02415arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/subprograms/hold_time_checker.vhd
4
1565
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA entity hold_time_checker is end entity hold_time_checker; architecture test of hold_time_checker is constant Thold_d_clk : delay_length := 3 ns; signal clk, d : bit := '0'; begin -- code from book hold_time_checker : process ( clk, d ) is variable last_clk_edge_time : time := 0 fs; begin if clk'event and clk = '1' then last_clk_edge_time := now; end if; if d'event then assert now - last_clk_edge_time >= Thold_d_clk report "hold time violation"; end if; end process hold_time_checker; -- end code from book clk_gen : clk <= '1' after 10 ns, '0' after 20 ns when clk = '0'; stimulus : d <= '1' after 15 ns, '0' after 53 ns, '1' after 72 ns; end architecture test;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1541.vhd
4
1691
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1541.vhd,v 1.2 2001-10-26 16:30:11 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s09b00x00p10n01i01541ent IS END c08s09b00x00p10n01i01541ent; ARCHITECTURE c08s09b00x00p10n01i01541arch OF c08s09b00x00p10n01i01541ent IS BEGIN TESTING: PROCESS variable k : integer := 0; BEGIN s : for j in 1 to 100 loop s := 3; end loop s; s := 3; assert FALSE report "***FAILED TEST: c08s09b00x00p10n01i01541 - The target of the variable assignment statement is not declared" severity ERROR; wait; END PROCESS TESTING; END c08s09b00x00p10n01i01541arch;
gpl-2.0
emogenet/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc405.vhd
4
2229
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc405.vhd,v 1.2 2001-10-26 16:30:26 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s02b01x01p19n01i00405ent IS END c03s02b01x01p19n01i00405ent; ARCHITECTURE c03s02b01x01p19n01i00405arch OF c03s02b01x01p19n01i00405ent IS type MEM is array (positive range <>) of BIT; type ME1 is array (positive range <>) of Integer; subtype ME2 is ME1(1 to 3); subtype M1 is MEM (1 to 5); function WR_OR(Input : ME1) return M1 is begin for I in Input'Range loop if Input(I) = 2 then return "11111" ; end if; end loop; end WR_OR; procedure F2 (X1 : in MEM; WR_OR: out M1) is begin end F2; BEGIN TESTING: PROCESS variable V1 :ME2 := (20, 30, 40, 50); BEGIN F2(WR_OR(V1),WR_OR(V1)) ; -- failure_here wait for 10 ns; assert FALSE report "***FAILED TEST: c03s02b01x01p19n01i00405 - For an interface object of mode out, buffer, inout, or linkage, if the formal part includes a type conversion function, then the parameter subtype of that function must be a constrained array subtype." severity ERROR; wait; END PROCESS TESTING; END c03s02b01x01p19n01i00405arch;
gpl-2.0