For understanding SystemVerilog, I have been writing the codes on the Digital Design And the Computer Architecture. So, I wrote the first example and the testbench in the book.
Design
module sillyfunction(input logic a,b,c,
output logic y);
assign y = ~a & ~b & ~c |
a & ~b & ~c |
a & ~b & c;
endmodule
Testbench
module testbench();
input a, b, c;
output y;
sillyfunction dut(a,b,c,y);
initial begin
$dumpfile("file.vcd");
$dumpvars(1);
a = 0; b = 0; c = 0;
#10
c = 1;
#10
b = 1; c = 0;
#10
c = 1;
#10
a = 1; b = 0; c = 0;
#10
c = 1;
#10
b = 1; c = 0;
#10
c = 1;
end
endmodule
The problem is I have encountered the error:
[2021-10-30 14:44:15 EDT] iverilog '-Wall' design.sv testbench.sv && unbuffer vvp a.out
design.sv:1: syntax error
I give up.
Exit code expected: 0, received: 1
Done
I tried to debug it with the changing the input and output variables to reg
and wire
which has no effect. I also tried to
$dumpvars(1) to $dumvars(0)
Which has no effects on the bug.
How can I resolve the bug?