What is the reason for this error in ModelSim for my Verilog code? (string_literal.v(3): near ";": Syntax error.)

52 Views Asked by At
module string_l();

string a;

initial
begin
a="Hello";
$display ("@%gns a=%s", $time, a);
end
endmodule
1

There are 1 best solutions below

0
dave_59 On BEST ANSWER

Your problem is a string is a SystemVerilog datatype and you compiled with a Verilog .v file extension. Change the file extension to .sv.