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
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/guards-and-blocks/tb_full.vhd
4
1301
-- 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 tb_full is end entity tb_full; library util; use util.stimulus_generators.all; architecture test of tb_full is signal in1, in2, in3, out1, out2 : bit; signal test_vector : bit_vector(1 to 3); begin dut : configuration work.full generic map ( inpad_delay => 2 ns, outpad_delay => 3 ns ) port map ( in1 => in1, in2 => in2, in3 => in3, out1 => out1, out2 => out2 ); stimulus : all_possible_values ( test_vector, 50 ns ); (in1, in2, in3) <= test_vector; end architecture test;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1226.vhd
4
1838
-- 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: tc1226.vhd,v 1.2 2001-10-26 16:30:07 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s01b00x00p29n01i01226ent IS END c08s01b00x00p29n01i01226ent; ARCHITECTURE c08s01b00x00p29n01i01226arch OF c08s01b00x00p29n01i01226ent IS BEGIN TESTING: PROCESS function test_1 (a:integer; b:boolean) return integer is variable c : integer := 1; begin wait for 100 ns; return c; end; variable k : integer := 0; variable y : boolean := false; variable i : integer; BEGIN i := test_1 (a=>k, b=>y); assert FALSE report "***FAILED TEST: c08s01b00x00p29n01i01226 - Wait not allowed in a function subprogram." severity ERROR; wait; END PROCESS TESTING; END c08s01b00x00p29n01i01226arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1192.vhd
4
1753
-- 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: tc1192.vhd,v 1.2 2001-10-26 16:29:39 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s01b00x00p03n01i01192ent IS END c08s01b00x00p03n01i01192ent; ARCHITECTURE c08s01b00x00p03n01i01192arch OF c08s01b00x00p03n01i01192ent IS signal k : integer := 0; BEGIN TESTING: PROCESS BEGIN k <= 5 after 5 ns; wait on k, k, k; assert NOT(k=5) report "***PASSED TEST: c08s01b00x00p03n01i01192" severity NOTE; assert (k=5) report "***FAILED TEST: c08s01b00x00p03n01i01192 - Same signal multiple times. This is not made clearly in LRM" severity ERROR; wait; END PROCESS TESTING; END c08s01b00x00p03n01i01192arch;
gpl-2.0
tgingold/ghdl
testsuite/synth/issue1100/tb_repro.vhdl
1
727
entity tb_repro is end tb_repro; library ieee; use ieee.std_logic_1164.all; architecture behav of tb_repro is signal val : std_logic_vector (63 downto 0); signal iperm : std_logic_vector (3*8 - 1 downto 0) := (others => '0'); signal en : std_ulogic; signal res : std_logic_vector (63 downto 0); begin dut: entity work.repro port map (val, iperm, en, res); process begin val <= x"01_23_45_67_89_ab_cd_ef"; en <= '1'; iperm <= o"76543210"; wait for 1 ns; assert res = x"01_23_45_67_89_ab_cd_ef"severity failure; iperm <= o"01234567"; wait for 1 ns; assert res = x"ef_cd_ab_89_67_45_23_01" report to_hstring(res) severity failure; wait; end process; end behav;
gpl-2.0
tgingold/ghdl
testsuite/synth/var01/tb_var02.vhdl
1
1013
entity tb_var02 is end tb_var02; library ieee; use ieee.std_logic_1164.all; architecture behav of tb_var02 is signal clk : std_logic; signal mask : std_logic_vector (3 downto 0); signal val : std_logic_vector (31 downto 0); signal res : std_logic_vector (31 downto 0); begin dut: entity work.var02 port map ( clk => clk, mask => mask, val => val, res => res); process procedure pulse is begin clk <= '0'; wait for 1 ns; clk <= '1'; wait for 1 ns; end pulse; begin mask <= x"f"; val <= x"12_34_56_78"; pulse; assert res = x"12_34_56_78" severity failure; mask <= x"8"; val <= x"9a_00_00_00"; pulse; assert res = x"9a_34_56_78" severity failure; mask <= x"0"; val <= x"00_00_00_00"; pulse; assert res = x"9a_34_56_78" severity failure; mask <= x"5"; val <= x"00_bc_00_de"; pulse; assert res = x"9a_bc_56_de" severity failure; wait; end process; end behav;
gpl-2.0
tgingold/ghdl
testsuite/gna/issue317/OSVVM/AlertLogPkg.vhd
1
129426
-- -- File Name: AlertLogPkg.vhd -- Design Unit Name: AlertLogPkg -- Revision: STANDARD VERSION -- -- Maintainer: Jim Lewis email: [email protected] -- Contributor(s): -- Jim Lewis [email protected] -- -- -- Description: -- Alert handling and log filtering (verbosity control) -- Alert handling provides a method to count failures, errors, and warnings -- To accumlate counts, a data structure is created in a shared variable -- It is of type AlertLogStructPType which is defined in AlertLogBasePkg -- Log filtering provides verbosity control for logs (display or do not display) -- AlertLogPkg provides a simplified interface to the shared variable -- -- -- Developed for: -- SynthWorks Design Inc. -- VHDL Training Classes -- 11898 SW 128th Ave. Tigard, Or 97223 -- http://www.SynthWorks.com -- -- Revision History: -- Date Version Description -- 01/2015: 2015.01 Initial revision -- 03/2015 2015.03 Added: AlertIfEqual, AlertIfNotEqual, AlertIfDiff, PathTail, -- ReportNonZeroAlerts, ReadLogEnables -- 05/2015 2015.06 Added IncAlertCount, AffirmIf -- 07/2015 2016.01 Fixed AlertLogID issue with > 32 IDs -- 02/2016 2016.02 Fixed IsLogEnableType (for PASSED), AffirmIf (to pass AlertLevel) -- Created LocalInitialize -- -- Copyright (c) 2015 - 2016 by SynthWorks Design Inc. All rights reserved. -- -- Verbatim copies of this source file may be used and -- distributed without restriction. -- -- This source file is free software; you can redistribute it -- and/or modify it under the terms of the ARTISTIC License -- as published by The Perl Foundation; either version 2.0 of -- the License, or (at your option) any later version. -- -- This source 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 Artistic License for details. -- -- You should have received a copy of the license with this source. -- If not download it from, -- http://www.perlfoundation.org/artistic_license_2_0 -- use std.textio.all ; use work.OsvvmGlobalPkg.all ; use work.TranscriptPkg.all ; use work.TextUtilPkg.all ; library IEEE ; use ieee.std_logic_1164.all ; use ieee.numeric_std.all ; package AlertLogPkg is subtype AlertLogIDType is integer ; type AlertType is (FAILURE, ERROR, WARNING) ; -- NEVER subtype AlertIndexType is AlertType range FAILURE to WARNING ; type AlertCountType is array (AlertIndexType) of integer ; type AlertEnableType is array(AlertIndexType) of boolean ; type LogType is (ALWAYS, DEBUG, FINAL, INFO, PASSED) ; -- NEVER -- See function IsLogEnableType subtype LogIndexType is LogType range DEBUG to PASSED ; type LogEnableType is array (LogIndexType) of boolean ; constant ALERTLOG_BASE_ID : AlertLogIDType := 0 ; -- Careful as some code may assume this is 0. constant ALERTLOG_DEFAULT_ID : AlertLogIDType := 1 ; constant ALERT_DEFAULT_ID : AlertLogIDType := ALERTLOG_DEFAULT_ID ; constant LOG_DEFAULT_ID : AlertLogIDType := ALERTLOG_DEFAULT_ID ; constant OSVVM_ALERTLOG_ID : AlertLogIDType := 2 ; constant OSVVM_SCOREBOARD_ALERTLOG_ID : AlertLogIDType := OSVVM_ALERTLOG_ID ; -- NUM_PREDEFINED_AL_IDS intended to be local, but depends on others -- constant NUM_PREDEFINED_AL_IDS : AlertLogIDType := OSVVM_SCOREBOARD_ALERTLOG_ID - ALERTLOG_BASE_ID ; -- Not including base constant ALERTLOG_ID_NOT_FOUND : AlertLogIDType := -1 ; -- alternately integer'right constant ALERTLOG_ID_NOT_ASSIGNED : AlertLogIDType := -1 ; constant MIN_NUM_AL_IDS : AlertLogIDType := 32 ; -- Number IDs initially allocated alias AlertLogOptionsType is work.OsvvmGlobalPkg.OsvvmOptionsType ; ------------------------------------------------------------ -- Alert always goes to the transcript file procedure Alert( AlertLogID : AlertLogIDType ; Message : string ; Level : AlertType := ERROR ) ; procedure Alert( Message : string ; Level : AlertType := ERROR ) ; ------------------------------------------------------------ procedure IncAlertCount( -- A silent form of alert AlertLogID : AlertLogIDType ; Level : AlertType := ERROR ) ; procedure IncAlertCount( Level : AlertType := ERROR ) ; ------------------------------------------------------------ -- Similar to assert, except condition is positive procedure AlertIf( AlertLogID : AlertLogIDType ; condition : boolean ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIf( condition : boolean ; Message : string ; Level : AlertType := ERROR ) ; impure function AlertIf( AlertLogID : AlertLogIDType ; condition : boolean ; Message : string ; Level : AlertType := ERROR ) return boolean ; impure function AlertIf( condition : boolean ; Message : string ; Level : AlertType := ERROR ) return boolean ; -- deprecated procedure AlertIf( condition : boolean ; AlertLogID : AlertLogIDType ; Message : string ; Level : AlertType := ERROR ) ; impure function AlertIf( condition : boolean ; AlertLogID : AlertLogIDType ; Message : string ; Level : AlertType := ERROR ) return boolean ; ------------------------------------------------------------ -- Direct replacement for assert procedure AlertIfNot( AlertLogID : AlertLogIDType ; condition : boolean ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNot( condition : boolean ; Message : string ; Level : AlertType := ERROR ) ; impure function AlertIfNot( AlertLogID : AlertLogIDType ; condition : boolean ; Message : string ; Level : AlertType := ERROR ) return boolean ; impure function AlertIfNot( condition : boolean ; Message : string ; Level : AlertType := ERROR ) return boolean ; -- deprecated procedure AlertIfNot( condition : boolean ; AlertLogID : AlertLogIDType ; Message : string ; Level : AlertType := ERROR ) ; impure function AlertIfNot( condition : boolean ; AlertLogID : AlertLogIDType ; Message : string ; Level : AlertType := ERROR ) return boolean ; ------------------------------------------------------------ -- overloading for common functionality procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : std_logic ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : std_logic_vector ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : unsigned ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : signed ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : integer ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : real ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : character ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : string ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( L, R : std_logic ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( L, R : std_logic_vector ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( L, R : unsigned ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( L, R : signed ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( L, R : integer ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( L, R : real ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( L, R : character ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfEqual( L, R : string ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : std_logic ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : std_logic_vector ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : unsigned ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : signed ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : integer ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : real ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : character ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : string ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( L, R : std_logic ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( L, R : std_logic_vector ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( L, R : unsigned ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( L, R : signed ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( L, R : integer ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( L, R : real ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( L, R : character ; Message : string ; Level : AlertType := ERROR ) ; procedure AlertIfNotEqual( L, R : string ; Message : string ; Level : AlertType := ERROR ) ; ------------------------------------------------------------ -- Simple Diff for file comparisons procedure AlertIfDiff (AlertLogID : AlertLogIDType ; Name1, Name2 : string; Message : string := "" ; Level : AlertType := ERROR ) ; procedure AlertIfDiff (Name1, Name2 : string; Message : string := "" ; Level : AlertType := ERROR ) ; procedure AlertIfDiff (AlertLogID : AlertLogIDType ; file File1, File2 : text; Message : string := "" ; Level : AlertType := ERROR ) ; procedure AlertIfDiff (file File1, File2 : text; Message : string := "" ; Level : AlertType := ERROR ) ; ------------------------------------------------------------ procedure AffirmIf( AlertLogID : AlertLogIDType ; condition : boolean ; Message : string ; LogLevel : LogType := PASSED ; AlertLevel : AlertType := ERROR ) ; procedure AffirmIf(condition : boolean ; Message : string ; LogLevel : LogType := PASSED ; AlertLevel : AlertType := ERROR) ; ------------------------------------------------------------ procedure SetAlertLogJustify ; procedure ReportAlerts ( Name : String ; AlertCount : AlertCountType ) ; procedure ReportAlerts ( Name : string := OSVVM_STRING_INIT_PARM_DETECT ; AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID ; ExternalErrors : AlertCountType := (others => 0) ) ; procedure ReportNonZeroAlerts ( Name : string := OSVVM_STRING_INIT_PARM_DETECT ; AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID ; ExternalErrors : AlertCountType := (others => 0) ) ; procedure ClearAlerts ; function "ABS" (L : AlertCountType) return AlertCountType ; function "+" (L, R : AlertCountType) return AlertCountType ; function "-" (L, R : AlertCountType) return AlertCountType ; function "-" (R : AlertCountType) return AlertCountType ; impure function SumAlertCount(AlertCount: AlertCountType) return integer ; impure function GetAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return AlertCountType ; impure function GetAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return integer ; impure function GetEnabledAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return AlertCountType ; impure function GetEnabledAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return integer ; impure function GetDisabledAlertCount return AlertCountType ; impure function GetDisabledAlertCount return integer ; impure function GetDisabledAlertCount(AlertLogID: AlertLogIDType) return AlertCountType ; impure function GetDisabledAlertCount(AlertLogID: AlertLogIDType) return integer ; ------------------------------------------------------------ -- log filtering for verbosity control, optionally has a separate file parameter procedure Log( AlertLogID : AlertLogIDType ; Message : string ; Level : LogType := ALWAYS ; Enable : boolean := FALSE -- override internal enable ) ; procedure Log( Message : string ; Level : LogType := ALWAYS ; Enable : boolean := FALSE) ; ------------------------------------------------------------ -- Accessor Methods procedure SetAlertLogName(Name : string ) ; impure function GetAlertLogName(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return string ; procedure DeallocateAlertLogStruct ; procedure InitializeAlertLogStruct ; impure function FindAlertLogID(Name : string ) return AlertLogIDType ; impure function FindAlertLogID(Name : string ; ParentID : AlertLogIDType) return AlertLogIDType ; impure function GetAlertLogID(Name : string ; ParentID : AlertLogIDType := ALERTLOG_BASE_ID ; CreateHierarchy : Boolean := TRUE) return AlertLogIDType ; impure function GetAlertLogParentID(AlertLogID : AlertLogIDType) return AlertLogIDType ; ------------------------------------------------------------ -- Accessor Methods procedure SetGlobalAlertEnable (A : boolean := TRUE) ; impure function SetGlobalAlertEnable (A : boolean := TRUE) return boolean ; impure function GetGlobalAlertEnable return boolean ; procedure IncAffirmCheckCount ; impure function GetAffirmCheckCount return natural ; --?? procedure IncAffirmPassCount ; --?? impure function GetAffirmPassCount return natural ; procedure SetAlertStopCount(AlertLogID : AlertLogIDType ; Level : AlertType ; Count : integer) ; procedure SetAlertStopCount(Level : AlertType ; Count : integer) ; impure function GetAlertStopCount(AlertLogID : AlertLogIDType ; Level : AlertType) return integer ; impure function GetAlertStopCount(Level : AlertType) return integer ; procedure SetAlertEnable(Level : AlertType ; Enable : boolean) ; procedure SetAlertEnable(AlertLogID : AlertLogIDType ; Level : AlertType ; Enable : boolean ; DescendHierarchy : boolean := TRUE) ; impure function GetAlertEnable(AlertLogID : AlertLogIDType ; Level : AlertType) return boolean ; impure function GetAlertEnable(Level : AlertType) return boolean ; procedure SetLogEnable(Level : LogType ; Enable : boolean) ; procedure SetLogEnable(AlertLogID : AlertLogIDType ; Level : LogType ; Enable : boolean ; DescendHierarchy : boolean := TRUE) ; impure function GetLogEnable(AlertLogID : AlertLogIDType ; Level : LogType) return boolean ; impure function GetLogEnable(Level : LogType) return boolean ; impure function IsLoggingEnabled(AlertLogID : AlertLogIDType ; Level : LogType) return boolean ; -- same as GetLogEnable impure function IsLoggingEnabled(Level : LogType) return boolean ; procedure ReportLogEnables ; ------------------------------------------------------------ procedure SetAlertLogOptions ( FailOnWarning : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; FailOnDisabledErrors : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; ReportHierarchy : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertLevel : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertName : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertTime : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogLevel : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogName : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogTime : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; AlertPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; LogPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; ReportPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; DoneName : string := OSVVM_STRING_INIT_PARM_DETECT ; PassName : string := OSVVM_STRING_INIT_PARM_DETECT ; FailName : string := OSVVM_STRING_INIT_PARM_DETECT ) ; procedure ReportAlertLogOptions ; impure function GetAlertLogFailOnWarning return AlertLogOptionsType ; impure function GetAlertLogFailOnDisabledErrors return AlertLogOptionsType ; impure function GetAlertLogReportHierarchy return AlertLogOptionsType ; impure function GetAlertLogFoundReportHier return boolean ; impure function GetAlertLogFoundAlertHier return boolean ; impure function GetAlertLogWriteAlertLevel return AlertLogOptionsType ; impure function GetAlertLogWriteAlertName return AlertLogOptionsType ; impure function GetAlertLogWriteAlertTime return AlertLogOptionsType ; impure function GetAlertLogWriteLogLevel return AlertLogOptionsType ; impure function GetAlertLogWriteLogName return AlertLogOptionsType ; impure function GetAlertLogWriteLogTime return AlertLogOptionsType ; impure function GetAlertLogAlertPrefix return string ; impure function GetAlertLogLogPrefix return string ; impure function GetAlertLogReportPrefix return string ; impure function GetAlertLogDoneName return string ; impure function GetAlertLogPassName return string ; impure function GetAlertLogFailName return string ; -- File Reading Utilities function IsLogEnableType (Name : String) return boolean ; procedure ReadLogEnables (file AlertLogInitFile : text) ; procedure ReadLogEnables (FileName : string) ; -- String Helper Functions -- This should be in a more general string package function PathTail (A : string) return string ; end AlertLogPkg ; --- /////////////////////////////////////////////////////////////////////////// --- /////////////////////////////////////////////////////////////////////////// --- /////////////////////////////////////////////////////////////////////////// use work.NamePkg.all ; package body AlertLogPkg is -- instead of justify(to_upper(to_string())), just look up the upper case, left justified values type AlertNameType is array(AlertType) of string(1 to 7) ; constant ALERT_NAME : AlertNameType := (WARNING => "WARNING", ERROR => "ERROR ", FAILURE => "FAILURE") ; -- , NEVER => "NEVER " type LogNameType is array(LogType) of string(1 to 7) ; constant LOG_NAME : LogNameType := (DEBUG => "DEBUG ", FINAL => "FINAL ", INFO => "INFO ", ALWAYS => "ALWAYS ", PASSED => "PASSED ") ; -- , NEVER => "NEVER " type AlertLogStructPType is protected ------------------------------------------------------------ procedure alert ( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; message : string ; level : AlertType := ERROR ) ; ------------------------------------------------------------ procedure IncAlertCount ( AlertLogID : AlertLogIDType ; level : AlertType := ERROR ) ; procedure SetJustify ; procedure ReportAlerts ( Name : string ; AlertCount : AlertCountType ) ; procedure ReportAlerts ( Name : string := OSVVM_STRING_INIT_PARM_DETECT ; AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID ; ExternalErrors : AlertCountType := (0,0,0) ; ReportAll : boolean := TRUE ) ; procedure ClearAlerts ; impure function GetAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return AlertCountType ; impure function GetEnabledAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return AlertCountType ; impure function GetDisabledAlertCount return AlertCountType ; impure function GetDisabledAlertCount(AlertLogID: AlertLogIDType) return AlertCountType ; ------------------------------------------------------------ procedure log ( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; Message : string ; Level : LogType := ALWAYS ; Enable : boolean := FALSE -- override internal enable ) ; ------------------------------------------------------------ -- FILE IO Controls -- procedure SetTranscriptEnable (A : boolean := TRUE) ; -- impure function IsTranscriptEnabled return boolean ; -- procedure MirrorTranscript (A : boolean := TRUE) ; -- impure function IsTranscriptMirrored return boolean ; ------------------------------------------------------------ ------------------------------------------------------------ -- AlertLog Structure Creation and Interaction Methods ------------------------------------------------------------ procedure SetAlertLogName(Name : string ) ; procedure SetNumAlertLogIDs (NewNumAlertLogIDs : integer) ; impure function FindAlertLogID(Name : string ) return AlertLogIDType ; impure function FindAlertLogID(Name : string ; ParentID : AlertLogIDType) return AlertLogIDType ; impure function GetAlertLogID(Name : string ; ParentID : AlertLogIDType ; CreateHierarchy : Boolean) return AlertLogIDType ; impure function GetAlertLogParentID(AlertLogID : AlertLogIDType) return AlertLogIDType ; procedure Initialize(NewNumAlertLogIDs : integer := MIN_NUM_AL_IDS) ; procedure Deallocate ; ------------------------------------------------------------ ------------------------------------------------------------ -- Accessor Methods ------------------------------------------------------------ procedure SetGlobalAlertEnable (A : boolean := TRUE) ; impure function GetAlertLogName(AlertLogID : AlertLogIDType) return string ; impure function GetGlobalAlertEnable return boolean ; procedure IncAffirmCheckCount ; impure function GetAffirmCheckCount return natural ; --?? procedure IncAffirmPassCount ; --?? impure function GetAffirmPassCount return natural ; procedure SetAlertStopCount(AlertLogID : AlertLogIDType ; Level : AlertType ; Count : integer) ; impure function GetAlertStopCount(AlertLogID : AlertLogIDType ; Level : AlertType) return integer ; procedure SetAlertEnable(Level : AlertType ; Enable : boolean) ; procedure SetAlertEnable(AlertLogID : AlertLogIDType ; Level : AlertType ; Enable : boolean ; DescendHierarchy : boolean := TRUE) ; impure function GetAlertEnable(AlertLogID : AlertLogIDType ; Level : AlertType) return boolean ; procedure SetLogEnable(Level : LogType ; Enable : boolean) ; procedure SetLogEnable(AlertLogID : AlertLogIDType ; Level : LogType ; Enable : boolean ; DescendHierarchy : boolean := TRUE) ; impure function GetLogEnable(AlertLogID : AlertLogIDType ; Level : LogType) return boolean ; procedure ReportLogEnables ; ------------------------------------------------------------ -- Reporting Accessor procedure SetAlertLogOptions ( FailOnWarning : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; FailOnDisabledErrors : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; ReportHierarchy : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertLevel : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertName : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertTime : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogLevel : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogName : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogTime : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; AlertPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; LogPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; ReportPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; DoneName : string := OSVVM_STRING_INIT_PARM_DETECT ; PassName : string := OSVVM_STRING_INIT_PARM_DETECT ; FailName : string := OSVVM_STRING_INIT_PARM_DETECT ) ; procedure ReportAlertLogOptions ; impure function GetAlertLogFailOnWarning return AlertLogOptionsType ; impure function GetAlertLogFailOnDisabledErrors return AlertLogOptionsType ; impure function GetAlertLogReportHierarchy return AlertLogOptionsType ; impure function GetAlertLogFoundReportHier return boolean ; impure function GetAlertLogFoundAlertHier return boolean ; impure function GetAlertLogWriteAlertLevel return AlertLogOptionsType ; impure function GetAlertLogWriteAlertName return AlertLogOptionsType ; impure function GetAlertLogWriteAlertTime return AlertLogOptionsType ; impure function GetAlertLogWriteLogLevel return AlertLogOptionsType ; impure function GetAlertLogWriteLogName return AlertLogOptionsType ; impure function GetAlertLogWriteLogTime return AlertLogOptionsType ; impure function GetAlertLogAlertPrefix return string ; impure function GetAlertLogLogPrefix return string ; impure function GetAlertLogReportPrefix return string ; impure function GetAlertLogDoneName return string ; impure function GetAlertLogPassName return string ; impure function GetAlertLogFailName return string ; end protected AlertLogStructPType ; --- /////////////////////////////////////////////////////////////////////////// type AlertLogStructPType is protected body variable GlobalAlertEnabledVar : boolean := TRUE ; -- Allows turn off and on variable AffirmCheckCountVar : natural := 0 ; --?? variable AffirmPassedCountVar : natural := 0 ; ------------------------------------------------------------ type AlertLogRecType is record ------------------------------------------------------------ Name : Line ; ParentID : AlertLogIDType ; AlertCount : AlertCountType ; AlertStopCount : AlertCountType ; AlertEnabled : AlertEnableType ; LogEnabled : LogEnableType ; end record AlertLogRecType ; ------------------------------------------------------------ -- Basis for AlertLog Data Structure variable NumAlertLogIDsVar : AlertLogIDType := 0 ; -- defined by initialize variable NumAllocatedAlertLogIDsVar : AlertLogIDType := 0 ; --xx variable NumPredefinedAlIDsVar : AlertLogIDType := 0 ; -- defined by initialize type AlertLogRecPtrType is access AlertLogRecType ; type AlertLogArrayType is array (AlertLogIDType range <>) of AlertLogRecPtrType ; type AlertLogArrayPtrType is access AlertLogArrayType ; variable AlertLogPtr : AlertLogArrayPtrType ; ------------------------------------------------------------ -- Report formatting settings, with defaults variable FailOnWarningVar : boolean := TRUE ; variable FailOnDisabledErrorsVar : boolean := TRUE ; variable ReportHierarchyVar : boolean := TRUE ; variable FoundReportHierVar : boolean := FALSE ; variable FoundAlertHierVar : boolean := FALSE ; variable WriteAlertLevelVar : boolean := TRUE ; variable WriteAlertNameVar : boolean := TRUE ; variable WriteAlertTimeVar : boolean := TRUE ; variable WriteLogLevelVar : boolean := TRUE ; variable WriteLogNameVar : boolean := TRUE ; variable WriteLogTimeVar : boolean := TRUE ; variable AlertPrefixVar : NamePType ; variable LogPrefixVar : NamePType ; variable ReportPrefixVar : NamePType ; variable DoneNameVar : NamePType ; variable PassNameVar : NamePType ; variable FailNameVar : NamePType ; variable AlertLogJustifyAmountVar : integer := 0 ; variable ReportJustifyAmountVar : integer := 0 ; ------------------------------------------------------------ -- PT Local impure function LeftJustify(A : String; Amount : integer) return string is ------------------------------------------------------------ constant Spaces : string(1 to maximum(1, Amount)) := (others => ' ') ; begin if A'length >= Amount then return A ; else return A & Spaces(1 to Amount - A'length) ; end if ; end function LeftJustify ; ------------------------------------------------------------ -- PT Local procedure IncrementAlertCount( ------------------------------------------------------------ constant AlertLogID : in AlertLogIDType ; constant Level : in AlertType ; variable StopDueToCount : inout boolean ) is begin -- Always Count at this level AlertLogPtr(AlertLogID).AlertCount(Level) := AlertLogPtr(AlertLogID).AlertCount(Level) + 1 ; -- Only do remaining actions if enabled if AlertLogPtr(AlertLogID).AlertEnabled(Level) then -- Exceeded Stop Count at this level? if AlertLogPtr(AlertLogID).AlertCount(Level) >= AlertLogPtr(AlertLogID).AlertStopCount(Level) then StopDueToCount := TRUE ; end if ; -- Propagate counts to parent(s) -- Ascend Hierarchy if AlertLogID /= ALERTLOG_BASE_ID then IncrementAlertCount(AlertLogPtr(AlertLogID).ParentID, Level, StopDueToCount) ; end if ; end if ; end procedure IncrementAlertCount ; ------------------------------------------------------------ procedure alert ( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; message : string ; level : AlertType := ERROR ) is variable buf : Line ; constant AlertPrefix : string := AlertPrefixVar.Get(OSVVM_DEFAULT_ALERT_PREFIX) ; variable StopDueToCount : boolean := FALSE ; begin if GlobalAlertEnabledVar then -- Do not write or count when GlobalAlertEnabledVar is disabled if AlertLogPtr(AlertLogID).AlertEnabled(Level) then -- do not write when disabled write(buf, AlertPrefix) ; if WriteAlertLevelVar then -- write(buf, " " & to_string(Level) ) ; write(buf, " " & ALERT_NAME(Level)) ; -- uses constant lookup end if ; --xx if (NumAlertLogIDsVar > NumPredefinedAlIDsVar) and WriteAlertNameVar then -- print hierarchy names even when silent if FoundAlertHierVar and WriteAlertNameVar then -- write(buf, " in " & justify(AlertLogPtr(AlertLogID).Name.all & ",", LEFT, AlertLogJustifyAmountVar) ) ; write(buf, " in " & LeftJustify(AlertLogPtr(AlertLogID).Name.all & ",", AlertLogJustifyAmountVar) ) ; end if ; write(buf, " " & Message) ; if WriteAlertTimeVar then write(buf, " at " & to_string(NOW, 1 ns)) ; end if ; writeline(buf) ; end if ; -- Always Count IncrementAlertCount(AlertLogID, Level, StopDueToCount) ; if StopDueToCount then write(buf, LF & AlertPrefix & " Stop Count on " & ALERT_NAME(Level) & " reached") ; --xx if NumAlertLogIDsVar > NumPredefinedAlIDsVar then -- print hierarchy names even when silent if FoundAlertHierVar then write(buf, " in " & AlertLogPtr(AlertLogID).Name.all) ; end if ; write(buf, " at " & to_string(NOW, 1 ns) & " ") ; writeline(buf) ; ReportAlerts(ReportAll => TRUE) ; std.env.stop(1) ; end if ; end if ; end procedure alert ; ------------------------------------------------------------ procedure IncAlertCount ( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; level : AlertType := ERROR ) is variable buf : Line ; constant AlertPrefix : string := AlertPrefixVar.Get(OSVVM_DEFAULT_ALERT_PREFIX) ; variable StopDueToCount : boolean := FALSE ; begin if GlobalAlertEnabledVar then IncrementAlertCount(AlertLogID, Level, StopDueToCount) ; if StopDueToCount then write(buf, LF & AlertPrefix & " Stop Count on " & ALERT_NAME(Level) & " reached") ; --xx if NumAlertLogIDsVar > NumPredefinedAlIDsVar then -- print hierarchy names even when silent if FoundAlertHierVar then write(buf, " in " & AlertLogPtr(AlertLogID).Name.all) ; end if ; write(buf, " at " & to_string(NOW, 1 ns) & " ") ; writeline(buf) ; ReportAlerts(ReportAll => TRUE) ; std.env.stop ; end if ; end if ; end procedure IncAlertCount ; ------------------------------------------------------------ -- PT Local impure function CalcJustify (AlertLogID : AlertLogIDType ; CurrentLength : integer ; IndentAmount : integer) return integer_vector is ------------------------------------------------------------ variable ResultValues, LowerLevelValues : integer_vector(1 to 2) ; -- 1 = Max, 2 = Indented begin ResultValues(1) := CurrentLength + 1 ; -- AlertLogJustifyAmountVar ResultValues(2) := CurrentLength + IndentAmount ; -- ReportJustifyAmountVar for i in AlertLogID+1 to NumAlertLogIDsVar loop if AlertLogID = AlertLogPtr(i).ParentID then LowerLevelValues := CalcJustify(i, AlertLogPtr(i).Name'length, IndentAmount + 2) ; ResultValues(1) := maximum(ResultValues(1), LowerLevelValues(1)) ; ResultValues(2) := maximum(ResultValues(2), LowerLevelValues(2)) ; end if ; end loop ; return ResultValues ; end function CalcJustify ; ------------------------------------------------------------ procedure SetJustify is ------------------------------------------------------------ variable ResultValues : integer_vector(1 to 2) ; -- 1 = Max, 2 = Indented begin ResultValues := CalcJustify(ALERTLOG_BASE_ID, 0, 0) ; AlertLogJustifyAmountVar := ResultValues(1) ; ReportJustifyAmountVar := ResultValues(2) ; end procedure SetJustify ; ------------------------------------------------------------ -- PT Local impure function GetEnabledAlertCount(AlertCount: AlertCountType; AlertEnabled : AlertEnableType) return AlertCountType is ------------------------------------------------------------ variable Count : AlertCountType := (others => 0) ; begin if AlertEnabled(FAILURE) then Count(FAILURE) := AlertCount(FAILURE) ; end if ; if AlertEnabled(ERROR) then Count(ERROR) := AlertCount(ERROR) ; end if ; if FailOnWarningVar and AlertEnabled(WARNING) then Count(WARNING) := AlertCount(WARNING) ; end if ; return Count ; end function GetEnabledAlertCount ; ------------------------------------------------------------ impure function GetAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return AlertCountType is ------------------------------------------------------------ variable AlertCount : AlertCountType ; begin return AlertLogPtr(AlertLogID).AlertCount ; end function GetAlertCount ; ------------------------------------------------------------ impure function GetEnabledAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return AlertCountType is ------------------------------------------------------------ variable AlertCount : AlertCountType ; begin return GetEnabledAlertCount(AlertLogPtr(AlertLogID).AlertCount, AlertLogPtr(AlertLogID).AlertEnabled) ; end function GetEnabledAlertCount ; ------------------------------------------------------------ -- PT Local impure function GetDisabledAlertCount(AlertCount: AlertCountType; AlertEnabled : AlertEnableType) return AlertCountType is ------------------------------------------------------------ variable Count : AlertCountType := (others => 0) ; begin if not AlertEnabled(FAILURE) then Count(FAILURE) := AlertCount(FAILURE) ; end if ; if not AlertEnabled(ERROR) then Count(ERROR) := AlertCount(ERROR) ; end if ; if FailOnWarningVar and not AlertEnabled(WARNING) then Count(WARNING) := AlertCount(WARNING) ; end if ; return Count ; end function GetDisabledAlertCount ; ------------------------------------------------------------ impure function GetDisabledAlertCount return AlertCountType is ------------------------------------------------------------ variable Count : AlertCountType := (others => 0) ; begin for i in ALERTLOG_BASE_ID to NumAlertLogIDsVar loop Count := Count + GetDisabledAlertCount(AlertLogPtr(i).AlertCount, AlertLogPtr(i).AlertEnabled) ; end loop ; return Count ; end function GetDisabledAlertCount ; ------------------------------------------------------------ impure function GetDisabledAlertCount(AlertLogID: AlertLogIDType) return AlertCountType is ------------------------------------------------------------ variable Count : AlertCountType := (others => 0) ; begin Count := GetDisabledAlertCount(AlertLogPtr(AlertLogID).AlertCount, AlertLogPtr(AlertLogID).AlertEnabled) ; for i in AlertLogID+1 to NumAlertLogIDsVar loop if AlertLogID = AlertLogPtr(i).ParentID then Count := Count + GetDisabledAlertCount(i) ; end if ; end loop ; return Count ; end function GetDisabledAlertCount ; ------------------------------------------------------------ -- PT Local procedure PrintTopAlerts ( ------------------------------------------------------------ NumErrors : integer ; AlertCount : AlertCountType ; Name : string ; NumDisabledErrors : integer ) is constant ReportPrefix : string := ResolveOsvvmWritePrefix(ReportPrefixVar.GetOpt ) ; constant DoneName : string := ResolveOsvvmDoneName(DoneNameVar.GetOpt ) ; constant PassName : string := ResolveOsvvmPassName(PassNameVar.GetOpt ) ; constant FailName : string := ResolveOsvvmFailName(FailNameVar.GetOpt ) ; variable buf : line ; begin if NumErrors = 0 then if NumDisabledErrors = 0 then -- Passed write(buf, ReportPrefix & DoneName & " " & PassName & " " & Name) ; if AffirmCheckCountVar > 0 then write(buf, " Affirmations Checked: " & to_string(AffirmCheckCountVar)) ; end if ; write(buf, " at " & to_string(NOW, 1 ns)) ; WriteLine(buf) ; else -- Failed Due to Disabled Errors write(buf, ReportPrefix & DoneName & " " & FailName & " " & Name) ; write(buf, " Failed Due to Disabled Error(s) = " & to_string(NumDisabledErrors)) ; if AffirmCheckCountVar > 0 then write(buf, " Affirmations Checked: " & to_string(AffirmCheckCountVar)) ; end if ; write(buf, " at " & to_string(NOW, 1 ns)) ; WriteLine(buf) ; end if ; else -- Failed write(buf, ReportPrefix & DoneName & " " & FailName & " "& Name) ; write(buf, " Total Error(s) = " & to_string(NumErrors) ) ; write(buf, " Failures: " & to_string(AlertCount(FAILURE)) ) ; write(buf, " Errors: " & to_string(AlertCount(ERROR) ) ) ; write(buf, " Warnings: " & to_string(AlertCount(WARNING) ) ) ; if AffirmCheckCountVar > 0 then --?? write(buf, " Affirmations Passed: " & to_string(AffirmPassedCountVar)) ; --?? write(buf, " Checked: " & to_string(AffirmCheckCountVar)) ; write(buf, " Affirmations Checked: " & to_string(AffirmCheckCountVar)) ; end if ; Write(buf, " at " & to_string(NOW, 1 ns)) ; WriteLine(buf) ; end if ; end procedure PrintTopAlerts ; ------------------------------------------------------------ -- PT Local procedure PrintChild( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; Prefix : string ; IndentAmount : integer ; ReportAll : boolean ) is variable buf : line ; begin for i in AlertLogID+1 to NumAlertLogIDsVar loop if AlertLogID = AlertLogPtr(i).ParentID then if ReportAll or SumAlertCount(AlertLogPtr(i).AlertCount) > 0 then Write(buf, Prefix & " " & LeftJustify(AlertLogPtr(i).Name.all, ReportJustifyAmountVar - IndentAmount)) ; write(buf, " Failures: " & to_string(AlertLogPtr(i).AlertCount(FAILURE) ) ) ; write(buf, " Errors: " & to_string(AlertLogPtr(i).AlertCount(ERROR) ) ) ; write(buf, " Warnings: " & to_string(AlertLogPtr(i).AlertCount(WARNING) ) ) ; WriteLine(buf) ; end if ; PrintChild( AlertLogID => i, Prefix => Prefix & " ", IndentAmount => IndentAmount + 2, ReportAll => ReportAll ) ; end if ; end loop ; end procedure PrintChild ; ------------------------------------------------------------ procedure ReportAlerts ( Name : string := OSVVM_STRING_INIT_PARM_DETECT ; AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID ; ExternalErrors : AlertCountType := (0,0,0) ; ReportAll : boolean := TRUE) is ------------------------------------------------------------ variable NumErrors : integer ; variable NumDisabledErrors : integer ; constant ReportPrefix : string := ResolveOsvvmWritePrefix(ReportPrefixVar.GetOpt) ; begin if ReportJustifyAmountVar <= 0 then SetJustify ; end if ; NumErrors := SumAlertCount( ExternalErrors + GetEnabledAlertCount(AlertLogPtr(AlertLogID).AlertCount, AlertLogPtr(AlertLogID).AlertEnabled) ) ; if FailOnDisabledErrorsVar then NumDisabledErrors := SumAlertCount( GetDisabledAlertCount(AlertLogID) ) ; else NumDisabledErrors := 0 ; end if ; if IsOsvvmStringSet(Name) then PrintTopAlerts ( NumErrors => NumErrors, AlertCount => AlertLogPtr(AlertLogID).AlertCount + ExternalErrors, Name => Name, NumDisabledErrors => NumDisabledErrors ) ; else PrintTopAlerts ( NumErrors => NumErrors, AlertCount => AlertLogPtr(AlertLogID).AlertCount + ExternalErrors, Name => AlertLogPtr(AlertLogID).Name.all, NumDisabledErrors => NumDisabledErrors ) ; end if ; --Print Hierarchy when enabled and error or disabled error if (FoundReportHierVar and ReportHierarchyVar) and (NumErrors /= 0 or NumDisabledErrors /=0) then PrintChild( AlertLogID => AlertLogID, Prefix => ReportPrefix & " ", IndentAmount => 2, ReportAll => ReportAll ) ; end if ; end procedure ReportAlerts ; ------------------------------------------------------------ procedure ReportAlerts ( Name : string ; AlertCount : AlertCountType ) is ------------------------------------------------------------ begin PrintTopAlerts ( NumErrors => SumAlertCount(AlertCount), AlertCount => AlertCount, Name => Name, NumDisabledErrors => 0 ) ; end procedure ReportAlerts ; ------------------------------------------------------------ procedure ClearAlerts is ------------------------------------------------------------ begin AffirmCheckCountVar := 0 ; --?? AffirmPassedCountVar := 0 ; AlertLogPtr(ALERTLOG_BASE_ID).AlertCount := (0, 0, 0) ; AlertLogPtr(ALERTLOG_BASE_ID).AlertStopCount := (FAILURE => 0, ERROR => integer'right, WARNING => integer'right) ; for i in ALERTLOG_BASE_ID + 1 to NumAlertLogIDsVar loop AlertLogPtr(i).AlertCount := (0, 0, 0) ; AlertLogPtr(i).AlertStopCount := (FAILURE => integer'right, ERROR => integer'right, WARNING => integer'right) ; end loop ; end procedure ClearAlerts ; ------------------------------------------------------------ -- PT Local procedure LocalLog ( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; Message : string ; Level : LogType ) is variable buf : line ; constant LogPrefix : string := LogPrefixVar.Get(OSVVM_DEFAULT_LOG_PREFIX) ; begin write(buf, LogPrefix) ; if WriteLogLevelVar then write(buf, " " & LOG_NAME(Level) ) ; end if ; --xx if (NumAlertLogIDsVar > NumPredefinedAlIDsVar) and WriteLogNameVar then -- print hierarchy names even when silent if FoundAlertHierVar and WriteLogNameVar then -- write(buf, " in " & justify(AlertLogPtr(AlertLogID).Name.all & ",", LEFT, AlertLogJustifyAmountVar) ) ; write(buf, " in " & LeftJustify(AlertLogPtr(AlertLogID).Name.all & ",", AlertLogJustifyAmountVar) ) ; end if ; write(buf, " " & Message) ; if WriteLogTimeVar then write(buf, " at " & to_string(NOW, 1 ns)) ; end if ; writeline(buf) ; end procedure LocalLog ; ------------------------------------------------------------ procedure log ( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; Message : string ; Level : LogType := ALWAYS ; Enable : boolean := FALSE -- override internal enable ) is begin if Level = ALWAYS or Enable then LocalLog(AlertLogID, Message, Level) ; elsif AlertLogPtr(AlertLogID).LogEnabled(Level) then LocalLog(AlertLogID, Message, Level) ; end if ; end procedure log ; ------------------------------------------------------------ ------------------------------------------------------------ -- AlertLog Structure Creation and Interaction Methods ------------------------------------------------------------ procedure SetAlertLogName(Name : string ) is ------------------------------------------------------------ begin Deallocate(AlertLogPtr(ALERTLOG_BASE_ID).Name) ; AlertLogPtr(ALERTLOG_BASE_ID).Name := new string'(Name) ; end procedure SetAlertLogName ; ------------------------------------------------------------ impure function GetAlertLogName(AlertLogID : AlertLogIDType) return string is ------------------------------------------------------------ begin return AlertLogPtr(AlertLogID).Name.all ; end function GetAlertLogName ; ------------------------------------------------------------ -- PT Local procedure NewAlertLogRec(AlertLogID : AlertLogIDType ; Name : string ; ParentID : AlertLogIDType) is ------------------------------------------------------------ variable AlertEnabled : AlertEnableType ; variable AlertStopCount : AlertCountType ; variable LogEnabled : LogEnableType ; begin if AlertLogID = ALERTLOG_BASE_ID then AlertEnabled := (TRUE, TRUE, TRUE) ; LogEnabled := (others => FALSE) ; AlertStopCount := (FAILURE => 0, ERROR => integer'right, WARNING => integer'right) ; else if ParentID < ALERTLOG_BASE_ID then AlertEnabled := AlertLogPtr(ALERTLOG_BASE_ID).AlertEnabled ; LogEnabled := AlertLogPtr(ALERTLOG_BASE_ID).LogEnabled ; else AlertEnabled := AlertLogPtr(ParentID).AlertEnabled ; LogEnabled := AlertLogPtr(ParentID).LogEnabled ; end if ; AlertStopCount := (FAILURE => integer'right, ERROR => integer'right, WARNING => integer'right) ; end if ; AlertLogPtr(AlertLogID) := new AlertLogRecType ; AlertLogPtr(AlertLogID).Name := new string'(NAME) ; AlertLogPtr(AlertLogID).ParentID := ParentID ; AlertLogPtr(AlertLogID).AlertCount := (0, 0, 0) ; AlertLogPtr(AlertLogID).AlertEnabled := AlertEnabled ; AlertLogPtr(AlertLogID).AlertStopCount := AlertStopCount ; AlertLogPtr(AlertLogID).LogEnabled := LogEnabled ; -- AlertLogPtr(AlertLogID) := new AlertLogRecType'( -- Name => new string'(NAME), -- ParentID => ParentID, -- AlertCount => (0, 0, 0), -- AlertEnabled => AlertEnabled, -- AlertStopCount => AlertStopCount, -- LogEnabled => LogEnabled -- ) ; end procedure NewAlertLogRec ; ------------------------------------------------------------ -- PT Local -- Construct initial data structure procedure LocalInitialize(NewNumAlertLogIDs : integer := MIN_NUM_AL_IDS) is ------------------------------------------------------------ begin if NumAllocatedAlertLogIDsVar /= 0 then Alert(ALERT_DEFAULT_ID, "AlertLogPkg: Initialize, data structure already initialized", FAILURE) ; return ; end if ; -- Initialize Pointer AlertLogPtr := new AlertLogArrayType(ALERTLOG_BASE_ID to ALERTLOG_BASE_ID + NewNumAlertLogIDs) ; NumAllocatedAlertLogIDsVar := NewNumAlertLogIDs ; -- Create BASE AlertLogID (if it differs from DEFAULT if ALERTLOG_BASE_ID /= ALERT_DEFAULT_ID then NewAlertLogRec(ALERTLOG_BASE_ID, "AlertLogTop", ALERTLOG_BASE_ID) ; end if ; -- Create DEFAULT AlertLogID NewAlertLogRec(ALERT_DEFAULT_ID, "Default", ALERTLOG_BASE_ID) ; NumAlertLogIDsVar := ALERT_DEFAULT_ID ; -- Create OSVVM AlertLogID (if it differs from DEFAULT if OSVVM_ALERTLOG_ID /= ALERT_DEFAULT_ID then NewAlertLogRec(OSVVM_ALERTLOG_ID, "OSVVM", ALERTLOG_BASE_ID) ; NumAlertLogIDsVar := NumAlertLogIDsVar + 1 ; end if ; if OSVVM_SCOREBOARD_ALERTLOG_ID /= OSVVM_ALERTLOG_ID then NewAlertLogRec(OSVVM_SCOREBOARD_ALERTLOG_ID, "OSVVM Scoreboard", ALERTLOG_BASE_ID) ; NumAlertLogIDsVar := NumAlertLogIDsVar + 1 ; end if ; end procedure LocalInitialize ; ------------------------------------------------------------ -- Construct initial data structure procedure Initialize(NewNumAlertLogIDs : integer := MIN_NUM_AL_IDS) is ------------------------------------------------------------ begin LocalInitialize(NewNumAlertLogIDs) ; end procedure Initialize ; ------------------------------------------------------------ -- PT Local -- Constructs initial data structure using constant below impure function LocalInitialize return boolean is ------------------------------------------------------------ begin LocalInitialize(MIN_NUM_AL_IDS) ; return TRUE ; end function LocalInitialize ; constant CONSTRUCT_ALERT_DATA_STRUCTURE : boolean := LocalInitialize ; ------------------------------------------------------------ procedure Deallocate is ------------------------------------------------------------ begin for i in ALERTLOG_BASE_ID to NumAlertLogIDsVar loop Deallocate(AlertLogPtr(i).Name) ; Deallocate(AlertLogPtr(i)) ; end loop ; deallocate(AlertLogPtr) ; -- Free up space used by protected types within AlertLogPkg AlertPrefixVar.Deallocate ; LogPrefixVar.Deallocate ; ReportPrefixVar.Deallocate ; DoneNameVar.Deallocate ; PassNameVar.Deallocate ; FailNameVar.Deallocate ; -- Restore variables to their initial state NumAlertLogIDsVar := 0 ; NumAllocatedAlertLogIDsVar := 0 ; GlobalAlertEnabledVar := TRUE ; -- Allows turn off and on AffirmCheckCountVar := 0 ; --?? AffirmPassedCountVar := 0 ; FailOnWarningVar := TRUE ; FailOnDisabledErrorsVar := TRUE ; ReportHierarchyVar := TRUE ; FoundReportHierVar := FALSE ; FoundAlertHierVar := FALSE ; WriteAlertLevelVar := TRUE ; WriteAlertNameVar := TRUE ; WriteAlertTimeVar := TRUE ; WriteLogLevelVar := TRUE ; WriteLogNameVar := TRUE ; WriteLogTimeVar := TRUE ; end procedure Deallocate ; ------------------------------------------------------------ -- PT Local. procedure GrowAlertStructure (NewNumAlertLogIDs : integer) is ------------------------------------------------------------ variable oldAlertLogPtr : AlertLogArrayPtrType ; begin if NumAllocatedAlertLogIDsVar = 0 then Initialize (NewNumAlertLogIDs) ; -- Construct initial structure else oldAlertLogPtr := AlertLogPtr ; AlertLogPtr := new AlertLogArrayType(ALERTLOG_BASE_ID to NewNumAlertLogIDs) ; AlertLogPtr(ALERTLOG_BASE_ID to NumAlertLogIDsVar) := oldAlertLogPtr(ALERTLOG_BASE_ID to NumAlertLogIDsVar) ; deallocate(oldAlertLogPtr) ; end if ; NumAllocatedAlertLogIDsVar := NewNumAlertLogIDs ; end procedure GrowAlertStructure ; ------------------------------------------------------------ -- Sets a AlertLogPtr to a particular size -- Use for small bins to save space or large bins to -- suppress the resize and copy as a CovBin autosizes. procedure SetNumAlertLogIDs (NewNumAlertLogIDs : integer) is ------------------------------------------------------------ variable oldAlertLogPtr : AlertLogArrayPtrType ; begin if NewNumAlertLogIDs > NumAllocatedAlertLogIDsVar then GrowAlertStructure(NewNumAlertLogIDs) ; end if; end procedure SetNumAlertLogIDs ; ------------------------------------------------------------ -- PT Local impure function GetNextAlertLogID return AlertLogIDType is ------------------------------------------------------------ variable NewNumAlertLogIDs : AlertLogIDType ; begin NewNumAlertLogIDs := NumAlertLogIDsVar + 1 ; if NewNumAlertLogIDs > NumAllocatedAlertLogIDsVar then GrowAlertStructure(NumAllocatedAlertLogIDsVar + MIN_NUM_AL_IDS) ; end if ; NumAlertLogIDsVar := NewNumAlertLogIDs ; return NumAlertLogIDsVar ; end function GetNextAlertLogID ; ------------------------------------------------------------ impure function FindAlertLogID(Name : string ) return AlertLogIDType is ------------------------------------------------------------ begin for i in ALERTLOG_BASE_ID to NumAlertLogIDsVar loop if Name = AlertLogPtr(i).Name.all then return i ; end if ; end loop ; return ALERTLOG_ID_NOT_FOUND ; -- not found end function FindAlertLogID ; ------------------------------------------------------------ impure function FindAlertLogID(Name : string ; ParentID : AlertLogIDType) return AlertLogIDType is ------------------------------------------------------------ variable CurParentID : AlertLogIDType ; begin for i in ALERTLOG_BASE_ID to NumAlertLogIDsVar loop CurParentID := AlertLogPtr(i).ParentID ; if Name = AlertLogPtr(i).Name.all and (CurParentID = ParentID or CurParentID = ALERTLOG_ID_NOT_ASSIGNED or ParentID = ALERTLOG_ID_NOT_ASSIGNED) then return i ; end if ; end loop ; return ALERTLOG_ID_NOT_FOUND ; -- not found end function FindAlertLogID ; ------------------------------------------------------------ impure function GetAlertLogID(Name : string ; ParentID : AlertLogIDType ; CreateHierarchy : Boolean) return AlertLogIDType is ------------------------------------------------------------ variable ResultID : AlertLogIDType ; begin ResultID := FindAlertLogID(Name, ParentID) ; if ResultID /= ALERTLOG_ID_NOT_FOUND then -- found it, set ParentID if AlertLogPtr(ResultID).ParentID = ALERTLOG_ID_NOT_ASSIGNED then AlertLogPtr(ResultID).ParentID := ParentID ; -- else -- do not update as ParentIDs are either same or input ParentID = ALERTLOG_ID_NOT_ASSIGNED end if ; else ResultID := GetNextAlertLogID ; NewAlertLogRec(ResultID, Name, ParentID) ; FoundAlertHierVar := TRUE ; if CreateHierarchy then FoundReportHierVar := TRUE ; end if ; end if ; return ResultID ; end function GetAlertLogID ; ------------------------------------------------------------ impure function GetAlertLogParentID(AlertLogID : AlertLogIDType) return AlertLogIDType is ------------------------------------------------------------ begin return AlertLogPtr(AlertLogID).ParentID ; end function GetAlertLogParentID ; ------------------------------------------------------------ ------------------------------------------------------------ -- Accessor Methods ------------------------------------------------------------ ------------------------------------------------------------ procedure SetGlobalAlertEnable (A : boolean := TRUE) is ------------------------------------------------------------ begin GlobalAlertEnabledVar := A ; end procedure SetGlobalAlertEnable ; ------------------------------------------------------------ impure function GetGlobalAlertEnable return boolean is ------------------------------------------------------------ begin return GlobalAlertEnabledVar ; end function GetGlobalAlertEnable ; ------------------------------------------------------------ procedure IncAffirmCheckCount is ------------------------------------------------------------ begin if GlobalAlertEnabledVar then AffirmCheckCountVar := AffirmCheckCountVar + 1 ; end if ; end procedure IncAffirmCheckCount ; ------------------------------------------------------------ impure function GetAffirmCheckCount return natural is ------------------------------------------------------------ begin return AffirmCheckCountVar ; end function GetAffirmCheckCount ; --?? ------------------------------------------------------------ --?? procedure IncAffirmPassCount is --?? ------------------------------------------------------------ --?? begin --?? if GlobalAlertEnabledVar then --?? AffirmCheckCountVar := AffirmCheckCountVar + 1 ; --?? AffirmPassedCountVar := AffirmPassedCountVar + 1 ; --?? end if ; --?? end procedure IncAffirmPassCount ; --?? --?? ------------------------------------------------------------ --?? impure function GetAffirmPassCount return natural is --?? ------------------------------------------------------------ --?? begin --?? return AffirmPassedCountVar ; --?? end function GetAffirmPassCount ; ------------------------------------------------------------ -- PT LOCAL procedure SetOneStopCount( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; Level : AlertType ; Count : integer ) is begin if AlertLogPtr(AlertLogID).AlertStopCount(Level) = integer'right then AlertLogPtr(AlertLogID).AlertStopCount(Level) := Count ; else AlertLogPtr(AlertLogID).AlertStopCount(Level) := AlertLogPtr(AlertLogID).AlertStopCount(Level) + Count ; end if ; end procedure SetOneStopCount ; ------------------------------------------------------------ procedure SetAlertStopCount(AlertLogID : AlertLogIDType ; Level : AlertType ; Count : integer) is ------------------------------------------------------------ begin SetOneStopCount(AlertLogID, Level, Count) ; if AlertLogID /= ALERTLOG_BASE_ID then SetAlertStopCount(AlertLogPtr(AlertLogID).ParentID, Level, Count) ; end if ; end procedure SetAlertStopCount ; ------------------------------------------------------------ impure function GetAlertStopCount(AlertLogID : AlertLogIDType ; Level : AlertType) return integer is ------------------------------------------------------------ begin return AlertLogPtr(AlertLogID).AlertStopCount(Level) ; end function GetAlertStopCount ; ------------------------------------------------------------ procedure SetAlertEnable(Level : AlertType ; Enable : boolean) is ------------------------------------------------------------ begin for i in ALERTLOG_BASE_ID to NumAlertLogIDsVar loop AlertLogPtr(i).AlertEnabled(Level) := Enable ; end loop ; end procedure SetAlertEnable ; ------------------------------------------------------------ procedure SetAlertEnable(AlertLogID : AlertLogIDType ; Level : AlertType ; Enable : boolean ; DescendHierarchy : boolean := TRUE) is ------------------------------------------------------------ begin AlertLogPtr(AlertLogID).AlertEnabled(Level) := Enable ; if DescendHierarchy then for i in AlertLogID+1 to NumAlertLogIDsVar loop if AlertLogID = AlertLogPtr(i).ParentID then SetAlertEnable(i, Level, Enable, DescendHierarchy) ; end if ; end loop ; end if ; end procedure SetAlertEnable ; ------------------------------------------------------------ impure function GetAlertEnable(AlertLogID : AlertLogIDType ; Level : AlertType) return boolean is ------------------------------------------------------------ begin return AlertLogPtr(AlertLogID).AlertEnabled(Level) ; end function GetAlertEnable ; ------------------------------------------------------------ procedure SetLogEnable(Level : LogType ; Enable : boolean) is ------------------------------------------------------------ begin for i in ALERTLOG_BASE_ID to NumAlertLogIDsVar loop AlertLogPtr(i).LogEnabled(Level) := Enable ; end loop ; end procedure SetLogEnable ; ------------------------------------------------------------ procedure SetLogEnable(AlertLogID : AlertLogIDType ; Level : LogType ; Enable : boolean ; DescendHierarchy : boolean := TRUE) is ------------------------------------------------------------ begin AlertLogPtr(AlertLogID).LogEnabled(Level) := Enable ; if DescendHierarchy then for i in AlertLogID+1 to NumAlertLogIDsVar loop if AlertLogID = AlertLogPtr(i).ParentID then SetLogEnable(i, Level, Enable, DescendHierarchy) ; end if ; end loop ; end if ; end procedure SetLogEnable ; ------------------------------------------------------------ impure function GetLogEnable(AlertLogID : AlertLogIDType ; Level : LogType) return boolean is ------------------------------------------------------------ begin if Level = ALWAYS then return TRUE ; else return AlertLogPtr(AlertLogID).LogEnabled(Level) ; end if ; end function GetLogEnable ; ------------------------------------------------------------ -- PT Local procedure PrintLogLevels( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; Prefix : string ; IndentAmount : integer ) is variable buf : line ; begin write(buf, Prefix & " " & LeftJustify(AlertLogPtr(AlertLogID).Name.all, ReportJustifyAmountVar - IndentAmount)) ; for i in LogIndexType loop if AlertLogPtr(AlertLogID).LogEnabled(i) then -- write(buf, " " & to_string(AlertLogPtr(AlertLogID).LogEnabled(i)) ) ; write(buf, " " & to_string(i)) ; end if ; end loop ; WriteLine(buf) ; for i in AlertLogID+1 to NumAlertLogIDsVar loop if AlertLogID = AlertLogPtr(i).ParentID then PrintLogLevels( AlertLogID => i, Prefix => Prefix & " ", IndentAmount => IndentAmount + 2 ) ; end if ; end loop ; end procedure PrintLogLevels ; ------------------------------------------------------------ procedure ReportLogEnables is ------------------------------------------------------------ begin if ReportJustifyAmountVar <= 0 then SetJustify ; end if ; PrintLogLevels(ALERTLOG_BASE_ID, "", 0) ; end procedure ReportLogEnables ; ------------------------------------------------------------ procedure SetAlertLogOptions ( ------------------------------------------------------------ FailOnWarning : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; FailOnDisabledErrors : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; ReportHierarchy : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertLevel : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertName : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertTime : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogLevel : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogName : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogTime : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; AlertPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; LogPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; ReportPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; DoneName : string := OSVVM_STRING_INIT_PARM_DETECT ; PassName : string := OSVVM_STRING_INIT_PARM_DETECT ; FailName : string := OSVVM_STRING_INIT_PARM_DETECT ) is begin if FailOnWarning /= OPT_INIT_PARM_DETECT then FailOnWarningVar := IsEnabled(FailOnWarning) ; end if ; if FailOnDisabledErrors /= OPT_INIT_PARM_DETECT then FailOnDisabledErrorsVar := IsEnabled(FailOnDisabledErrors) ; end if ; if ReportHierarchy /= OPT_INIT_PARM_DETECT then ReportHierarchyVar := IsEnabled(ReportHierarchy) ; end if ; if WriteAlertLevel /= OPT_INIT_PARM_DETECT then WriteAlertLevelVar := IsEnabled(WriteAlertLevel) ; end if ; if WriteAlertName /= OPT_INIT_PARM_DETECT then WriteAlertNameVar := IsEnabled(WriteAlertName) ; end if ; if WriteAlertTime /= OPT_INIT_PARM_DETECT then WriteAlertTimeVar := IsEnabled(WriteAlertTime) ; end if ; if WriteLogLevel /= OPT_INIT_PARM_DETECT then WriteLogLevelVar := IsEnabled(WriteLogLevel) ; end if ; if WriteLogName /= OPT_INIT_PARM_DETECT then WriteLogNameVar := IsEnabled(WriteLogName) ; end if ; if WriteLogTime /= OPT_INIT_PARM_DETECT then WriteLogTimeVar := IsEnabled(WriteLogTime) ; end if ; if AlertPrefix /= OSVVM_STRING_INIT_PARM_DETECT then AlertPrefixVar.Set(AlertPrefix) ; end if ; if LogPrefix /= OSVVM_STRING_INIT_PARM_DETECT then LogPrefixVar.Set(LogPrefix) ; end if ; if ReportPrefix /= OSVVM_STRING_INIT_PARM_DETECT then ReportPrefixVar.Set(ReportPrefix) ; end if ; if DoneName /= OSVVM_STRING_INIT_PARM_DETECT then DoneNameVar.Set(DoneName) ; end if ; if PassName /= OSVVM_STRING_INIT_PARM_DETECT then PassNameVar.Set(PassName) ; end if ; if FailName /= OSVVM_STRING_INIT_PARM_DETECT then FailNameVar.Set(FailName) ; end if ; end procedure SetAlertLogOptions ; ------------------------------------------------------------ procedure ReportAlertLogOptions is ------------------------------------------------------------ variable buf : line ; begin -- Boolean Values swrite(buf, "ReportAlertLogOptions" & LF ) ; swrite(buf, "---------------------" & LF ) ; swrite(buf, "FailOnWarningVar: " & to_string(FailOnWarningVar ) & LF ) ; swrite(buf, "FailOnDisabledErrorsVar: " & to_string(FailOnDisabledErrorsVar ) & LF ) ; swrite(buf, "ReportHierarchyVar: " & to_string(ReportHierarchyVar ) & LF ) ; swrite(buf, "FoundReportHierVar: " & to_string(FoundReportHierVar ) & LF ) ; -- Not set by user swrite(buf, "FoundAlertHierVar: " & to_string(FoundAlertHierVar ) & LF ) ; -- Not set by user swrite(buf, "WriteAlertLevelVar: " & to_string(WriteAlertLevelVar ) & LF ) ; swrite(buf, "WriteAlertNameVar: " & to_string(WriteAlertNameVar ) & LF ) ; swrite(buf, "WriteAlertTimeVar: " & to_string(WriteAlertTimeVar ) & LF ) ; swrite(buf, "WriteLogLevelVar: " & to_string(WriteLogLevelVar ) & LF ) ; swrite(buf, "WriteLogNameVar: " & to_string(WriteLogNameVar ) & LF ) ; swrite(buf, "WriteLogTimeVar: " & to_string(WriteLogTimeVar ) & LF ) ; -- String swrite(buf, "AlertPrefixVar: " & string'(AlertPrefixVar.Get(OSVVM_DEFAULT_ALERT_PREFIX)) & LF ) ; swrite(buf, "LogPrefixVar: " & string'(LogPrefixVar.Get(OSVVM_DEFAULT_LOG_PREFIX)) & LF ) ; swrite(buf, "ReportPrefixVar: " & ResolveOsvvmWritePrefix(ReportPrefixVar.GetOpt) & LF ) ; swrite(buf, "DoneNameVar: " & ResolveOsvvmDoneName(DoneNameVar.GetOpt) & LF ) ; swrite(buf, "PassNameVar: " & ResolveOsvvmPassName(PassNameVar.GetOpt) & LF ) ; swrite(buf, "FailNameVar: " & ResolveOsvvmFailName(FailNameVar.GetOpt) & LF ) ; writeline(buf) ; end procedure ReportAlertLogOptions ; ------------------------------------------------------------ impure function GetAlertLogFailOnWarning return AlertLogOptionsType is ------------------------------------------------------------ begin return to_OsvvmOptionsType(FailOnWarningVar) ; end function GetAlertLogFailOnWarning ; ------------------------------------------------------------ impure function GetAlertLogFailOnDisabledErrors return AlertLogOptionsType is ------------------------------------------------------------ begin return to_OsvvmOptionsType(FailOnDisabledErrorsVar) ; end function GetAlertLogFailOnDisabledErrors ; ------------------------------------------------------------ impure function GetAlertLogReportHierarchy return AlertLogOptionsType is ------------------------------------------------------------ begin return to_OsvvmOptionsType(ReportHierarchyVar) ; end function GetAlertLogReportHierarchy ; ------------------------------------------------------------ impure function GetAlertLogFoundReportHier return boolean is ------------------------------------------------------------ begin return FoundReportHierVar ; end function GetAlertLogFoundReportHier ; ------------------------------------------------------------ impure function GetAlertLogFoundAlertHier return boolean is ------------------------------------------------------------ begin return FoundAlertHierVar ; end function GetAlertLogFoundAlertHier ; ------------------------------------------------------------ impure function GetAlertLogWriteAlertLevel return AlertLogOptionsType is ------------------------------------------------------------ begin return to_OsvvmOptionsType(WriteAlertLevelVar) ; end function GetAlertLogWriteAlertLevel ; ------------------------------------------------------------ impure function GetAlertLogWriteAlertName return AlertLogOptionsType is ------------------------------------------------------------ begin return to_OsvvmOptionsType(WriteAlertNameVar) ; end function GetAlertLogWriteAlertName ; ------------------------------------------------------------ impure function GetAlertLogWriteAlertTime return AlertLogOptionsType is ------------------------------------------------------------ begin return to_OsvvmOptionsType(WriteAlertTimeVar) ; end function GetAlertLogWriteAlertTime ; ------------------------------------------------------------ impure function GetAlertLogWriteLogLevel return AlertLogOptionsType is ------------------------------------------------------------ begin return to_OsvvmOptionsType(WriteLogLevelVar) ; end function GetAlertLogWriteLogLevel ; ------------------------------------------------------------ impure function GetAlertLogWriteLogName return AlertLogOptionsType is ------------------------------------------------------------ begin return to_OsvvmOptionsType(WriteLogNameVar) ; end function GetAlertLogWriteLogName ; ------------------------------------------------------------ impure function GetAlertLogWriteLogTime return AlertLogOptionsType is ------------------------------------------------------------ begin return to_OsvvmOptionsType(WriteLogTimeVar) ; end function GetAlertLogWriteLogTime ; ------------------------------------------------------------ impure function GetAlertLogAlertPrefix return string is ------------------------------------------------------------ begin return AlertPrefixVar.Get(OSVVM_DEFAULT_ALERT_PREFIX) ; end function GetAlertLogAlertPrefix ; ------------------------------------------------------------ impure function GetAlertLogLogPrefix return string is ------------------------------------------------------------ begin return LogPrefixVar.Get(OSVVM_DEFAULT_LOG_PREFIX) ; end function GetAlertLogLogPrefix ; ------------------------------------------------------------ impure function GetAlertLogReportPrefix return string is ------------------------------------------------------------ begin return ResolveOsvvmWritePrefix(ReportPrefixVar.GetOpt) ; end function GetAlertLogReportPrefix ; ------------------------------------------------------------ impure function GetAlertLogDoneName return string is ------------------------------------------------------------ begin return ResolveOsvvmDoneName(DoneNameVar.GetOpt) ; end function GetAlertLogDoneName ; ------------------------------------------------------------ impure function GetAlertLogPassName return string is ------------------------------------------------------------ begin return ResolveOsvvmPassName(PassNameVar.GetOpt) ; end function GetAlertLogPassName ; ------------------------------------------------------------ impure function GetAlertLogFailName return string is ------------------------------------------------------------ begin return ResolveOsvvmFailName(FailNameVar.GetOpt) ; end function GetAlertLogFailName ; end protected body AlertLogStructPType ; shared variable AlertLogStruct : AlertLogStructPType ; --- /////////////////////////////////////////////////////////////////////////// --- /////////////////////////////////////////////////////////////////////////// --- /////////////////////////////////////////////////////////////////////////// ------------------------------------------------------------ procedure Alert( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; Message : string ; Level : AlertType := ERROR ) is begin AlertLogStruct.Alert(AlertLogID, Message, Level) ; end procedure alert ; ------------------------------------------------------------ procedure Alert( Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message, Level) ; end procedure alert ; ------------------------------------------------------------ procedure IncAlertCount( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; Level : AlertType := ERROR ) is begin AlertLogStruct.IncAlertCount(AlertLogID, Level) ; end procedure IncAlertCount ; ------------------------------------------------------------ procedure IncAlertCount( Level : AlertType := ERROR ) is ------------------------------------------------------------ begin AlertLogStruct.IncAlertCount(ALERT_DEFAULT_ID, Level) ; end procedure IncAlertCount ; ------------------------------------------------------------ procedure AlertIf( AlertLogID : AlertLogIDType ; condition : boolean ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if condition then AlertLogStruct.Alert(AlertLogID , Message, Level) ; end if ; end procedure AlertIf ; ------------------------------------------------------------ -- deprecated procedure AlertIf( condition : boolean ; AlertLogID : AlertLogIDType ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin AlertIf( AlertLogID, condition, Message, Level) ; end procedure AlertIf ; ------------------------------------------------------------ procedure AlertIf( condition : boolean ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if condition then AlertLogStruct.Alert(ALERT_DEFAULT_ID , Message, Level) ; end if ; end procedure AlertIf ; ------------------------------------------------------------ -- useful with exit conditions in a loop: exit when alert( not ReadValid, failure, "Read Failed") ; impure function AlertIf( AlertLogID : AlertLogIDType ; condition : boolean ; Message : string ; Level : AlertType := ERROR ) return boolean is ------------------------------------------------------------ begin if condition then AlertLogStruct.Alert(AlertLogID , Message, Level) ; end if ; return condition ; end function AlertIf ; ------------------------------------------------------------ -- deprecated impure function AlertIf( condition : boolean ; AlertLogID : AlertLogIDType ; Message : string ; Level : AlertType := ERROR ) return boolean is ------------------------------------------------------------ begin return AlertIf( AlertLogID, condition, Message, Level) ; end function AlertIf ; ------------------------------------------------------------ impure function AlertIf( condition : boolean ; Message : string ; Level : AlertType := ERROR ) return boolean is ------------------------------------------------------------ begin if condition then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message, Level) ; end if ; return condition ; end function AlertIf ; ------------------------------------------------------------ procedure AlertIfNot( AlertLogID : AlertLogIDType ; condition : boolean ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if not condition then AlertLogStruct.Alert(AlertLogID, Message, Level) ; end if ; end procedure AlertIfNot ; ------------------------------------------------------------ -- deprecated procedure AlertIfNot( condition : boolean ; AlertLogID : AlertLogIDType ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin AlertIfNot( AlertLogID, condition, Message, Level) ; end procedure AlertIfNot ; ------------------------------------------------------------ procedure AlertIfNot( condition : boolean ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if not condition then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message, Level) ; end if ; end procedure AlertIfNot ; ------------------------------------------------------------ -- useful with exit conditions in a loop: exit when alert( not ReadValid, failure, "Read Failed") ; impure function AlertIfNot( AlertLogID : AlertLogIDType ; condition : boolean ; Message : string ; Level : AlertType := ERROR ) return boolean is ------------------------------------------------------------ begin if not condition then AlertLogStruct.Alert(AlertLogID, Message, Level) ; end if ; return not condition ; end function AlertIfNot ; ------------------------------------------------------------ -- deprecated impure function AlertIfNot( condition : boolean ; AlertLogID : AlertLogIDType ; Message : string ; Level : AlertType := ERROR ) return boolean is ------------------------------------------------------------ begin return AlertIfNot( AlertLogID, condition, Message, Level) ; end function AlertIfNot ; ------------------------------------------------------------ impure function AlertIfNot( condition : boolean ; Message : string ; Level : AlertType := ERROR ) return boolean is ------------------------------------------------------------ begin if not condition then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message, Level) ; end if ; return not condition ; end function AlertIfNot ; -- With AlertLogID ------------------------------------------------------------ procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : std_logic ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?= R then AlertLogStruct.Alert(AlertLogID, Message & " L = R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : std_logic_vector ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?= R then AlertLogStruct.Alert(AlertLogID, Message & " L = R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : unsigned ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?= R then AlertLogStruct.Alert(AlertLogID, Message & " L = R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : signed ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?= R then AlertLogStruct.Alert(AlertLogID, Message & " L = R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : integer ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L = R then AlertLogStruct.Alert(AlertLogID, Message & " L = R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : real ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L = R then AlertLogStruct.Alert(AlertLogID, Message & " L = R, L = " & to_string(L, 4) & " R = " & to_string(R, 4), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : character ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L = R then AlertLogStruct.Alert(AlertLogID, Message & " L = R, L = " & L & " R = " & R, Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( AlertLogID : AlertLogIDType ; L, R : string ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L = R then AlertLogStruct.Alert(AlertLogID, Message & " L = R, L = " & L & " R = " & R, Level) ; end if ; end procedure AlertIfEqual ; -- Without AlertLogID ------------------------------------------------------------ procedure AlertIfEqual( L, R : std_logic ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L = R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( L, R : std_logic_vector ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L = R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( L, R : unsigned ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L = R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( L, R : signed ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L = R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( L, R : integer ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L = R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L = R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( L, R : real ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L = R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L = R, L = " & to_string(L, 4) & " R = " & to_string(R, 4), Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( L, R : character ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L = R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L = R, L = " & L & " R = " & R, Level) ; end if ; end procedure AlertIfEqual ; ------------------------------------------------------------ procedure AlertIfEqual( L, R : string ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L = R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L = R, L = " & L & " R = " & R, Level) ; end if ; end procedure AlertIfEqual ; -- With AlertLogID ------------------------------------------------------------ procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : std_logic ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?/= R then AlertLogStruct.Alert(AlertLogID, Message & " L /= R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : std_logic_vector ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?/= R then AlertLogStruct.Alert(AlertLogID, Message & " L /= R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : unsigned ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?/= R then AlertLogStruct.Alert(AlertLogID, Message & " L /= R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : signed ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?/= R then AlertLogStruct.Alert(AlertLogID, Message & " L /= R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : integer ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L /= R then AlertLogStruct.Alert(AlertLogID, Message & " L /= R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : real ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L /= R then AlertLogStruct.Alert(AlertLogID, Message & " L /= R, L = " & to_string(L, 4) & " R = " & to_string(R, 4), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : character ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L /= R then AlertLogStruct.Alert(AlertLogID, Message & " L /= R, L = " & L & " R = " & R, Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( AlertLogID : AlertLogIDType ; L, R : string ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L /= R then AlertLogStruct.Alert(AlertLogID, Message & " L /= R, L = " & L & " R = " & R, Level) ; end if ; end procedure AlertIfNotEqual ; -- Without AlertLogID ------------------------------------------------------------ procedure AlertIfNotEqual( L, R : std_logic ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?/= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L /= R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( L, R : std_logic_vector ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?/= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L /= R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( L, R : unsigned ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?/= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L /= R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( L, R : signed ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L ?/= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L /= R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( L, R : integer ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L /= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L /= R, L = " & to_string(L) & " R = " & to_string(R), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( L, R : real ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L /= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L /= R, L = " & to_string(L, 4) & " R = " & to_string(R, 4), Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( L, R : character ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L /= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L /= R, L = " & L & " R = " & R, Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfNotEqual( L, R : string ; Message : string ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin if L /= R then AlertLogStruct.Alert(ALERT_DEFAULT_ID, Message & " L /= R, L = " & L & " R = " & R, Level) ; end if ; end procedure AlertIfNotEqual ; ------------------------------------------------------------ procedure AlertIfDiff (AlertLogID : AlertLogIDType ; Name1, Name2 : string; Message : string := "" ; Level : AlertType := ERROR ) is -- Open files and call AlertIfDiff[text, ...] ------------------------------------------------------------ file FileID1, FileID2 : text ; variable status1, status2 : file_open_status ; begin file_open(status1, FileID1, Name1, READ_MODE) ; file_open(status2, FileID2, Name2, READ_MODE) ; if status1 = OPEN_OK and status2 = OPEN_OK then AlertIfDiff (AlertLogID, FileID1, FileID2, Message & " " & Name1 & " /= " & Name2 & ", ", Level) ; else if status1 /= OPEN_OK then AlertLogStruct.Alert(AlertLogID , Message & " File, " & Name1 & ", did not open", Level) ; end if ; if status2 /= OPEN_OK then AlertLogStruct.Alert(AlertLogID , Message & " File, " & Name2 & ", did not open", Level) ; end if ; end if; end procedure AlertIfDiff ; ------------------------------------------------------------ procedure AlertIfDiff (Name1, Name2 : string; Message : string := "" ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin AlertIfDiff (ALERT_DEFAULT_ID, Name1, Name2, Message, Level) ; end procedure AlertIfDiff ; ------------------------------------------------------------ procedure AlertIfDiff (AlertLogID : AlertLogIDType ; file File1, File2 : text; Message : string := "" ; Level : AlertType := ERROR ) is -- Simple diff. ------------------------------------------------------------ variable Buf1, Buf2 : line ; variable File1Done, File2Done : boolean ; variable LineCount : integer := 0 ; begin ReadLoop : loop File1Done := EndFile(File1) ; File2Done := EndFile(File2) ; exit ReadLoop when File1Done or File2Done ; ReadLine(File1, Buf1) ; ReadLine(File2, Buf2) ; LineCount := LineCount + 1 ; if Buf1.all /= Buf2.all then AlertLogStruct.Alert(AlertLogID , Message & " File miscompare on line " & to_string(LineCount), Level) ; exit ReadLoop ; end if ; end loop ReadLoop ; if File1Done /= File2Done then if not File1Done then AlertLogStruct.Alert(AlertLogID , Message & " File1 longer than File2 " & to_string(LineCount), Level) ; end if ; if not File2Done then AlertLogStruct.Alert(AlertLogID , Message & " File2 longer than File1 " & to_string(LineCount), Level) ; end if ; end if; end procedure AlertIfDiff ; ------------------------------------------------------------ procedure AlertIfDiff (file File1, File2 : text; Message : string := "" ; Level : AlertType := ERROR ) is ------------------------------------------------------------ begin AlertIfDiff (ALERT_DEFAULT_ID, File1, File2, Message, Level) ; end procedure AlertIfDiff ; ------------------------------------------------------------ procedure AffirmIf( ------------------------------------------------------------ AlertLogID : AlertLogIDType ; condition : boolean ; Message : string ; LogLevel : LogType := PASSED ; AlertLevel : AlertType := ERROR ) is begin AlertLogStruct.IncAffirmCheckCount ; -- increment check count if condition then -- passed AlertLogStruct.Log(AlertLogID, Message, LogLevel) ; -- call log -- AlertLogStruct.IncAffirmPassCount ; -- increment pass & check count else AlertLogStruct.Alert(AlertLogID, Message, AlertLevel) ; -- signal failure end if ; end procedure AffirmIf ; ------------------------------------------------------------ procedure AffirmIf(condition : boolean ; Message : string ; LogLevel : LogType := PASSED ; AlertLevel : AlertType := ERROR) is ------------------------------------------------------------ begin AffirmIf(ALERT_DEFAULT_ID, condition, Message, LogLevel, AlertLevel) ; end procedure AffirmIf; ------------------------------------------------------------ procedure SetAlertLogJustify is ------------------------------------------------------------ begin AlertLogStruct.SetJustify ; end procedure SetAlertLogJustify ; ------------------------------------------------------------ procedure ReportAlerts ( Name : String ; AlertCount : AlertCountType ) is ------------------------------------------------------------ begin AlertLogStruct.ReportAlerts(Name, AlertCount) ; end procedure ReportAlerts ; ------------------------------------------------------------ procedure ReportAlerts ( Name : string := OSVVM_STRING_INIT_PARM_DETECT ; AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID ; ExternalErrors : AlertCountType := (others => 0) ) is ------------------------------------------------------------ begin AlertLogStruct.ReportAlerts(Name, AlertLogID, ExternalErrors, TRUE) ; end procedure ReportAlerts ; ------------------------------------------------------------ procedure ReportNonZeroAlerts ( Name : string := OSVVM_STRING_INIT_PARM_DETECT ; AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID ; ExternalErrors : AlertCountType := (others => 0) ) is ------------------------------------------------------------ begin AlertLogStruct.ReportAlerts(Name, AlertLogID, ExternalErrors, FALSE) ; end procedure ReportNonZeroAlerts ; ------------------------------------------------------------ procedure ClearAlerts is ------------------------------------------------------------ begin AlertLogStruct.ClearAlerts ; end procedure ClearAlerts ; ------------------------------------------------------------ function "ABS" (L : AlertCountType) return AlertCountType is ------------------------------------------------------------ variable Result : AlertCountType ; begin Result(FAILURE) := ABS( L(FAILURE) ) ; Result(ERROR) := ABS( L(ERROR) ) ; Result(WARNING) := ABS( L(WARNING) ); return Result ; end function "ABS" ; ------------------------------------------------------------ function "+" (L, R : AlertCountType) return AlertCountType is ------------------------------------------------------------ variable Result : AlertCountType ; begin Result(FAILURE) := L(FAILURE) + R(FAILURE) ; Result(ERROR) := L(ERROR) + R(ERROR) ; Result(WARNING) := L(WARNING) + R(WARNING) ; return Result ; end function "+" ; ------------------------------------------------------------ function "-" (L, R : AlertCountType) return AlertCountType is ------------------------------------------------------------ variable Result : AlertCountType ; begin Result(FAILURE) := L(FAILURE) - R(FAILURE) ; Result(ERROR) := L(ERROR) - R(ERROR) ; Result(WARNING) := L(WARNING) - R(WARNING) ; return Result ; end function "-" ; ------------------------------------------------------------ function "-" (R : AlertCountType) return AlertCountType is ------------------------------------------------------------ variable Result : AlertCountType ; begin Result(FAILURE) := - R(FAILURE) ; Result(ERROR) := - R(ERROR) ; Result(WARNING) := - R(WARNING) ; return Result ; end function "-" ; ------------------------------------------------------------ impure function SumAlertCount(AlertCount: AlertCountType) return integer is ------------------------------------------------------------ begin -- Using ABS ensures correct expected error handling. return abs(AlertCount(FAILURE)) + abs(AlertCount(ERROR)) + abs(AlertCount(WARNING)) ; end function SumAlertCount ; ------------------------------------------------------------ impure function GetAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return AlertCountType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertCount(AlertLogID) ; end function GetAlertCount ; ------------------------------------------------------------ impure function GetAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return integer is ------------------------------------------------------------ begin return SumAlertCount(AlertLogStruct.GetAlertCount(AlertLogID)) ; end function GetAlertCount ; ------------------------------------------------------------ impure function GetEnabledAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return AlertCountType is ------------------------------------------------------------ begin return AlertLogStruct.GetEnabledAlertCount(AlertLogID) ; end function GetEnabledAlertCount ; ------------------------------------------------------------ impure function GetEnabledAlertCount(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return integer is ------------------------------------------------------------ begin return SumAlertCount(AlertLogStruct.GetEnabledAlertCount(AlertLogID)) ; end function GetEnabledAlertCount ; ------------------------------------------------------------ impure function GetDisabledAlertCount return AlertCountType is ------------------------------------------------------------ begin return AlertLogStruct.GetDisabledAlertCount ; end function GetDisabledAlertCount ; ------------------------------------------------------------ impure function GetDisabledAlertCount return integer is ------------------------------------------------------------ begin return SumAlertCount(AlertLogStruct.GetDisabledAlertCount) ; end function GetDisabledAlertCount ; ------------------------------------------------------------ impure function GetDisabledAlertCount(AlertLogID: AlertLogIDType) return AlertCountType is ------------------------------------------------------------ begin return AlertLogStruct.GetDisabledAlertCount(AlertLogID) ; end function GetDisabledAlertCount ; ------------------------------------------------------------ impure function GetDisabledAlertCount(AlertLogID: AlertLogIDType) return integer is ------------------------------------------------------------ begin return SumAlertCount(AlertLogStruct.GetDisabledAlertCount(AlertLogID)) ; end function GetDisabledAlertCount ; ------------------------------------------------------------ procedure Log( AlertLogID : AlertLogIDType ; Message : string ; Level : LogType := ALWAYS ; Enable : boolean := FALSE -- override internal enable ) is begin AlertLogStruct.Log(AlertLogID, Message, Level, Enable) ; end procedure log ; ------------------------------------------------------------ procedure Log( Message : string ; Level : LogType := ALWAYS ; Enable : boolean := FALSE) is ------------------------------------------------------------ begin AlertLogStruct.Log(LOG_DEFAULT_ID, Message, Level, Enable) ; end procedure log ; ------------------------------------------------------------ procedure SetAlertLogName(Name : string ) is ------------------------------------------------------------ begin AlertLogStruct.SetAlertLogName(Name) ; end procedure SetAlertLogName ; ------------------------------------------------------------ impure function GetAlertLogName(AlertLogID : AlertLogIDType := ALERTLOG_BASE_ID) return string is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogName(AlertLogID) ; end GetAlertLogName ; ------------------------------------------------------------ procedure DeallocateAlertLogStruct is ------------------------------------------------------------ begin AlertLogStruct.Deallocate ; end procedure DeallocateAlertLogStruct ; ------------------------------------------------------------ procedure InitializeAlertLogStruct is ------------------------------------------------------------ begin AlertLogStruct.Initialize ; end procedure InitializeAlertLogStruct ; ------------------------------------------------------------ impure function FindAlertLogID(Name : string ) return AlertLogIDType is ------------------------------------------------------------ begin return AlertLogStruct.FindAlertLogID(Name) ; end function FindAlertLogID ; ------------------------------------------------------------ impure function FindAlertLogID(Name : string ; ParentID : AlertLogIDType) return AlertLogIDType is ------------------------------------------------------------ begin return AlertLogStruct.FindAlertLogID(Name, ParentID) ; end function FindAlertLogID ; ------------------------------------------------------------ impure function GetAlertLogID(Name : string ; ParentID : AlertLogIDType := ALERTLOG_BASE_ID ; CreateHierarchy : Boolean := TRUE) return AlertLogIDType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogID(Name, ParentID, CreateHierarchy ) ; end function GetAlertLogID ; ------------------------------------------------------------ impure function GetAlertLogParentID(AlertLogID : AlertLogIDType) return AlertLogIDType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogParentID(AlertLogID) ; end function GetAlertLogParentID ; ------------------------------------------------------------ procedure SetGlobalAlertEnable (A : boolean := TRUE) is ------------------------------------------------------------ begin AlertLogStruct.SetGlobalAlertEnable(A) ; end procedure SetGlobalAlertEnable ; ------------------------------------------------------------ -- Set using constant. Set before code runs. impure function SetGlobalAlertEnable (A : boolean := TRUE) return boolean is ------------------------------------------------------------ begin AlertLogStruct.SetGlobalAlertEnable(A) ; return A ; end function SetGlobalAlertEnable ; ------------------------------------------------------------ impure function GetGlobalAlertEnable return boolean is ------------------------------------------------------------ begin return AlertLogStruct.GetGlobalAlertEnable ; end function GetGlobalAlertEnable ; ------------------------------------------------------------ procedure IncAffirmCheckCount is ------------------------------------------------------------ begin AlertLogStruct.IncAffirmCheckCount ; end procedure IncAffirmCheckCount ; ------------------------------------------------------------ impure function GetAffirmCheckCount return natural is ------------------------------------------------------------ begin return AlertLogStruct.GetAffirmCheckCount ; end function GetAffirmCheckCount ; --?? ------------------------------------------------------------ --?? procedure IncAffirmPassCount is --?? ------------------------------------------------------------ --?? begin --?? AlertLogStruct.IncAffirmPassCount ; --?? end procedure IncAffirmPassCount ; --?? --?? ------------------------------------------------------------ --?? impure function GetAffirmPassCount return natural is --?? ------------------------------------------------------------ --?? begin --?? return AlertLogStruct.GetAffirmPassCount ; --?? end function GetAffirmPassCount ; ------------------------------------------------------------ procedure SetAlertStopCount(AlertLogID : AlertLogIDType ; Level : AlertType ; Count : integer) is ------------------------------------------------------------ begin AlertLogStruct.SetAlertStopCount(AlertLogID, Level, Count) ; end procedure SetAlertStopCount ; ------------------------------------------------------------ procedure SetAlertStopCount(Level : AlertType ; Count : integer) is ------------------------------------------------------------ begin AlertLogStruct.SetAlertStopCount(ALERTLOG_BASE_ID, Level, Count) ; end procedure SetAlertStopCount ; ------------------------------------------------------------ impure function GetAlertStopCount(AlertLogID : AlertLogIDType ; Level : AlertType) return integer is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertStopCount(AlertLogID, Level) ; end function GetAlertStopCount ; ------------------------------------------------------------ impure function GetAlertStopCount(Level : AlertType) return integer is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertStopCount(ALERTLOG_BASE_ID, Level) ; end function GetAlertStopCount ; ------------------------------------------------------------ procedure SetAlertEnable(Level : AlertType ; Enable : boolean) is ------------------------------------------------------------ begin AlertLogStruct.SetAlertEnable(Level, Enable) ; end procedure SetAlertEnable ; ------------------------------------------------------------ procedure SetAlertEnable(AlertLogID : AlertLogIDType ; Level : AlertType ; Enable : boolean ; DescendHierarchy : boolean := TRUE) is ------------------------------------------------------------ begin AlertLogStruct.SetAlertEnable(AlertLogID, Level, Enable, DescendHierarchy) ; end procedure SetAlertEnable ; ------------------------------------------------------------ impure function GetAlertEnable(AlertLogID : AlertLogIDType ; Level : AlertType) return boolean is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertEnable(AlertLogID, Level) ; end function GetAlertEnable ; ------------------------------------------------------------ impure function GetAlertEnable(Level : AlertType) return boolean is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertEnable(ALERT_DEFAULT_ID, Level) ; end function GetAlertEnable ; ------------------------------------------------------------ procedure SetLogEnable(Level : LogType ; Enable : boolean) is ------------------------------------------------------------ begin AlertLogStruct.SetLogEnable(Level, Enable) ; end procedure SetLogEnable ; ------------------------------------------------------------ procedure SetLogEnable(AlertLogID : AlertLogIDType ; Level : LogType ; Enable : boolean ; DescendHierarchy : boolean := TRUE) is ------------------------------------------------------------ begin AlertLogStruct.SetLogEnable(AlertLogID, Level, Enable, DescendHierarchy) ; end procedure SetLogEnable ; ------------------------------------------------------------ impure function GetLogEnable(AlertLogID : AlertLogIDType ; Level : LogType) return boolean is ------------------------------------------------------------ begin return AlertLogStruct.GetLogEnable(AlertLogID, Level) ; end function GetLogEnable ; ------------------------------------------------------------ impure function GetLogEnable(Level : LogType) return boolean is ------------------------------------------------------------ begin return AlertLogStruct.GetLogEnable(LOG_DEFAULT_ID, Level) ; end function GetLogEnable ; ------------------------------------------------------------ impure function IsLoggingEnabled(AlertLogID : AlertLogIDType ; Level : LogType) return boolean is ------------------------------------------------------------ begin return AlertLogStruct.GetLogEnable(AlertLogID, Level) ; end function IsLoggingEnabled ; ------------------------------------------------------------ impure function IsLoggingEnabled(Level : LogType) return boolean is ------------------------------------------------------------ begin return AlertLogStruct.GetLogEnable(LOG_DEFAULT_ID, Level) ; end function IsLoggingEnabled ; ------------------------------------------------------------ procedure ReportLogEnables is ------------------------------------------------------------ begin AlertLogStruct.ReportLogEnables ; end ReportLogEnables ; ------------------------------------------------------------ procedure SetAlertLogOptions ( ------------------------------------------------------------ FailOnWarning : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; FailOnDisabledErrors : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; ReportHierarchy : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertLevel : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertName : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteAlertTime : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogLevel : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogName : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; WriteLogTime : AlertLogOptionsType := OPT_INIT_PARM_DETECT ; AlertPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; LogPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; ReportPrefix : string := OSVVM_STRING_INIT_PARM_DETECT ; DoneName : string := OSVVM_STRING_INIT_PARM_DETECT ; PassName : string := OSVVM_STRING_INIT_PARM_DETECT ; FailName : string := OSVVM_STRING_INIT_PARM_DETECT ) is begin AlertLogStruct.SetAlertLogOptions ( FailOnWarning => FailOnWarning , FailOnDisabledErrors => FailOnDisabledErrors, ReportHierarchy => ReportHierarchy , WriteAlertLevel => WriteAlertLevel , WriteAlertName => WriteAlertName , WriteAlertTime => WriteAlertTime , WriteLogLevel => WriteLogLevel , WriteLogName => WriteLogName , WriteLogTime => WriteLogTime , AlertPrefix => AlertPrefix , LogPrefix => LogPrefix , ReportPrefix => ReportPrefix , DoneName => DoneName , PassName => PassName , FailName => FailName ); end procedure SetAlertLogOptions ; ------------------------------------------------------------ procedure ReportAlertLogOptions is ------------------------------------------------------------ begin AlertLogStruct.ReportAlertLogOptions ; end procedure ReportAlertLogOptions ; ------------------------------------------------------------ impure function GetAlertLogFailOnWarning return AlertLogOptionsType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogFailOnWarning ; end function GetAlertLogFailOnWarning ; ------------------------------------------------------------ impure function GetAlertLogFailOnDisabledErrors return AlertLogOptionsType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogFailOnDisabledErrors ; end function GetAlertLogFailOnDisabledErrors ; ------------------------------------------------------------ impure function GetAlertLogReportHierarchy return AlertLogOptionsType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogReportHierarchy ; end function GetAlertLogReportHierarchy ; ------------------------------------------------------------ impure function GetAlertLogFoundReportHier return boolean is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogFoundReportHier ; end function GetAlertLogFoundReportHier ; ------------------------------------------------------------ impure function GetAlertLogFoundAlertHier return boolean is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogFoundAlertHier ; end function GetAlertLogFoundAlertHier ; ------------------------------------------------------------ impure function GetAlertLogWriteAlertLevel return AlertLogOptionsType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogWriteAlertLevel ; end function GetAlertLogWriteAlertLevel ; ------------------------------------------------------------ impure function GetAlertLogWriteAlertName return AlertLogOptionsType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogWriteAlertName ; end function GetAlertLogWriteAlertName ; ------------------------------------------------------------ impure function GetAlertLogWriteAlertTime return AlertLogOptionsType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogWriteAlertTime ; end function GetAlertLogWriteAlertTime ; ------------------------------------------------------------ impure function GetAlertLogWriteLogLevel return AlertLogOptionsType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogWriteLogLevel ; end function GetAlertLogWriteLogLevel ; ------------------------------------------------------------ impure function GetAlertLogWriteLogName return AlertLogOptionsType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogWriteLogName ; end function GetAlertLogWriteLogName ; ------------------------------------------------------------ impure function GetAlertLogWriteLogTime return AlertLogOptionsType is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogWriteLogTime ; end function GetAlertLogWriteLogTime ; ------------------------------------------------------------ impure function GetAlertLogAlertPrefix return string is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogAlertPrefix ; end function GetAlertLogAlertPrefix ; ------------------------------------------------------------ impure function GetAlertLogLogPrefix return string is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogLogPrefix ; end function GetAlertLogLogPrefix ; ------------------------------------------------------------ impure function GetAlertLogReportPrefix return string is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogReportPrefix ; end function GetAlertLogReportPrefix ; ------------------------------------------------------------ impure function GetAlertLogDoneName return string is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogDoneName ; end function GetAlertLogDoneName ; ------------------------------------------------------------ impure function GetAlertLogPassName return string is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogPassName ; end function GetAlertLogPassName ; ------------------------------------------------------------ impure function GetAlertLogFailName return string is ------------------------------------------------------------ begin return AlertLogStruct.GetAlertLogFailName ; end function GetAlertLogFailName ; ------------------------------------------------------------ function IsLogEnableType (Name : String) return boolean is ------------------------------------------------------------ -- type LogType is (ALWAYS, DEBUG, FINAL, INFO, PASSED) ; -- NEVER begin if Name = "PASSED" then return TRUE ; elsif Name = "DEBUG" then return TRUE ; elsif Name = "FINAL" then return TRUE ; elsif Name = "INFO" then return TRUE ; end if ; return FALSE ; end function IsLogEnableType ; ------------------------------------------------------------ procedure ReadLogEnables (file AlertLogInitFile : text) is -- Preferred Read format -- Line 1: instance1_name log_enable log_enable log_enable -- Line 2: instance2_name log_enable log_enable log_enable -- when reading multiple log_enables on a line, they must be separated by a space -- --- Also supports alternate format from Lyle/.... -- Line 1: instance1_name -- Line 2: log enable -- Line 3: instance2_name -- Line 4: log enable -- ------------------------------------------------------------ type ReadStateType is (GET_ID, GET_ENABLE) ; variable ReadState : ReadStateType := GET_ID ; variable buf : line ; variable Empty : boolean ; variable MultiLineComment : boolean := FALSE ; variable Name : string(1 to 80) ; variable NameLen : integer ; variable AlertLogID : AlertLogIDType ; variable ReadAnEnable : boolean ; variable LogLevel : LogType ; begin ReadState := GET_ID ; ReadLineLoop : while not EndFile(AlertLogInitFile) loop ReadLine(AlertLogInitFile, buf) ; if ReadAnEnable then -- Read one or more enable values, next line read AlertLog name -- Note that any newline with ReadAnEnable TRUE will result in -- searching for another AlertLogID name - this includes multi-line comments. ReadState := GET_ID ; end if ; ReadNameLoop : loop EmptyOrCommentLine(buf, Empty, MultiLineComment) ; next ReadLineLoop when Empty ; case ReadState is when GET_ID => sread(buf, Name, NameLen) ; exit ReadNameLoop when NameLen = 0 ; AlertLogID := GetAlertLogID(Name(1 to NameLen), ALERTLOG_ID_NOT_ASSIGNED) ; ReadState := GET_ENABLE ; ReadAnEnable := FALSE ; when GET_ENABLE => sread(buf, Name, NameLen) ; exit ReadNameLoop when NameLen = 0 ; ReadAnEnable := TRUE ; if not IsLogEnableType(Name(1 to NameLen)) then Alert(OSVVM_ALERTLOG_ID, "AlertLogPkg.ReadLogEnables: Found Invalid LogEnable: " & Name(1 to NameLen)) ; exit ReadNameLoop ; end if ; LogLevel := LogType'value(Name(1 to NameLen)) ; SetLogEnable(AlertLogID, LogLevel, TRUE) ; end case ; end loop ReadNameLoop ; end loop ReadLineLoop ; end procedure ReadLogEnables ; ------------------------------------------------------------ procedure ReadLogEnables (FileName : string) is ------------------------------------------------------------ file AlertLogInitFile : text open READ_MODE is FileName ; begin ReadLogEnables(AlertLogInitFile) ; end procedure ReadLogEnables ; ------------------------------------------------------------ function PathTail (A : string) return string is ------------------------------------------------------------ alias aA : string(1 to A'length) is A ; begin for i in aA'length - 1 downto 1 loop if aA(i) = ':' then return aA(i+1 to aA'length-1) ; end if ; end loop ; return aA ; end function PathTail ; end package body AlertLogPkg ;
gpl-2.0
tgingold/ghdl
testsuite/gna/bug073/adder_tb2.vhdl
1
1870
-- A testbench has no ports. entity adder_tb2 is end adder_tb2; architecture behav of adder_tb2 is -- Declaration of the component that will be instantiated. component adder port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit); end component; -- Specifies which entity is bound with the component. for adder_0: adder use entity work.adder; signal i0, i1, ci, s, co : bit; begin -- Component instantiation. adder_0: entity work.adder port map (i0 => i0, i1 => i1, ci => ci, s => s, co => co); -- This process does the real job. process type pattern_type is record -- The inputs of the adder. i0, i1, ci : bit; -- The expected outputs of the adder. s, co : bit; end record; -- The patterns to apply. type pattern_array is array (natural range <>) of pattern_type; constant patterns : pattern_array := (('0', '0', '0', '0', '0'), ('0', '0', '1', '1', '0'), ('0', '1', '0', '1', '0'), ('0', '1', '1', '0', '1'), ('1', '0', '0', '1', '0'), ('1', '0', '1', '0', '1'), ('1', '1', '0', '0', '1'), ('1', '1', '1', '1', '1')); begin -- Check each pattern. for i in patterns'range loop -- Set the inputs. i0 <= patterns(i).i0; i1 <= patterns(i).i1; ci <= patterns(i).ci; -- Wait for the results. wait for 1 ns; -- Check the outputs. assert s = patterns(i).s report "bad sum value" severity error; assert co = patterns(i).co report "bad carry out value" severity error; end loop; assert false report "end of test" severity note; -- Wait forever; this will finish the simulation. wait; end process; end behav;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/record-types/integer-record-aggregate-init.vhdl
4
527
entity test is end test; architecture only of test is begin -- only p: process type integerRecord is record foo : integer; bar : integer; end record; variable myRecord : integerRecord; begin -- process p myRecord := ( 0, 1 ); assert myRecord.foo = 0 report "TEST FAILED - 0" severity FAILURE; assert myRecord.bar = 1 report "TEST FAILED - 1" severity FAILURE; report "TEST PASSED" severity NOTE; wait; end process p; end only;
gpl-2.0
tgingold/ghdl
testsuite/gna/bug040/p_jinfo_dc_xhuff_tbl_huffval.vhd
2
1461
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity p_jinfo_dc_xhuff_tbl_huffval is port ( wa0_data : in std_logic_vector(31 downto 0); wa0_addr : in std_logic_vector(9 downto 0); clk : in std_logic; ra0_addr : in std_logic_vector(9 downto 0); ra0_data : out std_logic_vector(31 downto 0); wa0_en : in std_logic ); end p_jinfo_dc_xhuff_tbl_huffval; architecture augh of p_jinfo_dc_xhuff_tbl_huffval is -- Embedded RAM type ram_type is array (0 to 1023) 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
tgingold/ghdl
testsuite/gna/issue626/repro.vhdl
1
517
entity inc is generic (v : natural; vec : bit_vector); end entity; architecture default of inc is begin assert vec'left = 0 severity failure; assert vec'right = v severity failure; assert false report integer'image(vec'right); end architecture; entity repro is end entity; architecture default of repro is begin g : for ix in 0 to 4 generate begin inst : entity work.inc generic map (v => ix, vec => (0 to ix => '1')); end generate; end architecture;
gpl-2.0
tgingold/ghdl
testsuite/gna/issue50/vector.d/cmp_150.vhd
2
376
library ieee; use ieee.std_logic_1164.all; entity cmp_150 is port ( eq : out std_logic; in0 : in std_logic_vector(2 downto 0); in1 : in std_logic_vector(2 downto 0) ); end cmp_150; architecture augh of cmp_150 is signal tmp : std_logic; begin -- Compute the result tmp <= '0' when in0 /= in1 else '1'; -- Set the outputs eq <= tmp; end architecture;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2094.vhd
4
2123
-- 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: tc2094.vhd,v 1.2 2001-10-26 16:29:45 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s02b04x00p20n01i02094ent IS END c07s02b04x00p20n01i02094ent; ARCHITECTURE c07s02b04x00p20n01i02094arch OF c07s02b04x00p20n01i02094ent 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); FUNCTION return_array RETURN boolean_4 is constant l_operand : boolean_4 := (true,false,true,false); begin RETURN l_operand; end return_array; BEGIN l : block generic ( info : boolean_8 ); generic map ( return_array & return_array ); begin assert NOT(info = (true,false,true,false,true,false,true,false)) report "***PASSED TEST: c07s02b04x00p20n01i02094" severity NOTE; assert (info = (true,false,true,false,true,false,true,false)) report "***FAILED TEST: c07s02b04x00p20n01i02094 - Function array concatenation did not succeed." severity ERROR; end block; END c07s02b04x00p20n01i02094arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2737.vhd
4
22389
-- 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: tc2737.vhd,v 1.2 2001-10-26 16:29:49 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s06b00x00p03n01i02737ent IS END c13s06b00x00p03n01i02737ent; ARCHITECTURE c13s06b00x00p03n01i02737arch OF c13s06b00x00p03n01i02737ent IS constant s01: string:="A "; -- 1 constant s02: string:="B "; -- 2 constant s03: string:="C "; -- 3 constant s04: string:="D "; -- 4 constant s05: string:="E "; -- 5 constant s06: string:="F "; -- 6 constant s07: string:="G "; -- 7 constant s08: string:="H "; -- 8 constant s09: string:="I "; -- 9 constant s10: string:="J "; -- 10 constant s11: string:="K "; -- 11 constant s12: string:="L "; -- 12 constant s13: string:="M "; -- 13 constant s14: string:="N "; -- 14 constant s15: string:="O "; -- 15 constant s16: string:="P "; -- 16 constant s17: string:="Q "; -- 17 constant s18: string:="R "; -- 18 constant s19: string:="S "; -- 19 constant s20: string:="T "; -- 20 constant s21: string:="U "; -- 21 constant s22: string:="V "; -- 22 constant s23: string:="W "; -- 23 constant s24: string:="X "; -- 24 constant s25: string:="Y "; -- 25 constant s26: string:="Z "; -- 26 constant s27: string:="0 "; -- 27 constant s28: string:="1 "; -- 28 constant s29: string:="2 "; -- 29 constant s30: string:="3 "; -- 30 constant s31: string:="4 "; -- 31 constant s32: string:="5 "; -- 32 constant s33: string:="6 "; -- 33 constant s34: string:="7 "; -- 34 constant s35: string:="8 "; -- 35 constant s36: string:="9 "; -- 36 constant s37: string:=""" "; -- 37 constant s38: string:="# "; -- 38 constant s39: string:="& "; -- 39 constant s40: string:="' "; -- 40 constant s41: string:="( "; -- 41 constant s42: string:=") "; -- 42 constant s43: string:="* "; -- 43 constant s44: string:="+ "; -- 44 constant s45: string:=", "; -- 45 constant s46: string:="- "; -- 46 constant s47: string:=". "; -- 47 constant s48: string:="/ "; -- 48 constant s49: string:=": "; -- 49 constant s50: string:="; "; -- 50 constant s51: string:="< "; -- 51 constant s52: string:="= "; -- 52 constant s53: string:="> "; -- 53 constant s54: string:="_ "; -- 54 constant s55: string:="| "; -- 55 constant s56: string:=" "; -- 56 constant s57: string:="a "; -- 57 constant s58: string:="b "; -- 58 constant s59: string:="c "; -- 59 constant s60: string:="d "; -- 60 constant s61: string:="e "; -- 61 constant s62: string:="f "; -- 62 constant s63: string:="g "; -- 63 constant s64: string:="h "; -- 64 constant s65: string:="i "; -- 65 constant s66: string:="j "; -- 66 constant s67: string:="k "; -- 67 constant s68: string:="l "; -- 68 constant s69: string:="m "; -- 69 constant s70: string:="n "; -- 70 constant s71: string:="o "; -- 71 constant s72: string:="p "; -- 72 constant s73: string:="q "; -- 73 constant s74: string:="r "; -- 74 constant s75: string:="s "; -- 75 constant s76: string:="t "; -- 76 constant s77: string:="u "; -- 77 constant s78: string:="v "; -- 78 constant s79: string:="w "; -- 79 constant s80: string:="x "; -- 80 constant s81: string:="y "; -- 81 constant s82: string:="z "; -- 82 constant s83: string:="! "; -- 83 constant s84: string:="$ "; -- 84 constant s85: string:="% "; -- 85 constant s86: string:="@ "; -- 86 constant s87: string:="? "; -- 87 constant s88: string:="[ "; -- 88 constant s89: string:="\ "; -- 89 constant s90: string:="] "; -- 90 constant s91: string:="^ "; -- 91 constant s92: string:="` "; -- 92 constant s93: string:="{ "; -- 93 constant s94: string:="} "; -- 94 constant s95: string:="~ "; -- 95 ------------------------------------------------------------ constant c01: string:=('A',' '); -- 1 constant c02: string:=('B',' '); -- 2 constant c03: string:=('C',' '); -- 3 constant c04: string:=('D',' '); -- 4 constant c05: string:=('E',' '); -- 5 constant c06: string:=('F',' '); -- 6 constant c07: string:=('G',' '); -- 7 constant c08: string:=('H',' '); -- 8 constant c09: string:=('I',' '); -- 9 constant c10: string:=('J',' '); -- 10 constant c11: string:=('K',' '); -- 11 constant c12: string:=('L',' '); -- 12 constant c13: string:=('M',' '); -- 13 constant c14: string:=('N',' '); -- 14 constant c15: string:=('O',' '); -- 15 constant c16: string:=('P',' '); -- 16 constant c17: string:=('Q',' '); -- 17 constant c18: string:=('R',' '); -- 18 constant c19: string:=('S',' '); -- 19 constant c20: string:=('T',' '); -- 20 constant c21: string:=('U',' '); -- 21 constant c22: string:=('V',' '); -- 22 constant c23: string:=('W',' '); -- 23 constant c24: string:=('X',' '); -- 24 constant c25: string:=('Y',' '); -- 25 constant c26: string:=('Z',' '); -- 26 constant c27: string:=('0',' '); -- 27 constant c28: string:=('1',' '); -- 28 constant c29: string:=('2',' '); -- 29 constant c30: string:=('3',' '); -- 30 constant c31: string:=('4',' '); -- 31 constant c32: string:=('5',' '); -- 32 constant c33: string:=('6',' '); -- 33 constant c34: string:=('7',' '); -- 34 constant c35: string:=('8',' '); -- 35 constant c36: string:=('9',' '); -- 36 constant c37: string:=('"',' '); -- 37 constant c38: string:=('#',' '); -- 38 constant c39: string:=('&',' '); -- 39 constant c40: string:=(''',' '); -- 40 constant c41: string:=('(',' '); -- 41 constant c42: string:=(')',' '); -- 42 constant c43: string:=('*',' '); -- 43 constant c44: string:=('+',' '); -- 44 constant c45: string:=(',',' '); -- 45 constant c46: string:=('-',' '); -- 46 constant c47: string:=('.',' '); -- 47 constant c48: string:=('/',' '); -- 48 constant c49: string:=(':',' '); -- 49 constant c50: string:=(';',' '); -- 50 constant c51: string:=('<',' '); -- 51 constant c52: string:=('=',' '); -- 52 constant c53: string:=('>',' '); -- 53 constant c54: string:=('_',' '); -- 54 constant c55: string:=('|',' '); -- 55 constant c56: string:=(' ',' '); -- 56 constant c57: string:=('a',' '); -- 57 constant c58: string:=('b',' '); -- 58 constant c59: string:=('c',' '); -- 59 constant c60: string:=('d',' '); -- 60 constant c61: string:=('e',' '); -- 61 constant c62: string:=('f',' '); -- 62 constant c63: string:=('g',' '); -- 63 constant c64: string:=('h',' '); -- 64 constant c65: string:=('i',' '); -- 65 constant c66: string:=('j',' '); -- 66 constant c67: string:=('k',' '); -- 67 constant c68: string:=('l',' '); -- 68 constant c69: string:=('m',' '); -- 69 constant c70: string:=('n',' '); -- 70 constant c71: string:=('o',' '); -- 71 constant c72: string:=('p',' '); -- 72 constant c73: string:=('q',' '); -- 73 constant c74: string:=('r',' '); -- 74 constant c75: string:=('s',' '); -- 75 constant c76: string:=('t',' '); -- 76 constant c77: string:=('u',' '); -- 77 constant c78: string:=('v',' '); -- 78 constant c79: string:=('w',' '); -- 79 constant c80: string:=('x',' '); -- 80 constant c81: string:=('y',' '); -- 81 constant c82: string:=('z',' '); -- 82 constant c83: string:=('!',' '); -- 83 constant c84: string:=('$',' '); -- 84 constant c85: string:=('%',' '); -- 85 constant c86: string:=('@',' '); -- 86 constant c87: string:=('?',' '); -- 87 constant c88: string:=('[',' '); -- 88 constant c89: string:=('\',' '); -- 89 constant c90: string:=(']',' '); -- 90 constant c91: string:=('^',' '); -- 91 constant c92: string:=('`',' '); -- 92 constant c93: string:=('{',' '); -- 93 constant c94: string:=('}',' '); -- 94 constant c95: string:=('~',' '); -- 95 BEGIN TESTING: PROCESS variable k : integer := 0; BEGIN assert (s01=c01) report "problem with 1 - 'A' " severity failure; assert (s02=c02) report "problem with 2 - 'B' " severity failure; assert (s03=c03) report "problem with 3 - 'C' " severity failure; assert (s04=c04) report "problem with 4 - 'D' " severity failure; assert (s05=c05) report "problem with 5 - 'E' " severity failure; assert (s06=c06) report "problem with 6 - 'F' " severity failure; assert (s07=c07) report "problem with 7 - 'G' " severity failure; assert (s08=c08) report "problem with 8 - 'H' " severity failure; assert (s09=c09) report "problem with 9 - 'I' " severity failure; assert (s10=c10) report "problem with 10 - 'J' " severity failure; assert (s11=c11) report "problem with 11 - 'K' " severity failure; assert (s12=c12) report "problem with 12 - 'L' " severity failure; assert (s13=c13) report "problem with 13 - 'M' " severity failure; assert (s14=c14) report "problem with 14 - 'N' " severity failure; assert (s15=c15) report "problem with 15 - 'O' " severity failure; assert (s16=c16) report "problem with 16 - 'P' " severity failure; assert (s17=c17) report "problem with 17 - 'Q' " severity failure; assert (s18=c18) report "problem with 18 - 'R' " severity failure; assert (s19=c19) report "problem with 19 - 'S' " severity failure; assert (s20=c20) report "problem with 20 - 'T' " severity failure; assert (s21=c21) report "problem with 21 - 'U' " severity failure; assert (s22=c22) report "problem with 22 - 'V' " severity failure; assert (s23=c23) report "problem with 23 - 'W' " severity failure; assert (s24=c24) report "problem with 24 - 'X' " severity failure; assert (s25=c25) report "problem with 25 - 'Y' " severity failure; assert (s26=c26) report "problem with 26 - 'Z' " severity failure; assert (s27=c27) report "problem with 27 - '0' " severity failure; assert (s28=c28) report "problem with 28 - '1' " severity failure; assert (s29=c29) report "problem with 29 - '2' " severity failure; assert (s30=c30) report "problem with 30 - '3' " severity failure; assert (s31=c31) report "problem with 31 - '4' " severity failure; assert (s32=c32) report "problem with 32 - '5' " severity failure; assert (s33=c33) report "problem with 33 - '6' " severity failure; assert (s34=c34) report "problem with 34 - '7' " severity failure; assert (s35=c35) report "problem with 35 - '8' " severity failure; assert (s36=c36) report "problem with 36 - '9' " severity failure; assert (s37=c37) report "problem with 37 - '""' " severity failure; assert (s38=c38) report "problem with 38 - '#' " severity failure; assert (s39=c39) report "problem with 39 - '&' " severity failure; assert (s40=c40) report "problem with 40 - ''' " severity failure; assert (s41=c41) report "problem with 41 - '(' " severity failure; assert (s42=c42) report "problem with 42 - ')' " severity failure; assert (s43=c43) report "problem with 43 - '*' " severity failure; assert (s44=c44) report "problem with 44 - '+' " severity failure; assert (s45=c45) report "problem with 45 - ',' " severity failure; assert (s46=c46) report "problem with 46 - '-' " severity failure; assert (s47=c47) report "problem with 47 - '.' " severity failure; assert (s48=c48) report "problem with 48 - '/' " severity failure; assert (s49=c49) report "problem with 49 - ':' " severity failure; assert (s50=c50) report "problem with 50 - ';' " severity failure; assert (s51=c51) report "problem with 51 - '<' " severity failure; assert (s52=c52) report "problem with 52 - '=' " severity failure; assert (s53=c53) report "problem with 53 - '>' " severity failure; assert (s54=c54) report "problem with 54 - '_' " severity failure; assert (s55=c55) report "problem with 55 - '|' " severity failure; assert (s56=c56) report "problem with 56 - ' ' " severity failure; assert (s57=c57) report "problem with 57 - 'a' " severity failure; assert (s58=c58) report "problem with 58 - 'b' " severity failure; assert (s59=c59) report "problem with 59 - 'c' " severity failure; assert (s60=c60) report "problem with 60 - 'd' " severity failure; assert (s61=c61) report "problem with 61 - 'e' " severity failure; assert (s62=c62) report "problem with 62 - 'f' " severity failure; assert (s63=c63) report "problem with 63 - 'g' " severity failure; assert (s64=c64) report "problem with 64 - 'h' " severity failure; assert (s65=c65) report "problem with 65 - 'i' " severity failure; assert (s66=c66) report "problem with 66 - 'j' " severity failure; assert (s67=c67) report "problem with 67 - 'k' " severity failure; assert (s68=c68) report "problem with 68 - 'l' " severity failure; assert (s69=c69) report "problem with 69 - 'm' " severity failure; assert (s70=c70) report "problem with 70 - 'n' " severity failure; assert (s71=c71) report "problem with 71 - 'o' " severity failure; assert (s72=c72) report "problem with 72 - 'p' " severity failure; assert (s73=c73) report "problem with 73 - 'q' " severity failure; assert (s74=c74) report "problem with 74 - 'r' " severity failure; assert (s75=c75) report "problem with 75 - 's' " severity failure; assert (s76=c76) report "problem with 76 - 't' " severity failure; assert (s77=c77) report "problem with 77 - 'u' " severity failure; assert (s78=c78) report "problem with 78 - 'v' " severity failure; assert (s79=c79) report "problem with 79 - 'w' " severity failure; assert (s80=c80) report "problem with 80 - 'x' " severity failure; assert (s81=c81) report "problem with 81 - 'y' " severity failure; assert (s82=c82) report "problem with 82 - 'z' " severity failure; assert (s83=c83) report "problem with 83 - '!' " severity failure; assert (s84=c84) report "problem with 84 - '$' " severity failure; assert (s85=c85) report "problem with 85 - '%' " severity failure; assert (s86=c86) report "problem with 86 - '@' " severity failure; assert (s87=c87) report "problem with 87 - '?' " severity failure; assert (s88=c88) report "problem with 88 - '[' " severity failure; assert (s89=c89) report "problem with 89 - '\' " severity failure; assert (s90=c90) report "problem with 90 - ']' " severity failure; assert (s91=c91) report "problem with 91 - '^' " severity failure; assert (s92=c92) report "problem with 92 - '`' " severity failure; assert (s93=c93) report "problem with 93 - '{' " severity failure; assert (s94=c94) report "problem with 94 - '}' " severity failure; assert (s95=c95) report "problem with 95 - '~' " severity failure; assert NOT( (s01=c01) and (s02=c02) and (s03=c03) and (s04=c04) and (s05=c05) and (s06=c06) and (s07=c07) and (s08=c08) and (s09=c09) and (s10=c10) and (s11=c11) and (s12=c12) and (s13=c13) and (s14=c14) and (s15=c15) and (s16=c16) and (s17=c17) and (s18=c18) and (s19=c19) and (s20=c20) and (s21=c21) and (s22=c22) and (s23=c23) and (s24=c24) and (s25=c25) and (s26=c26) and (s27=c27) and (s28=c28) and (s29=c29) and (s30=c30) and (s31=c31) and (s32=c32) and (s33=c33) and (s34=c34) and (s35=c35) and (s36=c36) and (s37=c37) and (s38=c38) and (s39=c39) and (s40=c40) and (s41=c41) and (s42=c42) and (s43=c43) and (s44=c44) and (s45=c45) and (s46=c46) and (s47=c47) and (s48=c48) and (s49=c49) and (s50=c50) and (s51=c51) and (s52=c52) and (s53=c53) and (s54=c54) and (s55=c55) and (s56=c56) and (s57=c57) and (s58=c58) and (s59=c59) and (s60=c60) and (s61=c61) and (s62=c62) and (s63=c63) and (s64=c64) and (s65=c65) and (s66=c66) and (s67=c67) and (s68=c68) and (s69=c69) and (s70=c70) and (s71=c71) and (s72=c72) and (s73=c73) and (s74=c74) and (s75=c75) and (s76=c76) and (s77=c77) and (s78=c78) and (s79=c79) and (s80=c80) and (s81=c81) and (s82=c82) and (s83=c83) and (s84=c84) and (s85=c85) and (s86=c86) and (s87=c87) and (s88=c88) and (s89=c89) and (s90=c90) and (s91=c91) and (s92=c92) and (s93=c93) and (s94=c94) and (s95=c95) ) report "***PASSED TEST: c13s06b00x00p03n01i02737" severity NOTE; assert ( (s01=c01) and (s02=c02) and (s03=c03) and (s04=c04) and (s05=c05) and (s06=c06) and (s07=c07) and (s08=c08) and (s09=c09) and (s10=c10) and (s11=c11) and (s12=c12) and (s13=c13) and (s14=c14) and (s15=c15) and (s16=c16) and (s17=c17) and (s18=c18) and (s19=c19) and (s20=c20) and (s21=c21) and (s22=c22) and (s23=c23) and (s24=c24) and (s25=c25) and (s26=c26) and (s27=c27) and (s28=c28) and (s29=c29) and (s30=c30) and (s31=c31) and (s32=c32) and (s33=c33) and (s34=c34) and (s35=c35) and (s36=c36) and (s37=c37) and (s38=c38) and (s39=c39) and (s40=c40) and (s41=c41) and (s42=c42) and (s43=c43) and (s44=c44) and (s45=c45) and (s46=c46) and (s47=c47) and (s48=c48) and (s49=c49) and (s50=c50) and (s51=c51) and (s52=c52) and (s53=c53) and (s54=c54) and (s55=c55) and (s56=c56) and (s57=c57) and (s58=c58) and (s59=c59) and (s60=c60) and (s61=c61) and (s62=c62) and (s63=c63) and (s64=c64) and (s65=c65) and (s66=c66) and (s67=c67) and (s68=c68) and (s69=c69) and (s70=c70) and (s71=c71) and (s72=c72) and (s73=c73) and (s74=c74) and (s75=c75) and (s76=c76) and (s77=c77) and (s78=c78) and (s79=c79) and (s80=c80) and (s81=c81) and (s82=c82) and (s83=c83) and (s84=c84) and (s85=c85) and (s86=c86) and (s87=c87) and (s88=c88) and (s89=c89) and (s90=c90) and (s91=c91) and (s92=c92) and (s93=c93) and (s94=c94) and (s95=c95) ) report "***FAILED TEST: c13s06b00x00p03n01i02737 - All string literal of length 1 are equal in value to their corresponding character values." severity ERROR; wait; END PROCESS TESTING; END c13s06b00x00p03n01i02737arch;
gpl-2.0
tgingold/ghdl
testsuite/gna/ticket87/hello.vhdl
3
101
entity hello is end; architecture behav of hello is begin assert false report "Hello"; end behav;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2498.vhd
4
1951
-- 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: tc2498.vhd,v 1.2 2001-10-26 16:30:19 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s03b03x00p05n01i02498ent IS END c07s03b03x00p05n01i02498ent; ARCHITECTURE c07s03b03x00p05n01i02498arch OF c07s03b03x00p05n01i02498ent IS BEGIN TESTING: PROCESS function check (x:integer; y:boolean; z:real) return boolean is begin if y then return true; else return false; end if; end; variable p: integer := 3; variable q: boolean := true; variable r: integer; -- should be real. variable s: boolean; BEGIN s := check (p, q, r); -- Failure_here assert FALSE report "***FAILED TEST: c07s03b03x00p05n01i02498 - Actual parameter must belong to the subtype of the associated formal parameter." severity ERROR; wait; END PROCESS TESTING; END c07s03b03x00p05n01i02498arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc117.vhd
4
3174
-- 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: tc117.vhd,v 1.2 2001-10-26 16:29:39 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- Package c04s03b02x00p29n10i00117pkg is type Apollo_string is array (INTEGER range 1 to 8) of CHARACTER; type V_REGISTER is array (INTEGER range 0 to 7) of BIT; end c04s03b02x00p29n10i00117pkg; use work.c04s03b02x00p29n10i00117pkg.all; ENTITY c04s03b02x00p29n10i00117ent IS port ( p23 : buffer Boolean := FALSE; p24 : buffer Bit := '0' ; p25 : buffer Character := NUL ; p26 : buffer SEVERITY_LEVEL := NOTE ; p27 : buffer Integer := -1 ; p28 : buffer Real := -1.0 ; p29 : buffer TIME := 1 fs ; p30 : buffer Natural := 0 ; p31 : buffer Positive := 1 ; p32 : buffer Apollo_string := "abcdefgh"; p33 : buffer V_register := B"10010110" ); END c04s03b02x00p29n10i00117ent; ARCHITECTURE c04s03b02x00p29n10i00117arch OF c04s03b02x00p29n10i00117ent IS BEGIN TESTING: PROCESS BEGIN assert NOT( p23 = FALSE and p24 = '0' and p25 = NUL and p26 = NOTE and p27 = -1 and p28 = -1.0 and p29 = 1 fs and p30 = 0 and p31 = 1 and p32 = "abcdefgh"and p33 = B"10010110" ) report "***PASSED TEST: c04s03b02x00p29n10i00117" severity NOTE; assert ( p23 = FALSE and p24 = '0' and p25 = NUL and p26 = NOTE and p27 = -1 and p28 = -1.0 and p29 = 1 fs and p30 = 0 and p31 = 1 and p32 = "abcdefgh"and p33 = B"10010110" ) report "***FAILED TEST: c04s03b02x00p29n10i00117 - The buffer ports on entities should be able to read." severity ERROR; wait; END PROCESS TESTING; END c04s03b02x00p29n10i00117arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc871.vhd
1
11627
-- 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: tc871.vhd,v 1.2 2001-10-26 16:30:01 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c01s03b01x00p12n01i00871pkg is constant low_number : integer := 0; constant hi_number : integer := 3; subtype hi_to_low_range is integer range low_number to hi_number; 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 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 array_rec_std is array (natural range <>) of record_std_package; type four_value is ('Z','0','1','X'); --enumerated type 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; signal Sin1 : bit_vector(0 to 5) ; signal Sin2 : boolean_vector(0 to 5) ; signal Sin4 : severity_level_vector(0 to 5) ; signal Sin5 : integer_vector(0 to 5) ; signal Sin6 : real_vector(0 to 5) ; signal Sin7 : time_vector(0 to 5) ; signal Sin8 : natural_vector(0 to 5) ; signal Sin9 : positive_vector(0 to 5) ; signal Sin10: array_rec_std(0 to 5) ; end c01s03b01x00p12n01i00871pkg; use work.c01s03b01x00p12n01i00871pkg.all; entity test is port( sigin1 : in boolean ; sigout1 : out boolean ; sigin2 : in bit ; sigout2 : out bit ; sigin4 : in severity_level ; sigout4 : out severity_level ; sigin5 : in integer ; sigout5 : out integer ; sigin6 : in real ; sigout6 : out real ; sigin7 : in time ; sigout7 : out time ; sigin8 : in natural ; sigout8 : out natural ; sigin9 : in positive ; sigout9 : out positive ; sigin10 : in record_std_package ; sigout10 : out record_std_package ); end; architecture test of test is begin sigout1 <= sigin1; sigout2 <= sigin2; sigout4 <= sigin4; sigout5 <= sigin5; sigout6 <= sigin6; sigout7 <= sigin7; sigout8 <= sigin8; sigout9 <= sigin9; sigout10 <= sigin10; end; configuration testbench of test is for test end for; end; use work.c01s03b01x00p12n01i00871pkg.all; entity test1 is port( sigin1 : in boolean ; sigout1 : out boolean ; sigin2 : in bit ; sigout2 : out bit ; sigin4 : in severity_level ; sigout4 : out severity_level ; sigin5 : in integer ; sigout5 : out integer ; sigin6 : in real ; sigout6 : out real ; sigin7 : in time ; sigout7 : out time ; sigin8 : in natural ; sigout8 : out natural ; sigin9 : in positive ; sigout9 : out positive ; sigin10 : in record_std_package ; sigout10 : out record_std_package ); end; architecture test1 of test1 is begin sigout1 <= false; sigout2 <= '0'; sigout4 <= error; sigout5 <= 6; sigout6 <= 6.0; sigout7 <= 6 ns; sigout8 <= 6; sigout9 <= 6; sigout10 <= (false,'0','h',error,6,6.0,6 ns,6,6); end; configuration test1bench of test1 is for test1 end for; end; use work.c01s03b01x00p12n01i00871pkg.all; ENTITY c01s03b01x00p12n01i00871ent IS generic( zero : integer := 0; one : integer := 1; two : integer := 2; three: integer := 3; four : integer := 4; five : integer := 5; six : integer := 6; seven: integer := 7; eight: integer := 8; nine : integer := 9; fifteen:integer:= 15); port( dumy : inout bit_vector(zero to three)); END c01s03b01x00p12n01i00871ent; ARCHITECTURE c01s03b01x00p12n01i00871arch OF c01s03b01x00p12n01i00871ent IS component test port( sigin1 : in boolean ; sigout1 : out boolean ; sigin2 : in bit ; sigout2 : out bit ; sigin4 : in severity_level ; sigout4 : out severity_level ; sigin5 : in integer ; sigout5 : out integer ; sigin6 : in real ; sigout6 : out real ; sigin7 : in time ; sigout7 : out time ; sigin8 : in natural ; sigout8 : out natural ; sigin9 : in positive ; sigout9 : out positive ; sigin10 : in record_std_package ; sigout10 : out record_std_package ); end component; begin Sin1(zero) <='1'; Sin2(zero) <= true; Sin4(zero) <= note; Sin5(zero) <= 3; Sin6(zero) <= 3.0; Sin7(zero) <= 3 ns; Sin8(zero) <= 1; Sin9(zero) <= 1; Sin10(zero) <= (C1,C2,C3,C4,C5,C6,C7,C8,C9); K:block BEGIN T5 : test port map ( Sin2(4),Sin2(5), Sin1(4),Sin1(5), Sin4(4),Sin4(5), Sin5(4),Sin5(5), Sin6(4),Sin6(5), Sin7(4),Sin7(5), Sin8(4),Sin8(5), Sin9(4),Sin9(5), Sin10(4),Sin10(5) ); G: for i in zero to three generate T1:test port map ( Sin2(i),Sin2(i+1), Sin1(i),Sin1(i+1), Sin4(i),Sin4(i+1), Sin5(i),Sin5(i+1), Sin6(i),Sin6(i+1), Sin7(i),Sin7(i+1), Sin8(i),Sin8(i+1), Sin9(i),Sin9(i+1), Sin10(i),Sin10(i+1) ); end generate; end block; TESTING: PROCESS variable dumb : bit_vector(zero to three); BEGIN wait for 1 ns; assert Sin1(0) = Sin1(4) report "assignment of Sin1(0) to Sin1(4) is invalid through entity port" severity failure; assert Sin2(0) = Sin2(4) report "assignment of Sin2(0) to Sin2(4) is invalid through entity port" severity failure; assert Sin4(0) = Sin4(4) report "assignment of Sin4(0) to Sin4(4) is invalid through entity port" severity failure; assert Sin5(0) = Sin5(4) report "assignment of Sin5(0) to Sin5(4) is invalid through entity port" severity failure; assert Sin6(0) = Sin6(4) report "assignment of Sin6(0) to Sin6(4) is invalid through entity port" severity failure; assert Sin7(0) = Sin7(4) report "assignment of Sin7(0) to Sin7(4) is invalid through entity port" severity failure; assert Sin8(0) = Sin8(4) report "assignment of Sin8(0) to Sin8(4) is invalid through entity port" severity failure; assert Sin9(0) = Sin9(4) report "assignment of Sin9(0) to Sin9(4) is invalid through entity port" severity failure; assert Sin10(0) = Sin10(4) report "assignment of Sin10(0) to Sin10(4) is invalid through entity port" severity failure; assert Sin1(5) = '1' report "assignment of Sin1(5) to Sin1(4) is invalid through entity port" severity failure; assert Sin2(5) = true report "assignment of Sin2(5) to Sin2(4) is invalid through entity port" severity failure; assert Sin4(5) = note report "assignment of Sin4(5) to Sin4(4) is invalid through entity port" severity failure; assert Sin5(5) = 3 report "assignment of Sin5(5) to Sin5(4) is invalid through entity port" severity failure; assert Sin6(5) = 3.0 report "assignment of Sin6(5) to Sin6(4) is invalid through entity port" severity failure; assert Sin7(5) = 3 ns report "assignment of Sin7(5) to Sin7(4) is invalid through entity port" severity failure; assert Sin8(5) = 1 report "assignment of Sin8(5) to Sin8(4) is invalid through entity port" severity failure; assert Sin9(5) = 1 report "assignment of Sin9(5) to Sin9(4) is invalid through entity port" severity failure; assert Sin10(5) = (true,'1','s',note,3,3.0,3 ns,1,1) report "assignment of Sin10(5) to Sin10(4) is invalid through entity port" severity failure; assert NOT( Sin1(0) = sin1(4) and Sin2(0) = Sin2(4) and Sin4(0) = Sin4(4) and Sin5(0) = Sin5(4) and Sin6(0) = Sin6(4) and Sin7(0) = Sin7(4) and Sin8(0) = Sin8(4) and Sin9(0) = Sin9(4) and Sin10(0)= Sin10(4) and Sin1(5) = '1' and Sin2(5) = TRUE and Sin4(5) = note and Sin5(5) = 3 and Sin6(5) = 3.0 and Sin7(5) = 3 ns and Sin8(5) = 1 and Sin9(5) = 1 and Sin10(5)=(True,'1','s',note,3,3.0,3 ns,1,1)) report "***PASSED TEST: c01s03b01x00p12n01i00871" severity NOTE; assert ( Sin1(0) = sin1(4) and Sin2(0) = Sin2(4) and Sin4(0) = Sin4(4) and Sin5(0) = Sin5(4) and Sin6(0) = Sin6(4) and Sin7(0) = Sin7(4) and Sin8(0) = Sin8(4) and Sin9(0) = Sin9(4) and Sin10(0)= Sin10(4) and Sin1(5) = '1' and Sin2(5) = TRUE and Sin4(5) = note and Sin5(5) = 3 and Sin6(5) = 3.0 and Sin7(5) = 3 ns and Sin8(5) = 1 and Sin9(5) = 1 and Sin10(5)=(True,'1','s',note,3,3.0,3 ns,1,1)) report "***FAILED TEST: c01s03b01x00p12n01i00871 - If such a block configuration contains an index specification that is a discrete range, then the block configuration applies to those implicit block statements that are generated for the specified range of values of the corresponding generate index." severity ERROR; wait; END PROCESS TESTING; END c01s03b01x00p12n01i00871arch; configuration c01s03b01x00p12n01i00871cfg of c01s03b01x00p12n01i00871ent is for c01s03b01x00p12n01i00871arch for K for all:test use configuration work.test1bench; end for; for G(0 to 3) for T1 :test use configuration work.testbench; end for; end for; end for; end for; end;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1507.vhd
4
2533
-- 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: tc1507.vhd,v 1.2 2001-10-26 16:29:41 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s08b00x00p16n01i01507ent IS END c08s08b00x00p16n01i01507ent; ARCHITECTURE c08s08b00x00p16n01i01507arch OF c08s08b00x00p16n01i01507ent IS BEGIN TESTING: PROCESS variable s1, s2, s3, s4, s5, s6 : INTEGER := 0; BEGIN for i in 1 to 1000 loop case i is when 1 => s1 := s1 + 1; when 2 | 3 => s2 := s2 + 1; when 4 to 100 => s3 := s3 + 1; when 200 to 201 | 300 to 350 => s4 := s4 + 1; when 400 to 450 => s5 := s5 + 1; when others => s6 := s6 + 1; end case; end loop; wait for 5 ns; assert NOT( s1 = 1 and s2 = 2 and s3 = 97 and s4 = 2 + 51 and s5 = 51 and s6 = 1000 - (s1+s2+s3+s4+s5) ) report "***PASSED TEST: c08s08b00x00p16n01i01507" severity NOTE; assert ( s1 = 1 and s2 = 2 and s3 = 97 and s4 = 2 + 51 and s5 = 51 and s6 = 1000 - (s1+s2+s3+s4+s5) ) report "***FAILED TEST: c08s08b00x00p16n01i01507 - Case statement execution test failed." severity ERROR; wait; END PROCESS TESTING; END c08s08b00x00p16n01i01507arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1798.vhd
4
1898
-- 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: tc1798.vhd,v 1.2 2001-10-26 16:29:43 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s01b00x00p02n01i01798ent IS END c07s01b00x00p02n01i01798ent; ARCHITECTURE c07s01b00x00p02n01i01798arch OF c07s01b00x00p02n01i01798ent IS BEGIN TESTING: PROCESS variable x : integer := 3; variable y : integer := 5; variable z : integer := 9; BEGIN if -x + z < y + x and x * z > y - x then -- No_failure_here x := x - z; end if; assert NOT(x=-6) report "***PASSED TEST: c07s01b00x00p02n01i01798" severity NOTE; assert (x=-6) report "***FAILED TEST: c07s01b00x00p02n01i01798 - The expression is a valid expression according to the rules of the syntactic diagram." severity ERROR; wait; END PROCESS TESTING; END c07s01b00x00p02n01i01798arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1453.vhd
4
1696
-- 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: tc1453.vhd,v 1.2 2001-10-26 16:30:10 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s07b00x00p01n01i01453ent IS END c08s07b00x00p01n01i01453ent; ARCHITECTURE c08s07b00x00p01n01i01453arch OF c08s07b00x00p01n01i01453ent IS BEGIN transmit: process variable s := 10; begin if s + 10 then -- failure_here condition not boolean. NULL; end if; assert FALSE report "***FAILED TEST: c08s07b00x00p01n01i01453 - Expression of IF statement must be of type BOOLEAN" severity ERROR; wait; end process transmit; END c08s07b00x00p01n01i01453arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/simulator_failure/tc263.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: tc263.vhd,v 1.2 2001-10-26 16:30:30 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s01b02x00p08n01i00263ent IS END c03s01b02x00p08n01i00263ent; ARCHITECTURE c03s01b02x00p08n01i00263arch OF c03s01b02x00p08n01i00263ent IS BEGIN TESTING: PROCESS variable V : INTEGER := INTEGER'HIGH / 2 + 1; BEGIN V := V + V; -- operation should overflow assert FALSE report "***FAILED TEST: c03s01b02x00p08n01i00263 - Number is out of integer bounds." severity ERROR; wait; END PROCESS TESTING; END c03s01b02x00p08n01i00263arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2937.vhd
4
1833
-- 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: tc2937.vhd,v 1.2 2001-10-26 16:30:24 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c02s02b00x00p07n03i02937pkg is end c02s02b00x00p07n03i02937pkg; package body c02s02b00x00p07n03i02937pkg is procedure proc1 (i,l:integer; res: boolean); -- ERROR: non-existent body for procedure proc1 end c02s02b00x00p07n03i02937pkg; ENTITY c02s02b00x00p07n03i02937ent IS END c02s02b00x00p07n03i02937ent; ARCHITECTURE c02s02b00x00p07n03i02937arch OF c02s02b00x00p07n03i02937ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c02s02b00x00p07n03i02937 - Every subprogram declaration has to have a corresponding body." severity ERROR; wait; END PROCESS TESTING; END c02s02b00x00p07n03i02937arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/sequential-statements/inline_19.vhd
4
1446
-- 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_19 is end entity inline_19; ---------------------------------------------------------------- architecture test of inline_19 is subtype data_type is integer; signal transmit_data : data_type := 0; begin -- code from book: transmit_element : process (transmit_data) is -- . . . -- variable declarations begin report "transmit_element: data = " & data_type'image(transmit_data); -- . . . end process transmit_element; -- end of code from book stimulus : process is begin transmit_data <= 10 after 10 ns, 20 after 20 ns; wait; end process stimulus; end architecture test;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2190.vhd
4
1828
-- 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: tc2190.vhd,v 1.2 2001-10-26 16:30:16 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s02b00x00p01n02i02190ent IS END c07s02b00x00p01n02i02190ent; ARCHITECTURE c07s02b00x00p01n02i02190arch OF c07s02b00x00p01n02i02190ent IS BEGIN TESTING: PROCESS type A_ARRAY is array (1 to 2) of CHARACTER; variable I : INTEGER; variable R : REAL; variable B : BOOLEAN; variable A : A_ARRAY; BEGIN R := R - - R; -- Failure_here -- SYNTAX ERROR: signed operator cannot follow adding operator. assert FALSE report "***FAILED TEST: c07s02b00x00p01n02i02190 - Signed operand cannot follow a mutiplying operator." severity ERROR; wait; END PROCESS TESTING; END c07s02b00x00p01n02i02190arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2812.vhd
4
1602
-- 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: tc2812.vhd,v 1.2 2001-10-26 16:30:22 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- entity NAND is end NAND; ENTITY c13s09b00x00p99n01i02812ent IS END c13s09b00x00p99n01i02812ent; ARCHITECTURE c13s09b00x00p99n01i02812arch OF c13s09b00x00p99n01i02812ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c13s09b00x00p99n01i02812 - Reserved word NAND can not be used as an entity name." severity ERROR; wait; END PROCESS TESTING; END c13s09b00x00p99n01i02812arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc267.vhd
4
1916
-- 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: tc267.vhd,v 1.2 2001-10-26 16:30:21 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s01b03x00p02n01i00267ent IS END c03s01b03x00p02n01i00267ent; ARCHITECTURE c03s01b03x00p02n01i00267arch OF c03s01b03x00p02n01i00267ent IS type UPLE is range 1 to 8 units single = 1 single; -- Failure_here -- ERROR - SYNTAX ERROR: BASE UNIT DECLARATION MISSING double = 2 single; triple = 3 single; quadruple = 2 double; pentuple = 5 single; sextuple = 2 triple; septuple = 7 single; octuple = 2 quadruple; end units; BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c03s01b03x00p02n01i00267 - Physical type declaration must have a base unit." severity ERROR; wait; END PROCESS TESTING; END c03s01b03x00p02n01i00267arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1602.vhd
4
1662
-- 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: tc1602.vhd,v 1.2 2001-10-26 16:30:11 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s11b00x00p03n01i01602ent IS END c08s11b00x00p03n01i01602ent; ARCHITECTURE c08s11b00x00p03n01i01602arch OF c08s11b00x00p03n01i01602ent IS BEGIN TESTING: PROCESS BEGIN L1: for i in 4 to 5 loop exit TESTING; -- wrong label end loop L1; assert FALSE report "***FAILED TEST: c08s11b00x00p03n01i01602 - Illegal label for exit statement." severity ERROR; wait; END PROCESS TESTING; END c08s11b00x00p03n01i01602arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc330.vhd
4
1772
-- 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: tc330.vhd,v 1.2 2001-10-26 16:30:25 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s02b01x00p05n01i00330ent IS END c03s02b01x00p05n01i00330ent; ARCHITECTURE c03s02b01x00p05n01i00330arch OF c03s02b01x00p05n01i00330ent IS type bit_vctor is array (natural range <>) of bit; type str_vctor is array (natural <>) of character; -- Failure_here type matrix is array (integer range <>) of real; BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c03s02b01x00p05n01i00330 - The reserved word range in the unconstrained array definition is missing." severity ERROR; wait; END PROCESS TESTING; END c03s02b01x00p05n01i00330arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1123.vhd
4
2227
-- 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: tc1123.vhd,v 1.2 2001-10-26 16:29:39 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s05b00x00p03n02i01123ent IS END c06s05b00x00p03n02i01123ent; ARCHITECTURE c06s05b00x00p03n02i01123arch OF c06s05b00x00p03n02i01123ent IS TYPE colors is ( red, green, blue, yellow, orange, black ); TYPE ncolor_array is array ( NATURAL range <> ) of colors; SUBTYPE ncolor_4 is ncolor_array ( 0 to 3 ); TYPE pcolor_array is array ( POSITIVE range <> ) of colors; SUBTYPE pcolor_4 is ncolor_array ( 1 to 4 ); BEGIN TESTING: PROCESS variable vn : ncolor_4 := ( red, red, green, black ); variable vp : pcolor_4 := ( blue, yellow, yellow, orange ); BEGIN vn(1 to 3) := vp(2 to 4); assert NOT( vn = ( red, yellow, yellow, orange ) ) report "***PASSED TEST: c06s05b00x00p03n02i01123" severity NOTE; assert ( vn = ( red, yellow, yellow, orange ) ) report "***FAILED TEST: c06s05b00x00p03n02i01123 - The base type of the array type is the type of the slice." severity ERROR; wait; END PROCESS TESTING; END c06s05b00x00p03n02i01123arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2770.vhd
4
1613
-- 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: tc2770.vhd,v 1.2 2001-10-26 16:30:22 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s08b00x00p01n01i02770ent IS END c13s08b00x00p01n01i02770ent; ARCHITECTURE c13s08b00x00p01n01i02770arch OF c13s08b00x00p01n01i02770ent IS --This is an error. --ERROR: COMMENTS MUST BE ON ONE LINE BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c13s08b00x00p01n01i02770 - Comments must be on one line." severity ERROR; wait; END PROCESS TESTING; END c13s08b00x00p01n01i02770arch;
gpl-2.0
tgingold/ghdl
testsuite/synth/dispin01/tb_rec06.vhdl
1
707
entity tb_rec06 is end tb_rec06; library ieee; use ieee.std_logic_1164.all; use work.rec06_pkg.all; architecture behav of tb_rec06 is signal inp : myrec; signal r : std_logic; begin dut: entity work.rec06 port map (inp => inp, o => r); process begin inp.a <= (2, "0000"); inp.b <= '1'; wait for 1 ns; assert r = '0' severity failure; inp.a <= (2, "0110"); inp.b <= '1'; wait for 1 ns; assert r = '1' severity failure; inp.a <= (3, "1001"); inp.b <= '0'; wait for 1 ns; assert r = '0' severity failure; inp.a <= (3, "0001"); inp.b <= '1'; wait for 1 ns; assert r = '0' severity failure; wait; end process; end behav;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc3034.vhd
4
3042
-- 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: tc3034.vhd,v 1.2 2001-10-26 16:29:50 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c12s02b01x00p01n02i03034ent IS END c12s02b01x00p01n02i03034ent; ARCHITECTURE c12s02b01x00p01n02i03034arch OF c12s02b01x00p01n02i03034ent IS subtype subi is integer range 1 to 10; subtype subr is real range 1.0 to 10.0; subtype subb is bit range '1' to '1'; type c_r is record i : subi; r : subr; b : subb; end record; signal s1, s2, s3 : c_r; BEGIN -- test record generics bl4: block generic(gr : c_r); generic map (gr => (1,1.0,'1')); port (s11 : OUT c_r); port map (s11 => s1); begin assert ((gr.i=1) and (gr.r=1.0) and (gr.b='1')) report "Generic record GR did not take on the correct low value" severity failure; s11 <= gr; end block; bl5: block generic(gr : c_r); generic map (gr => (5,5.0,'1')); port (s22 : OUT c_r); port map (s22 => s2); begin assert ((gr.i=5) and (gr.r=5.0) and (gr.b='1')) report "Generic record GR did not take on the correct middle value" severity failure; s22 <= gr; end block; bl6: block generic(gr : c_r); generic map (gr => (10,10.0,'1')); port (s33 : OUT c_r); port map (s33 => s3); begin assert ((gr.i=10) and (gr.r=10.0) and (gr.b='1')) report "Generic record GR did not take on the correct high value" severity failure; s33 <= gr; end block; TESTING: PROCESS BEGIN wait for 5 ns; assert NOT( s1 = (1,1.0,'1') and s2 = (5,5.0,'1') and s3 = (10,10.0,'1') ) report "***PASSED TEST: c12s02b01x00p01n02i03034" severity NOTE; assert ( s1 = (1,1.0,'1') and s2 = (5,5.0,'1') and s3 = (10,10.0,'1') ) report "***FAILED TEST: c12s02b01x00p01n02i03034 - Generic constants does not conform to their subtype indication." severity ERROR; wait; END PROCESS TESTING; END c12s02b01x00p01n02i03034arch;
gpl-2.0
tgingold/ghdl
testsuite/gna/issue818/tc17.vhdl
1
271
entity tc17 is end; library ieee; use ieee.std_logic_1164.all; architecture behav of tc17 is signal clk : std_logic; signal tg : std_logic; begin process (clk) is begin if (?? tg) and falling_edge(clk) then null; end if; end process; end behav;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2614.vhd
4
1587
-- 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: tc2614.vhd,v 1.2 2001-10-26 16:30:20 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s03b01x00p02n01i02614ent IS END c13s03b01x00p02n01i02614ent; ARCHITECTURE c13s03b01x00p02n01i02614arch OF c13s03b01x00p02n01i02614ent IS BEGIN TESTING: PROCESS variable k^k : integer := 0; BEGIN assert FALSE report "***FAILED TEST: c13s03b01x00p02n01i02614 - Identifier can not contain '^'." severity ERROR; wait; END PROCESS TESTING; END c13s03b01x00p02n01i02614arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/digital-modeling/S_R_flipflop-1.vhd
4
1009
-- 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 S_R_flipflop is port ( s, r : in bit; q, q_n : out bit ); begin check : assert not (s = '1' and r = '1') report "Incorrect use of S_R_flip_flop: s and r both '1'"; end entity S_R_flipflop;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1407.vhd
4
1735
-- 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: tc1407.vhd,v 1.2 2001-10-26 16:30:09 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s05b01x00p01n01i01407ent IS END c08s05b01x00p01n01i01407ent; ARCHITECTURE c08s05b01x00p01n01i01407arch OF c08s05b01x00p01n01i01407ent IS BEGIN TESTING: PROCESS variable B : Bit_vector (0 to 10) := B"01010010101"; BEGIN B(1 to 0) := B"01"; B(4 to 2) := B"101"; assert FALSE report "***FAILED TEST: c08s05b01x00p01n01i01407 - Every element of the array variable should have a matching element in the array value and vice versa." severity ERROR; wait; END PROCESS TESTING; END c08s05b01x00p01n01i01407arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2854.vhd
4
2294
-- 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: tc2854.vhd,v 1.2 2001-10-26 16:29:49 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s10b00x00p03n01i02854ent IS END c13s10b00x00p03n01i02854ent; ARCHITECTURE c13s10b00x00p03n01i02854arch OF c13s10b00x00p03n01i02854ent IS constant one : integer := 16:E:E1; constant two : integer := 16#E#E1; constant three : integer := 16#FF#; constant four : integer := 16:FF:; constant five : integer := 2#1110_0000#; constant six : integer := 2:1110_0000:; constant seven : integer := 8#776#; constant eight : integer := 8:776:; BEGIN TESTING: PROCESS BEGIN wait for 5 ns; assert NOT( one=two and three=four and five=six and seven=eight ) report "***PASSED TEST: c13s10b00x00p03n01i02854" severity NOTE; assert ( one=two and three=four and five=six and seven=eight ) report "***FAILED TEST: c13s10b00x00p03n01i02854 - Colon(:) can replace the sharp character(#) in based literal definition." severity ERROR; wait; END PROCESS TESTING; END c13s10b00x00p03n01i02854arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc602.vhd
4
2167
-- 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: tc602.vhd,v 1.3 2001-10-29 02:12:45 paw Exp $ -- $Revision: 1.3 $ -- -- --------------------------------------------------------------------- -- **************************** -- -- Ported to VHDL 93 by port93.pl - Tue Nov 5 16:37:41 1996 -- -- **************************** -- ENTITY c03s04b01x00p01n01i00602ent IS END c03s04b01x00p01n01i00602ent; ARCHITECTURE c03s04b01x00p01n01i00602arch OF c03s04b01x00p01n01i00602ent IS constant C4 : time := 3 ns; type time_vector is array (natural range <>) of time; subtype time_vector_st is time_vector(0 to 15); type time_vector_st_file is file of time_vector_st; constant C27 : time_vector_st := (others => C4); BEGIN TESTING: PROCESS file filein : time_vector_st_file open write_mode is "iofile.32"; BEGIN for i in 1 to 100 loop write(filein, C27); end loop; assert FALSE report "***PASSED TEST: c03s04b01x00p01n01i00602 - The output file will be verified by test s010264.vhd." severity NOTE; wait; END PROCESS TESTING; END c03s04b01x00p01n01i00602arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1002.vhd
4
1771
-- 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: tc1002.vhd,v 1.2 2001-10-26 16:30:05 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c06s03b00x00p09n01i01002pkg is type TWO is range 1 to 2; end c06s03b00x00p09n01i01002pkg; use work.c06s03b00x00p09n01i01002pkg.all; ENTITY c06s03b00x00p09n01i01002ent IS END c06s03b00x00p09n01i01002ent; ARCHITECTURE c06s03b00x00p09n01i01002arch OF c06s03b00x00p09n01i01002ent IS BEGIN TESTING: PROCESS subtype ST7 is Q.TWO (1 to 1); -- SEMANTIC ERROR: ILLEGAL EXPANDED NAME BEGIN assert FALSE report "***FAILED TEST: c06s03b00x00p09n01i01002 - Expanded name is illegal." severity ERROR; wait; END PROCESS TESTING; END c06s03b00x00p09n01i01002arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc371.vhd
4
1866
-- 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: tc371.vhd,v 1.2 2001-10-26 16:30:26 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s02b01x01p03n02i00371ent IS END c03s02b01x01p03n02i00371ent; ARCHITECTURE c03s02b01x01p03n02i00371arch OF c03s02b01x01p03n02i00371ent IS subtype BFALSE is BOOLEAN range FALSE to FALSE; type ONETWO is range 1 to 2; type A4 is array (ONETWO range <>, 1 to 2) of REAL range 0.0 downto -5.5; -- Failure_here -- ERROR - SYNTAX ERROR: CONSTRAINED AND UNCONSTRAINED INDEX RANGES -- CANNOT BE MIXED BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c03s02b01x01p03n02i00371 - Unconstrained and constrained index ranges cannot be mixed." severity ERROR; wait; END PROCESS TESTING; END c03s02b01x01p03n02i00371arch;
gpl-2.0
tgingold/ghdl
testsuite/gna/bug0100/notype2.vhdl
1
131
entity notype2 is end; architecture behav of notype2 is signal s : out bit_vector(7 downto 0); begin s (1) <= '0'; end behav;
gpl-2.0
tgingold/ghdl
testsuite/vpi/vpi001/mydesign.vhdl
1
822
library ieee ; use ieee.std_logic_1164.all; entity myentity is generic ( genint: integer := 42; genstring: string := "fish"; genbool: boolean := True; gensl: std_logic := '0' ); port ( iportbool: in boolean; iportint: in integer; iportsl: in std_logic; oportbool: out boolean; oportint: out integer; oportsl: out std_logic ); end myentity; architecture arch of myentity is constant constsl: std_logic := '0'; signal sigsl: std_logic; constant constint: integer := 42; signal sigint: integer; constant constbool: boolean := True; signal sigbool: boolean; constant conststring: string := "fish"; begin sigsl <= iportsl; sigbool <= iportbool; sigint <= iportint; oportbool <= constbool; oportint <= constint; oportsl <= constsl; end arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1865.vhd
4
1934
-- 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: tc1865.vhd,v 1.2 2001-10-26 16:30:14 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s01b00x00p08n01i01865ent IS END c07s01b00x00p08n01i01865ent; ARCHITECTURE c07s01b00x00p08n01i01865arch OF c07s01b00x00p08n01i01865ent IS type small_int is range 0 to 7; type cmd_bus is array (small_int range <>) of small_int; signal obus : cmd_bus(small_int); signal s_int : small_int; BEGIN TESTING : PROCESS BEGIN lop : for i in small_int loop s_int <= obus'right(lop) after 5 ns; -- loop label illegal here end loop lop; wait for 5 ns; assert FALSE report "***FAILED TEST: c07s01b00x00p08n01i01865 - Loop labels are not permitted as primaries in an attribute expression." severity ERROR; wait; END PROCESS TESTING; END c07s01b00x00p08n01i01865arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1612.vhd
4
1695
-- 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: tc1612.vhd,v 1.2 2001-10-26 16:30:11 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s11b00x00p04n01i01612ent IS END c08s11b00x00p04n01i01612ent; ARCHITECTURE c08s11b00x00p04n01i01612arch OF c08s11b00x00p04n01i01612ent IS BEGIN TESTING: PROCESS variable k : integer := 0; BEGIN L : for i in 1 to 10 loop exit L when "Tt"; k := i; end loop; assert FALSE report "***FAILED TEST: c08s11b00x00p04n01i01612 - The condition in an exit statement must be of boolean type" severity ERROR; wait; END PROCESS TESTING; END c08s11b00x00p04n01i01612arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc2668.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: tc2668.vhd,v 1.2 2001-10-26 16:30:21 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s03b01x00p02n01i02668ent IS END c13s03b01x00p02n01i02668ent; ARCHITECTURE c13s03b01x00p02n01i02668arch OF c13s03b01x00p02n01i02668ent IS BEGIN TESTING: PROCESS variable \k : integer; BEGIN assert FALSE report "***FAILED TEST: c13s03b01x00p02n01i02668 - Identifier can only begin with a letter." severity ERROR; wait; END PROCESS TESTING; END c13s03b01x00p02n01i02668arch;
gpl-2.0
tgingold/ghdl
testsuite/gna/issue50/idct.d/sub_488.vhd
2
800
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity sub_488 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_488; architecture augh of sub_488 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
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1079.vhd
4
2028
-- 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: tc1079.vhd,v 1.2 2001-10-26 16:29:38 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s05b00x00p01n02i01079ent IS END c06s05b00x00p01n02i01079ent; ARCHITECTURE c06s05b00x00p01n02i01079arch OF c06s05b00x00p01n02i01079ent IS SUBTYPE bit_vector_4 is bit_vector ( 0 to 3 ); SUBTYPE bit_vector_8 is bit_vector ( 0 to 7 ); SIGNAL v_slice : bit_vector_8 := B"1010_1100"; procedure subprogram ( signal v : out bit_vector_4 ) is begin v <= B"0101" after 10 ns; end ; BEGIN TESTING: PROCESS BEGIN subprogram ( v_slice ( 0 to 3 ) ); wait for 11 ns; assert NOT(v_slice = B"0101_1100") report "***PASSED TEST: c06s05b00x00p01n02i01079" severity NOTE; assert (v_slice = B"0101_1100") report "***FAILED TEST: c06s05b00x00p01n02i01079 - A slice of a signal should still be a signal." severity ERROR; wait; END PROCESS TESTING; END c06s05b00x00p01n02i01079arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/util/clock_duty.vhd
4
1340
-- 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 -- This digital clock allows user to specify the duty cycle using -- the parameters "on_time" and "off_time" library ieee; use ieee.std_logic_1164.all; entity clock_duty is generic ( on_time : time := 20 us; off_time : time := 19.98 ms ); port ( clock_out : out std_logic := 'Z' ); end entity clock_duty; architecture ideal of clock_duty is begin process begin wait for 1 us; clock_out <= '1'; wait for on_time; clock_out <= '0'; wait for off_time; end process; end architecture ideal;
gpl-2.0
tgingold/ghdl
testsuite/gna/bug082/repro.vhdl
1
843
entity repro is end; architecture behav of repro is type t_axilite_if is record write_address_channel : t_axilite_write_address_channel; write_data_channel : t_axilite_write_data_channel; write_response_channel : t_axilite_write_response_channel; read_address_channel : t_axilite_read_address_channel; read_data_channel : t_axilite_read_data_channel; end record; begin process variable init_if : t_axilite_if ( write_address_channel( awaddr( addr_width -1 downto 0)), write_data_channel( wdata( data_width -1 downto 0), wstrb(( data_width/8) -1 downto 0)), read_address_channel( araddr( addr_width -1 downto 0)), read_data_channel( rdata( data_width -1 downto 0))); begin wait; end process; end behav;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1358.vhd
4
1645
-- 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: tc1358.vhd,v 1.2 2001-10-26 16:30:09 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s05b00x00p03n01i01358ent IS END c08s05b00x00p03n01i01358ent; ARCHITECTURE c08s05b00x00p03n01i01358arch OF c08s05b00x00p03n01i01358ent IS signal s : integer := 0; BEGIN TESTING: PROCESS variable i : integer := 12; BEGIN s := i; assert FALSE report "***FAILED TEST: c08s05b00x00p03n01i01358 - Target of a variable assignment is not a variable." severity ERROR; wait; END PROCESS TESTING; END c08s05b00x00p03n01i01358arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1834.vhd
4
1836
-- 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: tc1834.vhd,v 1.2 2001-10-26 16:30:13 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s01b00x00p08n01i01834ent IS type small_int is range 0 to 7; END c07s01b00x00p08n01i01834ent; ARCHITECTURE c07s01b00x00p08n01i01834arch OF c07s01b00x00p08n01i01834ent IS BEGIN TESTING : PROCESS variable tmp : small_int := 0; BEGIN case c07s01b00x00p08n01i01834ent is -- entity name illegal here when 0 => tmp := 0; when others => tmp := 1; end case; wait for 5 ns; assert FALSE report "***FAILED TEST: c07s01b00x00p08n01i01834 - Entity name are not permitted as primaries in a case expression." severity ERROR; wait; END PROCESS TESTING; END c07s01b00x00p08n01i01834arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1845.vhd
4
1715
-- 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: tc1845.vhd,v 1.2 2001-10-26 16:30:13 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s01b00x00p08n01i01845ent IS type small_int is range 0 to 7; END c07s01b00x00p08n01i01845ent; ARCHITECTURE c07s01b00x00p08n01i01845arch OF c07s01b00x00p08n01i01845ent IS signal s_int : small_int := ch0701_p00801_36_arch; BEGIN TESTING : PROCESS BEGIN wait for 5 ns; assert FALSE report "***FAILED TEST: c07s01b00x00p08n01i01845 - Architecture body names are not permitted as primaries in an initialization expression." severity ERROR; wait; END PROCESS TESTING; END c07s01b00x00p08n01i01845arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc226.vhd
4
1813
-- 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: tc226.vhd,v 1.2 2001-10-26 16:30:17 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s01b01x00p07n01i00226ent IS END c03s01b01x00p07n01i00226ent; ARCHITECTURE c03s01b01x00p07n01i00226arch OF c03s01b01x00p07n01i00226ent 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 '0' to '1' loop k := 5; end loop; assert NOT( k=5 ) report "***PASSED TEST: c03s01b01x00p07n01i00226" severity NOTE; assert ( k=5 ) report "***FAILED TEST: c03s01b01x00p07n01i00226 - Literal cannot be determined." severity ERROR; wait; END PROCESS TESTING; END c03s01b01x00p07n01i00226arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc694.vhd
4
2119
-- 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: tc694.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:05 1996 -- -- **************************** -- ENTITY c03s04b01x00p23n01i00694ent IS END c03s04b01x00p23n01i00694ent; ARCHITECTURE c03s04b01x00p23n01i00694arch OF c03s04b01x00p23n01i00694ent IS BEGIN TESTING: PROCESS -- Declare the type and the file. type FT is file of REAL; -- Declare the actual file to write. file FILEV : FT open write_mode is "iofile.54"; -- Declare a variable. constant CON : REAL := 1.0; variable VAR : REAL := CON; BEGIN -- Write out the file. for I in 1 to 100 loop WRITE( FILEV,VAR ); end loop; assert FALSE report "***PASSED TEST: c03s04b01x00p23n01i00694 - The output file will tested by test file s010420.vhd" severity NOTE; wait; END PROCESS TESTING; END c03s04b01x00p23n01i00694arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1115.vhd
4
2107
-- 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: tc1115.vhd,v 1.2 2001-10-26 16:30:06 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s05b00x00p03n01i01115ent IS END c06s05b00x00p03n01i01115ent; ARCHITECTURE c06s05b00x00p03n01i01115arch OF c06s05b00x00p03n01i01115ent IS BEGIN TESTING: PROCESS type FIVE is range 1 to 5; type A1B is array (FIVE range <>) of BOOLEAN; subtype A1 is A1B(FIVE); type A2B is array (FIVE range <>, FIVE range <>) of A1; subtype A2 is A2B(FIVE, FIVE); function G return A2 is begin return (others => (others => (others => false))); end G; variable V1: A1; variable V2: A2; BEGIN V1(2 to 4) := G(3 to 5); -- ERROR: prefix of a slice name -- cannot be a function value -- of a multi-dimensional array type assert FALSE report "***FAILED TEST: c06s05b00x00p03n01i01115 - Prefix of a slice number must be a one-dimensional array type." severity ERROR; wait; END PROCESS TESTING; END c06s05b00x00p03n01i01115arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/subprograms/find_first_set.vhd
4
2195
-- 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 find_first_set is end entity find_first_set; architecture test of find_first_set is -- code from book procedure find_first_set ( v : in bit_vector; found : out boolean; first_set_index : out natural ) is begin for index in v'range loop if v(index) = '1' then found := true; first_set_index := index; return; end if; end loop; found := false; end procedure find_first_set; -- end code from book begin stimulus : process is -- code from book (in text) variable int_req : bit_vector (7 downto 0); variable top_priority : natural; variable int_pending : boolean; -- . . . -- end code from book constant block_count : natural := 16; -- code from book (in text) variable free_block_map : bit_vector(0 to block_count-1); variable first_free_block : natural; variable free_block_found : boolean; -- . . . -- end code from book begin int_req := "00010000"; -- code from book (in text) find_first_set ( int_req, int_pending, top_priority ); -- end code from book free_block_map := (others => '0'); -- code from book (in text) find_first_set ( free_block_map, free_block_found, first_free_block ); -- end code from book wait; end process stimulus; end architecture test;
gpl-2.0
tgingold/ghdl
libraries/openieee/v93/std_logic_1164.vhdl
1
6380
-- This is an implementation of -*- vhdl -*- ieee.std_logic_1164 based only -- on the specifications. This file is part of GHDL. -- Copyright (C) 2015 Tristan Gingold -- -- GHDL 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, or (at your option) any later -- version. -- -- GHDL 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 GCC; see the file COPYING2. If not see -- <http://www.gnu.org/licenses/>. package std_logic_1164 is -- Unresolved logic state. type std_ulogic is ( 'U', -- Uninitialized, this is also the default value. 'X', -- Unknown / conflict value (forcing level). '0', -- 0 (forcing level). '1', -- 1 (forcing level). 'Z', -- High impedance. 'W', -- Unknown / conflict (weak level). 'L', -- 0 (weak level). 'H', -- 1 (weak level). '-' -- Don't care. ); -- Vector of logic state. type std_ulogic_vector is array (natural range <>) of std_ulogic; -- Resolution function. -- If S is empty, returns 'Z'. -- If S has one element, return the element. -- Otherwise, 'U' is the strongest. -- then 'X' -- then '0' and '1' -- then 'W' -- then 'H' and 'L' -- then 'Z'. function resolved (s : std_ulogic_vector) return std_ulogic; -- Resolved logic state. subtype std_logic is resolved std_ulogic; -- Vector of std_logic. type std_logic_vector is array (natural range <>) of std_logic; -- Subtypes of std_ulogic. The names give the values. subtype X01 is resolved std_ulogic range 'X' to '1'; subtype X01Z is resolved std_ulogic range 'X' to 'Z'; subtype UX01 is resolved std_ulogic range 'U' to '1'; subtype UX01Z is resolved std_ulogic range 'U' to 'Z'; -- Logical operators. -- For logical operations, the inputs are first normalized to UX01: -- 0 and L are normalized to 0, 1 and 1 are normalized to 1, U isnt changed, -- all other states are normalized to X. -- Then the classical electric rules are followed. function "and" (l : std_ulogic; r : std_ulogic) return UX01; function "nand" (l : std_ulogic; r : std_ulogic) return UX01; function "or" (l : std_ulogic; r : std_ulogic) return UX01; function "nor" (l : std_ulogic; r : std_ulogic) return UX01; function "xor" (l : std_ulogic; r : std_ulogic) return UX01; function "xnor" (l : std_ulogic; r : std_ulogic) return UX01; function "not" (l : std_ulogic) return UX01; -- Logical operators for vectors. -- An assertion of severity failure fails if the length of L and R aren't -- equal. The result range is 1 to L'Length. function "and" (l, r : std_logic_vector) return std_logic_vector; function "nand" (l, r : std_logic_vector) return std_logic_vector; function "or" (l, r : std_logic_vector) return std_logic_vector; function "nor" (l, r : std_logic_vector) return std_logic_vector; function "xor" (l, r : std_logic_vector) return std_logic_vector; function "xnor" (l, r : std_logic_vector) return std_logic_vector; function "not" (l : std_logic_vector) return std_logic_vector; function "and" (l, r : std_ulogic_vector) return std_ulogic_vector; function "nand" (l, r : std_ulogic_vector) return std_ulogic_vector; function "or" (l, r : std_ulogic_vector) return std_ulogic_vector; function "nor" (l, r : std_ulogic_vector) return std_ulogic_vector; function "xor" (l, r : std_ulogic_vector) return std_ulogic_vector; function "xnor" (l, r : std_ulogic_vector) return std_ulogic_vector; function "not" (l : std_ulogic_vector) return std_ulogic_vector; -- Conversion functions. -- The result range (for vectors) is S'Length - 1 downto 0. -- XMAP is return for values not in '0', '1', 'L', 'H'. function to_bit (s : std_ulogic; xmap : bit := '0') return bit; function to_bitvector (s : std_logic_vector; xmap : bit := '0') return bit_vector; function to_bitvector (s : std_ulogic_vector; xmap : bit := '0') return bit_vector; function to_stdulogic (b : bit) return std_ulogic; function to_stdlogicvector (b : bit_vector) return std_logic_vector; function to_stdlogicvector (s : std_ulogic_vector) return std_logic_vector; function to_stdulogicvector (b : bit_vector) return std_ulogic_vector; function to_stdulogicvector (s : std_logic_vector) return std_ulogic_vector; -- Normalization. -- The result range (for vectors) is 1 to S'Length. function to_X01 (s : std_logic_vector) return std_logic_vector; function to_X01 (s : std_ulogic_vector) return std_ulogic_vector; function to_X01 (s : std_ulogic) return X01; function to_X01 (b : bit_vector) return std_logic_vector; function to_X01 (b : bit_vector) return std_ulogic_vector; function to_X01 (b : bit) return X01; function to_X01Z (s : std_logic_vector) return std_logic_vector; function to_X01Z (s : std_ulogic_vector) return std_ulogic_vector; function to_X01Z (s : std_ulogic) return X01Z; function to_X01Z (b : bit_vector) return std_logic_vector; function to_X01Z (b : bit_vector) return std_ulogic_vector; function to_X01Z (b : bit) return X01Z; function to_UX01 (s : std_logic_vector) return std_logic_vector; function to_UX01 (s : std_ulogic_vector) return std_ulogic_vector; function to_UX01 (s : std_ulogic) return UX01; function to_UX01 (b : bit_vector) return std_logic_vector; function to_UX01 (b : bit_vector) return std_ulogic_vector; function to_UX01 (b : bit) return UX01; -- Edge detection. -- An edge is detected in case of event on s, and X01 normalized value -- rises from 0 to 1 or falls from 1 to 0. function rising_edge (signal s : std_ulogic) return boolean; function falling_edge (signal s : std_ulogic) return boolean; -- Test for unknown. Only 0, 1, L and H are known values. function is_X (s : std_ulogic_vector) return boolean; function is_X (s : std_logic_vector) return boolean; function is_X (s : std_ulogic) return boolean; end std_logic_1164;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1502.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: tc1502.vhd,v 1.2 2001-10-26 16:30:10 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s08b00x00p14n03i01502ent IS END c08s08b00x00p14n03i01502ent; ARCHITECTURE c08s08b00x00p14n03i01502arch OF c08s08b00x00p14n03i01502ent IS BEGIN TESTING: PROCESS type months is (Jan, Feb,Mar); variable x : months; BEGIN case x is when Jan => NULL; when Feb => NULL; when Others => NULL; when Mar => NULL; end case; assert FALSE report "***FAILED TEST: c08s08b00x00p14n03i01502 - The choice OTHERS must be the last alternative in a CASE statement" severity ERROR; wait; END PROCESS TESTING; END c08s08b00x00p14n03i01502arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1262.vhd
4
1693
-- 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: tc1262.vhd,v 1.2 2001-10-26 16:29:39 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s02b00x00p05n03i01262ent IS END c08s02b00x00p05n03i01262ent; ARCHITECTURE c08s02b00x00p05n03i01262arch OF c08s02b00x00p05n03i01262ent IS BEGIN TESTING: PROCESS variable k : integer := 0; BEGIN assert FALSE report "Report this string"; assert FALSE report "***PASSED TEST: c08s02b00x00p05n03i01262 - This test needs manual check to see that default value of the severity level is ERROR." severity NOTE; wait; END PROCESS TESTING; END c08s02b00x00p05n03i01262arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1575.vhd
4
1648
-- 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: tc1575.vhd,v 1.2 2001-10-26 16:30:11 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s10b00x00p04n01i01575ent IS END c08s10b00x00p04n01i01575ent; ARCHITECTURE c08s10b00x00p04n01i01575arch OF c08s10b00x00p04n01i01575ent IS BEGIN TESTING: PROCESS BEGIN L : for i in 1 to 10 loop next L when 5; end loop; assert FALSE report "***FAILED TEST: c08s10b00x00p04n01i01575 - The condition in a next statement has to be of type boolean" severity ERROR; wait; END PROCESS TESTING; END c08s10b00x00p04n01i01575arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1715.vhd
4
1645
-- 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: tc1715.vhd,v 1.2 2001-10-26 16:30:12 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c09s02b00x00p10n01i01715ent IS port (signal max : in natural; signal mox : out natural); END c09s02b00x00p10n01i01715ent; ARCHITECTURE c09s02b00x00p10n01i01715arch OF c09s02b00x00p10n01i01715ent IS BEGIN TESTING: PROCESS(mox) BEGIN assert FALSE report "***FAILED TEST: c09s02b00x00p10n01i01715 - Signal with mode OUT can not be list in sensitivity list." severity ERROR; END PROCESS TESTING; END c09s02b00x00p10n01i01715arch;
gpl-2.0
tgingold/ghdl
testsuite/gna/bug017/for1.vhdl
2
218
entity for1 is end; architecture behav of for1 is begin process begin for i in 1 to 10 loop report "hello"; wait for 1 ns; end loop; report "SUCCESS"; wait; end process; end behav;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/fundamental/adc.vhd
4
2116
-- 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 adc is port ( quantity gain : in voltage; terminal a : electrical; signal clk : in bit; signal d_out : out bit ); end entity adc; architecture ideal of adc is constant ref : real := 5.0; quantity v_in across a; quantity v_amplified : voltage; begin v_amplified == v_in * gain; adc_behavior: process is variable stored_d : bit; begin if clk = '1' then if v_amplified > ref / 2.0 then stored_d := '1'; else stored_d := '0'; end if; end if; d_out <= stored_d after 5 ns; wait on clk; end process adc_behavior; end architecture ideal; architecture struct of adc is terminal a_amplified, ref, half_ref: electrical; quantity v_ref across i_ref through ref; signal d : bit; begin res1 : entity work.resistor(ideal) port map ( ref, half_ref); res2 : entity work.resistor(ideal) port map ( half_ref, electrical_ref ); amp : entity work.vc_amp(ideal) port map ( gain, a, a_amplified ); comp : entity work.comparator(ideal) port map ( a_amplified, half_ref, d); ff : entity work.d_ff(basic) port map ( d, clk, d_out ); v_ref == 5.0; end architecture struct;
gpl-2.0
tgingold/ghdl
testsuite/gna/bug037/vectors.vhdl
2
37508
-- EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*- -- vim: tabstop=2:shiftwidth=2:noexpandtab -- kate: tab-width 2; replace-tabs off; indent-width 2; -- -- ============================================================================ -- Package: Common functions and types -- -- Authors: Thomas B. Preusser -- Martin Zabel -- Patrick Lehmann -- -- Description: -- ------------------------------------ -- For detailed documentation see below. -- -- License: -- ============================================================================ -- Copyright 2007-2014 Technische Universitaet Dresden - Germany -- Chair for VLSI-Design, Diagnostics and Architecture -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- ============================================================================ library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library PoC; use PoC.utils.all; use PoC.strings.all; package vectors is -- ========================================================================== -- Type declarations -- ========================================================================== -- STD_LOGIC_VECTORs subtype T_SLV_2 is STD_LOGIC_VECTOR(1 downto 0); subtype T_SLV_3 is STD_LOGIC_VECTOR(2 downto 0); subtype T_SLV_4 is STD_LOGIC_VECTOR(3 downto 0); subtype T_SLV_8 is STD_LOGIC_VECTOR(7 downto 0); subtype T_SLV_12 is STD_LOGIC_VECTOR(11 downto 0); subtype T_SLV_16 is STD_LOGIC_VECTOR(15 downto 0); subtype T_SLV_24 is STD_LOGIC_VECTOR(23 downto 0); subtype T_SLV_32 is STD_LOGIC_VECTOR(31 downto 0); subtype T_SLV_48 is STD_LOGIC_VECTOR(47 downto 0); subtype T_SLV_64 is STD_LOGIC_VECTOR(63 downto 0); subtype T_SLV_96 is STD_LOGIC_VECTOR(95 downto 0); subtype T_SLV_128 is STD_LOGIC_VECTOR(127 downto 0); subtype T_SLV_256 is STD_LOGIC_VECTOR(255 downto 0); subtype T_SLV_512 is STD_LOGIC_VECTOR(511 downto 0); -- STD_LOGIC_VECTOR_VECTORs -- type T_SLVV is array(NATURAL range <>) of STD_LOGIC_VECTOR; -- VHDL 2008 syntax - not yet supported by Xilinx type T_SLVV_2 is array(NATURAL range <>) of T_SLV_2; type T_SLVV_3 is array(NATURAL range <>) of T_SLV_3; type T_SLVV_4 is array(NATURAL range <>) of T_SLV_4; type T_SLVV_8 is array(NATURAL range <>) of T_SLV_8; type T_SLVV_12 is array(NATURAL range <>) of T_SLV_12; type T_SLVV_16 is array(NATURAL range <>) of T_SLV_16; type T_SLVV_24 is array(NATURAL range <>) of T_SLV_24; type T_SLVV_32 is array(NATURAL range <>) of T_SLV_32; type T_SLVV_48 is array(NATURAL range <>) of T_SLV_48; type T_SLVV_64 is array(NATURAL range <>) of T_SLV_64; type T_SLVV_128 is array(NATURAL range <>) of T_SLV_128; type T_SLVV_256 is array(NATURAL range <>) of T_SLV_256; type T_SLVV_512 is array(NATURAL range <>) of T_SLV_512; -- STD_LOGIC_MATRIXs type T_SLM is array(NATURAL range <>, NATURAL range <>) of STD_LOGIC; -- ATTENTION: -- 1. you MUST initialize your matrix signal with 'Z' to get correct simulation results (iSIM, vSIM, ghdl/gtkwave) -- Example: signal myMatrix : T_SLM(3 downto 0, 7 downto 0) := (others => (others => 'Z')); -- 2. Xilinx iSIM work-around: DON'T use myMatrix'range(n) for n >= 2 -- because: myMatrix'range(2) returns always myMatrix'range(1); tested with ISE/iSIM 14.2 -- USAGE NOTES: -- dimmension 1 => rows - e.g. Words -- dimmension 2 => columns - e.g. Bits/Bytes in a word -- ========================================================================== -- Function declarations -- ========================================================================== -- slicing boundary calulations function low (lenvec : T_POSVEC; index : NATURAL) return NATURAL; function high(lenvec : T_POSVEC; index : NATURAL) return NATURAL; -- Assign procedures: assign_* procedure assign_row(signal slm : out T_SLM; slv : STD_LOGIC_VECTOR; constant RowIndex : NATURAL); -- assign vector to complete row procedure assign_row(signal slm : out T_SLM; slv : STD_LOGIC_VECTOR; constant RowIndex : NATURAL; Position : NATURAL); -- assign short vector to row starting at position procedure assign_row(signal slm : out T_SLM; slv : STD_LOGIC_VECTOR; constant RowIndex : NATURAL; High : NATURAL; Low : NATURAL); -- assign short vector to row in range high:low procedure assign_col(signal slm : out T_SLM; slv : STD_LOGIC_VECTOR; constant ColIndex : NATURAL); -- assign vector to complete column -- ATTENTION: see T_SLM definition for further details and work-arounds -- Matrix to matrix conversion: slm_slice* function slm_slice(slm : T_SLM; RowIndex : NATURAL; ColIndex : NATURAL; Height : NATURAL; Width : NATURAL) return T_SLM; -- get submatrix in boundingbox RowIndex,ColIndex,Height,Width function slm_slice_rows(slm : T_SLM; High : NATURAL; Low : NATURAL) return T_SLM; -- get submatrix / all rows in RowIndex range high:low function slm_slice_cols(slm : T_SLM; High : NATURAL; Low : NATURAL) return T_SLM; -- get submatrix / all columns in ColIndex range high:low -- Matrix concatenation: slm_merge_* function slm_merge_rows(slm1 : T_SLM; slm2 : T_SLM) return T_SLM; function slm_merge_cols(slm1 : T_SLM; slm2 : T_SLM) return T_SLM; -- Matrix to vector conversion: get_* function get_col(slm : T_SLM; ColIndex : NATURAL) return STD_LOGIC_VECTOR; -- get a matrix column function get_row(slm : T_SLM; RowIndex : NATURAL) return STD_LOGIC_VECTOR; -- get a matrix row function get_row(slm : T_SLM; RowIndex : NATURAL; Length : POSITIVE) return STD_LOGIC_VECTOR; -- get a matrix row of defined length [length - 1 downto 0] function get_row(slm : T_SLM; RowIndex : NATURAL; High : NATURAL; Low : NATURAL) return STD_LOGIC_VECTOR; -- get a sub vector of a matrix row at high:low -- Convert to vector: to_slv function to_slv(slvv : T_SLVV_2) return STD_LOGIC_VECTOR; -- convert vector-vector to flatten vector function to_slv(slvv : T_SLVV_4) return STD_LOGIC_VECTOR; -- ... function to_slv(slvv : T_SLVV_8) return STD_LOGIC_VECTOR; -- ... function to_slv(slvv : T_SLVV_12) return STD_LOGIC_VECTOR; -- ... function to_slv(slvv : T_SLVV_16) return STD_LOGIC_VECTOR; -- ... function to_slv(slvv : T_SLVV_24) return STD_LOGIC_VECTOR; -- ... function to_slv(slvv : T_SLVV_32) return STD_LOGIC_VECTOR; -- ... function to_slv(slvv : T_SLVV_64) return STD_LOGIC_VECTOR; -- ... function to_slv(slvv : T_SLVV_128) return STD_LOGIC_VECTOR; -- ... function to_slv(slm : T_SLM) return STD_LOGIC_VECTOR; -- convert matrix to flatten vector -- Convert flat vector to avector-vector: to_slvv_* function to_slvv_4(slv : STD_LOGIC_VECTOR) return T_SLVV_4; -- function to_slvv_8(slv : STD_LOGIC_VECTOR) return T_SLVV_8; -- function to_slvv_12(slv : STD_LOGIC_VECTOR) return T_SLVV_12; -- function to_slvv_16(slv : STD_LOGIC_VECTOR) return T_SLVV_16; -- function to_slvv_32(slv : STD_LOGIC_VECTOR) return T_SLVV_32; -- function to_slvv_64(slv : STD_LOGIC_VECTOR) return T_SLVV_64; -- function to_slvv_128(slv : STD_LOGIC_VECTOR) return T_SLVV_128; -- function to_slvv_256(slv : STD_LOGIC_VECTOR) return T_SLVV_256; -- function to_slvv_512(slv : STD_LOGIC_VECTOR) return T_SLVV_512; -- -- Convert matrix to avector-vector: to_slvv_* function to_slvv_4(slm : T_SLM) return T_SLVV_4; -- function to_slvv_8(slm : T_SLM) return T_SLVV_8; -- function to_slvv_12(slm : T_SLM) return T_SLVV_12; -- function to_slvv_16(slm : T_SLM) return T_SLVV_16; -- function to_slvv_32(slm : T_SLM) return T_SLVV_32; -- function to_slvv_64(slm : T_SLM) return T_SLVV_64; -- function to_slvv_128(slm : T_SLM) return T_SLVV_128; -- function to_slvv_256(slm : T_SLM) return T_SLVV_256; -- function to_slvv_512(slm : T_SLM) return T_SLVV_512; -- -- Convert vector-vector to matrix: to_slm function to_slm(slv : STD_LOGIC_VECTOR; ROWS : POSITIVE; COLS : POSITIVE) return T_SLM; -- create matrix from vector function to_slm(slvv : T_SLVV_4) return T_SLM; -- create matrix from vector-vector function to_slm(slvv : T_SLVV_8) return T_SLM; -- create matrix from vector-vector function to_slm(slvv : T_SLVV_12) return T_SLM; -- create matrix from vector-vector function to_slm(slvv : T_SLVV_16) return T_SLM; -- create matrix from vector-vector function to_slm(slvv : T_SLVV_32) return T_SLM; -- create matrix from vector-vector function to_slm(slvv : T_SLVV_48) return T_SLM; -- create matrix from vector-vector function to_slm(slvv : T_SLVV_64) return T_SLM; -- create matrix from vector-vector function to_slm(slvv : T_SLVV_128) return T_SLM; -- create matrix from vector-vector function to_slm(slvv : T_SLVV_256) return T_SLM; -- create matrix from vector-vector function to_slm(slvv : T_SLVV_512) return T_SLM; -- create matrix from vector-vector -- Change vector direction function dir(slvv : T_SLVV_8) return T_SLVV_8; -- Reverse vector elements function rev(slvv : T_SLVV_4) return T_SLVV_4; function rev(slvv : T_SLVV_8) return T_SLVV_8; function rev(slvv : T_SLVV_12) return T_SLVV_12; function rev(slvv : T_SLVV_16) return T_SLVV_16; function rev(slvv : T_SLVV_32) return T_SLVV_32; function rev(slvv : T_SLVV_64) return T_SLVV_64; function rev(slvv : T_SLVV_128) return T_SLVV_128; function rev(slvv : T_SLVV_256) return T_SLVV_256; function rev(slvv : T_SLVV_512) return T_SLVV_512; -- TODO: function resize(slm : T_SLM; size : POSITIVE) return T_SLM; -- to_string function to_string(slvv : T_SLVV_8; sep : CHARACTER := ':') return STRING; function to_string(slm : T_SLM; groups : POSITIVE := 4; format : CHARACTER := 'b') return STRING; end package vectors; package body vectors is -- slicing boundary calulations -- ========================================================================== function low(lenvec : T_POSVEC; index : NATURAL) return NATURAL is variable pos : NATURAL := 0; begin for i in lenvec'low to index - 1 loop pos := pos + lenvec(i); end loop; return pos; end function; function high(lenvec : T_POSVEC; index : NATURAL) return NATURAL is variable pos : NATURAL := 0; begin for i in lenvec'low to index loop pos := pos + lenvec(i); end loop; return pos - 1; end function; -- Assign procedures: assign_* -- ========================================================================== procedure assign_row(signal slm : out T_SLM; slv : STD_LOGIC_VECTOR; constant RowIndex : NATURAL) is variable temp : STD_LOGIC_VECTOR(slm'high(2) downto slm'low(2)); -- Xilinx iSIM work-around, because 'range(2) evaluates to 'range(1); tested with ISE/iSIM 14.2 begin temp := slv; for i in temp'range loop slm(RowIndex, i) <= temp(i); end loop; end procedure; procedure assign_row(signal slm : out T_SLM; slv : STD_LOGIC_VECTOR; constant RowIndex : NATURAL; Position : NATURAL) is variable temp : STD_LOGIC_VECTOR(Position + slv'length - 1 downto Position); begin temp := slv; for i in temp'range loop slm(RowIndex, i) <= temp(i); end loop; end procedure; procedure assign_row(signal slm : out T_SLM; slv : STD_LOGIC_VECTOR; constant RowIndex : NATURAL; High : NATURAL; Low : NATURAL) is variable temp : STD_LOGIC_VECTOR(High downto Low); begin temp := slv; for i in temp'range loop slm(RowIndex, i) <= temp(i); end loop; end procedure; procedure assign_col(signal slm : out T_SLM; slv : STD_LOGIC_VECTOR; constant ColIndex : NATURAL) is variable temp : STD_LOGIC_VECTOR(slm'range(1)); begin temp := slv; for i in temp'range loop slm(i, ColIndex) <= temp(i); end loop; end procedure; -- Matrix to matrix conversion: slm_slice* -- ========================================================================== function slm_slice(slm : T_SLM; RowIndex : NATURAL; ColIndex : NATURAL; Height : NATURAL; Width : NATURAL) return T_SLM is variable Result : T_SLM(Height - 1 downto 0, Width - 1 downto 0) := (others => (others => '0')); begin for i in 0 to Height - 1 loop for j in 0 to Width - 1 loop Result(i, j) := slm(RowIndex + i, ColIndex + j); end loop; end loop; return Result; end function; function slm_slice_rows(slm : T_SLM; High : NATURAL; Low : NATURAL) return T_SLM is variable Result : T_SLM(High - Low downto 0, slm'length(2) - 1 downto 0) := (others => (others => '0')); begin for i in 0 to High - Low loop for j in 0 to slm'length(2) - 1 loop Result(i, j) := slm(Low + i, slm'low(2) + j); end loop; end loop; return Result; end function; function slm_slice_cols(slm : T_SLM; High : NATURAL; Low : NATURAL) return T_SLM is variable Result : T_SLM(slm'length(1) - 1 downto 0, High - Low downto 0) := (others => (others => '0')); begin for i in 0 to slm'length(1) - 1 loop for j in 0 to High - Low loop Result(i, j) := slm(slm'low(1) + i, Low + j); end loop; end loop; return Result; end function; -- Matrix concatenation: slm_merge_* function slm_merge_rows(slm1 : T_SLM; slm2 : T_SLM) return T_SLM is constant ROWS : POSITIVE := slm1'length(1) + slm2'length(1); constant COLUMNS : POSITIVE := slm1'length(2); variable slm : T_SLM(ROWS - 1 downto 0, COLUMNS - 1 downto 0); begin for i in slm1'range(1) loop for j in slm1'low(2) to slm1'high(2) loop slm(i, j) := slm1(i, j); end loop; end loop; for i in slm2'range(1) loop for j in slm2'low(2) to slm2'high(2) loop slm(slm1'length(1) + i, j) := slm2(i, j); end loop; end loop; return slm; end function; function slm_merge_cols(slm1 : T_SLM; slm2 : T_SLM) return T_SLM is constant ROWS : POSITIVE := slm1'length(1); constant COLUMNS : POSITIVE := slm1'length(2) + slm2'length(2); variable slm : T_SLM(ROWS - 1 downto 0, COLUMNS - 1 downto 0); begin for i in slm1'range(1) loop for j in slm1'low(2) to slm1'high(2) loop slm(i, j) := slm1(i, j); end loop; for j in slm2'low(2) to slm2'high(2) loop slm(i, slm1'length(2) + j) := slm2(i, j); end loop; end loop; return slm; end function; -- Matrix to vector conversion: get_* -- ========================================================================== -- get a matrix column function get_col(slm : T_SLM; ColIndex : NATURAL) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR(slm'range(1)); begin for i in slm'range(1) loop slv(i) := slm(i, ColIndex); end loop; return slv; end function; -- get a matrix row function get_row(slm : T_SLM; RowIndex : NATURAL) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR(slm'high(2) downto slm'low(2)); -- Xilinx iSIM work-around, because 'range(2) = 'range(1); tested with ISE/iSIM 14.2 begin for i in slv'range loop slv(i) := slm(RowIndex, i); end loop; return slv; end function; -- get a matrix row of defined length [length - 1 downto 0] function get_row(slm : T_SLM; RowIndex : NATURAL; Length : POSITIVE) return STD_LOGIC_VECTOR is begin return get_row(slm, RowIndex, (Length - 1), 0); end function; -- get a sub vector of a matrix row at high:low function get_row(slm : T_SLM; RowIndex : NATURAL; High : NATURAL; Low : NATURAL) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR(High downto Low); -- Xilinx iSIM work-around, because 'range(2) = 'range(1); tested with ISE/iSIM 14.2 begin for i in slv'range loop slv(i) := slm(RowIndex, i); end loop; return slv; end function; -- Convert to vector: to_slv -- ========================================================================== -- convert vector-vector to flatten vector function to_slv(slvv : T_SLVV_2) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR((slvv'length * 2) - 1 downto 0); begin for i in slvv'range loop slv((i * 2) + 1 downto (i * 2)) := slvv(i); end loop; return slv; end function; function to_slv(slvv : T_SLVV_4) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR((slvv'length * 4) - 1 downto 0); begin for i in slvv'range loop slv((i * 4) + 3 downto (i * 4)) := slvv(i); end loop; return slv; end function; function to_slv(slvv : T_SLVV_8) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR((slvv'length * 8) - 1 downto 0); begin for i in slvv'range loop slv((i * 8) + 7 downto (i * 8)) := slvv(i); end loop; return slv; end function; function to_slv(slvv : T_SLVV_12) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR((slvv'length * 12) - 1 downto 0); begin for i in slvv'range loop slv((i * 12) + 11 downto (i * 12)) := slvv(i); end loop; return slv; end function; function to_slv(slvv : T_SLVV_16) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR((slvv'length * 16) - 1 downto 0); begin for i in slvv'range loop slv((i * 16) + 15 downto (i * 16)) := slvv(i); end loop; return slv; end function; function to_slv(slvv : T_SLVV_24) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR((slvv'length * 24) - 1 downto 0); begin for i in slvv'range loop slv((i * 24) + 23 downto (i * 24)) := slvv(i); end loop; return slv; end function; function to_slv(slvv : T_SLVV_32) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR((slvv'length * 32) - 1 downto 0); begin for i in slvv'range loop slv((i * 32) + 31 downto (i * 32)) := slvv(i); end loop; return slv; end function; function to_slv(slvv : T_SLVV_64) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR((slvv'length * 64) - 1 downto 0); begin for i in slvv'range loop slv((i * 64) + 63 downto (i * 64)) := slvv(i); end loop; return slv; end function; function to_slv(slvv : T_SLVV_128) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR((slvv'length * 128) - 1 downto 0); begin for i in slvv'range loop slv((i * 128) + 127 downto (i * 128)) := slvv(i); end loop; return slv; end function; -- convert matrix to flatten vector function to_slv(slm : T_SLM) return STD_LOGIC_VECTOR is variable slv : STD_LOGIC_VECTOR((slm'length(1) * slm'length(2)) - 1 downto 0); begin for i in slm'range(1) loop for j in slm'high(2) downto slm'low(2) loop -- Xilinx iSIM work-around, because 'range(2) evaluates to 'range(1); tested with ISE/iSIM 14.2 slv((i * slm'length(2)) + j) := slm(i, j); end loop; end loop; return slv; end function; -- Convert flat vector to a vector-vector: to_slvv_* -- ========================================================================== -- create vector-vector from vector (4 bit) function to_slvv_4(slv : STD_LOGIC_VECTOR) return T_SLVV_4 is variable Result : T_SLVV_4((slv'length / 4) - 1 downto 0); begin if ((slv'length mod 4) /= 0) then report "to_slvv_4: width mismatch - slv'length is no multiple of 4 (slv'length=" & INTEGER'image(slv'length) & ")" severity FAILURE; end if; for i in Result'range loop Result(i) := slv((i * 4) + 3 downto (i * 4)); end loop; return Result; end function; -- create vector-vector from vector (8 bit) function to_slvv_8(slv : STD_LOGIC_VECTOR) return T_SLVV_8 is variable Result : T_SLVV_8((slv'length / 8) - 1 downto 0); begin if ((slv'length mod 8) /= 0) then report "to_slvv_8: width mismatch - slv'length is no multiple of 8 (slv'length=" & INTEGER'image(slv'length) & ")" severity FAILURE; end if; for i in Result'range loop Result(i) := slv((i * 8) + 7 downto (i * 8)); end loop; return Result; end function; -- create vector-vector from vector (12 bit) function to_slvv_12(slv : STD_LOGIC_VECTOR) return T_SLVV_12 is variable Result : T_SLVV_12((slv'length / 12) - 1 downto 0); begin if ((slv'length mod 12) /= 0) then report "to_slvv_12: width mismatch - slv'length is no multiple of 12 (slv'length=" & INTEGER'image(slv'length) & ")" severity FAILURE; end if; for i in Result'range loop Result(i) := slv((i * 12) + 11 downto (i * 12)); end loop; return Result; end function; -- create vector-vector from vector (16 bit) function to_slvv_16(slv : STD_LOGIC_VECTOR) return T_SLVV_16 is variable Result : T_SLVV_16((slv'length / 16) - 1 downto 0); begin if ((slv'length mod 16) /= 0) then report "to_slvv_16: width mismatch - slv'length is no multiple of 16 (slv'length=" & INTEGER'image(slv'length) & ")" severity FAILURE; end if; for i in Result'range loop Result(i) := slv((i * 16) + 15 downto (i * 16)); end loop; return Result; end function; -- create vector-vector from vector (32 bit) function to_slvv_32(slv : STD_LOGIC_VECTOR) return T_SLVV_32 is variable Result : T_SLVV_32((slv'length / 32) - 1 downto 0); begin if ((slv'length mod 32) /= 0) then report "to_slvv_32: width mismatch - slv'length is no multiple of 32 (slv'length=" & INTEGER'image(slv'length) & ")" severity FAILURE; end if; for i in Result'range loop Result(i) := slv((i * 32) + 31 downto (i * 32)); end loop; return Result; end function; -- create vector-vector from vector (64 bit) function to_slvv_64(slv : STD_LOGIC_VECTOR) return T_SLVV_64 is variable Result : T_SLVV_64((slv'length / 64) - 1 downto 0); begin if ((slv'length mod 64) /= 0) then report "to_slvv_64: width mismatch - slv'length is no multiple of 64 (slv'length=" & INTEGER'image(slv'length) & ")" severity FAILURE; end if; for i in Result'range loop Result(i) := slv((i * 64) + 63 downto (i * 64)); end loop; return Result; end function; -- create vector-vector from vector (128 bit) function to_slvv_128(slv : STD_LOGIC_VECTOR) return T_SLVV_128 is variable Result : T_SLVV_128((slv'length / 128) - 1 downto 0); begin if ((slv'length mod 128) /= 0) then report "to_slvv_128: width mismatch - slv'length is no multiple of 128 (slv'length=" & INTEGER'image(slv'length) & ")" severity FAILURE; end if; for i in Result'range loop Result(i) := slv((i * 128) + 127 downto (i * 128)); end loop; return Result; end function; -- create vector-vector from vector (256 bit) function to_slvv_256(slv : STD_LOGIC_VECTOR) return T_SLVV_256 is variable Result : T_SLVV_256((slv'length / 256) - 1 downto 0); begin if ((slv'length mod 256) /= 0) then report "to_slvv_256: width mismatch - slv'length is no multiple of 256 (slv'length=" & INTEGER'image(slv'length) & ")" severity FAILURE; end if; for i in Result'range loop Result(i) := slv((i * 256) + 255 downto (i * 256)); end loop; return Result; end function; -- create vector-vector from vector (512 bit) function to_slvv_512(slv : STD_LOGIC_VECTOR) return T_SLVV_512 is variable Result : T_SLVV_512((slv'length / 512) - 1 downto 0); begin if ((slv'length mod 512) /= 0) then report "to_slvv_512: width mismatch - slv'length is no multiple of 512 (slv'length=" & INTEGER'image(slv'length) & ")" severity FAILURE; end if; for i in Result'range loop Result(i) := slv((i * 512) + 511 downto (i * 512)); end loop; return Result; end function; -- Convert matrix to avector-vector: to_slvv_* -- ========================================================================== -- create vector-vector from matrix (4 bit) function to_slvv_4(slm : T_SLM) return T_SLVV_4 is variable Result : T_SLVV_4(slm'range(1)); begin if (slm'length(2) /= 4) then report "to_slvv_4: type mismatch - slm'length(2)=" & INTEGER'image(slm'length(2)) severity FAILURE; end if; for i in slm'range(1) loop Result(i) := get_row(slm, i); end loop; return Result; end function; -- create vector-vector from matrix (8 bit) function to_slvv_8(slm : T_SLM) return T_SLVV_8 is variable Result : T_SLVV_8(slm'range(1)); begin if (slm'length(2) /= 8) then report "to_slvv_8: type mismatch - slm'length(2)=" & INTEGER'image(slm'length(2)) severity FAILURE; end if; for i in slm'range(1) loop Result(i) := get_row(slm, i); end loop; return Result; end function; -- create vector-vector from matrix (12 bit) function to_slvv_12(slm : T_SLM) return T_SLVV_12 is variable Result : T_SLVV_12(slm'range(1)); begin if (slm'length(2) /= 12) then report "to_slvv_12: type mismatch - slm'length(2)=" & INTEGER'image(slm'length(2)) severity FAILURE; end if; for i in slm'range(1) loop Result(i) := get_row(slm, i); end loop; return Result; end function; -- create vector-vector from matrix (16 bit) function to_slvv_16(slm : T_SLM) return T_SLVV_16 is variable Result : T_SLVV_16(slm'range(1)); begin if (slm'length(2) /= 16) then report "to_slvv_16: type mismatch - slm'length(2)=" & INTEGER'image(slm'length(2)) severity FAILURE; end if; for i in slm'range(1) loop Result(i) := get_row(slm, i); end loop; return Result; end function; -- create vector-vector from matrix (32 bit) function to_slvv_32(slm : T_SLM) return T_SLVV_32 is variable Result : T_SLVV_32(slm'range(1)); begin if (slm'length(2) /= 32) then report "to_slvv_32: type mismatch - slm'length(2)=" & INTEGER'image(slm'length(2)) severity FAILURE; end if; for i in slm'range(1) loop Result(i) := get_row(slm, i); end loop; return Result; end function; -- create vector-vector from matrix (64 bit) function to_slvv_64(slm : T_SLM) return T_SLVV_64 is variable Result : T_SLVV_64(slm'range(1)); begin if (slm'length(2) /= 64) then report "to_slvv_64: type mismatch - slm'length(2)=" & INTEGER'image(slm'length(2)) severity FAILURE; end if; for i in slm'range(1) loop Result(i) := get_row(slm, i); end loop; return Result; end function; -- create vector-vector from matrix (128 bit) function to_slvv_128(slm : T_SLM) return T_SLVV_128 is variable Result : T_SLVV_128(slm'range(1)); begin if (slm'length(2) /= 128) then report "to_slvv_128: type mismatch - slm'length(2)=" & INTEGER'image(slm'length(2)) severity FAILURE; end if; for i in slm'range(1) loop Result(i) := get_row(slm, i); end loop; return Result; end function; -- create vector-vector from matrix (256 bit) function to_slvv_256(slm : T_SLM) return T_SLVV_256 is variable Result : T_SLVV_256(slm'range); begin if (slm'length(2) /= 256) then report "to_slvv_256: type mismatch - slm'length(2)=" & INTEGER'image(slm'length(2)) severity FAILURE; end if; for i in slm'range loop Result(i) := get_row(slm, i); end loop; return Result; end function; -- create vector-vector from matrix (512 bit) function to_slvv_512(slm : T_SLM) return T_SLVV_512 is variable Result : T_SLVV_512(slm'range(1)); begin if (slm'length(2) /= 512) then report "to_slvv_512: type mismatch - slm'length(2)=" & INTEGER'image(slm'length(2)) severity FAILURE; end if; for i in slm'range(1) loop Result(i) := get_row(slm, i); end loop; return Result; end function; -- Convert vector-vector to matrix: to_slm -- ========================================================================== -- create matrix from vector function to_slm(slv : STD_LOGIC_VECTOR; ROWS : POSITIVE; COLS : POSITIVE) return T_SLM is variable slm : T_SLM(ROWS - 1 downto 0, COLS - 1 downto 0); begin for i in 0 to ROWS - 1 loop for j in 0 to COLS - 1 loop slm(i, j) := slv((i * COLS) + j); end loop; end loop; return slm; end function; -- create matrix from vector-vector function to_slm(slvv : T_SLVV_4) return T_SLM is variable slm : T_SLM(slvv'range, 3 downto 0); begin for i in slvv'range loop for j in T_SLV_4'range loop slm(i, j) := slvv(i)(j); end loop; end loop; return slm; end function; function to_slm(slvv : T_SLVV_8) return T_SLM is -- variable test : STD_LOGIC_VECTOR(T_SLV_8'range); -- variable slm : T_SLM(slvv'range, test'range); -- BUG: iSIM 14.5 cascaded 'range accesses let iSIM break down -- variable slm : T_SLM(slvv'range, T_SLV_8'range); -- BUG: iSIM 14.5 allocates 9 bits in dimmension 2 variable slm : T_SLM(slvv'range, 7 downto 0); begin -- report "slvv: slvv.length=" & INTEGER'image(slvv'length) & " slm.dim0.length=" & INTEGER'image(slm'length(1)) & " slm.dim1.length=" & INTEGER'image(slm'length(2)) severity NOTE; -- report "T_SLV_8: .length=" & INTEGER'image(T_SLV_8'length) & " .high=" & INTEGER'image(T_SLV_8'high) & " .low=" & INTEGER'image(T_SLV_8'low) severity NOTE; -- report "test: test.length=" & INTEGER'image(test'length) & " .high=" & INTEGER'image(test'high) & " .low=" & INTEGER'image(test'low) severity NOTE; for i in slvv'range loop for j in T_SLV_8'range loop slm(i, j) := slvv(i)(j); end loop; end loop; return slm; end function; function to_slm(slvv : T_SLVV_12) return T_SLM is variable slm : T_SLM(slvv'range, 11 downto 0); begin for i in slvv'range loop for j in T_SLV_12'range loop slm(i, j) := slvv(i)(j); end loop; end loop; return slm; end function; function to_slm(slvv : T_SLVV_16) return T_SLM is variable slm : T_SLM(slvv'range, 15 downto 0); begin for i in slvv'range loop for j in T_SLV_16'range loop slm(i, j) := slvv(i)(j); end loop; end loop; return slm; end function; function to_slm(slvv : T_SLVV_32) return T_SLM is variable slm : T_SLM(slvv'range, 31 downto 0); begin for i in slvv'range loop for j in T_SLV_32'range loop slm(i, j) := slvv(i)(j); end loop; end loop; return slm; end function; function to_slm(slvv : T_SLVV_48) return T_SLM is variable slm : T_SLM(slvv'range, 47 downto 0); begin for i in slvv'range loop for j in T_SLV_48'range loop slm(i, j) := slvv(i)(j); end loop; end loop; return slm; end function; function to_slm(slvv : T_SLVV_64) return T_SLM is variable slm : T_SLM(slvv'range, 63 downto 0); begin for i in slvv'range loop for j in T_SLV_64'range loop slm(i, j) := slvv(i)(j); end loop; end loop; return slm; end function; function to_slm(slvv : T_SLVV_128) return T_SLM is variable slm : T_SLM(slvv'range, 127 downto 0); begin for i in slvv'range loop for j in T_SLV_128'range loop slm(i, j) := slvv(i)(j); end loop; end loop; return slm; end function; function to_slm(slvv : T_SLVV_256) return T_SLM is variable slm : T_SLM(slvv'range, 255 downto 0); begin for i in slvv'range loop for j in T_SLV_256'range loop slm(i, j) := slvv(i)(j); end loop; end loop; return slm; end function; function to_slm(slvv : T_SLVV_512) return T_SLM is variable slm : T_SLM(slvv'range, 511 downto 0); begin for i in slvv'range loop for j in T_SLV_512'range loop slm(i, j) := slvv(i)(j); end loop; end loop; return slm; end function; -- Change vector direction -- ========================================================================== function dir(slvv : T_SLVV_8) return T_SLVV_8 is variable Result : T_SLVV_8(slvv'reverse_range); begin Result := slvv; return Result; end function; -- Reverse vector elements function rev(slvv : T_SLVV_4) return T_SLVV_4 is variable Result : T_SLVV_4(slvv'range); begin for i in slvv'low to slvv'high loop Result(slvv'high - i) := slvv(i); end loop; return Result; end function; function rev(slvv : T_SLVV_8) return T_SLVV_8 is variable Result : T_SLVV_8(slvv'range); begin for i in slvv'low to slvv'high loop Result(slvv'high - i) := slvv(i); end loop; return Result; end function; function rev(slvv : T_SLVV_12) return T_SLVV_12 is variable Result : T_SLVV_12(slvv'range); begin for i in slvv'low to slvv'high loop Result(slvv'high - i) := slvv(i); end loop; return Result; end function; function rev(slvv : T_SLVV_16) return T_SLVV_16 is variable Result : T_SLVV_16(slvv'range); begin for i in slvv'low to slvv'high loop Result(slvv'high - i) := slvv(i); end loop; return Result; end function; function rev(slvv : T_SLVV_32) return T_SLVV_32 is variable Result : T_SLVV_32(slvv'range); begin for i in slvv'low to slvv'high loop Result(slvv'high - i) := slvv(i); end loop; return Result; end function; function rev(slvv : T_SLVV_64) return T_SLVV_64 is variable Result : T_SLVV_64(slvv'range); begin for i in slvv'low to slvv'high loop Result(slvv'high - i) := slvv(i); end loop; return Result; end function; function rev(slvv : T_SLVV_128) return T_SLVV_128 is variable Result : T_SLVV_128(slvv'range); begin for i in slvv'low to slvv'high loop Result(slvv'high - i) := slvv(i); end loop; return Result; end function; function rev(slvv : T_SLVV_256) return T_SLVV_256 is variable Result : T_SLVV_256(slvv'range); begin for i in slvv'low to slvv'high loop Result(slvv'high - i) := slvv(i); end loop; return Result; end function; function rev(slvv : T_SLVV_512) return T_SLVV_512 is variable Result : T_SLVV_512(slvv'range); begin for i in slvv'low to slvv'high loop Result(slvv'high - i) := slvv(i); end loop; return Result; end function; -- Resize functions -- ========================================================================== -- Resizes the vector to the specified length. Input vectors larger than the specified size are truncated from the left side. Smaller input -- vectors are extended on the left by the provided fill value (default: '0'). Use the resize functions of the numeric_std package for -- value-preserving resizes of the signed and unsigned data types. function resize(slm : T_SLM; size : POSITIVE) return T_SLM is variable Result : T_SLM(size - 1 downto 0, slm'high(2) downto slm'low(2)) := (others => (others => '0')); begin for i in slm'range(1) loop for j in slm'high(2) downto slm'low(2) loop Result(i, j) := slm(i, j); end loop; end loop; return Result; end function; function to_string(slvv : T_SLVV_8; sep : CHARACTER := ':') return STRING is constant hex_len : POSITIVE := ite((sep = C_POC_NUL), (slvv'length * 2), (slvv'length * 3) - 1); variable Result : STRING(1 to hex_len) := (others => sep); variable pos : POSITIVE := 1; begin for i in slvv'range loop Result(pos to pos + 1) := to_string(slvv(i), 'h'); pos := pos + ite((sep = C_POC_NUL), 2, 3); end loop; return Result; end function; function to_string_bin(slm : T_SLM; groups : POSITIVE := 4; format : CHARACTER := 'h') return STRING is variable PerLineOverheader : POSITIVE := div_ceil(slm'length(2), groups); variable Result : STRING(1 to (slm'length(1) * (slm'length(2) + PerLineOverheader)) + 10); variable Writer : POSITIVE; variable GroupCounter : NATURAL; begin Result := (others => C_POC_NUL); Result(1) := LF; Writer := 2; GroupCounter := 0; for i in slm'low(1) to slm'high(1) loop for j in slm'high(2) downto slm'low(2) loop Result(Writer) := to_char(slm(i, j)); Writer := Writer + 1; GroupCounter := GroupCounter + 1; if (GroupCounter = groups) then Result(Writer) := ' '; Writer := Writer + 1; GroupCounter := 0; end if; end loop; Result(Writer - 1) := LF; GroupCounter := 0; end loop; return str_trim(Result); end function; function to_string(slm : T_SLM; groups : POSITIVE := 4; format : CHARACTER := 'b') return STRING is begin if (format = 'b') then return to_string_bin(slm, groups); else return "Format not supported."; end if; end function; end package body;
gpl-2.0
tgingold/ghdl
testsuite/gna/bug084/func_test3.vhdl
1
1085
entity func_test3 is generic (NBITS: natural := 6); end entity; architecture fum of func_test3 is type remains is (r0, r1, r2, r3, r4); -- remainder values function mod5 (dividend: bit_vector) return boolean is type remain_array is array (NBITS downto 0) of remains; type branch is array (remains, bit) of remains; constant br_table: branch := ( r0 => ('0' => r0, '1' => r1), r1 => ('0' => r2, '1' => r3), r2 => ('0' => r4, '1' => r0), r3 => ('0' => r1, '1' => r2), r4 => ('0' => r3, '1' => r4) ); variable remaind: remains := r0; variable tbit: bit_vector (NBITS - 1 downto 0) := dividend; begin for i in dividend'length - 1 downto 0 loop remaind := br_table(remaind,tbit(i)); end loop; return remaind = r0; end function; begin assert mod5("101000"); end architecture;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/digital-modeling/inline_06.vhd
4
1593
-- 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_06 is end entity inline_06; ---------------------------------------------------------------- architecture test of inline_06 is signal y : bit := '0'; signal or_a_b : bit := '0'; signal clk : bit := '0'; begin process_3_a : process is begin -- code from book: y <= not or_a_b after 5 ns; -- end of code from book wait on or_a_b; end process process_3_a; stimulus_3_a : process is begin or_a_b <= '1' after 20 ns, '0' after 40 ns; wait; end process stimulus_3_a; process_3_b : process is constant T_pw : delay_length := 10 ns; begin -- code from book: clk <= '1' after T_pw, '0' after 2*T_pw; -- end of code from book wait for 2*T_pw; end process process_3_b; end architecture test;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc755.vhd
4
57757
-- 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: tc755.vhd,v 1.2 2001-10-26 16:30:00 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c01s01b01x01p05n02i00755ent IS generic( zero : integer := 0; one : integer := 1; two : integer := 2; three: integer := 3; four : integer := 4; five : integer := 5; six : integer := 6; seven: integer := 7; eight: integer := 8; nine : integer := 9; fifteen:integer:= 15; C1 : boolean := true; C2 : bit := '1'; C3 : character := 's'; C4 : severity_level := note; C5 : integer := 3; C6 : real := 3.0; C7 : time := 3 ns; C8 : natural := 1; C9 : positive := 1; C10 : string := "shishir"; C11 : bit_vector := B"0011" ); END c01s01b01x01p05n02i00755ent; ARCHITECTURE c01s01b01x01p05n02i00755arch OF c01s01b01x01p05n02i00755ent IS subtype hi_to_low_range is integer range zero to seven; 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; subtype boolean_vector_st is boolean_vector(zero to fifteen); subtype severity_level_vector_st is severity_level_vector(zero to fifteen); subtype integer_vector_st is integer_vector(zero to fifteen); subtype real_vector_st is real_vector(zero to fifteen); subtype time_vector_st is time_vector(zero to fifteen); subtype natural_vector_st is natural_vector(zero to fifteen); subtype positive_vector_st is positive_vector(zero to fifteen); type boolean_cons_vector is array (fifteen downto zero) of boolean; type severity_level_cons_vector is array (fifteen downto zero) of severity_level; type integer_cons_vector is array (fifteen downto zero) of integer; type real_cons_vector is array (fifteen downto zero) of real; type time_cons_vector is array (fifteen downto zero) of time; type natural_cons_vector is array (fifteen downto zero) of natural; type positive_cons_vector is array (fifteen downto zero) of positive; type boolean_cons_vectorofvector is array (zero to fifteen) of boolean_cons_vector; type severity_level_cons_vectorofvector is array (zero to fifteen) of severity_level_cons_vector; type integer_cons_vectorofvector is array (zero to fifteen) of integer_cons_vector ; type real_cons_vectorofvector is array (zero to fifteen) of real_cons_vector; type time_cons_vectorofvector is array (zero to fifteen) of time_cons_vector; type natural_cons_vectorofvector is array (zero to fifteen) of natural_cons_vector; type positive_cons_vectorofvector is array (zero to fifteen) of positive_cons_vector; 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; j:string(one to seven); k:bit_vector(zero to three); 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_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_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_new is record a:boolean_vector(zero to fifteen); b:severity_level_vector(zero to fifteen); c:integer_vector(zero to fifteen); d:real_vector(zero to fifteen); e:time_vector(zero to fifteen); f:natural_vector(zero to fifteen); g:positive_vector(zero to fifteen); end record; type record_of_records is record a: record_std_package; c: record_cons_array; g: record_cons_arrayofarray; i: record_array_st; j: record_array_new; end record; subtype boolean_vector_range is boolean_vector(hi_to_low_range); subtype severity_level_vector_range is severity_level_vector(hi_to_low_range); subtype integer_vector_range is integer_vector(hi_to_low_range); subtype real_vector_range is real_vector(hi_to_low_range); subtype time_vector_range is time_vector(hi_to_low_range); subtype natural_vector_range is natural_vector(hi_to_low_range); subtype positive_vector_range is positive_vector(hi_to_low_range); type array_rec_std is array (integer range <>) of record_std_package; type array_rec_cons is array (integer range <>) of record_cons_array; type array_rec_rec is array (integer range <>) of record_of_records; subtype array_rec_std_st is array_rec_std (hi_to_low_range); subtype array_rec_cons_st is array_rec_cons (hi_to_low_range); subtype array_rec_rec_st is array_rec_rec (hi_to_low_range); type record_of_arr_of_record is record a: array_rec_std(zero to seven); b: array_rec_cons(zero to seven); c: array_rec_rec(zero to seven); end record; type current is range -2147483647 to +2147483647 units nA; uA = 1000 nA; mA = 1000 uA; A = 1000 mA; end units; type current_vector is array (natural range <>) of current; subtype current_vector_range is current_vector(hi_to_low_range); type resistance is range -2147483647 to +2147483647 units uOhm; mOhm = 1000 uOhm; Ohm = 1000 mOhm; KOhm = 1000 Ohm; end units; type resistance_vector is array (natural range <>) of resistance; subtype resistance_vector_range is resistance_vector(hi_to_low_range); type byte is array(zero to seven) of bit; subtype word is bit_vector(zero to fifteen); --constrained array constant size :integer := seven; type primary_memory is array(zero to size) of word; --array of an array type primary_memory_module is --record with field record --as an array enable:bit; memory_number:primary_memory; end record; type whole_memory is array(0 to size) of primary_memory_module; --array of a complex record subtype delay is integer range one to 10; constant C12 : boolean_vector := (C1,false); constant C13 : severity_level_vector := (C4,error); constant C14 : integer_vector := (one,two,three,four); constant C15 : real_vector := (1.0,2.0,C6,4.0); constant C16 : time_vector := (1 ns, 2 ns,C7, 4 ns); constant C17 : natural_vector := (one,2,3,4); constant C18 : positive_vector := (one,2,3,4); 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 C50 : record_std_package := (C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11); constant C51 : record_cons_array := (C19,C20,C21,C22,C23,C24,C25); 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 C54a : record_array_st := (C70,C71,C72,C73,C74,C75,C76); constant C54b : record_array_new:= (C70,C71,C72,C73,C74,C75,C76); constant C55 : record_of_records := (C50,C51,C53,C77,C54b); constant C60 : byte := (others => '0'); constant C61 : word := (others =>'0' ); constant C64 : primary_memory := (others => C61); constant C65 : primary_memory_module := ('1',C64); constant C66 : whole_memory := (others => C65); constant C67 : current := 1 A; constant C68 : resistance := 1 Ohm; constant C69 : delay := 2; constant C78 : boolean_vector_range := (others => C1); constant C79 : severity_level_vector_range := (others => C4) ; constant C80 : integer_vector_range :=(others => C5) ; constant C81 : real_vector_range :=(others => C6); constant C82 : time_vector_range :=(others => C7); constant C83 : natural_vector_range :=(others => C8); constant C84 : positive_vector_range :=(others => C9); constant C85 : array_rec_std(0 to 7) :=(others => C50) ; constant C86 : array_rec_cons (0 to 7) :=(others => C51); constant C88 : array_rec_rec(0 to 7) :=(others => C55); constant C102 : record_of_arr_of_record:= (C85,C86,C88); signal S1 : boolean_vector(zero to fifteen); signal S2 : severity_level_vector(zero to fifteen); signal S3 : integer_vector(zero to fifteen); signal S4 : real_vector(zero to fifteen); signal S5 : time_vector (zero to fifteen); signal S6 : natural_vector(zero to fifteen); signal S7 : positive_vector(zero to fifteen); signal S8 : boolean_cons_vector; signal S9 : severity_level_cons_vector ; signal S10 : integer_cons_vector; signal S11 : real_cons_vector; signal S12 : time_cons_vector ; signal S13 : natural_cons_vector ; signal S14 : positive_cons_vector ; signal S15 : boolean_cons_vectorofvector; signal S16 : severity_level_cons_vectorofvector; signal S17 : integer_cons_vectorofvector; signal S18 : real_cons_vectorofvector; signal S19 : time_cons_vectorofvector; signal S20 : natural_cons_vectorofvector; signal S21 : positive_cons_vectorofvector; signal S22 : record_std_package; signal S23 : record_cons_array; signal S24 : record_cons_arrayofarray ; signal S25 : boolean_vector_st; signal S26 : severity_level_vector_st; signal S27 : integer_vector_st; signal S28 : real_vector_st; signal S29 : time_vector_st; signal S30 : natural_vector_st; signal S31 : positive_vector_st; signal S32 : record_array_st; signal S33 : record_array_st; signal S34 : record_array_new; signal S35 : record_of_records; signal S36 : byte; signal S37 : word; signal S38 : current_vector(zero to three); signal S39 : resistance_vector(zero to three); signal S40 : delay; signal S41 : boolean_vector_range; signal S42 : severity_level_vector_range ; signal S43 : integer_vector_range ; signal S44 : real_vector_range ; signal S45 : time_vector_range ; signal S46 : natural_vector_range ; signal S47 : positive_vector_range ; signal S48 : array_rec_std(zero to seven); signal S49 : array_rec_cons(zero to seven); signal S50 : array_rec_rec(zero to seven); signal S51 : record_of_arr_of_record; BEGIN assert (S1'left = 0) report " boolean_vector(zero to fifteen) error in the left generic value" severity error; assert (S2'left = 0) report " severity_level_vector(zero to fifteen) error in the left generic value" severity error; assert (S3'left = 0) report " integer_vector(zero to fifteen) error in the left generic value" severity error; assert (S4'left = 0) report " real_vector(zero to fifteen) error in the left generic value" severity error; assert (S5'left = 0) report " time_vector (zero to fifteen) error in the left generic value" severity error; assert (S6'left = 0) report " natural_vector(zero to fifteen) error in the left generic value" severity error; assert (S7'left = 0) report " positive_vector(zero to fifteen) error in the left generic value" severity error; assert (S8'left = 15) report " boolean_cons_vector error in the left generic value" severity error; assert (S9'left = 15) report " severity_level_cons_vector error in the left generic value" severity error; assert (S10'left = 15) report " integer_cons_vector error in the left generic value" severity error; assert (S11'left = 15) report " real_cons_vector error in the left generic value" severity error; assert (S12'left = 15) report " time_cons_vector error in the left generic value" severity error; assert (S13'left = 15) report " natural_cons_vector error in the left generic value" severity error; assert (S14'left = 15) report " positive_cons_vector error in the left generic value" severity error; assert (S15'left = 0) report " boolean_cons_vectorofvector error in the left generic value" severity error; assert (S16'left = 0) report " severity_level_cons_vectorofvector error in the left generic value" severity error; assert (S17'left = 0) report " integer_cons_vectorofvector error in the left generic value" severity error; assert (S18'left = 0) report " real_cons_vectorofvector error in the left generic value" severity error; assert (S19'left = 0) report " time_cons_vectorofvector error in the left generic value" severity error; assert (S20'left = 0) report " natural_cons_vectorofvector error in the left generic value" severity error; assert (S21'left = 0) report " positive_cons_vectorofvector error in the left generic value" severity error; assert (S22.j'left = 1) report " record_std_package error in the left generic value" severity error; assert (S22.k'left = 0) report " record_std_package error in the left generic value" severity error; assert (S23.a'left = 15) report " record_cons_array error in the left generic value" severity error; assert (S23.b'left = 15) report " record_cons_array error in the left generic value" severity error; assert (S23.c'left = 15) report " record_cons_array error in the left generic value" severity error; assert (S23.d'left = 15) report " record_cons_array error in the left generic value" severity error; assert (S23.e'left = 15) report " record_cons_array error in the left generic value" severity error; assert (S23.f'left = 15) report " record_cons_array error in the left generic value" severity error; assert (S23.g'left = 15) report " record_cons_array error in the left generic value" severity error; assert (S24.a'left = 0) report " record_cons_arrayofarray error in the left generic value" severity error; assert (S24.b'left = 0) report " record_cons_arrayofarray error in the left generic value" severity error; assert (S24.c'left = 0) report " record_cons_arrayofarray error in the left generic value" severity error; assert (S24.d'left = 0) report " record_cons_arrayofarray error in the left generic value" severity error; assert (S24.e'left = 0) report " record_cons_arrayofarray error in the left generic value" severity error; assert (S24.f'left = 0) report " record_cons_arrayofarray error in the left generic value" severity error; assert (S24.g'left = 0) report " record_cons_arrayofarray error in the left generic value" severity error; assert (S25'left = 0) report " boolean_vector_st error in the left generic value" severity error; assert (S26'left = 0) report " severity_level_vector_st error in the left generic value" severity error; assert (S27'left = 0) report " integer_vector_st error in the left generic value" severity error; assert (S28'left = 0) report " real_vector_st error in the left generic value" severity error; assert (S29'left = 0) report " time_vector_st error in the left generic value" severity error; assert (S30'left = 0) report " natural_vector_st error in the left generic value" severity error; assert (S31'left = 0) report " positive_vector_st error in the left generic value" severity error; assert (S32.a'left = 0) report " record_array_st error in the left generic value" severity error; assert (S32.b'left = 0) report " record_array_st error in the left generic value" severity error; assert (S32.c'left = 0) report " record_array_st error in the left generic value" severity error; assert (S32.d'left = 0) report " record_array_st error in the left generic value" severity error; assert (S32.e'left = 0) report " record_array_st error in the left generic value" severity error; assert (S32.f'left = 0) report " record_array_st error in the left generic value" severity error; assert (S32.g'left = 0) report " record_array_st error in the left generic value" severity error; assert (S34.a'left = 0) report " record_array_new error in the left generic value" severity error; assert (S34.b'left = 0) report " record_array_new error in the left generic value" severity error; assert (S34.c'left = 0) report " record_array_new error in the left generic value" severity error; assert (S34.d'left = 0) report " record_array_new error in the left generic value" severity error; assert (S34.e'left = 0) report " record_array_new error in the left generic value" severity error; assert (S34.f'left = 0) report " record_array_new error in the left generic value" severity error; assert (S34.g'left = 0) report " record_array_new error in the left generic value" severity error; assert (S36'left = 0) report " byte error in the left generic value" severity error; assert (S37'left = 0) report " word error in the left generic value" severity error; assert (S38'left = 0) report " current_vector(zero to three) error in the left generic value" severity error; assert (S39'left = 0) report " resistance_vector(zero to three) error in the left generic value" severity error; --assert (S40'left = 1) report " delay error in the left generic value" severity error; assert (S41'left = 0) report " boolean_vector_range error in the left generic value" severity error; assert (S42'left = 0) report " severity_level_vector_range error in the left generic value" severity error; assert (S43'left = 0) report " integer_vector_range error in the left generic value" severity error; assert (S44'left = 0) report " real_vector_range error in the left generic value" severity error; assert (S45'left = 0) report " time_vector_range error in the left generic value" severity error; assert (S46'left = 0) report " natural_vector_range error in the left generic value" severity error; assert (S47'left = 0) report " positive_vector_range error in the left generic value" severity error; assert (S48'left = 0) report " array_rec_std(zero to seven) error in the left generic value" severity error; assert (S49'left = 0) report " array_rec_cons(zero to seven) error in the left generic value" severity error; assert (S50'left = 0) report " array_rec_rec(zero to seven) error in the left generic value" severity error; assert (S51.a'left = 0) report " record_of_arr_of_record error in the left generic value" severity error; assert (S51.b'left = 0) report " record_of_arr_of_record error in the left generic value" severity error; assert (S51.c'left = 0) report " record_of_arr_of_record error in the left generic value" severity error; assert (S1'right = 15) report " boolean_vector(zero to fifteen) error in the right generic value" severity error; assert (S2'right = 15) report " severity_level_vector(zero to fifteen) error in the right generic value" severity error; assert (S3'right = 15) report " integer_vector(zero to fifteen) error in the right generic value" severity error; assert (S4'right = 15) report " real_vector(zero to fifteen) error in the right generic value" severity error; assert (S5'right = 15) report " time_vector (zero to fifteen) error in the right generic value" severity error; assert (S6'right = 15) report " natural_vector(zero to fifteen) error in the right generic value" severity error; assert (S7'right = 15) report " positive_vector(zero to fifteen) error in the right generic value" severity error; assert (S8'right = 0) report " boolean_cons_vector error in the right generic value" severity error; assert (S9'right = 0) report " severity_level_cons_vector error in the right generic value" severity error; assert (S10'right = 0) report " integer_cons_vector error in the right generic value" severity error; assert (S11'right = 0) report " real_cons_vector error in the right generic value" severity error; assert (S12'right = 0) report " time_cons_vector error in the right generic value" severity error; assert (S13'right = 0) report " natural_cons_vector error in the right generic value" severity error; assert (S14'right = 0) report " positive_cons_vector error in the right generic value" severity error; assert (S15'right = 15) report " boolean_cons_vectorofvector error in the right generic value" severity error; assert (S16'right = 15) report " severity_level_cons_vectorofvector error in the right generic value" severity error; assert (S17'right = 15) report " integer_cons_vectorofvector error in the right generic value" severity error; assert (S18'right = 15) report " real_cons_vectorofvector error in the right generic value" severity error; assert (S19'right = 15) report " time_cons_vectorofvector error in the right generic value" severity error; assert (S20'right = 15) report " natural_cons_vectorofvector error in the right generic value" severity error; assert (S21'right = 15) report " positive_cons_vectorofvector error in the right generic value" severity error; assert (S22.j'right = 7) report " record_std_package error in the right generic value" severity error; assert (S22.k'right = 3) report " record_std_package error in the right generic value" severity error; assert (S23.a'right = 0) report " record_cons_array error in the right generic value" severity error; assert (S23.b'right = 0) report " record_cons_array error in the right generic value" severity error; assert (S23.c'right = 0) report " record_cons_array error in the right generic value" severity error; assert (S23.d'right = 0) report " record_cons_array error in the right generic value" severity error; assert (S23.e'right = 0) report " record_cons_array error in the right generic value" severity error; assert (S23.f'right = 0) report " record_cons_array error in the right generic value" severity error; assert (S23.g'right = 0) report " record_cons_array error in the right generic value" severity error; assert (S24.a'right = 15) report " record_cons_arrayofarray error in the right generic value" severity error; assert (S24.b'right = 15) report " record_cons_arrayofarray error in the right generic value" severity error; assert (S24.c'right = 15) report " record_cons_arrayofarray error in the right generic value" severity error; assert (S24.d'right = 15) report " record_cons_arrayofarray error in the right generic value" severity error; assert (S24.e'right = 15) report " record_cons_arrayofarray error in the right generic value" severity error; assert (S24.f'right = 15) report " record_cons_arrayofarray error in the right generic value" severity error; assert (S24.g'right = 15) report " record_cons_arrayofarray error in the right generic value" severity error; assert (S25'right = 15) report " boolean_vector_st error in the right generic value" severity error; assert (S26'right = 15) report " severity_level_vector_st error in the right generic value" severity error; assert (S27'right = 15) report " integer_vector_st error in the right generic value" severity error; assert (S28'right = 15) report " real_vector_st error in the right generic value" severity error; assert (S29'right = 15) report " time_vector_st error in the right generic value" severity error; assert (S30'right = 15) report " natural_vector_st error in the right generic value" severity error; assert (S31'right = 15) report " positive_vector_st error in the right generic value" severity error; assert (S32.a'right = 15) report " record_array_st error in the right generic value" severity error; assert (S32.b'right = 15) report " record_array_st error in the right generic value" severity error; assert (S32.c'right = 15) report " record_array_st error in the right generic value" severity error; assert (S32.d'right = 15) report " record_array_st error in the right generic value" severity error; assert (S32.e'right = 15) report " record_array_st error in the right generic value" severity error; assert (S32.f'right = 15) report " record_array_st error in the right generic value" severity error; assert (S32.g'right = 15) report " record_array_st error in the right generic value" severity error; assert (S34.a'right = 15) report " record_array_new error in the right generic value" severity error; assert (S34.b'right = 15) report " record_array_new error in the right generic value" severity error; assert (S34.c'right = 15) report " record_array_new error in the right generic value" severity error; assert (S34.d'right = 15) report " record_array_new error in the right generic value" severity error; assert (S34.e'right = 15) report " record_array_new error in the right generic value" severity error; assert (S34.f'right = 15) report " record_array_new error in the right generic value" severity error; assert (S34.g'right = 15) report " record_array_new error in the right generic value" severity error; assert (S36'right = 7) report " byte error in the right generic value" severity error; assert (S37'right = 15) report " word error in the right generic value" severity error; assert (S38'right = 3) report " current_vector(zero to three) error in the right generic value" severity error; assert (S39'right = 3) report " resistance_vector(zero to three) error in the right generic value" severity error; --assert (S40'right = 1) report " delay error in the right generic value" severity error; assert (S41'right = 7) report " boolean_vector_range error in the right generic value" severity error; assert (S42'right = 7) report " severity_level_vector_range error in the right generic value" severity error; assert (S43'right = 7) report " integer_vector_range error in the right generic value" severity error; assert (S44'right = 7) report " real_vector_range error in the right generic value" severity error; assert (S45'right = 7) report " time_vector_range error in the right generic value" severity error; assert (S46'right = 7) report " natural_vector_range error in the right generic value" severity error; assert (S47'right = 7) report " positive_vector_range error in the right generic value" severity error; assert (S48'right = 7) report " array_rec_std(zero to seven) error in the right generic value" severity error; assert (S49'right = 7) report " array_rec_cons(zero to seven) error in the right generic value" severity error; assert (S50'right = 7) report " array_rec_rec(zero to seven) error in the right generic value" severity error; assert (S51.a'right = 7) report " record_of_arr_of_record error in the right generic value" severity error; assert (S51.b'right = 7) report " record_of_arr_of_record error in the right generic value" severity error; assert (S51.c'right = 7) report " record_of_arr_of_record error in the right generic value" severity error; assert (S1'length = 16) report " boolean_vector(zero to fifteen) error in the length generic value" severity error; assert (S2'length = 16) report " severity_level_vector(zero to fifteen) error in the length generic value" severity error; assert (S3'length = 16) report " integer_vector(zero to fifteen) error in the length generic value" severity error; assert (S4'length = 16) report " real_vector(zero to fifteen) error in the length generic value" severity error; assert (S5'length = 16) report " time_vector (zero to fifteen) error in the length generic value" severity error; assert (S6'length = 16) report " natural_vector(zero to fifteen) error in the length generic value" severity error; assert (S7'length = 16) report " positive_vector(zero to fifteen) error in the length generic value" severity error; assert (S8'length = 16) report " boolean_cons_vector error in the length generic value" severity error; assert (S9'length = 16) report " severity_level_cons_vector error in the length generic value" severity error; assert (S10'length = 16) report " integer_cons_vector error in the length generic value" severity error; assert (S11'length = 16) report " real_cons_vector error in the length generic value" severity error; assert (S12'length = 16) report " time_cons_vector error in the length generic value" severity error; assert (S13'length = 16) report " natural_cons_vector error in the length generic value" severity error; assert (S14'length = 16) report " positive_cons_vector error in the length generic value" severity error; assert (S15'length = 16) report " boolean_cons_vectorofvector error in the length generic value" severity error; assert (S16'length = 16) report " severity_level_cons_vectorofvector error in the length generic value" severity error; assert (S17'length = 16) report " integer_cons_vectorofvector error in the length generic value" severity error; assert (S18'length = 16) report " real_cons_vectorofvector error in the length generic value" severity error; assert (S19'length = 16) report " time_cons_vectorofvector error in the length generic value" severity error; assert (S20'length = 16) report " natural_cons_vectorofvector error in the length generic value" severity error; assert (S21'length = 16) report " positive_cons_vectorofvector error in the length generic value" severity error; assert (S22.j'length = 7) report " record_std_package error in the length generic value" severity error; assert (S22.k'length = 4) report " record_std_package error in the length generic value" severity error; assert (S23.a'length = 16) report " record_cons_array error in the length generic value" severity error; assert (S23.b'length = 16) report " record_cons_array error in the length generic value" severity error; assert (S23.c'length = 16) report " record_cons_array error in the length generic value" severity error; assert (S23.d'length = 16) report " record_cons_array error in the length generic value" severity error; assert (S23.e'length = 16) report " record_cons_array error in the length generic value" severity error; assert (S23.f'length = 16) report " record_cons_array error in the length generic value" severity error; assert (S23.g'length = 16) report " record_cons_array error in the length generic value" severity error; assert (S24.a'length = 16) report " record_cons_arrayofarray error in the length generic value" severity error; assert (S24.b'length = 16) report " record_cons_arrayofarray error in the length generic value" severity error; assert (S24.c'length = 16) report " record_cons_arrayofarray error in the length generic value" severity error; assert (S24.d'length = 16) report " record_cons_arrayofarray error in the length generic value" severity error; assert (S24.e'length = 16) report " record_cons_arrayofarray error in the length generic value" severity error; assert (S24.f'length = 16) report " record_cons_arrayofarray error in the length generic value" severity error; assert (S24.g'length = 16) report " record_cons_arrayofarray error in the length generic value" severity error; assert (S25'length = 16) report " boolean_vector_st error in the length generic value" severity error; assert (S26'length = 16) report " severity_level_vector_st error in the length generic value" severity error; assert (S27'length = 16) report " integer_vector_st error in the length generic value" severity error; assert (S28'length = 16) report " real_vector_st error in the length generic value" severity error; assert (S29'length = 16) report " time_vector_st error in the length generic value" severity error; assert (S30'length = 16) report " natural_vector_st error in the length generic value" severity error; assert (S31'length = 16) report " positive_vector_st error in the length generic value" severity error; assert (S32.a'length = 16) report " record_array_st error in the length generic value" severity error; assert (S32.b'length = 16) report " record_array_st error in the length generic value" severity error; assert (S32.c'length = 16) report " record_array_st error in the length generic value" severity error; assert (S32.d'length = 16) report " record_array_st error in the length generic value" severity error; assert (S32.e'length = 16) report " record_array_st error in the length generic value" severity error; assert (S32.f'length = 16) report " record_array_st error in the length generic value" severity error; assert (S32.g'length = 16) report " record_array_st error in the length generic value" severity error; assert (S34.a'length = 16) report " record_array_new error in the length generic value" severity error; assert (S34.b'length = 16) report " record_array_new error in the length generic value" severity error; assert (S34.c'length = 16) report " record_array_new error in the length generic value" severity error; assert (S34.d'length = 16) report " record_array_new error in the length generic value" severity error; assert (S34.e'length = 16) report " record_array_new error in the length generic value" severity error; assert (S34.f'length = 16) report " record_array_new error in the length generic value" severity error; assert (S34.g'length = 16) report " record_array_new error in the length generic value" severity error; assert (S36'length = 8) report " byte error in the length generic value" severity error; assert (S37'length = 16) report " word error in the length generic value" severity error; assert (S38'length = 4) report " current_vector(zero to three) error in the length generic value" severity error; assert (S39'length = 4) report " resistance_vector(zero to three) error in the length generic value" severity error; --assert (S40'length = 1) report " delay error in the length generic value" severity error; assert (S41'length = 8) report " boolean_vector_range error in the length generic value" severity error; assert (S42'length = 8) report " severity_level_vector_range error in the length generic value" severity error; assert (S43'length = 8) report " integer_vector_range error in the length generic value" severity error; assert (S44'length = 8) report " real_vector_range error in the length generic value" severity error; assert (S45'length = 8) report " time_vector_range error in the length generic value" severity error; assert (S46'length = 8) report " natural_vector_range error in the length generic value" severity error; assert (S48'length = 8) report " positive_vector_range error in the length generic value" severity error; assert (S48'length = 8) report " array_rec_std(zero to seven) error in the length generic value" severity error; assert (S49'length = 8) report " array_rec_cons(zero to seven) error in the length generic value" severity error; assert (S50'length = 8) report " array_rec_rec(zero to seven) error in the length generic value" severity error; assert (S51.a'length = 8) report " record_of_arr_of_record error in the length generic value" severity error; assert (S51.b'length = 8) report " record_of_arr_of_record error in the length generic value" severity error; assert (S51.c'length = 8) report " record_of_arr_of_record error in the length generic value" severity error; TESTING: PROCESS BEGIN assert NOT( (S1'left = 0) and (S2'left = 0) and (S3'left = 0) and (S4'left = 0) and (S5'left = 0) and (S6'left = 0) and (S7'left = 0) and (S8'left = 15) and (S9'left = 15) and (S10'left = 15) and (S11'left = 15) and (S12'left = 15) and (S13'left = 15) and (S14'left = 15) and (S15'left = 0) and (S16'left = 0) and (S17'left = 0) and (S18'left = 0) and (S19'left = 0) and (S20'left = 0) and (S21'left = 0) and (S22.j'left = 1) and (S22.k'left = 0) and (S23.a'left = 15) and (S23.b'left = 15) and (S23.c'left = 15) and (S23.d'left = 15) and (S23.e'left = 15) and (S23.f'left = 15) and (S23.g'left = 15) and (S24.a'left = 0) and (S24.b'left = 0) and (S24.c'left = 0) and (S24.d'left = 0) and (S24.e'left = 0) and (S24.f'left = 0) and (S24.g'left = 0) and (S25'left = 0) and (S26'left = 0) and (S27'left = 0) and (S28'left = 0) and (S29'left = 0) and (S30'left = 0) and (S31'left = 0) and (S32.a'left = 0) and (S32.b'left = 0) and (S32.c'left = 0) and (S32.d'left = 0) and (S32.e'left = 0) and (S32.f'left = 0) and (S32.g'left = 0) and (S34.a'left = 0) and (S34.b'left = 0) and (S34.c'left = 0) and (S34.d'left = 0) and (S34.e'left = 0) and (S34.f'left = 0) and (S34.g'left = 0) and (S36'left = 0) and (S37'left = 0) and (S38'left = 0) and (S39'left = 0) and -- (S40'left = 1) and (S42'left = 0) and (S43'left = 0) and (S44'left = 0) and (S45'left = 0) and (S46'left = 0) and (S47'left = 0) and (S48'left = 0) and (S49'left = 0) and (S50'left = 0) and (S51.a'left = 0) and (S51.b'left = 0) and (S51.c'left = 0) and (S1'right = 15) and (S2'right = 15) and (S3'right = 15) and (S4'right = 15) and (S5'right = 15) and (S6'right = 15) and (S7'right = 15) and (S8'right = 0) and (S9'right = 0) and (S10'right = 0)and (S11'right = 0) and (S12'right = 0) and (S13'right = 0) and (S14'right = 0) and (S15'right = 15) and (S16'right = 15) and (S17'right = 15) and (S18'right = 15) and (S19'right = 15) and (S20'right = 15) and (S21'right = 15) and (S22.j'right = 7) and (S22.k'right = 3) and (S23.a'right = 0) and (S23.b'right = 0) and (S23.c'right = 0) and (S23.d'right = 0) and (S23.e'right = 0) and (S23.f'right = 0) and (S23.g'right = 0) and (S24.a'right = 15) and (S24.b'right = 15) and (S24.c'right = 15) and (S24.d'right = 15) and (S24.e'right = 15) and (S24.f'right = 15) and (S24.g'right = 15) and (S25'right = 15) and (S26'right = 15) and (S27'right = 15) and (S28'right = 15) and (S29'right = 15) and (S30'right = 15) and (S31'right = 15) and (S32.a'right = 15) and (S32.b'right = 15) and (S32.c'right = 15) and (S32.d'right = 15) and (S32.e'right = 15) and (S32.f'right = 15) and (S32.g'right = 15) and (S34.a'right = 15) and (S34.b'right = 15) and (S34.c'right = 15) and (S34.d'right = 15) and (S34.e'right = 15) and (S34.f'right = 15) and (S34.g'right = 15) and (S36'right = 7) and (S37'right = 15) and (S38'right = 3) and (S39'right = 3) and -- (S40'right = 1) and (S41'right = 7) and (S42'right = 7) and (S43'right = 7) and (S44'right = 7) and (S45'right = 7) and (S46'right = 7) and (S47'right = 7) and (S48'right = 7) and (S49'right = 7) and (S50'right = 7) and (S51.a'right = 7) and (S51.b'right = 7) and (S51.c'right = 7) and (S1'length = 16) and (S2'length = 16) and (S3'length = 16) and (S4'length = 16) and (S5'length = 16) and (S6'length = 16) and (S7'length = 16) and (S8'length = 16) and (S9'length = 16) and (S10'length = 16) and (S11'length = 16) and (S12'length = 16) and (S13'length = 16) and (S14'length = 16) and (S15'length = 16) and (S16'length = 16) and (S17'length = 16) and (S18'length = 16) and (S19'length = 16) and (S20'length = 16) and (S21'length = 16) and (S22.j'length = 7)and (S22.k'length = 4) and (S23.a'length = 16) and (S23.b'length = 16) and (S23.c'length = 16) and (S23.d'length = 16) and (S23.e'length = 16) and (S23.f'length = 16) and (S23.g'length = 16) and (S24.a'length = 16) and (S24.b'length = 16) and (S24.c'length = 16) and (S24.d'length = 16) and (S24.e'length = 16) and (S24.f'length = 16) and (S24.g'length = 16) and (S25'length = 16) and (S26'length = 16) and (S27'length = 16) and (S28'length = 16) and (S29'length = 16) and (S30'length = 16) and (S31'length = 16) and (S32.a'length = 16) and (S32.b'length = 16) and (S32.c'length = 16) and (S32.d'length = 16) and (S32.e'length = 16) and (S32.f'length = 16) and (S32.g'length = 16) and (S34.a'length = 16) and (S34.b'length = 16) and (S34.c'length = 16) and (S34.d'length = 16) and (S34.e'length = 16) and (S34.f'length = 16) and (S34.g'length = 16) and (S36'length = 8) and (S37'length = 16) and (S38'length = 4) and (S39'length = 4) and -- (S40'length = 1) and (S41'length = 8) and (S42'length = 8) and (S43'length = 8) and (S44'length = 8) and (S45'length = 8) and (S46'length = 8) and (S48'length = 8) and (S48'length = 8) and (S49'length = 8) and (S50'length = 8) and (S51.a'length = 8) and (S51.b'length = 8) and (S51.c'length = 8) ) report "***PASSED TEST: c01s01b01x01p05n02i00755" severity NOTE; assert ((S1'left = 0) and (S2'left = 0) and (S3'left = 0) and (S4'left = 0) and (S5'left = 0) and (S6'left = 0) and (S7'left = 0) and (S8'left = 15) and (S9'left = 15) and (S10'left = 15) and (S11'left = 15) and (S12'left = 15) and (S13'left = 15) and (S14'left = 15) and (S15'left = 0) and (S16'left = 0) and (S17'left = 0) and (S18'left = 0) and (S19'left = 0) and (S20'left = 0) and (S21'left = 0) and (S22.j'left = 1) and (S22.k'left = 0) and (S23.a'left = 15) and (S23.b'left = 15) and (S23.c'left = 15) and (S23.d'left = 15) and (S23.e'left = 15) and (S23.f'left = 15) and (S23.g'left = 15) and (S24.a'left = 0) and (S24.b'left = 0) and (S24.c'left = 0) and (S24.d'left = 0) and (S24.e'left = 0) and (S24.f'left = 0) and (S24.g'left = 0) and (S25'left = 0) and (S26'left = 0) and (S27'left = 0) and (S28'left = 0) and (S29'left = 0) and (S30'left = 0) and (S31'left = 0) and (S32.a'left = 0) and (S32.b'left = 0) and (S32.c'left = 0) and (S32.d'left = 0) and (S32.e'left = 0) and (S32.f'left = 0) and (S32.g'left = 0) and (S34.a'left = 0) and (S34.b'left = 0) and (S34.c'left = 0) and (S34.d'left = 0) and (S34.e'left = 0) and (S34.f'left = 0) and (S34.g'left = 0) and (S36'left = 0) and (S37'left = 0) and (S38'left = 0) and (S39'left = 0) and -- (S40'left = 1) and (S42'left = 0) and (S43'left = 0) and (S44'left = 0) and (S45'left = 0) and (S46'left = 0) and (S47'left = 0) and (S48'left = 0) and (S49'left = 0) and (S50'left = 0) and (S51.a'left = 0) and (S51.b'left = 0) and (S51.c'left = 0) and (S1'right = 15) and (S2'right = 15) and (S3'right = 15) and (S4'right = 15) and (S5'right = 15) and (S6'right = 15) and (S7'right = 15) and (S8'right = 0) and (S9'right = 0) and (S10'right = 0)and (S11'right = 0) and (S12'right = 0) and (S13'right = 0) and (S14'right = 0) and (S15'right = 15) and (S16'right = 15) and (S17'right = 15) and (S18'right = 15) and (S19'right = 15) and (S20'right = 15) and (S21'right = 15) and (S22.j'right = 7) and (S22.k'right = 3) and (S23.a'right = 0) and (S23.b'right = 0) and (S23.c'right = 0) and (S23.d'right = 0) and (S23.e'right = 0) and (S23.f'right = 0) and (S23.g'right = 0) and (S24.a'right = 15) and (S24.b'right = 15) and (S24.c'right = 15) and (S24.d'right = 15) and (S24.e'right = 15) and (S24.f'right = 15) and (S24.g'right = 15) and (S25'right = 15) and (S26'right = 15) and (S27'right = 15) and (S28'right = 15) and (S29'right = 15) and (S30'right = 15) and (S31'right = 15) and (S32.a'right = 15) and (S32.b'right = 15) and (S32.c'right = 15) and (S32.d'right = 15) and (S32.e'right = 15) and (S32.f'right = 15) and (S32.g'right = 15) and (S34.a'right = 15) and (S34.b'right = 15) and (S34.c'right = 15) and (S34.d'right = 15) and (S34.e'right = 15) and (S34.f'right = 15) and (S34.g'right = 15) and (S36'right = 7) and (S37'right = 15) and (S38'right = 3) and (S39'right = 3) and -- (S40'right = 1) and (S41'right = 7) and (S42'right = 7) and (S43'right = 7) and (S44'right = 7) and (S45'right = 7) and (S46'right = 7) and (S47'right = 7) and (S48'right = 7) and (S49'right = 7) and (S50'right = 7) and (S51.a'right = 7) and (S51.b'right = 7) and (S51.c'right = 7) and (S1'length = 16) and (S2'length = 16) and (S3'length = 16) and (S4'length = 16) and (S5'length = 16) and (S6'length = 16) and (S7'length = 16) and (S8'length = 16) and (S9'length = 16) and (S10'length = 16) and (S11'length = 16) and (S12'length = 16) and (S13'length = 16) and (S14'length = 16) and (S15'length = 16) and (S16'length = 16) and (S17'length = 16) and (S18'length = 16) and (S19'length = 16) and (S20'length = 16) and (S21'length = 16) and (S22.j'length = 7)and (S22.k'length = 4) and (S23.a'length = 16) and (S23.b'length = 16) and (S23.c'length = 16) and (S23.d'length = 16) and (S23.e'length = 16) and (S23.f'length = 16) and (S23.g'length = 16) and (S24.a'length = 16) and (S24.b'length = 16) and (S24.c'length = 16) and (S24.d'length = 16) and (S24.e'length = 16) and (S24.f'length = 16) and (S24.g'length = 16) and (S25'length = 16) and (S26'length = 16) and (S27'length = 16) and (S28'length = 16) and (S29'length = 16) and (S30'length = 16) and (S31'length = 16) and (S32.a'length = 16) and (S32.b'length = 16) and (S32.c'length = 16) and (S32.d'length = 16) and (S32.e'length = 16) and (S32.f'length = 16) and (S32.g'length = 16) and (S34.a'length = 16) and (S34.b'length = 16) and (S34.c'length = 16) and (S34.d'length = 16) and (S34.e'length = 16) and (S34.f'length = 16) and (S34.g'length = 16) and (S36'length = 8) and (S37'length = 16) and (S38'length = 4) and (S39'length = 4) and -- (S40'length = 1) and (S41'length = 8) and (S42'length = 8) and (S43'length = 8) and (S44'length = 8) and (S45'length = 8) and (S46'length = 8) and (S48'length = 8) and (S48'length = 8) and (S49'length = 8) and (S50'length = 8) and (S51.a'length = 8) and (S51.b'length = 8) and (S51.c'length = 8) ) report "***FAILED TEST: c01s01b01x01p05n02i00755 - Generic can be used to specify the size of ports." severity ERROR; wait; END PROCESS TESTING; END c01s01b01x01p05n02i00755arch;
gpl-2.0
tgingold/ghdl
testsuite/gna/issue50/vector.d/cmp_204.vhd
2
376
library ieee; use ieee.std_logic_1164.all; entity cmp_204 is port ( eq : out std_logic; in0 : in std_logic_vector(2 downto 0); in1 : in std_logic_vector(2 downto 0) ); end cmp_204; architecture augh of cmp_204 is signal tmp : std_logic; begin -- Compute the result tmp <= '0' when in0 /= in1 else '1'; -- Set the outputs eq <= tmp; end architecture;
gpl-2.0
tgingold/ghdl
testsuite/gna/perf02-long/mul_149.vhd
3
503
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity mul_149 is port ( output : out std_logic_vector(63 downto 0); in_a : in std_logic_vector(32 downto 0); in_b : in std_logic_vector(31 downto 0) ); end mul_149; architecture augh of mul_149 is signal tmp_res : signed(64 downto 0); begin -- The actual multiplication tmp_res <= signed(in_a) * signed(in_b); -- Set the output output <= std_logic_vector(tmp_res(63 downto 0)); end architecture;
gpl-2.0
tgingold/ghdl
libraries/ieee/numeric_std.vhdl
5
34294
-- -------------------------------------------------------------------- -- -- Copyright 1995 by IEEE. All rights reserved. -- -- This source file is considered by the IEEE to be an essential part of the use -- of the standard 1076.3 and as such may be distributed without change, except -- as permitted by the standard. This source file may not be sold or distributed -- for profit. This package may be modified to include additional data required -- by tools, but must in no way change the external interfaces or simulation -- behaviour of the description. It is permissible to add comments and/or -- attributes to the package declarations, but not to change or delete any -- original lines of the approved package declaration. The package body may be -- changed only in accordance with the terms of clauses 7.1 and 7.2 of the -- standard. -- -- Title : Standard VHDL Synthesis Package (1076.3, NUMERIC_STD) -- -- Library : This package shall be compiled into a library symbolically -- : named IEEE. -- -- Developers : IEEE DASC Synthesis Working Group, PAR 1076.3 -- -- Purpose : This package defines numeric types and arithmetic functions -- : for use with synthesis tools. Two numeric types are defined: -- : -- > UNSIGNED: represents UNSIGNED number in vector form -- : -- > SIGNED: represents a SIGNED number in vector form -- : The base element type is type STD_LOGIC. -- : The leftmost bit is treated as the most significant bit. -- : Signed vectors are represented in two's complement form. -- : This package contains overloaded arithmetic operators on -- : the SIGNED and UNSIGNED types. The package also contains -- : useful type conversions functions. -- : -- : If any argument to a function is a null array, a null array is -- : returned (exceptions, if any, are noted individually). -- -- Limitation : -- -- Note : No declarations or definitions shall be included in, -- : or excluded from this package. The "package declaration" -- : defines the types, subtypes and declarations of -- : NUMERIC_STD. The NUMERIC_STD 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: 2.4 -- Date : 12 April 1995 -- ----------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.all; package NUMERIC_STD is constant CopyRightNotice: STRING := "Copyright 1995 IEEE. All rights reserved."; --============================================================================ -- Numeric array type definitions --============================================================================ type UNSIGNED is array (NATURAL range <>) of STD_LOGIC; type SIGNED is array (NATURAL range <>) of STD_LOGIC; --============================================================================ -- Arithmetic Operators: --=========================================================================== -- Id: A.1 function "abs" (ARG: SIGNED) return SIGNED; -- Result subtype: SIGNED(ARG'LENGTH-1 downto 0). -- Result: Returns the absolute value of a SIGNED vector ARG. -- Id: A.2 function "-" (ARG: SIGNED) return SIGNED; -- Result subtype: SIGNED(ARG'LENGTH-1 downto 0). -- Result: Returns the value of the unary minus operation on a -- SIGNED vector ARG. --============================================================================ -- Id: A.3 function "+" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0). -- Result: Adds two UNSIGNED vectors that may be of different lengths. -- Id: A.4 function "+" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0). -- Result: Adds two SIGNED vectors that may be of different lengths. -- Id: A.5 function "+" (L: UNSIGNED; R: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0). -- Result: Adds an UNSIGNED vector, L, with a non-negative INTEGER, R. -- Id: A.6 function "+" (L: NATURAL; R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(R'LENGTH-1 downto 0). -- Result: Adds a non-negative INTEGER, L, with an UNSIGNED vector, R. -- Id: A.7 function "+" (L: INTEGER; R: SIGNED) return SIGNED; -- Result subtype: SIGNED(R'LENGTH-1 downto 0). -- Result: Adds an INTEGER, L(may be positive or negative), to a SIGNED -- vector, R. -- Id: A.8 function "+" (L: SIGNED; R: INTEGER) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0). -- Result: Adds a SIGNED vector, L, to an INTEGER, R. --============================================================================ -- Id: A.9 function "-" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0). -- Result: Subtracts two UNSIGNED vectors that may be of different lengths. -- Id: A.10 function "-" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED(MAX(L'LENGTH, R'LENGTH)-1 downto 0). -- Result: Subtracts a SIGNED vector, R, from another SIGNED vector, L, -- that may possibly be of different lengths. -- Id: A.11 function "-" (L: UNSIGNED;R: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0). -- Result: Subtracts a non-negative INTEGER, R, from an UNSIGNED vector, L. -- Id: A.12 function "-" (L: NATURAL; R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(R'LENGTH-1 downto 0). -- Result: Subtracts an UNSIGNED vector, R, from a non-negative INTEGER, L. -- Id: A.13 function "-" (L: SIGNED; R: INTEGER) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0). -- Result: Subtracts an INTEGER, R, from a SIGNED vector, L. -- Id: A.14 function "-" (L: INTEGER; R: SIGNED) return SIGNED; -- Result subtype: SIGNED(R'LENGTH-1 downto 0). -- Result: Subtracts a SIGNED vector, R, from an INTEGER, L. --============================================================================ -- Id: A.15 function "*" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED((L'LENGTH+R'LENGTH-1) downto 0). -- Result: Performs the multiplication operation on two UNSIGNED vectors -- that may possibly be of different lengths. -- Id: A.16 function "*" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED((L'LENGTH+R'LENGTH-1) downto 0) -- Result: Multiplies two SIGNED vectors that may possibly be of -- different lengths. -- Id: A.17 function "*" (L: UNSIGNED; R: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED((L'LENGTH+L'LENGTH-1) downto 0). -- Result: Multiplies an UNSIGNED vector, L, with a non-negative -- INTEGER, R. R is converted to an UNSIGNED vector of -- SIZE L'LENGTH before multiplication. -- Id: A.18 function "*" (L: NATURAL; R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED((R'LENGTH+R'LENGTH-1) downto 0). -- Result: Multiplies an UNSIGNED vector, R, with a non-negative -- INTEGER, L. L is converted to an UNSIGNED vector of -- SIZE R'LENGTH before multiplication. -- Id: A.19 function "*" (L: SIGNED; R: INTEGER) return SIGNED; -- Result subtype: SIGNED((L'LENGTH+L'LENGTH-1) downto 0) -- Result: Multiplies a SIGNED vector, L, with an INTEGER, R. R is -- converted to a SIGNED vector of SIZE L'LENGTH before -- multiplication. -- Id: A.20 function "*" (L: INTEGER; R: SIGNED) return SIGNED; -- Result subtype: SIGNED((R'LENGTH+R'LENGTH-1) downto 0) -- Result: Multiplies a SIGNED vector, R, with an INTEGER, L. L is -- converted to a SIGNED vector of SIZE R'LENGTH before -- multiplication. --============================================================================ -- -- NOTE: If second argument is zero for "/" operator, a severity level -- of ERROR is issued. -- Id: A.21 function "/" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Divides an UNSIGNED vector, L, by another UNSIGNED vector, R. -- Id: A.22 function "/" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Divides an SIGNED vector, L, by another SIGNED vector, R. -- Id: A.23 function "/" (L: UNSIGNED; R: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Divides an UNSIGNED vector, L, by a non-negative INTEGER, R. -- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH. -- Id: A.24 function "/" (L: NATURAL; R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(R'LENGTH-1 downto 0) -- Result: Divides a non-negative INTEGER, L, by an UNSIGNED vector, R. -- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH. -- Id: A.25 function "/" (L: SIGNED; R: INTEGER) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Divides a SIGNED vector, L, by an INTEGER, R. -- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH. -- Id: A.26 function "/" (L: INTEGER; R: SIGNED) return SIGNED; -- Result subtype: SIGNED(R'LENGTH-1 downto 0) -- Result: Divides an INTEGER, L, by a SIGNED vector, R. -- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH. --============================================================================ -- -- NOTE: If second argument is zero for "rem" operator, a severity level -- of ERROR is issued. -- Id: A.27 function "rem" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(R'LENGTH-1 downto 0) -- Result: Computes "L rem R" where L and R are UNSIGNED vectors. -- Id: A.28 function "rem" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED(R'LENGTH-1 downto 0) -- Result: Computes "L rem R" where L and R are SIGNED vectors. -- Id: A.29 function "rem" (L: UNSIGNED; R: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Computes "L rem R" where L is an UNSIGNED vector and R is a -- non-negative INTEGER. -- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH. -- Id: A.30 function "rem" (L: NATURAL; R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(R'LENGTH-1 downto 0) -- Result: Computes "L rem R" where R is an UNSIGNED vector and L is a -- non-negative INTEGER. -- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH. -- Id: A.31 function "rem" (L: SIGNED; R: INTEGER) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Computes "L rem R" where L is SIGNED vector and R is an INTEGER. -- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH. -- Id: A.32 function "rem" (L: INTEGER; R: SIGNED) return SIGNED; -- Result subtype: SIGNED(R'LENGTH-1 downto 0) -- Result: Computes "L rem R" where R is SIGNED vector and L is an INTEGER. -- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH. --============================================================================ -- -- NOTE: If second argument is zero for "mod" operator, a severity level -- of ERROR is issued. -- Id: A.33 function "mod" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(R'LENGTH-1 downto 0) -- Result: Computes "L mod R" where L and R are UNSIGNED vectors. -- Id: A.34 function "mod" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED(R'LENGTH-1 downto 0) -- Result: Computes "L mod R" where L and R are SIGNED vectors. -- Id: A.35 function "mod" (L: UNSIGNED; R: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Computes "L mod R" where L is an UNSIGNED vector and R -- is a non-negative INTEGER. -- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH. -- Id: A.36 function "mod" (L: NATURAL; R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(R'LENGTH-1 downto 0) -- Result: Computes "L mod R" where R is an UNSIGNED vector and L -- is a non-negative INTEGER. -- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH. -- Id: A.37 function "mod" (L: SIGNED; R: INTEGER) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Computes "L mod R" where L is a SIGNED vector and -- R is an INTEGER. -- If NO_OF_BITS(R) > L'LENGTH, result is truncated to L'LENGTH. -- Id: A.38 function "mod" (L: INTEGER; R: SIGNED) return SIGNED; -- Result subtype: SIGNED(R'LENGTH-1 downto 0) -- Result: Computes "L mod R" where L is an INTEGER and -- R is a SIGNED vector. -- If NO_OF_BITS(L) > R'LENGTH, result is truncated to R'LENGTH. --============================================================================ -- Comparison Operators --============================================================================ -- Id: C.1 function ">" (L, R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L > R" where L and R are UNSIGNED vectors possibly -- of different lengths. -- Id: C.2 function ">" (L, R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L > R" where L and R are SIGNED vectors possibly -- of different lengths. -- Id: C.3 function ">" (L: NATURAL; R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L > R" where L is a non-negative INTEGER and -- R is an UNSIGNED vector. -- Id: C.4 function ">" (L: INTEGER; R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L > R" where L is a INTEGER and -- R is a SIGNED vector. -- Id: C.5 function ">" (L: UNSIGNED; R: NATURAL) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L > R" where L is an UNSIGNED vector and -- R is a non-negative INTEGER. -- Id: C.6 function ">" (L: SIGNED; R: INTEGER) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L > R" where L is a SIGNED vector and -- R is a INTEGER. --============================================================================ -- Id: C.7 function "<" (L, R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L < R" where L and R are UNSIGNED vectors possibly -- of different lengths. -- Id: C.8 function "<" (L, R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L < R" where L and R are SIGNED vectors possibly -- of different lengths. -- Id: C.9 function "<" (L: NATURAL; R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L < R" where L is a non-negative INTEGER and -- R is an UNSIGNED vector. -- Id: C.10 function "<" (L: INTEGER; R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L < R" where L is an INTEGER and -- R is a SIGNED vector. -- Id: C.11 function "<" (L: UNSIGNED; R: NATURAL) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L < R" where L is an UNSIGNED vector and -- R is a non-negative INTEGER. -- Id: C.12 function "<" (L: SIGNED; R: INTEGER) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L < R" where L is a SIGNED vector and -- R is an INTEGER. --============================================================================ -- Id: C.13 function "<=" (L, R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L <= R" where L and R are UNSIGNED vectors possibly -- of different lengths. -- Id: C.14 function "<=" (L, R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L <= R" where L and R are SIGNED vectors possibly -- of different lengths. -- Id: C.15 function "<=" (L: NATURAL; R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L <= R" where L is a non-negative INTEGER and -- R is an UNSIGNED vector. -- Id: C.16 function "<=" (L: INTEGER; R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L <= R" where L is an INTEGER and -- R is a SIGNED vector. -- Id: C.17 function "<=" (L: UNSIGNED; R: NATURAL) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L <= R" where L is an UNSIGNED vector and -- R is a non-negative INTEGER. -- Id: C.18 function "<=" (L: SIGNED; R: INTEGER) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L <= R" where L is a SIGNED vector and -- R is an INTEGER. --============================================================================ -- Id: C.19 function ">=" (L, R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L >= R" where L and R are UNSIGNED vectors possibly -- of different lengths. -- Id: C.20 function ">=" (L, R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L >= R" where L and R are SIGNED vectors possibly -- of different lengths. -- Id: C.21 function ">=" (L: NATURAL; R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L >= R" where L is a non-negative INTEGER and -- R is an UNSIGNED vector. -- Id: C.22 function ">=" (L: INTEGER; R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L >= R" where L is an INTEGER and -- R is a SIGNED vector. -- Id: C.23 function ">=" (L: UNSIGNED; R: NATURAL) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L >= R" where L is an UNSIGNED vector and -- R is a non-negative INTEGER. -- Id: C.24 function ">=" (L: SIGNED; R: INTEGER) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L >= R" where L is a SIGNED vector and -- R is an INTEGER. --============================================================================ -- Id: C.25 function "=" (L, R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L = R" where L and R are UNSIGNED vectors possibly -- of different lengths. -- Id: C.26 function "=" (L, R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L = R" where L and R are SIGNED vectors possibly -- of different lengths. -- Id: C.27 function "=" (L: NATURAL; R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L = R" where L is a non-negative INTEGER and -- R is an UNSIGNED vector. -- Id: C.28 function "=" (L: INTEGER; R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L = R" where L is an INTEGER and -- R is a SIGNED vector. -- Id: C.29 function "=" (L: UNSIGNED; R: NATURAL) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L = R" where L is an UNSIGNED vector and -- R is a non-negative INTEGER. -- Id: C.30 function "=" (L: SIGNED; R: INTEGER) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L = R" where L is a SIGNED vector and -- R is an INTEGER. --============================================================================ -- Id: C.31 function "/=" (L, R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L /= R" where L and R are UNSIGNED vectors possibly -- of different lengths. -- Id: C.32 function "/=" (L, R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L /= R" where L and R are SIGNED vectors possibly -- of different lengths. -- Id: C.33 function "/=" (L: NATURAL; R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L /= R" where L is a non-negative INTEGER and -- R is an UNSIGNED vector. -- Id: C.34 function "/=" (L: INTEGER; R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L /= R" where L is an INTEGER and -- R is a SIGNED vector. -- Id: C.35 function "/=" (L: UNSIGNED; R: NATURAL) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L /= R" where L is an UNSIGNED vector and -- R is a non-negative INTEGER. -- Id: C.36 function "/=" (L: SIGNED; R: INTEGER) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: Computes "L /= R" where L is a SIGNED vector and -- R is an INTEGER. --============================================================================ -- Shift and Rotate Functions --============================================================================ -- Id: S.1 function SHIFT_LEFT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0) -- Result: Performs a shift-left on an UNSIGNED vector COUNT times. -- The vacated positions are filled with '0'. -- The COUNT leftmost elements are lost. -- Id: S.2 function SHIFT_RIGHT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0) -- Result: Performs a shift-right on an UNSIGNED vector COUNT times. -- The vacated positions are filled with '0'. -- The COUNT rightmost elements are lost. -- Id: S.3 function SHIFT_LEFT (ARG: SIGNED; COUNT: NATURAL) return SIGNED; -- Result subtype: SIGNED(ARG'LENGTH-1 downto 0) -- Result: Performs a shift-left on a SIGNED vector COUNT times. -- The vacated positions are filled with '0'. -- The COUNT leftmost elements are lost. -- Id: S.4 function SHIFT_RIGHT (ARG: SIGNED; COUNT: NATURAL) return SIGNED; -- Result subtype: SIGNED(ARG'LENGTH-1 downto 0) -- Result: Performs a shift-right on a SIGNED vector COUNT times. -- The vacated positions are filled with the leftmost -- element, ARG'LEFT. The COUNT rightmost elements are lost. --============================================================================ -- Id: S.5 function ROTATE_LEFT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0) -- Result: Performs a rotate-left of an UNSIGNED vector COUNT times. -- Id: S.6 function ROTATE_RIGHT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0) -- Result: Performs a rotate-right of an UNSIGNED vector COUNT times. -- Id: S.7 function ROTATE_LEFT (ARG: SIGNED; COUNT: NATURAL) return SIGNED; -- Result subtype: SIGNED(ARG'LENGTH-1 downto 0) -- Result: Performs a logical rotate-left of a SIGNED -- vector COUNT times. -- Id: S.8 function ROTATE_RIGHT (ARG: SIGNED; COUNT: NATURAL) return SIGNED; -- Result subtype: SIGNED(ARG'LENGTH-1 downto 0) -- Result: Performs a logical rotate-right of a SIGNED -- vector COUNT times. --============================================================================ --============================================================================ ------------------------------------------------------------------------------ -- Note : Function S.9 is not compatible with VHDL 1076-1987. Comment -- out the function (declaration and body) for VHDL 1076-1987 compatibility. ------------------------------------------------------------------------------ -- Id: S.9 function "sll" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED; --!V87 -- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0) -- Result: SHIFT_LEFT(ARG, COUNT) ------------------------------------------------------------------------------ -- Note : Function S.10 is not compatible with VHDL 1076-1987. Comment -- out the function (declaration and body) for VHDL 1076-1987 compatibility. ------------------------------------------------------------------------------ -- Id: S.10 function "sll" (ARG: SIGNED; COUNT: INTEGER) return SIGNED; --!V87 -- Result subtype: SIGNED(ARG'LENGTH-1 downto 0) -- Result: SHIFT_LEFT(ARG, COUNT) ------------------------------------------------------------------------------ -- Note : Function S.11 is not compatible with VHDL 1076-1987. Comment -- out the function (declaration and body) for VHDL 1076-1987 compatibility. ------------------------------------------------------------------------------ -- Id: S.11 function "srl" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED; --!V87 -- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0) -- Result: SHIFT_RIGHT(ARG, COUNT) ------------------------------------------------------------------------------ -- Note : Function S.12 is not compatible with VHDL 1076-1987. Comment -- out the function (declaration and body) for VHDL 1076-1987 compatibility. ------------------------------------------------------------------------------ -- Id: S.12 function "srl" (ARG: SIGNED; COUNT: INTEGER) return SIGNED; --!V87 -- Result subtype: SIGNED(ARG'LENGTH-1 downto 0) -- Result: SIGNED(SHIFT_RIGHT(UNSIGNED(ARG), COUNT)) ------------------------------------------------------------------------------ -- Note : Function S.13 is not compatible with VHDL 1076-1987. Comment -- out the function (declaration and body) for VHDL 1076-1987 compatibility. ------------------------------------------------------------------------------ -- Id: S.13 function "rol" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED; --!V87 -- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0) -- Result: ROTATE_LEFT(ARG, COUNT) ------------------------------------------------------------------------------ -- Note : Function S.14 is not compatible with VHDL 1076-1987. Comment -- out the function (declaration and body) for VHDL 1076-1987 compatibility. ------------------------------------------------------------------------------ -- Id: S.14 function "rol" (ARG: SIGNED; COUNT: INTEGER) return SIGNED; --!V87 -- Result subtype: SIGNED(ARG'LENGTH-1 downto 0) -- Result: ROTATE_LEFT(ARG, COUNT) ------------------------------------------------------------------------------ -- Note : Function S.15 is not compatible with VHDL 1076-1987. Comment -- out the function (declaration and body) for VHDL 1076-1987 compatibility. ------------------------------------------------------------------------------ -- Id: S.15 function "ror" (ARG: UNSIGNED; COUNT: INTEGER) return UNSIGNED; --!V87 -- Result subtype: UNSIGNED(ARG'LENGTH-1 downto 0) -- Result: ROTATE_RIGHT(ARG, COUNT) ------------------------------------------------------------------------------ -- Note : Function S.16 is not compatible with VHDL 1076-1987. Comment -- out the function (declaration and body) for VHDL 1076-1987 compatibility. ------------------------------------------------------------------------------ -- Id: S.16 function "ror" (ARG: SIGNED; COUNT: INTEGER) return SIGNED; --!V87 -- Result subtype: SIGNED(ARG'LENGTH-1 downto 0) -- Result: ROTATE_RIGHT(ARG, COUNT) --============================================================================ -- RESIZE Functions --============================================================================ -- Id: R.1 function RESIZE (ARG: SIGNED; NEW_SIZE: NATURAL) return SIGNED; -- Result subtype: SIGNED(NEW_SIZE-1 downto 0) -- Result: Resizes the SIGNED vector ARG to the specified size. -- To create a larger vector, the new [leftmost] bit positions -- are filled with the sign bit (ARG'LEFT). When truncating, -- the sign bit is retained along with the rightmost part. -- Id: R.2 function RESIZE (ARG: UNSIGNED; NEW_SIZE: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(NEW_SIZE-1 downto 0) -- Result: Resizes the SIGNED vector ARG to the specified size. -- To create a larger vector, the new [leftmost] bit positions -- are filled with '0'. When truncating, the leftmost bits -- are dropped. --============================================================================ -- Conversion Functions --============================================================================ -- Id: D.1 function TO_INTEGER (ARG: UNSIGNED) return NATURAL; -- Result subtype: NATURAL. Value cannot be negative since parameter is an -- UNSIGNED vector. -- Result: Converts the UNSIGNED vector to an INTEGER. -- Id: D.2 function TO_INTEGER (ARG: SIGNED) return INTEGER; -- Result subtype: INTEGER -- Result: Converts a SIGNED vector to an INTEGER. -- Id: D.3 function TO_UNSIGNED (ARG, SIZE: NATURAL) return UNSIGNED; -- Result subtype: UNSIGNED(SIZE-1 downto 0) -- Result: Converts a non-negative INTEGER to an UNSIGNED vector with -- the specified SIZE. -- Id: D.4 function TO_SIGNED (ARG: INTEGER; SIZE: NATURAL) return SIGNED; -- Result subtype: SIGNED(SIZE-1 downto 0) -- Result: Converts an INTEGER to a SIGNED vector of the specified SIZE. --============================================================================ -- Logical Operators --============================================================================ -- Id: L.1 function "not" (L: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Termwise inversion -- Id: L.2 function "and" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Vector AND operation -- Id: L.3 function "or" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Vector OR operation -- Id: L.4 function "nand" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Vector NAND operation -- Id: L.5 function "nor" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Vector NOR operation -- Id: L.6 function "xor" (L, R: UNSIGNED) return UNSIGNED; -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Vector XOR operation -- --------------------------------------------------------------------------- -- Note : Function L.7 is not compatible with VHDL 1076-1987. Comment -- out the function (declaration and body) for VHDL 1076-1987 compatibility. -- --------------------------------------------------------------------------- -- Id: L.7 function "xnor" (L, R: UNSIGNED) return UNSIGNED; --!V87 -- Result subtype: UNSIGNED(L'LENGTH-1 downto 0) -- Result: Vector XNOR operation -- Id: L.8 function "not" (L: SIGNED) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Termwise inversion -- Id: L.9 function "and" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Vector AND operation -- Id: L.10 function "or" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Vector OR operation -- Id: L.11 function "nand" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Vector NAND operation -- Id: L.12 function "nor" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Vector NOR operation -- Id: L.13 function "xor" (L, R: SIGNED) return SIGNED; -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Vector XOR operation -- --------------------------------------------------------------------------- -- Note : Function L.14 is not compatible with VHDL 1076-1987. Comment -- out the function (declaration and body) for VHDL 1076-1987 compatibility. -- --------------------------------------------------------------------------- -- Id: L.14 function "xnor" (L, R: SIGNED) return SIGNED; --!V87 -- Result subtype: SIGNED(L'LENGTH-1 downto 0) -- Result: Vector XNOR operation --============================================================================ -- Match Functions --============================================================================ -- Id: M.1 function STD_MATCH (L, R: STD_ULOGIC) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: terms compared per STD_LOGIC_1164 intent -- Id: M.2 function STD_MATCH (L, R: UNSIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: terms compared per STD_LOGIC_1164 intent -- Id: M.3 function STD_MATCH (L, R: SIGNED) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: terms compared per STD_LOGIC_1164 intent -- Id: M.4 function STD_MATCH (L, R: STD_LOGIC_VECTOR) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: terms compared per STD_LOGIC_1164 intent -- Id: M.5 function STD_MATCH (L, R: STD_ULOGIC_VECTOR) return BOOLEAN; -- Result subtype: BOOLEAN -- Result: terms compared per STD_LOGIC_1164 intent --============================================================================ -- Translation Functions --============================================================================ -- Id: T.1 function TO_01 (S: UNSIGNED; XMAP: STD_LOGIC := '0') return UNSIGNED; -- Result subtype: UNSIGNED(S'RANGE) -- Result: Termwise, 'H' is translated to '1', and 'L' is translated -- to '0'. If a value other than '0'|'1'|'H'|'L' is found, -- the array is set to (others => XMAP), and a warning is -- issued. -- Id: T.2 function TO_01 (S: SIGNED; XMAP: STD_LOGIC := '0') return SIGNED; -- Result subtype: SIGNED(S'RANGE) -- Result: Termwise, 'H' is translated to '1', and 'L' is translated -- to '0'. If a value other than '0'|'1'|'H'|'L' is found, -- the array is set to (others => XMAP), and a warning is -- issued. end NUMERIC_STD;
gpl-2.0
tgingold/ghdl
testsuite/synth/issue955/tb_ent1.vhdl
1
979
entity tb_ent1 is end tb_ent1; library ieee; use ieee.std_logic_1164.all; architecture behav of tb_ent1 is signal clk : std_logic; signal dout : std_logic_vector (7 downto 0); begin dut: entity work.ent1 port map (clk => clk, o => dout); process procedure pulse is begin clk <= '0'; wait for 1 ns; clk <= '1'; wait for 1 ns; end pulse; begin wait for 1 ns; assert dout = x"10" severity failure; pulse; assert dout = x"11" severity failure; pulse; assert dout = x"12" severity failure; pulse; assert dout = x"13" severity failure; pulse; assert dout = x"14" severity failure; pulse; assert dout = x"15" severity failure; pulse; assert dout = x"16" severity failure; pulse; assert dout = x"17" severity failure; pulse; assert dout = x"00" severity failure; pulse; assert dout = x"00" severity failure; wait; end process; end behav;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc169.vhd
4
2777
-- 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: tc169.vhd,v 1.2 2001-10-26 16:29:42 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c04s03b03x00p01n01i00169ent IS END c04s03b03x00p01n01i00169ent; ARCHITECTURE c04s03b03x00p01n01i00169arch OF c04s03b03x00p01n01i00169ent IS BEGIN TESTING: PROCESS variable V2 : STRING(1 to 5) := "Hello"; alias a3 : STRING(1 to 5) is V2; -- composite alias of composite alias a2 : STRING(4 downto 1) is V2(1 to 4); alias a4 : CHARACTER is V2(4); -- scalar alias of composite BEGIN assert V2 = "Hello"; assert A2 = "Hell"; assert V2(1) = 'H'; assert A2(4) = 'H'; assert V2(2) = 'e'; assert A2(3) = 'e'; assert A3 = "Hello"; assert A4 = 'l'; wait for 5 ns; assert NOT( V2 = "Hello" and A2 = "Hell" and V2(1) = 'H' and A2(4) = 'H' and V2(2) = 'e' and A2(3) = 'e' and A3 = "Hello" and A4 = 'l' ) report "***PASSED TEST: c04s03b03x00p01n01i00169" severity NOTE; assert ( V2 = "Hello" and A2 = "Hell" and V2(1) = 'H' and A2(4) = 'H' and V2(2) = 'e' and A2(3) = 'e' and A3 = "Hello" and A4 = 'l' ) report "***FAILED TEST: c04s03b03x00p01n01i00169 - Alias of alias composite type test failed." severity ERROR; wait; END PROCESS TESTING; END c04s03b03x00p01n01i00169arch;
gpl-2.0
tgingold/ghdl
testsuite/synth/issue1069/ram41.vhdl
1
1648
library ieee; use ieee.std_logic_1164.all, ieee.numeric_std.all; entity tdp_ram is generic ( ADDRWIDTH : positive := 7; WIDTH : positive := 8 ); port ( clk_a : in std_logic; read_a : in std_logic; write_a : in std_logic; addr_a : in std_logic_vector(ADDRWIDTH - 1 downto 0); data_read_a : out std_logic_vector(WIDTH - 1 downto 0); data_write_a : in std_logic_vector(WIDTH - 1 downto 0); clk_b : in std_logic; read_b : in std_logic; write_b : in std_logic; addr_b : in std_logic_vector(ADDRWIDTH - 1 downto 0); data_read_b : out std_logic_vector(WIDTH - 1 downto 0); data_write_b : in std_logic_vector(WIDTH - 1 downto 0) ); end tdp_ram; architecture behavioral of tdp_ram is begin process(clk_a, clk_b) type ram_t is array(0 to 2**ADDRWIDTH - 1) of std_logic_vector(WIDTH - 1 downto 0); variable store : ram_t := (others => (others => '0')); begin if rising_edge(clk_a) then if read_a = '1' then data_read_a <= store(to_integer(unsigned(addr_a))); end if; if write_a = '1' then store(to_integer(unsigned(addr_a))) := data_write_a; end if; elsif rising_edge(clk_b) then if read_b = '1' then data_read_b <= store(to_integer(unsigned(addr_b))); end if; if write_b = '1' then store(to_integer(unsigned(addr_b))) := data_write_b; end if; end if; end process; end behavioral;
gpl-2.0
tgingold/ghdl
testsuite/synth/func01/func03.vhdl
1
499
library ieee; use ieee.std_logic_1164.all; entity func03 is port (a : std_logic_vector (7 downto 0); b : out std_logic_vector (7 downto 0)); end func03; architecture behav of func03 is function gen_mask (len : natural) return std_logic_vector is variable res : std_logic_vector (len - 1 downto 0); begin res := (0 => '1', others => '0'); return res; end gen_mask; constant mask : std_logic_vector(7 downto 0) := gen_mask (8); begin b <= a and mask; end behav;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/analog-modeling/resistor.vhd
4
1129
-- 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 resistor is port ( terminal node1, node2 : electrical ); end entity resistor; architecture ideal of resistor is constant R : real := 1000.0; quantity v across i through node1 to node2; begin v == i * R; end architecture ideal;
gpl-2.0
tgingold/ghdl
testsuite/synth/dispout01/pkg_rec08.vhdl
1
171
library ieee; use ieee.std_logic_1164.all; package rec08_pkg is type myrec is record a : bit_vector (0 downto 0); b : std_logic; end record; end rec08_pkg;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1819.vhd
4
1929
-- 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: tc1819.vhd,v 1.2 2001-10-26 16:30:13 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s01b00x00p08n01i01819ent IS type small_int is range 0 to 7; type byte is range 0 to 3; END c07s01b00x00p08n01i01819ent; ARCHITECTURE c07s01b00x00p08n01i01819arch OF c07s01b00x00p08n01i01819ent IS function test return small_int is variable tmp : small_int := 0; begin tmp := small_int; -- type name illegal here return tmp; end test; signal s_int : small_int := 0; BEGIN TESTING : PROCESS BEGIN s_int <= test after 5 ns; wait for 5 ns; assert FALSE report "***FAILED TEST: c07s01b00x00p08n01i01819 - Type names are not permitted as primaries in a variable assignment statement." severity ERROR; wait; END PROCESS TESTING; END c07s01b00x00p08n01i01819arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1368.vhd
4
6488
-- 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: tc1368.vhd,v 1.2 2001-10-26 16:29:40 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s05b00x00p03n01i01368ent IS END c08s05b00x00p03n01i01368ent; ARCHITECTURE c08s05b00x00p03n01i01368arch OF c08s05b00x00p03n01i01368ent 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_arr1 : st_arr1 := c_st_arr1_1 ; -- BEGIN v_st_arr1(st_arr1'Left) := c_st_arr1_2(st_arr1'Right) ; assert NOT(v_st_arr1(st_arr1'Left) = c_st_int1_2) report "***PASSED TEST: c08s05b00x00p03n01i01368" severity NOTE; assert (v_st_arr1(st_arr1'Left) = c_st_int1_2) report "***FAILED TEST: c08s05b00x00p03n01i01368 - The types of the variable and the assigned variable must match." severity ERROR; wait; END PROCESS TESTING; END c08s05b00x00p03n01i01368arch;
gpl-2.0
tgingold/ghdl
testsuite/gna/issue524/cond.vhdl
1
339
library ieee; use ieee.std_logic_1164.all; entity cond is port (i, rst, clk : std_logic; o : out std_logic); end; architecture behav of cond is begin process (clk) is begin if rising_edge(clk) then if rst then o <= '0'; else o <= i; end if; end if; end process; end;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1989.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: tc1989.vhd,v 1.2 2001-10-26 16:30:14 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s02b02x00p07n01i01989ent IS END c07s02b02x00p07n01i01989ent; ARCHITECTURE c07s02b02x00p07n01i01989arch OF c07s02b02x00p07n01i01989ent IS BEGIN TESTING: PROCESS type ft is file of integer; file f1 : ft is "01.vhdl"; file f2 : ft is "02.vhdl"; BEGIN if (f1=f2) then -- Failure_here -- equality and inequality operators are NULL; -- not defined for file types. end if; assert FALSE report "***FAILED TEST: c07s02b02x00p07n01i01989 - Equality operators are not defined for file types." severity ERROR; wait; END PROCESS TESTING; END c07s02b02x00p07n01i01989arch;
gpl-2.0
tgingold/ghdl
testsuite/gna/issue50/idct.d/add_350.vhd
2
800
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity add_350 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 add_350; architecture augh of add_350 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 '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(32 downto 1); end architecture;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc732.vhd
4
1616
-- 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: tc732.vhd,v 1.2 2001-10-26 16:30:27 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c01s01b01x00p04n01i00732ent IS -- A basic entity with a port port ( signal s : bit) --Failure_here END c01s01b01x00p04n01i00732ent; ARCHITECTURE c01s01b01x00p04n01i00732arch OF c01s01b01x00p04n01i00732ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c01s01b01x00p04n01i00732 - Missing semicolon." severity ERROR; wait; END PROCESS TESTING; END c01s01b01x00p04n01i00732arch;
gpl-2.0
tgingold/ghdl
testsuite/synth/issue973/ent.vhdl
1
302
library ieee; use ieee.std_logic_1164.all; entity ent is port ( i : in std_logic_vector(7 downto 0); o : out std_logic_vector(3 downto 0) ); end; architecture a of ent is alias high_nibble : std_logic_vector(3 downto 0) is i(7 downto 4); begin o <= high_nibble; end;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1640.vhd
4
1709
-- 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: tc1640.vhd,v 1.2 2001-10-26 16:30:11 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s12b00x00p06n01i01640ent IS END c08s12b00x00p06n01i01640ent; ARCHITECTURE c08s12b00x00p06n01i01640arch OF c08s12b00x00p06n01i01640ent IS BEGIN TESTING: PROCESS function ts (x1:bit) return integer is begin return ('1'); end ts; variable k : integer := 0; BEGIN k := ts('1'); assert FALSE report "***FAILED TEST: c08s12b00x00p06n01i01640 - Value of the expression is of different subtype." severity ERROR; wait; END PROCESS TESTING; END c08s12b00x00p06n01i01640arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc672.vhd
4
3202
-- 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: tc672.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:37:58 1996 -- -- **************************** -- -- **************************** -- -- Reversed to VHDL 87 by reverse87.pl - Tue Nov 5 11:26:29 1996 -- -- **************************** -- -- **************************** -- -- Ported to VHDL 93 by port93.pl - Mon Nov 4 17:36:38 1996 -- -- **************************** -- ENTITY c03s04b01x00p23n01i00672ent IS END c03s04b01x00p23n01i00672ent; ARCHITECTURE c03s04b01x00p23n01i00672arch OF c03s04b01x00p23n01i00672ent IS BEGIN TESTING: PROCESS -- Declare the type and the file. type SWITCH_LEVEL is ('0', '1', 'X'); type FT is file of SWITCH_LEVEL; -- Declare the actual file to read. file FILEV : FT open read_mode is "iofile.48"; -- Declare a variable into which we will read. constant CON : SWITCH_LEVEL := '1'; variable VAR : SWITCH_LEVEL ; variable k : integer := 0; BEGIN -- Read in the file. for I in 1 to 100 loop if (ENDFILE( FILEV ) /= FALSE) then k := 1; end if; assert( (ENDFILE( FILEV ) = FALSE) ) report "Hit the end of file too soon."; READ( FILEV,VAR ); if (VAR /= CON) then k := 1; end if; end loop; -- Verify that we are at the end. if (ENDFILE( FILEV ) /= TRUE) then k := 1; end if; assert( ENDFILE( FILEV ) = TRUE ) report "Have not reached end of file yet." severity ERROR; assert NOT( k = 0 ) report "***PASSED TEST: c03s04b01x00p23n01i00672" severity NOTE; assert( k = 0 ) report "***FAILED TEST: c03s04b01x00p23n01i00672 - The variables don't equal the constants." severity ERROR; wait; END PROCESS TESTING; END c03s04b01x00p23n01i00672arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc310.vhd
4
1784
-- 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: tc310.vhd,v 1.2 2001-10-26 16:30:25 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c03s01b04x00p06n01i00310ent IS END c03s01b04x00p06n01i00310ent; ARCHITECTURE c03s01b04x00p06n01i00310arch OF c03s01b04x00p06n01i00310ent IS type R1 is range -10.0 to 10.0; constant C1 : R1 := 2.0 ; signal S1 : R1; BEGIN TESTING: PROCESS BEGIN S1 <= C1 * 6.0 after 5 ns; wait for 10 ns; assert NOT(S1 = 12.0) report "***PASSED TEST: c03s01b04x00p06n01i00310" severity NOTE; assert ( S1=12.0) report "***FAILED TEST: c03s01b04x00p06n01i00310 - Value not within bounds." severity ERROR; wait; END PROCESS TESTING; END c03s01b04x00p06n01i00310arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/digital-modeling/inline_02.vhd
4
1021
-- 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 package adder_types is subtype word is integer; end package adder_types; use work.adder_types.all; -- end not in book entity adder is port ( a, b : in word; sum : out word ); end entity adder;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc3146.vhd
4
2470
-- 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: tc3146.vhd,v 1.2 2001-10-26 16:29:52 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c05s02b02x00p08n01i03146ent_a IS END c05s02b02x00p08n01i03146ent_a; ARCHITECTURE c05s02b02x00p08n01i03146arch_a OF c05s02b02x00p08n01i03146ent_a IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c05s02b02x00p08n01i03146 - Architecture did not implicitly choose the most recently analyzed one for the entity." severity ERROR; wait; END PROCESS TESTING; END c05s02b02x00p08n01i03146arch_a; --most recently analyzed ... ARCHITECTURE c05s02b02x00p08n01i03146arch_b OF c05s02b02x00p08n01i03146ent_a IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***PASSED TEST: c05s02b02x00p08n01i03146" severity NOTE; wait; END PROCESS TESTING; END c05s02b02x00p08n01i03146arch_b; -- ENTITY c05s02b02x00p08n01i03146ent IS END c05s02b02x00p08n01i03146ent; ARCHITECTURE c05s02b02x00p08n01i03146arch OF c05s02b02x00p08n01i03146ent IS component c05s02b02x00p08n01i03146ent_c end component; for comp1 : c05s02b02x00p08n01i03146ent_c use entity work.c05s02b02x00p08n01i03146ent_a; BEGIN comp1 : c05s02b02x00p08n01i03146ent_c; END c05s02b02x00p08n01i03146arch; configuration c05s02b02x00p08n01i03146cfg of c05s02b02x00p08n01i03146ent is for c05s02b02x00p08n01i03146arch end for; end c05s02b02x00p08n01i03146cfg;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/non_compliant/analyzer_failure/tc1537.vhd
4
1884
-- 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: tc1537.vhd,v 1.2 2001-10-26 16:30:10 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s09b00x00p09n05i01537ent IS END c08s09b00x00p09n05i01537ent; ARCHITECTURE c08s09b00x00p09n05i01537arch OF c08s09b00x00p09n05i01537ent IS procedure copy ( variable v_in : in integer := 0; variable v_out : out integer ) is begin v_out := v_in; end copy; BEGIN TESTING: PROCESS BEGIN L1: for i in 4 to 5 loop copy (6, i); -- illegal: 2nd param is mode "inout" end loop L1; assert FALSE report "***FAILED TEST: c08s09b00x00p09n05i01537 - A loop parameter can not be an actual corresponding to a formal of mode out " severity ERROR; wait; END PROCESS TESTING; END c08s09b00x00p09n05i01537arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/analog-modeling/variable_comparator.vhd
4
1513
-- 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 variable_comparator is port ( terminal a : electrical; terminal ref : electrical; signal d : out std_ulogic ); end entity variable_comparator; ---------------------------------------------------------------- architecture ideal of variable_comparator is quantity v_ref across ref; quantity vin across a; begin comparator_behavior : process is begin if vin > v_ref then d <= '1' after 5 ns; else d <= '0' after 5 ns; end if; wait on vin'above(v_ref / 2.0); end process comparator_behavior; end architecture ideal;
gpl-2.0
tgingold/ghdl
testsuite/gna/issue50/vector.d/muxb_123.vhd
2
355
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity muxb_123 is port ( in_sel : in std_logic; out_data : out std_logic; in_data0 : in std_logic; in_data1 : in std_logic ); end muxb_123; architecture augh of muxb_123 is begin out_data <= in_data0 when in_sel = '0' else in_data1; end architecture;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2743.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: tc2743.vhd,v 1.2 2001-10-26 16:29:49 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c13s06b00x00p04n01i02743ent IS END c13s06b00x00p04n01i02743ent; ARCHITECTURE c13s06b00x00p04n01i02743arch OF c13s06b00x00p04n01i02743ent IS constant mystring : string := "abcdefghijklmnopqrstuvwxyz"; BEGIN TESTING: PROCESS BEGIN assert NOT( mystring'length = 26 ) report "***PASSED TEST: c13s06b00x00p04n01i02743" severity NOTE; assert ( mystring'length = 26 ) report "***FAILED TEST: c13s06b00x00p04n01i02743 - The length of a character string is the number of character values in the sequence represented." severity ERROR; wait; END PROCESS TESTING; END c13s06b00x00p04n01i02743arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-ams/ashenden/compliant/digital-modeling/S_R_flipflop.vhd
4
1248
-- 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 S_R_flipflop is port ( s, r : in bit; q, q_n : out bit ); end entity S_R_flipflop; -------------------------------------------------- architecture functional of S_R_flipflop is begin q <= '1' when s = '1' else '0' when r = '1'; q_n <= '0' when s = '1' else '1' when r = '1'; check : assert not (s = '1' and r = '1') report "Incorrect use of S_R_flip_flop: s and r both '1'"; end architecture functional;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/disputed/tc1749.vhd
4
2079
-- 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: tc1749.vhd,v 1.2 2001-10-26 16:30:04 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c09s05b00x00p16n01i01749ent IS END c09s05b00x00p16n01i01749ent; ARCHITECTURE c09s05b00x00p16n01i01749arch OF c09s05b00x00p16n01i01749ent IS signal a : bit; signal b : bit; signal grd : boolean; BEGIN grd <= not grd after 75 ns; block_label : BLOCK (grd) begin b <= guarded '1' after 1 ns; end block block_label; BG: block (grd) begin TESTING: PROCESS BEGIN if GUARD then a <= '1' after 1 ns; end if; wait on GUARD, a; END PROCESS TESTING; end block BG; process(a,b) begin if (now > 1 ns) then assert NOT( a=b ) report "***PASSED TEST: c09s05b00x00p16n01i01749" severity NOTE; assert ( a=b ) report "***FAILED TEST: c09s05b00x00p16n01i01749 - Concurrent signal assignment test failed." severity ERROR; end if; end process; END c09s05b00x00p16n01i01749arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc951.vhd
4
1923
-- 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: tc951.vhd,v 1.2 2001-10-26 16:30:02 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s01b00x00p10n01i00951ent IS END c06s01b00x00p10n01i00951ent; ARCHITECTURE c06s01b00x00p10n01i00951arch OF c06s01b00x00p10n01i00951ent IS BEGIN TESTING: PROCESS type TWO is range 1 to 2; type R1 is record X1: TWO; RE1: BOOLEAN; end record; type A1 is array (TWO) of R1; variable V1: BOOLEAN; variable V2: A1 ; BEGIN V1 := V2(1).RE1; assert NOT(V1 = false) report "***PASSED TEST: c06s01b00x00p10n01i00951" severity NOTE; assert (V1 = false) report "***FAILED TEST: c06s01b00x00p10n01i00951 - Prefix of a selected name cannot be an aggregate." severity ERROR; wait; END PROCESS TESTING; END c06s01b00x00p10n01i00951arch;
gpl-2.0
tgingold/ghdl
testsuite/synth/asgn01/asgn08.vhdl
1
535
library ieee; use ieee.std_logic_1164.all; entity asgn08 is port (clk : std_logic; ce : std_logic; s0 : std_logic; r : out std_logic_vector (65 downto 0)); end asgn08; architecture behav of asgn08 is begin r (0) <= '1'; process (clk) is begin if rising_edge(clk) and ce = '1' then if s0 = '1' then r (64 downto 1) <= x"ffff_eeee_dddd_cccc"; r (65) <= '1'; else r (8 downto 5) <= x"7"; r (65) <= '0'; end if; end if; end process; end behav;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc2151.vhd
4
2085
-- 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: tc2151.vhd,v 1.2 2001-10-26 16:29:46 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c07s02b04x00p21n01i02151ent IS END c07s02b04x00p21n01i02151ent; ARCHITECTURE c07s02b04x00p21n01i02151arch OF c07s02b04x00p21n01i02151ent IS TYPE real_v is array (integer range <>) of real; SUBTYPE real_1 is real_v (1 to 1); SUBTYPE real_null is real_v (1 to 0); BEGIN TESTING: PROCESS variable result : real_1; variable l_operand : real_null; variable r_operand : real := 12.345; BEGIN -- -- The element is treated as an implicit single element array ! -- result := l_operand & r_operand; wait for 5 ns; assert NOT(result(1) = 12.345) report "***PASSED TEST: c07s02b04x00p21n01i02151" severity NOTE; assert (result(1) = 12.345) report "***FAILED TEST: c07s02b04x00p21n01i02151 - Concatenation of null and REAL array failed." severity ERROR; wait; END PROCESS TESTING; END c07s02b04x00p21n01i02151arch;
gpl-2.0
tgingold/ghdl
testsuite/vests/vhdl-93/billowitch/compliant/tc1413.vhd
4
2252
-- 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: tc1413.vhd,v 1.2 2001-10-26 16:29:41 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s05b01x00p01n01i01413ent IS END c08s05b01x00p01n01i01413ent; ARCHITECTURE c08s05b01x00p01n01i01413arch OF c08s05b01x00p01n01i01413ent IS BEGIN TESTING: PROCESS function check (i : integer) return real is begin return (1.0); end; type rec_type is record x : integer; y : real; z : boolean; b : bit; end record; type array_type is array (1 to 10) of rec_type; variable v1 : array_type; constant i : integer := 20; BEGIN v1 (1).x := i; v1 (1).y := check(i); v1 (1).z := true; v1 (1).b := bit'('0'); assert NOT(v1(1).x=20 and v1(1).y=1.0 and v1(1).z=true and v1(1).b='0') report "***PASSED TEST: c08s05b01x00p01n01i01413" severity NOTE; assert (v1(1).x=20 and v1(1).y=1.0 and v1(1).z=true and v1(1).b='0') report "***FAILED TEST: c08s05b01x00p01n01i01413 Each element of the array variable there is a matching element on the right hand side." severity ERROR; wait; END PROCESS TESTING; END c08s05b01x00p01n01i01413arch;
gpl-2.0
tgingold/ghdl
testsuite/gna/bug090/hang3.vhdl
1
128
entity hello is end hello; architecture behav of hello is begin assert false report "Hello world" severity note;with behav;
gpl-2.0
tgingold/ghdl
testsuite/synth/var01/tb_var01c.vhdl
1
984
entity tb_var01c is end tb_var01c; library ieee; use ieee.std_logic_1164.all; architecture behav of tb_var01c is signal clk : std_logic; signal mask : std_logic_vector (1 downto 0); signal val : std_logic_vector (1 downto 0); signal res : std_logic_vector (3 downto 0); begin dut: entity work.var01c port map ( clk => clk, mask => mask, val => val, res => res); process procedure pulse is begin clk <= '0'; wait for 1 ns; clk <= '1'; wait for 1 ns; end pulse; begin mask <= "11"; val <= b"01"; pulse; assert res = b"01_01" report "res=" & to_bstring (res) severity failure; mask <= "10"; val <= b"11"; pulse; assert res = b"11_01" severity failure; mask <= "00"; val <= b"00"; pulse; assert res = b"11_01" severity failure; mask <= "01"; val <= b"10"; pulse; assert res = b"11_10" severity failure; wait; end process; end behav;
gpl-2.0