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

📄 phone_tb.vhd

📁 电话用户信令的控制器源码
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;

Entity Phone_Tb is
end Phone_Tb;

Architecture Arch_Phone_Tb of Phone_Tb is
	Component Phone 
		port(clk,Reset,af,ab:in std_logic;
				 bcc,brc,rc: out std_logic	 
				 );
	end Component;

signal clk,Reset,af,ab,bcc,brc,rc:std_logic;
begin
Inst:	Phone port map(clk,Reset,af,ab,bcc,brc,rc);
	process
		begin
			clk<='0';
			wait for 10 ns;
			clk<='1';
			wait for 10 ns;
		end process;	
	
	process
		begin
			Reset<='1';	
			af<='1';
			ab<='1';		
			wait for 100 ns;		
			Reset<='0';		
			
--2.1进入示忙
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='0';
			ab<='0';
			wait for 100 ns;
--2.2进入主叫			
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='0';
			ab<='1';
			wait for 100 ns;

--2.3进入振铃			
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='1';
			ab<='0';
			wait for 100 ns;			
			
--3.1	主叫下进入空闲		
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='0';
			ab<='1';
			wait for 100 ns;
			af<='1';		
--3.2	主叫下进入通话		
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='0';
			ab<='1';
			wait for 100 ns;
			ab<='0';		
		
--4.1	通话下进入示忙		
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='0';
			ab<='1';
			wait for 100 ns;
			ab<='0';
			wait for 100 ns;
			ab<='1';	

--4.2通话下进入等待
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='0';
			ab<='1';
			wait for 100 ns;
			ab<='0';
			wait for 100 ns;
			af<='1';
--5.1	示忙下进入等待
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='0';
			ab<='1';
			wait for 100 ns;
			ab<='0';
			wait for 100 ns;
			ab<='1';
			wait for 100 ns;
			af<='1';	
			
--6.1		等待下进入空闲				
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='0';
			ab<='1';
			wait for 100 ns;
			ab<='0';
			wait for 100 ns;
			ab<='1';
			wait for 100 ns;
			af<='1';	
			wait for 100 ns;
			ab<='1';

--7.1振铃下进入通话
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='1';
			ab<='0';
			wait for 100 ns;
			af<='0';
			
--7.2振铃下进入空闲
			wait for 100 ns;
			af<='1';		--af,本端,ab,对方
			ab<='1';
			wait for 100 ns;			
			af<='1';
			ab<='0';
			wait for 100 ns;
			ab<='1';			
		wait;	
	end process;		
end Arch_Phone_Tb ;

⌨️ 快捷键说明

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