作者arclitetank (More than meet the eye!)
看板Electronics
標題Re: [問題] verilog 語法 inout
時間Wed Nov 4 14:37:37 2009
io pad的 model 大概是長類似這樣
inout IO;
input I;
ouput O;
input OE;
assign IO = OE ? I : 1'bz; // bufif1 bufif1_inst(IO, I, OE);
assign O = IO; // buf buf_inst(O, IO);
值得注意的是這是 "verilog simulation model"
真正你想用在電路上的話需要include artisan或是自己做的layout
dc 只負責合成core logic~
※ 引述《ccjin (別活在自己的地獄裡)》之銘言:
: 請教各位 假設inout 合成會變成 three-state logic (也許是我搞錯了)
: 但是如何做到雙向呢 因為就算是 three-state logic 感覺也不能雙向溝通
: 還有請教
: module bidir_port(oe, clk, bidir)
: input oe; // 即你所寫的oe
: input clk;
: inout bidir;
: wire a; // 要丟出去的資料
: reg b; // 讀資料進來處理的位置
: assign bidir = oe ? a : 1'bZ;
: always @(posedge clk)
: begin
: b <= birdir;
: end
: 對於上式 oe = 0; 輸出等於高阻抗 不會跟 input 相衝突
: 但是面對 oe = 1; 不就出現 內部資料想輸出 但是外部資料也輸入
: 這不是就會造成衝突 ?
: 也許這是很簡單的問題 卻困擾我很久 想請教一下
: 或是有比較好的資料 可提供 我自己研究也可以 謝謝
--
● NY B D A ¯︶¯ NY S J
⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙ ⊙
— — — — — — — — —
郭勇志 勇維拉 寶貝勇 祖馬勇 勇-ROD 勇巴西亞 勇塔那 King勇 勇樂迪
張伯勇 岡島勇樹 勇盾
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.251.64.19
※ 編輯: arclitetank 來自: 60.251.64.19 (11/04 14:38)