完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
这是top文件: LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENtiTY CNT10 IS PORT(CLK,RST,EN,LOAD:IN STD_LOGIC; DATA:IN STD_LOGIC_VECTOR(3 DOWNTO 0); DOUT:OUT STD_LOGIC_VECTOR(3 DOWNTO 0); COUT:OUT STD_LOGIC); END CNT10; ARCHITECTURE BEHAV OF CNT10 IS BEGIN PROCESS(CLK,RST,EN,LOAD) VARIABLE Q:STD_LOGIC_VECTOR(3 DOWNTO 0); BEGIN IF RST='0' THEN Q:=(OTHERS=>'0'); ELSIF CLK'EVENT AND CLK='1' THEN IF EN='1' THEN IF(LOAD='0') THEN Q:=DATA;ELSE IF Q<9 THEN Q:=Q+1; ELSE Q:=(OTHERS=>'0'); END IF; END IF; END IF; END IF; IF Q="1001" THEN COUT<='1'; ELSE COUT<='0'; END IF; DOUT<=Q; END PROCESS; END BEHAV; 下面是test文件 LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY CNT10_vhd_tst IS END CNT10_vhd_tst; ARCHITECTURE CNT10_arch OF CNT10_vhd_tst IS -- constants -- signals SIGNAL CLK : STD_LOGIC; SIGNAL COUT : STD_LOGIC; SIGNAL DATA : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL DOUT : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL EN : STD_LOGIC; SIGNAL LOAD : STD_LOGIC; SIGNAL RST : STD_LOGIC; SIGNAL CLK_P:TIME:=30 NS; COMPONENT CNT10 PORT ( CLK : IN STD_LOGIC; COUT : OUT STD_LOGIC; DATA : IN STD_LOGIC_VECTOR(3 DOWNTO 0); DOUT : OUT STD_LOGIC_VECTOR(3 DOWNTO 0); EN : IN STD_LOGIC; LOAD : IN STD_LOGIC; RST : IN STD_LOGIC ); END COMPONENT; BEGIN i1 : CNT10 PORT MAP ( -- list connections between master ports and signals CLK => CLK, COUT => COUT, DATA => DATA, DOUT => DOUT, EN => EN, LOAD => LOAD, RST => RST ); init : PROCESS -- variable declarations BEGIN -- code that executes only once CLK<='0'; WAIT FOR CLK_P; CLK<='1'; WAIT FOR CLK_P; END PROCESS init; always : PROCESS -- optional sensitivity list -- ( ) -- variable declarations BEGIN -- code executes for every event on sensitivity list RST<='1','0' AFTER 110 NS,'1' AFTER 114 NS; EN<='0','1' AFTER 40 NS; LOAD<='1','0' AFTER 910 NS,'1' AFTER 940 NS; DATA<="0100","0110" AFTER 400 NS, "0111" AFTER 700 NS,"0100" AFTER 1000 NS; END PROCESS always; END CNT10_arch; 请帮忙看看,谢谢,不知道是什么问题,或者是操作上的问题 |
|
相关推荐
2个回答
|
|
没细看代码,不过可以把WAIT FOR CLK_P 改成after试试。原来遇到过一方真就死机的情况,就是改的waitfor
|
|
|
|
谢谢先,大神发现我那个.vht里面搞错了,进程没有敏感信号,可以把它删除 |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1583 浏览 1 评论
助力AIoT应用:在米尔FPGA开发板上实现Tiny YOLO V4
1082 浏览 0 评论
2657 浏览 1 评论
2347 浏览 0 评论
矩阵4x4个按键,如何把识别结果按编号01-16(十进制)显示在两个七段数码管上?
2620 浏览 0 评论
2050 浏览 55 评论
6044 浏览 113 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-30 12:09 , Processed in 0.618460 second(s), Total 77, Slave 58 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号