我是 Verilog 的新手。
我已经编写了将线值转换为整数的代码:
wire [31:0] w1;
integer k;
always @ (w1) k = w1;
现在,对于下一部分,我得到一个错误!
wire [63:0] w2; // Suppose it contains some value
wire [63:0] w3;
assign w3[k-1:0] = w2[k-1:0]; // ERROR in this line
ERROR : k is not a constant.
我该如何解决这个问题?