打印

帮我看看这个问题怎么解决最有效。。

[复制链接]
1493|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
lljwq|  楼主 | 2007-1-11 10:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
ic, ST, logic, se, rc
一段VHDL程序,有可能同时写同一信号出错。。寻求有效简单解决方法 
library ieee; 
use ieee.std_logic_1164.all; 
use ieee.std_logic_unsigned.all; 

entity main is 
    generic(width:integer:=5); 
    port( 
         data:in std_logic_vector(width-1 downto 0); 
         clk:in std_logic; 
         write:in std_logic; 
         pulse:out std_logic 
        ); 
end entity; 

architecture behave of main is 
signal curcnt,cnt:std_logic_vector(width-1 downto 0); 
begin 
    process(data,clk,write) 
    begin 
        if write='1' then 
            curcnt<=data; 
            wb:='0'; 
        end if; 
        if clk'event and clk='1' then 
            cnt<=cnt-1; 
            if cnt=1 then 
                pulse<='1'; 
                cnt<=curcnt;             
                curcnt<="00001";    --出问题就是这了。。可能同时写一个信号;    
          
            else 
                pulse<='0'; 
            end if; 
        end if; 
    end process; 
end behave; 

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

4

主题

4

帖子

0

粉丝