RISC-V MCU中文社区

【分享】 双口ram的使用方法

发表于 开源蜂鸟E203 2021-06-16 22:12:35
0
2141
0

团队:芯光  队伍编号:CICC1787

单口 RAM 只有一个时钟(clka)(时钟上升沿到来时对数据进行写入或者读出)、一组输入输出数据线(dina & douta)、一组地址线(addra)、一个使能端(ena)(“ena == 1”时可进行读或写的操作,“ena == 0”时无法进行读或写的操作)、一个写使能端(wea)(在“ena == 1”的情况下:“wea == 1”时只写不读,“wea == 0”时只读不写)。单口读、写无法同时进行,只能或读或写。

简单双口 RAM 有两个时钟(clka & clkb)、一组输入输出数据线(dina & doutb)、两组地址线(addra & addrb),两个使能端(ena & enb)、一个写使能端(wea)。一个端口只读(Port a),另一个端口只写(Port b)。整体上,读、写可以同时进行。

真双口 RAM 有两个时钟(clka & clkb)、两组输入输出数据线(dina & douta & dinb & doutb)、两组地址线(addra & addrb),两个使能端(ena & enb)、两个写使能端(wea & web)。两个端口都可以进行读写操作(Port a 和 Port b 可以一起读或者一起写或者一个读一个写)。整体上,读、写可以同时进行

下图为双口ram 中A口的信号端口,B口与之类似

abbra

地址总线

dina

数据输入总线

clka

A口时钟

douta

数据输出总线

ena

读使能(高有效)

wea

字节宽度写使能(高有效)

rsta

复位(高有效)

@font-face{ font-family:"Times New Roman"; } @font-face{ font-family:"宋体"; } @font-face{ font-family:"Calibri"; } p.MsoNormal{ mso-style-name:正文; mso-style-parent:""; margin:0pt; margin-bottom:.0001pt; mso-pagination:none; text-align:justify; text-justify:inter-ideograph; font-family:Calibri; mso-fareast-font-family:宋体; mso-bidi-font-family:'Times New Roman'; font-size:10.5000pt; mso-font-kerning:1.0000pt; } span.msoIns{ mso-style-type:export-only; mso-style-name:""; text-decoration:underline; text-underline:single; color:blue; } span.msoDel{ mso-style-type:export-only; mso-style-name:""; text-decoration:line-through; color:red; } @page{mso-page-border-surround-header:no; mso-page-border-surround-footer:no;}@page Section0{ } div.Section0{page:Section0;}

@font-face{ font-family:"Times New Roman"; } @font-face{ font-family:"宋体"; } @font-face{ font-family:"Calibri"; } p.MsoNormal{ mso-style-name:正文; mso-style-parent:""; margin:0pt; margin-bottom:.0001pt; mso-pagination:none; text-align:justify; text-justify:inter-ideograph; font-family:Calibri; mso-fareast-font-family:宋体; mso-bidi-font-family:'Times New Roman'; font-size:10.5000pt; mso-font-kerning:1.0000pt; } span.msoIns{ mso-style-type:export-only; mso-style-name:""; text-decoration:underline; text-underline:single; color:blue; } span.msoDel{ mso-style-type:export-only; mso-style-name:""; text-decoration:line-through; color:red; } @page{mso-page-border-surround-header:no; mso-page-border-surround-footer:no;}@page Section0{ } div.Section0{page:Section0;}

下图为A口写,A口和B口读的波形图,A口和B口共享一个地址空间。


下面为单口ram和双口ram的Verilog程序:





喜欢0
用户评论

未通过实名认证

懒的都不写签名

积分
问答
粉丝
关注
  • RV-STAR 开发板
  • RISC-V处理器设计系列课程
  • 培养RISC-V大学土壤 共建RISC-V教育生态
RV-STAR 开发板