|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
请问大家,我用 ISE 的 IP Core gen 生成了一个单口ram,然后在顶层文件里把它例化了,
然后我要如何把数据放进这个ram 呢,
module histo_count(
clk,
wea,
addra,
dina,
douta
);
parameter WIDTH = 8;
parameter DEPTH_BITS = 8;
parameter i = 0;
input clk;
input wea;
input [WIDTH-1:0] addra;
input [DEPTH_BITS-1:0] dina;
output [DEPTH_BITS-1:0] douta;
//INSTANTIATION
si_ram s_ram_1(
.clka(clk), // input clka
.wea(wea), // input [0 : 0] wea
.addra(addra), // input [7 : 0] addra
.dina(dina), // input [7 : 0] dina
.douta(douta) // output [7 : 0] douta
);
always @ (posedge clk)
if (wea)
s_ram_1[dina] <= s_ram_1[dina]+1;
提示有错误,s_ram_1 不能赋值,我是新手,请问应该怎么做读写。
谢谢 |
|