I am compiling the given code on Questasim 10.0b.
`define OVL_ASSERT_ON
`define OVL_INIT_MSG
`include "ovl.vlib"
// At the top of each file
`include "ovm_macros.svh"
// Within any modules or packages
interface dut_if();
bit x,y,s,c;
modport test(output x,y,s,c);
modport dut(input x,y,s,c);
endinterface
module dut(dut_if.dut i_f);
always @ (i_f.x or i_f.y)
{i_f.c,i_f.s}=i_f.x+i_f.y;
endmodule
package my_pkg;
import ovm_pkg::*;
class my_driver extends ovm_driver;
virtual dut_if m_dut_if;
endclass
class my_env extends ovm_env;
my_driver m_driver;
endclass
endpackage
module top;
import my_pkg::*;
dut_if dut_if1 ();
dut dut1 ( .i_f(dut_if1) );
class my_test extends ovm_test;
my_env m_env;
virtual function void connect;
m_env.m_driver.m_dut_if = dut_if1;
endfunction
endclass
endmodule
After compilation, i get this error.
** Error: C:/Modeltech_6.1f/examples/half-adder.sv(45): near "ovm_test": syntax error, unexpected IDENTIFIER
** Error: C:/Modeltech_6.1f/examples/half-adder.sv(45): Error in class extension specification.
Please suggest a solution. Thank you in advance.