定义了一个 integer i;
always @ (posedge clk or negedge rst)
begin
for (i=0;i<7;i=i+1)
begin
encode[55-i*7:52-i*7]<=data_in[31-i*4:28-i*4];
end
end
报错:Quartus Error : i is not a constant
Modelsim :Range must be bounded by constant expressions.
高手请指教,不胜感激涕零!
此帖出自
小平头技术问答
如果是被测文件,我质疑这个模块能综合么?想想看,它的电路是什么样的,怎样才能实现这样的逻辑?估计是不行的。
哪怎样才能实现上面的功能呀?
always @ (posedge clk or negedge rst)
begin
i<=i+1;
end
always @ (posedge clk or negedge rst)
begin
encode[55-i*7:52-i*7]<=data_in[31-i*4:28-i*4];
end
reg [55:0] encode;
genvar i;
generate
for(i=0;i<7;i=i+1)
begin : loop
assign encode_wire[55-i*7:52-i*7] = data_in[31-i*4:28-i*4];
end
endgenerate
always @ (posedge clk)
begin
encode <= encode_wire;
end
一周热门 更多>