我们可以在一个always块中生成吗?
我想要这样的东西:
generate
for( i=0 ; i<16 ; i=i+1 ) begin:
always @(posedge clk) begin
L[i+1] <= #1 R[i];
R[i+1] <= #1 L[i] ^ out[i];
end
end
endgenerate
如果有人能帮助我,我将不胜感激。
I want to have sth like this:
generate
for( i=0 ; i<16 ; i=i+1 ) begin:
always @(posedge clk) begin
L[i+1] <= #1 R[i];
R[i+1] <= #1 L[i] ^ out[i];
end
end
endgenerate
I would appreciate it if any one could possibly help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你在这里不需要
generate
。只需在always
块中使用for
循环就可以了。您可能需要考虑几个问题:
L
和R
总线的尺寸是多少?[15:0]
?L[0]
和R[0]
赋值?i
达到 15 时i+1
仍在您的公交车范围内吗?You don't need a
generate
here, I think. Just using afor
loop within thealways
block will work.A few questions you'd probably want to think about:
L
andR
buses?[15:0]
?L[0]
andR[0]
?i+1
wheni
hits 15 will be still within the bounds of your bus?你可以做
You could do