完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
初学FPGA,自己编写了一个三分频程序,有错,代码如下:
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity divclk3 is port(inclk : in std_logic; outclk : out std_logic); end divclk3; architecture one of divclk3 is signal tmp : std_logic; signal rise_cnt : std_logic_vector(1 downto 0) := "00"; signal down_cnt : std_logic_vector(1 downto 0) := "00"; signal cnt : std_logic_vector(1 downto 0) := "00"; begin process(inclk) begin if(inclk'event and inclk = '1') then rise_cnt <= rise_cnt + 1; end if; end process; process(inclk) begin if(inclk'event and inclk = '0') then down_cnt <= down_cnt + 1; end if; end process; process(rise_cnt, down_cnt) begin cnt <= rise_cnt + down_cnt; if(cnt="11") then tmp <= not tmp; rise_cnt <= "00"; down_cnt <= "00"; end if; end process; outclk <= tmp; end one; 编译出错,提示为: Error (10028): Can't resolve multiple constant drivers for net "rise_cnt[1]" at divclk3.vhd(19) Error (10029): Constant driver at divclk3.vhd(31) Error (10028): Can't resolve multiple constant drivers for net "rise_cnt[0]" at divclk3.vhd(19) Error (10028): Can't resolve multiple constant drivers for net "down_cnt[1]" at divclk3.vhd(26) Error (10028): Can't resolve multiple constant drivers for net "down_cnt[0]" at divclk3.vhd(26) Error: Can't elaborate user hierarchy "divclk3:inst6" Error: Quartus II Analysis & Synthesis was unsuccessful. 6 errors, 9 warnings Error: Peak virtual memory: 240 megabytes Error: Processing ended: Thu Nov 29 22:37:56 2012 Error: Elapsed time: 00:00:05 Error: Total CPU time (on all processors): 00:00:02 Error: Quartus II Full Compilation was unsuccessful. 8 errors, 9 warnings 自己想了半天,实在是不知问题所在,望各位指点,感激不尽! |
|
相关推荐
3个回答
|
|
本帖最后由 ytphrx 于 2012-12-4 15:09 编辑
這個程序如果能跑,輸出的結果大概也是二分頻。或者試驗一下把計數器數據類型進行強制轉化為整數,因為好象VHDL規定加法操作符必的操作數必須是整數的啊。 |
|
|
|
|
|
|
|
+法重载操作符好象只能是同一类型的相加,down_cnt + 1;表示一个是std_logic_vector类型,1这个数字却是整数类型.
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1947 浏览 1 评论
助力AIoT应用:在米尔FPGA开发板上实现Tiny YOLO V4
1134 浏览 0 评论
3049 浏览 1 评论
2716 浏览 0 评论
矩阵4x4个按键,如何把识别结果按编号01-16(十进制)显示在两个七段数码管上?
3008 浏览 0 评论
2207 浏览 58 评论
6101 浏览 113 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-11 16:38 , Processed in 0.754263 second(s), Total 75, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号