diff options
Diffstat (limited to 'testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC')
10 files changed, 1923 insertions, 0 deletions
diff --git a/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/MeasFreq.vhd b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/MeasFreq.vhd new file mode 100644 index 000000000..ad51b8704 --- /dev/null +++ b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/MeasFreq.vhd @@ -0,0 +1,45 @@ + +-- 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 MeasFreq is + generic ( thres : real := 0.0 ); + port ( terminal input : electrical; + signal f_out : out real := 0.0 ); +end entity MeasFreq; + +---------------------------------------------------------------- + +architecture ThresDetect of MeasFreq is + + quantity vin across input; + +begin + + detect : process ( vin'above(thres) ) is + variable t_old : real := real'low; + begin + if vin'above(thres) then + f_out <= 1.0 / (now - t_old); + t_old := now; + end if; + end process detect; + +end ThresDetect; diff --git a/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/PLL.vhd b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/PLL.vhd new file mode 100644 index 000000000..62a2162d8 --- /dev/null +++ b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/PLL.vhd @@ -0,0 +1,72 @@ + +-- 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; +library ieee; use ieee.math_real.all; + +entity PLL is + + generic ( Fp : real := 20.0e3; -- loop filter pole freq [Hz] + Fz : real := 1.0e6; -- loop filter zero freq [Hz] + Kv : real := 100.0e3; -- VCO gain [Hz/V] + Fc : real := 1.0e6 ); -- VCO center freq [Hz] + + port ( terminal input, lf_out, vco_out : electrical ); + +end entity PLL; + +---------------------------------------------------------------- + +architecture behavioral of PLL is + + quantity v_in across input to electrical_ref; + quantity v_lf across i_lf through lf_out to electrical_ref; + quantity v_vco across i_vco through vco_out to electrical_ref; + + -- internal quantities and constants + + -- multiplier + quantity mult : real; + + -- loop filter (Lag) + constant wp : real := math_2_pi * fp; -- pole freq in rad/s + constant wz : real := math_2_pi * fz; -- zero freq in rad/s + constant num : real_vector := (1.0, 1.0 / wz); -- numerator array + constant den : real_vector := (1.0, 1.0 / wp); -- denominator array + + -- VCO + quantity phi : real; -- used in VCO equation + constant Kv_w : real := math_2_pi * Kv; -- change gain to (rad/s)/V + constant wc : real := math_2_pi * Fc; -- change freq to rad/s + +begin + + if domain = quiescent_domain use + phi == 0.0; -- initialize phi + else + phi'dot == wc + Kv_w * (v_lf); -- calculate VCO frequency + end use; + + mult == v_in * v_vco; -- multiplier output + + v_lf == mult'ltf(num, den); -- loop filter output + + v_vco == cos(phi); -- VCO output + +end architecture behavioral; diff --git a/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/bfsk.vhd b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/bfsk.vhd new file mode 100644 index 000000000..96cc54e42 --- /dev/null +++ b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/bfsk.vhd @@ -0,0 +1,61 @@ + +-- 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, ieee_proposed; +use ieee_proposed.electrical_systems.all; +use ieee.std_logic_1164.all; +use ieee.math_real.all; + +entity bfsk is + + generic ( fc : real := 1.0e6; -- mean carrier frequency + delta_f : real := 5.0e3; -- difference between low and high + -- carrier frequencies + amp : voltage := 1.0; -- amplitude of modulated signal + offset : voltage := 0.0 ); -- output offset voltage + + port ( signal d_in : in std_logic; -- digital input + terminal a_out : electrical ); -- output terminal + +end entity bfsk; + +---------------------------------------------------------------- + +architecture behavioral of bfsk is + + quantity vout across iout through a_out; -- output branch + quantity phi : real; -- free quantity angle in radians + constant wc : real := math_2_pi * fc; -- convert fc to rad/s + constant delta_w : real := math_2_pi * delta_f; -- convert delta_f to rad/s + +begin + + if To_X01(d_in) = '0' use + phi'dot == wc; -- set to carrier frequency + elsif To_X01(d_in) = '1' use + phi'dot == wc + delta_w; -- set to carrier frequency + delta + else + phi'dot == 0.0; + end use; + + break on d_in; + + vout == offset + amp * sin(phi); -- create sinusoidal output using phi + +end architecture behavioral; diff --git a/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/bfsk_wa.vhd b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/bfsk_wa.vhd new file mode 100644 index 000000000..3a58538f2 --- /dev/null +++ b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/bfsk_wa.vhd @@ -0,0 +1,63 @@ + +-- 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, ieee_proposed; +use ieee_proposed.electrical_systems.all; +use ieee.std_logic_1164.all; +use ieee.math_real.all; + +entity bfsk_wa is + + generic ( fc : real := 455.0e3; -- mean carrier frequency + delta_f : real := 5.0e3; -- difference between low and high + -- carrier frequency + amp : voltage := 1.0; -- amplitude of modulated signal + offset : voltage := 0.0 ); -- output offset voltage + + port ( signal d_in : in std_logic; -- digital input + terminal a_out : electrical ); -- output terminal + +end entity bfsk_wa; + +---------------------------------------------------------------- + +architecture behavioral of bfsk_wa is + + quantity vout across iout through a_out; -- output branch + quantity phi : real; -- free quantity angle in radians + constant wc : real := math_2_pi * fc; -- convert fc to rad/s + constant delta_w : real := math_2_pi * delta_f; -- convert delta_f to rad/s + +begin + + if To_X01(d_in) = '0' use + phi'dot == wc; -- set to carrier frequency + elsif To_X01(d_in) = '1' use + phi'dot == wc + delta_w; -- set to carrier frequency + delta + else + phi'dot == 0.0; + end use; + + vout == offset + amp * sin(phi); -- create sinusoidal output using phi + +end architecture behavioral; + + + + diff --git a/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/index-ams.txt b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/index-ams.txt new file mode 100644 index 000000000..d5ec2129a --- /dev/null +++ b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/index-ams.txt @@ -0,0 +1,37 @@ +--------------------------------------------------------------------------------------------------------------------------------------------- +-- Chapter 23 - Case Study 4: Communications System +--------------------------------------------------------------------------------------------------------------------------------------------- +-- Filename Primary Unit Secondary Unit Figure/Section +----------- ------------ -------------- -------------- +bfsk.vhd entity bfsk behavioral Figure 23-3 +bfsk_wa.vhd entity bfsk_wa behavioral -- +MeasFreq.vhd entity MeasFreq ThresDetect Figure 23-5 +v_BPF.vhd entity v_BPF behavioral Figure 23-8 +v_Sum.vhd entity v_Sum behavioral Figure 23-9 +PLL.vhd entity PLL behavioral Figure 23-12 +--------------------------------------------------------------------------------------------------------------------------------------------- +-- TestBenches +--------------------------------------------------------------------------------------------------------------------------------------------- +-- Filename Primary Unit Secondary Unit Tested Model +------------ ------------ -------------- ------------ +tb_pll.vhd entity tb_pll tb_pll PLL.vhd +tb_CS4_CommSys_PLL.vhd entity VCOAnalog behavioral +-- entity vLeadLag behavioral +-- entity vMult behavioral +-- entity PLL PLL +-- entity bfsk behavioral +-- entity vLPF_2nd behavioral +-- entity MeasFreq ThresDetect +-- entity a2d_bit ideal +-- entity tb_CS4_CommSys_PLL TB_CS4_CommSys_PLL +tb_CS4_CommSys_det.vhd entity capacitor ideal +-- entity resistor ideal +-- entity diode ideal +-- entity EnvDetect EnvDetect +-- entity bfsk behavioral +-- entity vSum behavioral +-- entity vLPF_2nd behavioral +-- entity vBPF behavioral +-- entity MeasFreq ThresDetect +-- entity a2d_bit ideal +-- entity tb_CS4_CommSys_det TB_CS4_CommSys_det diff --git a/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/tb_CS4_CommSys_PLL.vhd b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/tb_CS4_CommSys_PLL.vhd new file mode 100644 index 000000000..4009d133a --- /dev/null +++ b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/tb_CS4_CommSys_PLL.vhd @@ -0,0 +1,639 @@ + +-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc + +-- This file is part of VESTs (Vhdl tESTs). + +-- VESTs is free software; you can redistribute it and/or modify it +-- under the terms of the GNU General Public License as published by the +-- Free Software Foundation; either version 2 of the License, or (at +-- your option) any later version. + +-- VESTs is distributed in the hope that it will be useful, but WITHOUT +-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +-- for more details. + +-- You should have received a copy of the GNU General Public License +-- along with VESTs; if not, write to the Free Software Foundation, +-- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : VCOAnalog.vhd +-- Author : Mentor Graphics +-- Created : 2001/07/11 +-- Last update: 2002/05/21 +------------------------------------------------------------------------------- +-- Description: Analog Voltage Controlled Oscillator +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/07/11 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- +library IEEE; +use IEEE.math_real.all; +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity VCOAnalog is + generic ( + Kv : real := 100.0e3; -- VCO Gain [Hz/Volt] + Fc : real := 1.0e6; -- center freq [Hz] + Vc : voltage := 2.5; -- input voltage that gives fc [Volts] + Vcmin : voltage := 0.0; -- control voltage mininum [Volts] + Vcmax : voltage := 5.0; -- control voltage maximum [Volts] + Vout_ampl : voltage := 1.0; -- amplitude of output [Volts] + Vout_offset : voltage := 0.0 -- offset voltage of output [Volts] + ); + port ( + terminal v_inp, v_inm, output : electrical); +end entity VCOAnalog; + +------------------------------------------------------------------------------- +-- VCO Equation: +-- Fout = Fc + Kv*Vin +------------------------------------------------------------------------------- +architecture behavioral of VCOAnalog is + quantity vout across iout through output to electrical_ref; + quantity vctrl across v_inp to v_inm; + quantity phi : real; + quantity vtmp : real; + constant Kv_w : real := math_2_pi*Kv; -- convert to (Rad/s)/Volt + constant wc : real := math_2_pi*Fc; -- convert freq to Rad/s + +begin -- ARCHITECTURE behavioral + + if vctrl > Vcmax use -- test control voltage for limits + vtmp == Vcmax; + elsif vctrl < Vcmin use + vtmp == Vcmin; + else + vtmp == vctrl; + end use; + + if domain = quiescent_domain use + phi == 0.0; + else + -- use one of the following equations depending on preference + -- phi'dot == Fc + Kv*(vtmp-Vc); -- Calculate output Freq in Rad/s + phi'dot == wc + Kv_w*(vtmp-Vc); -- Calculate output Freq in Hz + end use; + +-- Use one of the following equations depending on phi'dot equation above +--vout == Vout_offset + Vout_ampl*cos(math_2_pi*phi); +vout == Vout_offset + Vout_ampl*cos(phi); + +end architecture behavioral; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : vLeadLag.vhd +-- Author : Mentor Graphics +-- Created : 2001/11/09 +-- Last update: 2001/11/27 +------------------------------------------------------------------------------- +-- Description: Lead-Lag filter with electrical connections +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/11/09 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- +library ieee; +use ieee.math_real.all; +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity vLeadLag is + + generic ( + K : real := 1.0; -- gain + Fp : real := 20.0e3; -- pole frequency + Fz : real := 1.0e6); -- zero frequency + + port ( + terminal input, output : electrical); + +end entity vLeadLag; + +------------------------------------------------------------------------------- +-- Transfer Fucntion: +-- +-- 1 + (s/wz) +-- H(s) = K * ------------ +-- 1 + (s/wp) +-- +------------------------------------------------------------------------------- + +architecture behavioral of vLeadLag is + + quantity vin across input to electrical_ref; + quantity vout across iout through output to electrical_ref; + constant wp : real := math_2_pi*Fp; -- Pole freq (in radians) + constant wz : real := math_2_pi*Fz; -- Zero freq (in radians) + constant num : real_vector := (1.0, 1.0/wz); + constant den : real_vector := (1.0, 1.0/wp); + +begin + + vout == K * vin'ltf(num, den); -- Laplace transform of input + +end architecture behavioral; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : vMult.vhd +-- Author : Mentor Graphics +-- Created : 2001/11/09 +-- Last update: 2001/11/09 +------------------------------------------------------------------------------- +-- Description: Two input Multiplier with electrical connections +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/11/09 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- + +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity vMult is + + generic (K : real := 1.0); -- Gain + + port ( + terminal in1, in2 : electrical; + terminal output : electrical); + +end entity vMult; + +architecture behavioral of vMult is + + quantity vin1 across in1 to electrical_ref; + quantity vin2 across in2 to electrical_ref; + quantity vout across iout through output to electrical_ref; + +begin + + vout == k * vin1 * vin2; + +end architecture behavioral; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- + +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_arith.all; + +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; +use IEEE_proposed.mechanical_systems.all; +use IEEE_proposed.fluidic_systems.all; +use IEEE_proposed.thermal_systems.all; +use IEEE_proposed.radiant_systems.all; + +entity PLL is + port( + terminal lf_out : electrical; + terminal input : electrical; + terminal vco_out : electrical + ); +end PLL; + +architecture PLL of PLL is + -- Component declarations + -- Signal declarations + terminal pd_out : electrical; +begin + -- Signal assignments + -- Component instances + vco2 : entity work.VCOAnalog(behavioral) + generic map( + Fc => 455.0e3, + Vcmax => 5.0, + Vcmin => -5.0, + Vc => 0.0 + ) + port map( + v_inp => lf_out, + output => vco_out, + v_inm => ELECTRICAL_REF + ); + vLeadLag1 : entity work.vLeadLag(behavioral) + generic map( + Fz => 500.0e3 + ) + port map( + input => pd_out, + output => lf_out + ); + vmult1 : entity work.vMult(behavioral) + port map( + in1 => input, + in2 => vco_out, + output => pd_out + ); +end PLL; +-- + +-- Model of Binary Frequency Shift Keying (BFSK) modulator +-- with digital input and analog output + +library IEEE; +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; +use IEEE.STD_LOGIC_1164.all; +use IEEE.MATH_REAL.all; + +entity bfsk is + generic ( + fc : real := 455.0e3; -- Mean carrier frequency + delta_f : real := 5.0e3; -- Difference between low and high carrier frequency + amp : voltage := 1.0; -- Amplitude of modulated signal + offset : voltage := 0.0 -- output offset voltage + ); + + port ( + d_in : in std_logic; -- digital input + terminal a_out : electrical -- output terminal + ); +end entity bfsk; + +architecture behavioral of bfsk is + + quantity vout across iout through a_out; -- output branch + quantity phi : real; -- free quantity for angle in radians + constant wc : real := math_2_pi*fc; -- convert fc to rad/s + constant delta_w : real := math_2_pi*delta_f; -- convert delta_f to rad/s + +begin + + if (d_in = '0') use + phi'dot == wc; -- set to carrier frequency + elsif (d_in = '1') use + phi'dot == wc + delta_w; -- set to carrier frequency + delta + else + phi'dot == 0.0; + end use; + + vout == offset + amp*sin(phi); -- create sinusoidal output using phi + +end architecture behavioral; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : vLPF_2nd.vhd +-- Author : Mentor Graphics +-- Created : 2001/11/27 +-- Last update: 2001/11/27 +------------------------------------------------------------------------------- +-- Description: 2nd order Lowpass Filter with Electrical connections +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/11/27 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- +library IEEE; +use IEEE.MATH_REAL.all; +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity vLPF_2nd is + generic ( K : real := 1.0; -- Filter Gain + Fp : real; -- Double Pole Frequency [Hz] + Q : real := 0.707 -- Quality factor + ); + port ( terminal input : electrical; + terminal output : electrical + ); +end entity vLPF_2nd; +------------------------------------------------------------------------------- +-- Transfer Function: +-- +-- wp^2 +-- Vo(s) = K * --------------------- Vin(s) +-- S^2 + (wp/Q)*s + wp^2 +------------------------------------------------------------------------------- +architecture behavioral of vLPF_2nd is + quantity vin across input; + quantity vout across iout through output; + + constant wp : real := math_2_pi*Fp; -- Frequency in Radians + constant num : real_vector := (wp*wp, 0.0, 0.0); -- Numerator array + constant den : real_vector := (wp*wp, wp/Q, 1.0); -- Denominator array + +begin + + vout == K * vin'ltf(num, den); -- Laplace Transform of input + +end architecture behavioral; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- + +library ieee_proposed; +use ieee_proposed.electrical_systems.all; + +entity MeasFreq is + generic ( thres : real := 0.0 ); -- threshold crossing + port ( terminal input : electrical; + signal f_out : out real := 0.0); +end entity MeasFreq; + +architecture ThresDetect of MeasFreq is + quantity vin across input; +-- signal freq : real := 0.0; +begin +-- f_out <= freq; + detect : process (vin'above(thres)) is + variable t_old : real := real'low; + begin + if vin'above(thres) then + f_out <= 1.0 / (now - t_old); + t_old := now; + end if; + end process detect; +end ThresDetect; +-- + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : a2d_bit.vhd +-- Author : Mentor Graphics +-- Created : 2001/06/16 +-- Last update: 2001/06/16 +------------------------------------------------------------------------------- +-- Description: Ideal one bit A/D converter +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/06/16 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- + +library IEEE; +use IEEE.math_real.all; +use IEEE.std_logic_1164.all; + +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity a2d_bit is + + generic ( + thres : real := 2.5); -- Threshold to determine logic output + + port ( + terminal a : electrical; -- analog input + signal d : out std_logic); -- digital (std_logic) output + +end entity a2d_bit; + +------------------------------------------------------------------------------- +-- Ideal architecture +-- Uses 'above operator to detect threshold crossing +------------------------------------------------------------------------------- +architecture ideal of a2d_bit is + + quantity vin across a; + +begin + + -- purpose: Detect threshold crossing and assign event on output (d) + -- type : combinational + -- inputs : vin'above(thres) + -- outputs: pulse_signal + process (vin'above(thres)) is + begin -- PROCESS + if vin'above(thres) then + d <= '1'; + else + d <= '0'; + end if; + end process; + +end ideal; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- + +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_arith.all; + +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; +use IEEE_proposed.mechanical_systems.all; +use IEEE_proposed.fluidic_systems.all; +use IEEE_proposed.thermal_systems.all; +use IEEE_proposed.radiant_systems.all; + +entity tb_CS4_CommSys_PLL is +end tb_CS4_CommSys_PLL; + +architecture TB_CS4_CommSys_PLL of tb_CS4_CommSys_PLL is + -- Component declarations + -- Signal declarations + terminal a_out : electrical; + signal baseband : std_logic; + terminal fsk_out : electrical; + signal fsk_out_f : real; + terminal lpf_pll_out : electrical; + terminal vco_out : electrical; + signal bitstream : std_logic; + signal vco_out_f : real; +begin + -- Signal assignments + -- Component instances + pll3 : entity work.PLL + port map( + vco_out => vco_out, + input => fsk_out, + lf_out => lpf_pll_out + ); + BFSK4 : entity work.bfsk(behavioral) + port map( + d_in => bitstream, + a_out => fsk_out + ); + vLPF1 : entity work.vLPF_2nd(behavioral) + generic map( + K => 200.0, + Fp => 50.0e3 + ) + port map( + input => lpf_pll_out, + output => a_out + ); + MeasFreq8 : entity work.MeasFreq(ThresDetect) + port map( + input => fsk_out, + f_out => fsk_out_f + ); + MeasFreq9 : entity work.MeasFreq(ThresDetect) + port map( + input => vco_out, + f_out => vco_out_f + ); + a4 : entity work.a2d_bit(ideal) + port map( + D => baseband, + A => a_out + ); + -- bitstream + P_bitstream : + process + begin + -- 0.000 + wait for 0.000 ns; bitstream <= '0'; + -- 50000.000 + wait for 50000.000 ns; bitstream <= '1'; + -- 100000.000 + wait for 50000.000 ns; bitstream <= '0'; + -- 150000.000 + wait for 50000.000 ns; bitstream <= '1'; + -- 200000.000 + wait for 50000.000 ns; bitstream <= '0'; + -- 300000.000 + wait for 100000.000 ns; bitstream <= '1'; + -- 501000.000 + wait for 201000.000 ns; bitstream <= '0'; + -- 550000.000 + wait for 49000.000 ns; bitstream <= '1'; + -- 600000.000 + wait for 50000.000 ns; bitstream <= '0'; + wait; + end process; + +end TB_CS4_CommSys_PLL; + + diff --git a/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/tb_CS4_CommSys_det.vhd b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/tb_CS4_CommSys_det.vhd new file mode 100644 index 000000000..6e989b326 --- /dev/null +++ b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/tb_CS4_CommSys_det.vhd @@ -0,0 +1,830 @@ + +-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc + +-- This file is part of VESTs (Vhdl tESTs). + +-- VESTs is free software; you can redistribute it and/or modify it +-- under the terms of the GNU General Public License as published by the +-- Free Software Foundation; either version 2 of the License, or (at +-- your option) any later version. + +-- VESTs is distributed in the hope that it will be useful, but WITHOUT +-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +-- for more details. + +-- You should have received a copy of the GNU General Public License +-- along with VESTs; if not, write to the Free Software Foundation, +-- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : capacitor.vhd +-- Author : Mentor Graphics +-- Created : 2001/06/16 +-- Last update: 2002/05/21 +------------------------------------------------------------------------------- +-- Description: Electrical Capacitor +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/06/16 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- + +-- Use proposed IEEE natures and packages +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity capacitor is + + generic ( + cap : capacitance; -- Capacitance [F] + v_ic : real := real'low); -- Initial voltage (activated by + -- IF statement below) + + port ( + terminal p1, p2 : electrical); + +end entity capacitor; + +------------------------------------------------------------------------------- +-- Ideal Architecture (I = C * dV/dt) +-- Includes initial condition +------------------------------------------------------------------------------- +architecture ideal of capacitor is + + quantity v across i through p1 to p2; + +begin + + if domain = quiescent_domain and v_ic /= real'low use + v == v_ic; + else + i == cap * v'dot; -- characteristic equation + end use; + +end architecture ideal; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : resistor.vhd +-- Author : Mentor Graphics +-- Created : 2001/06/16 +-- Last update: 2001/06/16 +------------------------------------------------------------------------------- +-- Description: Electrical Resistor +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/06/16 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- + +-- Use proposed IEEE natures and packages +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity resistor is + + generic ( + res : resistance); -- resistance (no initial value) + + port ( + terminal p1, p2 : electrical); + +end entity resistor; + +------------------------------------------------------------------------------- +-- Ideal Architecture (V = I*R) +------------------------------------------------------------------------------- +architecture ideal of resistor is + + quantity v across i through p1 to p2; + +begin + +-- Characteristic equation + v == i*res; + +end architecture ideal; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : diode.vhd +-- Author : Mentor Graphics +-- Created : 2001/06/16 +-- Last update: 2001/11/07 +------------------------------------------------------------------------------- +-- Description: Diode model with ideal architecture +-- Currently no Generics due to bug in DV +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/06/16 1.0 Mentor Graphics Created +-- 2001/11/07 1.1 Mentor Graphics Added limit_exp function +------------------------------------------------------------------------------- + +library IEEE; +use IEEE.math_real.all; + +-- Use proposed IEEE natures and packages +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; +-- energy_systems package needed for Boltzmann constant (K = Joules/Kelvin) +use IEEE_proposed.energy_systems.all; + +entity diode is + + port ( + terminal p, n : electrical); + +end entity diode; + +------------------------------------------------------------------------------- +-- Ideal Architecture: i = is*(exp(v/vt) - 1) +------------------------------------------------------------------------------- +architecture ideal of diode is + +-- Declare internal quanties and constants + quantity v across i through p to n; + constant isat : current := 1.0e-14; -- Saturation current [Amps] + constant TempC : real := 27.0; -- Ambient Temperature [Degrees] + constant TempK : real := 273.0 + TempC; -- Temperaure [Kelvin] + constant vt : real := K*TempK/Q; -- Thermal Voltage + + -- This function is to limit the exponential function to avoid convergence + -- problems due to numerical overflow. At x=100, it becomes a straight line + -- with slope matching that at the intercept. + function limit_exp( x : real ) return real is + variable abs_x : real := abs(x); + variable result : real; + begin + if abs_x < 100.0 then + result := exp(abs_x); + else + result := exp(100.0) * (abs_x - 99.0); + end if; + -- If exponent is negative, set exp(-x) = 1/exp(x) + if x < 0.0 then + result := 1.0 / result; + end if; + return result; + end function limit_exp; +begin -- ideal architecture + +-- Characteristic equation + i == isat*(limit_exp(v/vt) - 1.0); + +end architecture ideal; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- + +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_arith.all; + +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; +use IEEE_proposed.mechanical_systems.all; + +entity EnvDetect is + port( + terminal input : electrical; + terminal output : electrical + ); +end EnvDetect; + +architecture EnvDetect of EnvDetect is + -- Component declarations + -- Signal declarations + terminal XSIG010001 : electrical; +begin + -- Signal assignments + -- Component instances + C1 : entity work.capacitor(ideal) + generic map( + cap => 0.1e-6 + ) + port map( + p1 => XSIG010001, + p2 => ELECTRICAL_REF + ); + R1 : entity work.resistor(ideal) + generic map( + res => 1.0e3 + ) + port map( + p1 => XSIG010001, + p2 => ELECTRICAL_REF + ); + D4 : entity work.diode(ideal) + port map( + p => input, + n => XSIG010001 + ); + C2 : entity work.capacitor(ideal) + generic map( + cap => 6.0e-6 + ) + port map( + p1 => XSIG010001, + p2 => output + ); + R6 : entity work.resistor(ideal) + generic map( + res => 1.0e3 + ) + port map( + p1 => output, + p2 => ELECTRICAL_REF + ); +end EnvDetect; +-- + +-- Model of Binary Frequency Shift Keying (BFSK) modulator +-- with digital input and analog output + + +library IEEE; +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; +use IEEE.STD_LOGIC_1164.all; +use IEEE.MATH_REAL.all; + +entity bfsk is + generic ( + fc : real := 455.0e3; -- Mean carrier frequency + delta_f : real := 5.0e3; -- Difference between low and high carrier frequency + amp : voltage := 1.0; -- Amplitude of modulated signal + offset : voltage := 0.0 -- output offset voltage + ); + + port ( + d_in : in std_logic; -- digital input + terminal a_out : electrical -- output terminal + ); +end entity bfsk; + +architecture behavioral of bfsk is + + quantity vout across iout through a_out; -- output branch + quantity phi : real; -- free quantity for angle in radians + constant wc : real := math_2_pi*fc; -- convert fc to rad/s + constant delta_w : real := math_2_pi*delta_f; -- convert delta_f to rad/s + +begin + + if (d_in = '0') use + phi'dot == wc; -- set to carrier frequency + elsif (d_in = '1') use + phi'dot == wc + delta_w; -- set to carrier frequency + delta + else + phi'dot == 0.0; + end use; + + vout == offset + amp*sin(phi); -- create sinusoidal output using phi + +end architecture behavioral; +-- + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : vSum.vhd +-- Author : Mentor Graphics +-- Created : 2001/11/09 +-- Last update: 2001/11/09 +------------------------------------------------------------------------------- +-- Description: Summing junction with electrical connections +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/11/09 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity vSum is + + generic ( + K1 : real := 1.0; + K2 : real := -1.0); + + port ( + terminal in1, in2 : electrical; + terminal output : electrical); + +end entity vSum; + +architecture behavioral of vSum is + + quantity vin1 across in1 to electrical_ref; + quantity vin2 across in2 to electrical_ref; + quantity vout across iout through output to electrical_ref; + +begin + + vout == K1*vin1 + K2*vin2; + +end architecture behavioral; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : vLPF_2nd.vhd +-- Author : Mentor Graphics +-- Created : 2001/11/27 +-- Last update: 2001/11/27 +------------------------------------------------------------------------------- +-- Description: 2nd order Lowpass Filter with Electrical connections +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/11/27 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- +library IEEE; +use IEEE.MATH_REAL.all; +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity vLPF_2nd is + generic ( K : real := 1.0; -- Filter Gain + Fp : real; -- Double Pole Frequency [Hz] + Q : real := 0.707 -- Quality factor + ); + port ( terminal input : electrical; + terminal output : electrical + ); +end entity vLPF_2nd; +------------------------------------------------------------------------------- +-- Transfer Function: +-- +-- wp^2 +-- Vo(s) = K * --------------------- Vin(s) +-- S^2 + (wp/Q)*s + wp^2 +------------------------------------------------------------------------------- +architecture behavioral of vLPF_2nd is + quantity vin across input; + quantity vout across iout through output; + + constant wp : real := math_2_pi*Fp; -- Frequency in Radians + constant num : real_vector := (wp*wp, 0.0, 0.0); -- Numerator array + constant den : real_vector := (wp*wp, wp/Q, 1.0); -- Denominator array + +begin + + vout == K * vin'ltf(num, den); -- Laplace Transform of input + +end architecture behavioral; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : vBPF.vhd +-- Author : Mentor Graphics +-- Created : 2001/11/27 +-- Last update: 2001/11/27 +------------------------------------------------------------------------------- +-- Description: Bandpass Filter with Electrical connections +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/11/27 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- + +library IEEE; +use IEEE.MATH_REAL.all; +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity vBPF is + generic ( K : real := 1.0; -- Filter Gain + Fc : real; -- Center Frequency [Hz] + Q : real := 0.707 -- Quality factor + ); + port ( terminal input : electrical; + terminal output : electrical + ); +end entity vBPF; +------------------------------------------------------------------------------- +-- Transfer Function: +-- +-- wc*s +-- Vo(s) = K * --------------------- Vin(s) +-- S^2 + (wc/Q)*s + wc^2 +------------------------------------------------------------------------------- +architecture behavioral of vBPF is + quantity vin across input; + quantity vout across iout through output; + + constant wc : real := math_2_pi*Fc; -- Frequency in Radians + constant num : real_vector := (0.0, wc); -- Numerator array + constant den : real_vector := (wc*wc, wc/Q, 1.0); -- Denominator array + +begin + + vout == K * vin'ltf(num, den); -- Laplace Transform of output + +end architecture behavioral; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- + +library ieee_proposed; +use ieee_proposed.electrical_systems.all; + +entity MeasFreq is + generic ( thres : real := 0.0 ); -- threshold crossing + port ( terminal input : electrical; + signal f_out : out real := 0.0); +end entity MeasFreq; + +architecture ThresDetect of MeasFreq is + quantity vin across input; +-- signal freq : real := 0.0; +begin +-- f_out <= freq; + detect : process (vin'above(thres)) is + variable t_old : real := real'low; + begin + if vin'above(thres) then + f_out <= 1.0 / (now - t_old); + t_old := now; + end if; + end process detect; +end ThresDetect; +-- + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +-- +-- This model is a component of the Mentor Graphics VHDL-AMS educational open +-- source model library, and is covered by this license agreement. This model, +-- including any updates, modifications, revisions, copies, and documentation +-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR +-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH +-- IN THIS LICENSE AGREEMENT. Mentor Graphics grants you a non-exclusive +-- license to use, reproduce, modify and distribute this model, provided that: +-- (a) no fee or other consideration is charged for any distribution except +-- compilations distributed in accordance with Section (d) of this license +-- agreement; (b) the comment text embedded in this model is included verbatim +-- in each copy of this model made or distributed by you, whether or not such +-- version is modified; (c) any modified version must include a conspicuous +-- notice that this model has been modified and the date of modification; and +-- (d) any compilations sold by you that include this model must include a +-- conspicuous notice that this model is available from Mentor Graphics in its +-- original form at no charge. +-- +-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR +-- IMPLIED. MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF +-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. MENTOR GRAPHICS SHALL +-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER. +------------------------------------------------------------------------------- +-- File : a2d_bit.vhd +-- Author : Mentor Graphics +-- Created : 2001/06/16 +-- Last update: 2001/06/16 +------------------------------------------------------------------------------- +-- Description: Ideal one bit A/D converter +------------------------------------------------------------------------------- +-- Revisions : +-- Date Version Author Description +-- 2001/06/16 1.0 Mentor Graphics Created +------------------------------------------------------------------------------- + +library IEEE; +use IEEE.math_real.all; +use IEEE.std_logic_1164.all; + +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; + +entity a2d_bit is + + generic ( + thres : real := 2.5); -- Threshold to determine logic output + + port ( + terminal a : electrical; -- analog input + signal d : out std_logic); -- digital (std_logic) output + +end entity a2d_bit; + +------------------------------------------------------------------------------- +-- Ideal architecture +-- Uses 'above operator to detect threshold crossing +------------------------------------------------------------------------------- +architecture ideal of a2d_bit is + + quantity vin across a; + +begin + + -- purpose: Detect threshold crossing and assign event on output (d) + -- type : combinational + -- inputs : vin'above(thres) + -- outputs: pulse_signal + process (vin'above(thres)) is + begin -- PROCESS + if vin'above(thres) then + d <= '1'; + else + d <= '0'; + end if; + end process; + +end ideal; + +------------------------------------------------------------------------------- +-- Copyright (c) 2001 Mentor Graphics Corporation +------------------------------------------------------------------------------- +-- + +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_arith.all; + +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; +use IEEE_proposed.mechanical_systems.all; +use IEEE_proposed.fluidic_systems.all; +use IEEE_proposed.thermal_systems.all; +use IEEE_proposed.radiant_systems.all; + +entity tb_CS4_CommSys_det is +end tb_CS4_CommSys_det; + +architecture TB_CS4_CommSys_det of tb_CS4_CommSys_det is + -- Component declarations + -- Signal declarations + signal baseband : std_logic; + signal bitstream : std_logic; + terminal bp1_out : electrical; + terminal bp2_out : electrical; + terminal ed1_out : electrical; + terminal ed2_out : electrical; + terminal fsk_out : electrical; + signal fsk_out_f : real; + terminal lna_in : electrical; + terminal lna_out : electrical; +begin + -- Signal assignments + -- Component instances + EnvDetect1 : entity work.EnvDetect + port map( + output => ed1_out, + input => bp1_out + ); + EnvDetect2 : entity work.EnvDetect + port map( + output => ed2_out, + input => bp2_out + ); + BFSK3 : entity work.bfsk(behavioral) + generic map( + amp => 5.0 + ) + port map( + d_in => bitstream, + a_out => fsk_out + ); + vsum1 : entity work.vSum(behavioral) + port map( + in1 => ed1_out, + in2 => ed2_out, + output => lna_in + ); + vLPF2 : entity work.vLPF_2nd(behavioral) + generic map( + Fp => 20.0e3, + K => 10000.0 + ) + port map( + input => lna_in, + output => lna_out + ); + vBPF2 : entity work.vBPF(behavioral) + generic map( + Fc => 455.0e3 + ) + port map( + input => fsk_out, + output => bp2_out + ); + vBPF3 : entity work.vBPF(behavioral) + generic map( + Fc => 460.0e3 + ) + port map( + input => fsk_out, + output => bp1_out + ); + MeasFreq6 : entity work.MeasFreq(ThresDetect) + port map( + input => fsk_out, + f_out => fsk_out_f + ); + a2 : entity work.a2d_bit(ideal) + generic map( + thres => 1.0 + ) + port map( + D => baseband, + A => lna_out + ); + -- bitstream + P_bitstream : + process + begin + -- 0.000 + wait for 0.000 ns; bitstream <= '0'; + -- 50000.000 + wait for 50000.000 ns; bitstream <= '1'; + -- 100000.000 + wait for 50000.000 ns; bitstream <= '0'; + -- 150000.000 + wait for 50000.000 ns; bitstream <= '1'; + -- 200000.000 + wait for 50000.000 ns; bitstream <= '0'; + -- 300000.000 + wait for 100000.000 ns; bitstream <= '1'; + -- 501000.000 + wait for 201000.000 ns; bitstream <= '0'; + -- 550000.000 + wait for 49000.000 ns; bitstream <= '1'; + -- 600000.000 + wait for 50000.000 ns; bitstream <= '0'; + wait; + end process; + +-- KillerProc : +-- process +-- begin +-- wait for 1 ns; +-- lclclkinitwire <= '1'; +-- wait; +-- end process; +end TB_CS4_CommSys_det; + + + diff --git a/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/tb_pll.vhd b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/tb_pll.vhd new file mode 100644 index 000000000..7b23d0587 --- /dev/null +++ b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/tb_pll.vhd @@ -0,0 +1,87 @@ + +-- 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 + +-- +-- File : C:\VHDL-AMS\CaseStudies\CS4_CommSystem\Default\genhdl\vhdl\tb_pll.vhd +-- CDB : C:\VHDL-AMS\CaseStudies\CS4_CommSystem\default\default.cdb +-- By : CDB2VHDL Netlister version 16.1.0.2 +-- Time : Fri Apr 05 12:08:46 2002 + +-- Entity/architecture declarations + +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_arith.all; + +library IEEE_proposed; +use IEEE_proposed.electrical_systems.all; +use IEEE_proposed.mechanical_systems.all; +use IEEE_proposed.fluidic_systems.all; +use IEEE_proposed.thermal_systems.all; +use IEEE_proposed.radiant_systems.all; + +entity tb_pll is +end tb_pll; + +architecture tb_pll of tb_pll is + -- Component declarations + -- Signal declarations + signal f_ref : real; + terminal lf_out : electrical; + terminal v_ref : electrical; + signal vco_f : real; + terminal vco_out : electrical; +begin + -- Signal assignments + -- Component instances + PLL6 : entity work.PLL(behavioral) + generic map( + Fp => 20.0e3, + Fz => 1.0e6, + Kv => 100.0e3, + Fc => 1.0e6 + ) + port map( + input => v_ref, + lf_out => lf_out, + vco_out => vco_out + ); + v1 : entity work.v_SweptSine(bhv) + generic map( + StartFreq => 900.0e3, + SweepRate => 2000.0e6, + FinishFreq => 1.1e6, + InitDelay => 80.0e-6, + PeakAmp => 5.0 + ) + port map( + pos => v_ref, + neg => ELECTRICAL_REF + ); + MeasFreq9 : entity work.MeasFreq(ThresDetect) + port map( + input => v_ref, + f_out => f_ref + ); + MeasFreq10 : entity work.MeasFreq(ThresDetect) + port map( + input => vco_out, + f_out => vco_f + ); +end tb_pll; diff --git a/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/v_BPF.vhd b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/v_BPF.vhd new file mode 100644 index 000000000..6558c1c85 --- /dev/null +++ b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/v_BPF.vhd @@ -0,0 +1,48 @@ + +-- 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.math_real.all; +library ieee_proposed; use ieee_proposed.electrical_systems.all; + +entity v_BPF is + + generic ( k : real := 1.0; -- filter gain + fo : real := 100.0e3; -- center frequency [Hz] + q : real := 0.707 ); -- quality factor + + port ( terminal input : electrical; + terminal output : electrical ); + +end entity v_BPF; + +---------------------------------------------------------------- + +architecture behavioral of v_BPF is + + quantity vin across input; + quantity vout across iout through output; + constant wo : real := math_2_pi * fo; -- frequency in radians + constant num : real_vector := (0.0, wo); -- numerator array + constant den : real_vector := (wo * wo, wo / q, 1.0); -- denominator array + +begin + + vout == k * vin'ltf(num, den); -- Laplace transform of output + +end architecture behavioral; diff --git a/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/v_Sum.vhd b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/v_Sum.vhd new file mode 100644 index 000000000..e3d4c1e2d --- /dev/null +++ b/testsuite/vests/vhdl-ams/ashenden/compliant/AMS_CS4_RF_IC/v_Sum.vhd @@ -0,0 +1,41 @@ + +-- 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 v_Sum is + generic ( k1 : real := 1.0; + k2 : real := -1.0 ); + port ( terminal in1, in2 : electrical; + terminal output : electrical ); +end entity v_Sum; + +---------------------------------------------------------------- + +architecture behavioral of v_Sum is + + quantity vin1 across in1 to electrical_ref; + quantity vin2 across in2 to electrical_ref; + quantity vout across iout through output to electrical_ref; + +begin + + vout == k1 * vin1 + k2 * vin2; + +end architecture behavioral; |