Re: [問題] 用 single port 的 RAM 實現 FIFO

看板Electronics作者 (數位邏輯之繩)時間13年前 (2011/03/03 02:21), 編輯推噓0(004)
留言4則, 2人參與, 最新討論串1/2 (看更多)
現在的 IC 應該都不能接受 read/write 會 lose data 如果因為 single port 比 two port 的 SRAM 省面積 (通常,not always) 最簡單的情況是,同步,read N bits, write N bits 那你的 single port SRAM 要用 N*2 bits 採分時多工 這樣的 bandwidth 才能應付同時 read/write 頻寬是最基本第一個要卡關的 再來 write 2次才寫入 sram 一次,從 sram 讀一次要應付 2 次 read read/write signal 跟著 data 作 pipeline 不妨前後各有 read/write 自己的 counter (你所謂的 tag?) 如果沒有非同步,或其它不同速率的問題,上面的電路可以參考一下 ※ 引述《ccjin (半年之後你會變怎樣)》之銘言: : 先請問有相關的參考文件嗎 : 我找了 google 但是都沒有比較明確的資料 : 請教各位板友 為了實現標題 : 我的設計是想 當 write enable 跟 read enable : 有衝突的時候 當然是先寫入 : 但是 control unit 會順便紀錄少讀了一筆 : read tag 會被累加 1 : 它會等待 writing is idle 的情況下 : 才開始讀的動作 每讀一筆 read tag 就會被減少 : 直到把 read tag 清為零 : 這樣的設計理念 會有什麼缺失嗎 : 譬如說 read 連續送出四個 request : 結果我的設計 在送出第四個 request的時候 : FIFO 才回第二個 data valid : 這樣接收端會錯亂嗎 : 請指教 謝謝 -- `timescale 1s/1s module life(input t,born);parameter year=31557600,incom=year/31 ,payout=incom;integer age,money,gf,wife,marry,child;always@(posedge t)if(!born) begin{age,money,gf,marry,child}<=0;end else if(t%year)begin age<=age+1;money<= money+incom-payout;if((age>35&gf)|gf>5)begin gf<=gf-1;wife<=1;end else if(money/ 10>incom)gf<=gf+1;if(wife&age<40)child<=child+1;end endmodule module I;reg t,b; always#0.5 t=~t;initial t=0;initial#1 b=1;life pash(t,b);endmodule/* by Pash */ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.204.207.55

03/05 00:14, , 1F
這麼麻煩?
03/05 00:14, 1F

03/08 02:34, , 2F
你的解答沒有考慮到 Cost
03/08 02:34, 2F

03/08 02:35, , 3F
而且原po所需要的 read/write 只需 2-port 不需 dual-port
03/08 02:35, 3F

03/09 21:07, , 4F
都自稱"繩"了 我還有啥好說 .........
03/09 21:07, 4F
文章代碼(AID): #1DRegfz6 (Electronics)
文章代碼(AID): #1DRegfz6 (Electronics)