- 3
- 0
- 约7.59千字
- 约 6页
- 2018-05-22 发布于江苏
- 举报
程序实例9:URAT VHDL程序与仿真
URAT VHDL 程序与仿真
1. 顶层程序与仿真
(1)顶层程序
--文件名:top.vhd 。
--功能:顶层映射。
--最后修改日期:2004.3.24 。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity top is
Port (clk32mhz,reset,rxd,xmit_cmd_p_in:in std_logic; --总的输入输出信号的定义
rec_ready,txd_out,txd_done_out:out std_logic;
txdbuf_in:in std_logic_vector(7 downto 0); --待发送数据输入
rec_buf:out std_logic_vector(7 downto 0)); --接收数据缓冲
end top;
architecture Behavioral of top is
component reciever
Port (bclkr,resetr,rxdr:in std_logic;
r_ready:out std_logic;
rbuf:out std_logic_vector(7 downto 0));
end component;
component transfer
Port (bclkt,resett,xmit_cmd_p:in std_logic;
txdbuf:in std_logic_vector(7 downto 0);
txd:out std_logic;
txd_done:out std_logic);
end component;
component baud
Port (clk,resetb:in std_logic;
bclk:out std_logic);
end component;
signal b:std_logic;
begin
u1:baud port map(clk=clk32mhz,resetb=reset,bclk=b); --顶层映射
u2:reciever port map(bclkr=b,resetr=reset,rxdr=rxd,r_ready=rec_ready,
rbuf=rec_buf);
u3:transfer port map(bclkt=b,resett=reset,xmit_cmd_p=xmit_cmd_p_in,
txdbuf=txdbuf_in,txd=txd_out,txd_done=txd_done_out);
end Behavioral;
(2 )程序仿真
仿真波形图如图8.8.5 所示。
图8.8.5 仿真波形
2. 波特率发生器程序与仿真
(1)波特率发生器VHDL 程序
--文件名:baud.vhd.
--功能:将外部输入的32MHz 的信号分成频率为153600Hz 的信号。
--最后修改日期:2004.3.24 。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity baud is
Port (clk,resetb:in std_logic;
bclk:out std_logic);
end baud;
architecture Behavioral of baud is
begin
process(clk,resetb)
variable cnt:integer;
begin
if resetb=1 then cnt:=0; bclk=0; --
您可能关注的文档
最近下载
- 2025-2026二手房行业研究报告.doc VIP
- 2026龙飞平面图形推理基础理论➕百大图形3.0版本.pdf VIP
- 2026马年幸运大抽奖PPT模板.pptx VIP
- 智研咨询—中国无人靶机行业市场全景调查、投资策略研究报告.docx VIP
- 第1-13届北方数学奥林匹克数学试题及解答.pdf VIP
- 门诊统筹基金分析报告.pptx VIP
- 电光KBZ16-400 1140(660) (WZBK-6D)矿用隔爆型型真空馈电开关说明书.pdf VIP
- 聚酯切粒机培训课件.pptx VIP
- 园林植物病虫害防治课件共104张PPT).pptx VIP
- DB44/26-2001水污染物排放限值.pdf VIP
原创力文档

文档评论(0)