我从这段代码的第 15 行得到一个解析错误。
12: module DoShellSort(
13: input [10*20-1:0] toSort,
14: output [10*20-1:0] sorted
15: reg arrBitSize
16: );
这是我正在初始化 input 和 reg 变量的测试台的一部分。
module ShellSort_tb;
reg [10*19:0] toSort, arrBitSize;
wire [10*19:0] sorted;
integer i;
DoShellSort ss_tb ([10*19:0] toSort, [10*19:0] sorted, arrBitSize);
// Input values you want to sort here
// Note: Should be 20 bits in size
initial $readmemh ("memory_hex.txt", toSort);
initial begin
#1 $display("\nThis program implements SHELL SORT to arrange values.\n");
// Display initial array
#10 $display("Array to sort: ");
#10 for (i = 0; i < arrBitSize + 1; i = i + 1)
$write("%h", toSort[i]);
#10 arrBitSize = 4'd9;
// ................
endmodule
我正在使用 iVerilog 进行合成。这是错误消息:
谁能帮我弄清楚为什么我会遇到解析错误?谢谢!