我正在尝试在eda playground中运行此代码,但我收到以下错误:
module array_redu();
byte b[] = { 1, 2, 3, 4 };
int sum,product,b_xor;
initial
begin
sum =b.sum ; // y becomes 10 => 1 + 2 + 3 + 4
product =b.product ; // y becomes 24 => 1 * 2 * 3 * 4
b_xor=b.xor with (item+ 4 ); // y becomes 12 => 5 ^ 6 ^ 7 ^8
$display(" Sum is %0d, product is %0d, xor is %0b",sum,product,b_xor)
end
endmodule
我收到以下错误:
design.sv:2: syntax error
design.sv:2: error: Invalid module instantiation
design.sv:3: syntax error
design.sv:3: error: Invalid module instantiation
design.sv:8: syntax error
design.sv:8: error: malformed statement
design.sv:10: syntax error