www.pudn.com > uart_v11.zip > filterx.tdf
%//////////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// PROJECT: Parameterized Digital Filter. //
// Keith Willis //
// Copyright © 1998. All Rights Reserved. //
// //
// You may use or distribute this module freely, provided you do not remove this //
// copyright notice or modify the contents of this file. //
// If you have questions or comments, feel free to contact me by email at //
// kcwillis@mech.eng.usyd.edu.au //
// //
// AUTHOR: Keith Willis //
// //
// MODULE: FilterX.tdf //
// //
// DESCRIPTION: AHDL File for MIMO Digital Filter. //
// //
// VERSION: 1.0 //
// //
//////////////////////////////////////////////////////////////////////////////////////////////////////////%
TITLE "MIMO Digital Filter";
%//////////////////
// INCLUDE FILES //
//////////////////%
INCLUDE "filt_tpl.inc";
%////////////////////////////
// USER-DEFINED PARAMETERS //
////////////////////////////%
PARAMETERS
(
WIDTH=1,
DEPTH=2
);
%/////////////////////
// INPUTS & OUTPUTS //
/////////////////////%
SUBDESIGN Filterx
(
CLK, S_IN[(WIDTH-1)..0] : INPUT;
RESET : INPUT=GND;
PRESET : INPUT=GND;
S_OUT[(WIDTH-1)..0] : OUTPUT;
/S_OUT[(WIDTH-1)..0] : OUTPUT;
)
%/////////////////////////
// VARIABLE DEFINITIONS //
/////////////////////////%
VARIABLE
F_ARRAY[(WIDTH-1)..0] : NODE;
%//////////////////
// LOGIC SECTION //
//////////////////%
BEGIN
ASSERT (WIDTH > 0)
REPORT "Value of WIDTH parameter must be greater than 0"
SEVERITY ERROR;
ASSERT (DEPTH > 1)
REPORT "Value of DEPTH parameter must be greater than 1"
SEVERITY ERROR;
F_ARRAY[] = FILT_TPL (CLK, S_IN[], RESET, PRESET)
WITH (NUM_STAGES = DEPTH)
RETURNS (.F_OUT);
S_OUT[]=F_ARRAY[];
/S_OUT[]=!S_OUT[];
END;