⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main_tb_post.vhd

📁 8b10b design reference
💻 VHD
字号:
-- **************************************************************
-- Owner:		Xilinx Inc.
-- File:  		main_tb_post.vhd
--
-- Purpose: 		Post route test for encoder and decoder 
--			functionality of 8 bit-wide transmission.
--	
-- Author:		JLJ
-- Date:		12-26-02
--
-- ****************************************************************


library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;

entity MAIN_TB_POST is
end MAIN_TB_POST;


architecture BEHAVIOUR of MAIN_TB_POST is

-- ******************** CONSTANT DECLARATIONS ***********************
constant RESET_ACTIVE 			: STD_LOGIC := '0';

-- ********************* SIGNAL DECLARATIONS ************************
signal clk, rst				: STD_LOGIC;
signal data_trs, data_rcv 		: STD_LOGIC_VECTOR(7 downto 0);
signal k_char, dis_in, dis_out		: STD_LOGIC;
signal encoded_data, serial_data	: STD_LOGIC_VECTOR(9 downto 0);
signal frame_in_enc, frame_out_enc 	: STD_LOGIC;
signal frame_in_dec, frame_out_dec 	: STD_LOGIC;
signal kout, err_out			: STD_LOGIC;


-- ******************** COMPONENT DECLARATION ***********************

-- 8B/10B Encoder Function
component ENCODER_TIME_POST
	port(          	
          	clk 		: in 	STD_LOGIC; 
		dis_in 		: in 	STD_LOGIC; 
		frame_in 	: in 	STD_LOGIC; 
		rst 		: in 	STD_LOGIC; 
		k_char 		: in 	STD_LOGIC; 
		dis_out 	: out 	STD_LOGIC; 
		frame_out 	: out 	STD_LOGIC; 
		data_in 	: in 	STD_LOGIC_VECTOR ( 7 downto 0 ); 
   		encoded_data 	: out 	STD_LOGIC_VECTOR ( 9 downto 0 )
   		);        	
end component;


-- 8B/10B Decoder Function
component DECODER_TIME_POST
    	port(
               	clk 		: in 	STD_LOGIC; 
    		frame_in 	: in 	STD_LOGIC; 
    		rst 		: in 	STD_LOGIC; 
		err_out 	: out 	STD_LOGIC; 
		frame_out 	: out 	STD_LOGIC; 
		kout 		: out 	STD_LOGIC; 
		data_in 	: in 	STD_LOGIC_VECTOR ( 9 downto 0 ); 
		data_out 	: out 	STD_LOGIC_VECTOR ( 7 downto 0 ) 
		);
end component;

  
-- 8B/10B Test Function Generator
component TST_8B10B
	port(

		clk20			: inout	STD_LOGIC;			-- Local clock to encoder & decoder @ 20MHz	
		sync_reset		: out	STD_LOGIC;			-- Control signals to encoder
		
		data_trs		: out	STD_LOGIC_VECTOR (7 downto 0);	-- Date byte to encode
		k_char			: out 	STD_LOGIC;			-- Asserted denotes special 
										-- character transmission									
		disparity		: out	STD_LOGIC;			-- Denotes incoming parity
		run_dis			: in	STD_LOGIC;			-- Running disparity
		frame_to_enc		: inout	STD_LOGIC;			-- Control to start data encoding
		frame_out_enc		: in	STD_LOGIC;			-- Asserted - done with encoding
	
		
		data_rcv		: in	STD_LOGIC_VECTOR (7 downto 0);	-- Incoming data from decoder
		frame_in_dec		: out 	STD_LOGIC;			-- Control to start decoding
		frame_out_dec		: in	STD_LOGIC;			-- Asserted => done decoding
		data_from_enc		: in 	STD_LOGIC_VECTOR (9 downto 0);	-- Data transfer from encoder
		data_to_dec		: out	STD_LOGIC_VECTOR (9 downto 0);  -- Serial data to decoder
		k_rcv			: in 	STD_LOGIC;			-- Asserted when special char detected
		err_rcv			: in 	STD_LOGIC);			-- Asserted when illegal char detected	
		
end component;


begin

	-- ***************** COMPONENT ASSIGNMENTS *********************
	ENC: ENCODER_TIME_POST
		port map(
          		clk		=> clk,			
        		rst		=> rst,
			data_in		=> data_trs,
		  	k_char		=> k_char,
	  		frame_in 	=> frame_in_enc,	  
	  		dis_in		=> dis_in,			   	
	  		dis_out		=> dis_out,		  		
	  		encoded_data	=> encoded_data, 
	  		frame_out	=> frame_out_enc);


	DEC: DECODER_TIME_POST	
		port map(	
			clk		=> clk,			
        		rst		=> rst,
 			data_in		=> serial_data,
			frame_in 	=> frame_in_dec,		  	 
	  		data_out	=> data_rcv,
	 		frame_out	=> frame_out_dec,			  
	  		kout		=> kout,
			err_out		=> err_out);	
     
        				
	TB: TST_8B10B
		port map(
			clk20		=> clk,
			sync_reset	=> rst,		
			data_trs	=> data_trs,
			k_char		=> k_char,										
			disparity	=> dis_in,
			run_dis		=> dis_out,
			frame_to_enc	=> frame_in_enc,
			frame_out_enc	=> frame_out_enc,
			data_rcv	=> data_rcv,
			frame_in_dec	=> frame_in_dec,
			frame_out_dec	=> frame_out_dec,
			data_from_enc	=> encoded_data,
			data_to_dec	=> serial_data,
			k_rcv		=> kout,
			err_rcv		=> err_out);
  
   
end BEHAVIOUR;

















⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -