|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
VHDL雙向端口的問題,很煩人,幫幫忙 |
| 作者:haoxudong 欄目:EDA技術(shù) |
程序有很多警告,如何修改? library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity shuang is PORT(ALE,N_WR1,N_WR2,CPU:in std_logic; P0:inout std_logic_vector(7 downto 0); AIN:out std_logic_vector(7 downto 0); N_RD0,N_RD1,N_RD2:in std_logic); end shuang; architecture a of shuang is signal R1:std_logic_vector(2 downto 0); signal R2:std_logic_vector(3 downto 0); begin commandwrite:PROCESS(N_WR1,N_WR2,ALE) begin if(N_WR1'event and N_WR1='1')then if(CPU='0')then P0<="ZZZZZZZZ";R1<=P0(2 downto 0); end if; end if; if(N_WR2'event and N_WR2='1')then if(CPU='0')then P0<="ZZZZZZZZ";R2<=P0(3 downto 0); end if; end if; if(ALE'EVENT and ALE='0')then P0<="ZZZZZZZZ";AIN<=P0; end if; --------- if(N_RD0='0')then P0(0)<=CPU; elsif(N_RD1='0')then P0(2 downto 0)<=R1; elsif(N_RD2='0')then P0(3 downto 0)<=R2; end if; end PROCESS; end a; |
| 2樓: | >>參與討論 |
| 作者: 051127 于 2005/1/13 13:26:00 發(fā)布:
老問題 一個(gè)進(jìn)程不能有兩個(gè)沿觸發(fā)對(duì)一個(gè)單元進(jìn)行操作,先解決掉這個(gè)再說(shuō)其他的吧! |
|
| 3樓: | >>參與討論 |
| 作者: haoxudong 于 2005/1/13 16:53:00 發(fā)布:
re 每個(gè)WR信號(hào)是由AIN譯碼得到的,RD信號(hào)也是由AIN譯碼得到,應(yīng)該怎么改呢 |
|
| 4樓: | >>參與討論 |
| 作者: picklas 于 2005/1/13 22:42:00 發(fā)布:
re 用一個(gè)結(jié)構(gòu)描述出來(lái)就行了:〉 |
|
| 5樓: | >>參與討論 |
| 作者: haoxudong 于 2005/1/14 9:28:00 發(fā)布:
樓上的大哥,給我舉個(gè)例子吧 |
|
| 6樓: | >>參與討論 |
| 作者: liufang520 于 2005/1/14 11:33:00 發(fā)布:
reply 送高阻時(shí),不能要時(shí)鐘語(yǔ)句:if ()'event and ()='1' then |
|
| 7樓: | >>參與討論 |
| 作者: haoxudong 于 2005/1/14 15:04:00 發(fā)布:
這樣改,可以嗎? library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity shuang is PORT(ALE,N_WR1,N_WR2,CPU:in std_logic; P0:inout std_logic_vector(7 downto 0); AIN:out std_logic_vector(7 downto 0); R1,R2:buffer std_logic_vector(7 downto 0); N_RD0,N_RD1,N_RD2:in std_logic); end shuang; architecture a of shuang is signal D:std_logic_vector(7 downto 0); begin commandwrite:PROCESS(N_WR1,N_WR2,ALE) begin if(N_WR1='0')then P0<="ZZZZZZZZ";R1<=P0; elsif(N_WR2='0')then P0<="ZZZZZZZZ";R2<=P0; elsif(N_RD0='0')then P0(0)<=CPU; elsif(N_RD1='0')then P0<=R1; elsif(N_RD2='0')then P0<=R2; else P0<="ZZZZZZZZ";D<=P0; end if; if(ALE'EVENT and ALE='0')then AIN<=D; end if; --------- end PROCESS; end a; |
|
| 8樓: | >>參與討論 |
| 作者: haoxudong 于 2005/1/17 9:18:00 發(fā)布:
我要轉(zhuǎn)Verilog了,VHDL太煩人了,書上找不到相關(guān)的例子 |
|
| 免費(fèi)注冊(cè)為維庫(kù)電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào) |