完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
`各位大神求解答: 下面是5分频的vhdl程序与testbench : 为什么在modelsim中进行RTL仿真时出不来波形图,而在gate level 仿真时能够出波形图呢? //源程序: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity counterex is port(clk:in std_logic; k_or,k1,k2:out std_logic); end; architecture bhv of counterex is signal c1,c2:std_logic_vector(2 downto 0); signal n1,n2:std_logic; begin process(clk,c1) begin if rising_edge(clk) then if (c1="001") then n1 <= not n1; elsif (c1="011") then n1 <= not n1; end if; if (c1="100") then c1 <= "000"; else c1 <= c1+1; end if; end if; end process; process(clk,c2) begin if falling_edge(clk) then if (c2="001") then n2 <= not n2; elsif (c2="011") then n2 <= not n2; end if; if (c2="100") then c2 <="000"; else c2 <= c2+1; end if; end if; end process; k1 <= n1;k2 <= n2;k_or <= n1 or n2; end bhv; //modelsim中RTL仿真显示图 //testbench程序 LIBRARY ieee; USE ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; ENTITY counterex_vhd_tst IS END counterex_vhd_tst; ARCHITECTURE counterex_arch OF counterex_vhd_tst IS SIGNAL clk : STD_LOGIC; SIGNAL k1 : STD_LOGIC; SIGNAL k2 : STD_LOGIC; SIGNAL k_or : STD_LOGIC; constant clk_p : time := 50ns; COMPONENT counterex PORT ( clk : IN STD_LOGIC; k1 : OUT STD_LOGIC; k2 : OUT STD_LOGIC; k_or : OUT STD_LOGIC ); END COMPONENT; BEGIN i1 : counterex PORT MAP ( clk => clk, k1 => k1, k2 => k2, k_or => k_or ); PROCESS BEGIN clk <= '0' ; wait for clk_p/2; clk <= '1' ; wait for clk_p/2; END PROCESS ; END counterex_arch; //modelsim 中Gatelevel仿真图 ` |
|
相关推荐
1个回答
|
|
图中4个端口分别为,clk,k1,k2,k_or.
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1452 浏览 1 评论
1246 浏览 0 评论
矩阵4x4个按键,如何把识别结果按编号01-16(十进制)显示在两个七段数码管上?
1454 浏览 0 评论
916 浏览 0 评论
2255 浏览 0 评论
1434 浏览 35 评论
5622 浏览 113 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 04:56 , Processed in 0.562954 second(s), Total 72, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号