phone_tb.vhd
来自「电话用户信令的控制器源码」· VHDL 代码 · 共 152 行
VHD
152 行
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 + =
减小字号Ctrl + -
显示快捷键?