By default, the Vivado IDE compiles .v files with the Verilog 2001 syntax and .sv files with the SystemVerilog syntax.
To target SystemVerilog for a specific .v file in the Vivado IDE:
- Right-click the file and select Set file
type as shown in the figure below.
- In the Set Type dialog box, shown in the figure below, change the file type from
Verilog to SystemVerilog and click
OK.
Alternatively, you can use the following command in the Tcl Console:
set_property file_type SystemVerilog [get_files <filename>.v]