1 2-- Copyright (C) 2001-2002 The University of Cincinnati. 3-- All rights reserved. 4 5-- This file is part of VESTs (Vhdl tESTs). 6 7-- UC MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE 8-- SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 9-- IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 10-- OR NON-INFRINGEMENT. UC SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY 11-- LICENSEE AS A RESULT OF USING, RESULT OF USING, MODIFYING OR 12-- DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. 13 14-- By using or copying this Software, Licensee agrees to abide by the 15-- intellectual property laws, and all other applicable laws of the U.S., 16-- and the terms of this license. 17 18-- You may modify, distribute, and use the software contained in this 19-- package under the terms of the "GNU GENERAL PUBLIC LICENSE" version 2, 20-- June 1991. A copy of this license agreement can be found in the file 21-- "COPYING", distributed with this archive. 22 23-- You should have received a copy of the GNU General Public License 24-- along with VESTs; if not, write to the Free Software Foundation, 25-- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 27-- --------------------------------------------------------------------- 28-- 29-- $Id: test104.ams,v 1.1 2002-03-27 22:11:19 paw Exp $ 30-- $Revision: 1.1 $ 31-- 32-- --------------------------------------------------------------------- 33 34---------------------------------------------------------------------- 35-- SIERRA REGRESSION TESTING MODEL 36-- Develooped at: 37-- Distriburted Processing Laboratory 38-- University of cincinnati 39-- Cincinnati 40---------------------------------------------------------------------- 41-- File : test104.ams 42-- Author(s) : Geeta Balarkishnan(gbalakri@ececs.uc.edu) 43-- Created : May 2001 44---------------------------------------------------------------------- 45-- Description : 46---------------------------------------------------------------------- 47-- this is a test that checks for the correct implementation of if use 48-- end use. The condition is checked by comparing the quantity against a 49-- known constant value. 50----------------------------------------------------------------------- 51PACKAGE electricalSystem IS 52 NATURE electrical IS real ACROSS real THROUGH GROUND REFERENCE; 53 FUNCTION SIN(X : real) RETURN real; 54 FUNCTION EXP(X : real) RETURN real; 55 FUNCTION SQRT(X : real) RETURN real; 56 FUNCTION POW(X,Y : real) RETURN real; 57 58END PACKAGE electricalSystem; 59use work.electricalSystem.all; 60 61entity test is 62 generic (vmax :real:=10.0); 63end entity; 64 65architecture atest of test is 66terminal T1:electrical; 67quantity vin across T1; 68constant a:real:=1.0; 69constant b:real:=2.0; 70quantity vin1:real; 71quantity vin2:real; 72 73begin 74 75vin == vmax/a; 76 77if (vin==10.0) use 78e1: vin1==vmax*b; 79else 80e2: vin2==vmax; 81end use; 82 83 84--if(vin<vmax) use 85--e3: vin==vmax/b; 86--else 87--e4: vin==vmax; 88--end use; 89 90end architecture atest; 91