定义了一个 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.
高手请指教,不胜感激涕零!
此帖出自
小平头技术问答
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
一周热门 更多>