mbits-mirafra / axi4_avip

MIT License
21 stars 23 forks source link

Mocking Interface-class using SVMock #95

Open muneebullashariff opened 10 months ago

muneebullashariff commented 10 months ago

A workaround for this is to define a dummy class that extends the interface to mock. Due to the fact that the IEEE people believe strongly in boilerplate code, you're also going to have to re-declare all interface method in that dummy class:

interface class some_intf;
  pure virtual function void some_func();
  pure virtual function void some_other_func();
endclass

virtual class some_intf_dummy implements some_intf;
  pure virtual function void some_func();
  pure virtual function void some_other_func();
endclass

`SVMOCK(some_intf_dummy)
muneebullashariff commented 10 months ago

Can have an example for this and see how it works