www.pudn.com > NCO.rar > cntr_47h.tdf, change:2010-05-05,size:4667b


--lpm_counter CBX_DECLARE_ALL_CONNECTED_PORTS="OFF" DEVICE_FAMILY="Stratix II" lpm_avalue=26 lpm_direction="DOWN" lpm_port_updown="PORT_UNUSED" lpm_width=5 aset clk_en clock cnt_en cout 
--VERSION_BEGIN 9.0 cbx_cycloneii 2008:05:19:10:57:37:SJ cbx_lpm_add_sub 2008:12:09:22:11:50:SJ cbx_lpm_compare 2009:02:03:01:43:16:SJ cbx_lpm_counter 2008:05:19:10:42:20:SJ cbx_lpm_decode 2008:05:19:10:39:27:SJ cbx_mgl 2009:01:29:16:12:07:SJ cbx_stratix 2008:09:18:16:08:35:SJ cbx_stratixii 2008:11:14:16:08:42:SJ  VERSION_END 
 
 
-- Copyright (C) 1991-2009 Altera Corporation 
--  Your use of Altera Corporation's design tools, logic functions  
--  and other software and tools, and its AMPP partner logic  
--  functions, and any output files from any of the foregoing  
--  (including device programming or simulation files), and any  
--  associated documentation or information are expressly subject  
--  to the terms and conditions of the Altera Program License  
--  Subscription Agreement, Altera MegaCore Function License  
--  Agreement, or other applicable license agreement, including,  
--  without limitation, that your use is for the sole purpose of  
--  programming logic devices manufactured by Altera and sold by  
--  Altera or its authorized distributors.  Please refer to the  
--  applicable agreement for further details. 
 
 
FUNCTION stratixii_lcell_comb (cin, dataa, datab, datac, datad, datae, dataf, datag, sharein) 
WITH ( EXTENDED_LUT, LUT_MASK, SHARED_ARITH) 
RETURNS ( combout, cout, shareout, sumout); 
FUNCTION stratixii_lcell_ff (aclr, adatasdata, aload, clk, datain, ena, sclr, sload) 
WITH ( x_on_violation) 
RETURNS ( regout); 
 
--synthesis_resources = lut 5 reg 5  
SUBDESIGN cntr_47h 
(  
	aset	:	input; 
	clk_en	:	input; 
	clock	:	input; 
	cnt_en	:	input; 
	cout	:	output; 
	q[4..0]	:	output; 
)  
VARIABLE  
	counter_comb_bita0 : stratixii_lcell_comb 
		WITH ( 
			EXTENDED_LUT = "off", 
			LUT_MASK = "000000000000FF00", 
			SHARED_ARITH = "off" 
		); 
	counter_comb_bita1 : stratixii_lcell_comb 
		WITH ( 
			EXTENDED_LUT = "off", 
			LUT_MASK = "0000FF000000FF00", 
			SHARED_ARITH = "off" 
		); 
	counter_comb_bita2 : stratixii_lcell_comb 
		WITH ( 
			EXTENDED_LUT = "off", 
			LUT_MASK = "0000FF000000FF00", 
			SHARED_ARITH = "off" 
		); 
	counter_comb_bita3 : stratixii_lcell_comb 
		WITH ( 
			EXTENDED_LUT = "off", 
			LUT_MASK = "0000FF000000FF00", 
			SHARED_ARITH = "off" 
		); 
	counter_comb_bita4 : stratixii_lcell_comb 
		WITH ( 
			EXTENDED_LUT = "off", 
			LUT_MASK = "0000FF000000FF00", 
			SHARED_ARITH = "off" 
		); 
	counter_reg_bit8a[4..0] : stratixii_lcell_ff; 
	a_val[4..0]	: WIRE; 
	aclr_actual	: WIRE; 
	cout_actual	: WIRE; 
	data[4..0]	: NODE; 
	external_cin	: WIRE; 
	lsb_cin	: WIRE; 
	s_val[4..0]	: WIRE; 
	safe_q[4..0]	: WIRE; 
	sclr	: NODE; 
	sload	: NODE; 
	sset	: NODE; 
	sync_data_wire[4..0]	: WIRE; 
	sync_select_wire	: WIRE; 
	time_to_clear	: WIRE; 
	updown_dir	: WIRE; 
	updown_lsb	: WIRE; 
	updown_other_bits	: WIRE; 
 
BEGIN  
	counter_comb_bita[4..0].cin = ( counter_comb_bita[3..0].cout, lsb_cin); 
	counter_comb_bita[4..0].datad = ( counter_reg_bit8a[4..0].regout); 
	counter_comb_bita[4..0].dataf = ( updown_other_bits, updown_other_bits, updown_other_bits, updown_other_bits, updown_lsb); 
	counter_reg_bit8a[].aclr = aclr_actual; 
	counter_reg_bit8a[].adatasdata = a_val[]; 
	counter_reg_bit8a[].aload = aset; 
	counter_reg_bit8a[].clk = clock; 
	counter_reg_bit8a[].datain = ( ((sync_select_wire & sync_data_wire[4..4]) # ((! sync_select_wire) & counter_comb_bita[4].sumout)), ((sync_select_wire & sync_data_wire[3..3]) # ((! sync_select_wire) & counter_comb_bita[3].sumout)), ((sync_select_wire & sync_data_wire[2..2]) # ((! sync_select_wire) & counter_comb_bita[2].sumout)), ((sync_select_wire & sync_data_wire[1..1]) # ((! sync_select_wire) & counter_comb_bita[1].sumout)), ((sync_select_wire & sync_data_wire[0..0]) # ((! sync_select_wire) & counter_comb_bita[0].sumout))); 
	counter_reg_bit8a[].ena = (clk_en & (((cnt_en # sclr) # sset) # sload)); 
	counter_reg_bit8a[].sclr = sclr; 
	a_val[] = B"11010"; 
	aclr_actual = B"0"; 
	cout = cout_actual; 
	cout_actual = (((! counter_comb_bita[4].cout) $ updown_other_bits) # (time_to_clear & updown_dir)); 
	data[] = GND; 
	external_cin = B"1"; 
	lsb_cin = B"0"; 
	q[] = safe_q[]; 
	s_val[] = B"11111"; 
	safe_q[] = counter_reg_bit8a[].regout; 
	sclr = GND; 
	sload = GND; 
	sset = GND; 
	sync_data_wire[] = ((sset & s_val[]) # ((! sset) & data[])); 
	sync_select_wire = (sset # sload); 
	time_to_clear = B"0"; 
	updown_dir = B"0"; 
	updown_lsb = updown_dir; 
	updown_other_bits = ((! external_cin) # updown_dir); 
END; 
--VALID FILE