D Flip Flop Design without SV TB Environment

Hi,
Recently I tried to design D Flip-Flop in SV along with interface and no exact SV TB environment in eda-playground platform. I am getting an error message and cannot figure it out.

/////////////////////////// Testbench Components \\\\\\\\\\\\\\\\\\\



// File name : testbench.sv
`include "interface.sv"
module testcase(dff_if.TEST test_if);
  initial
    begin
      test_if.sync_reset;
      test_if.load_d(1);
      test_if.load_d(0);
      test_if.load_d(1);
      #10 $finish;
    end
endmodule


// File name : top.sv
module top;
   bit clk;
  always #10 clk = ~clk;
  dff_if IF(clk);
  testcase TB(IF);
  dff RTL(IF);
  initial 
    begin
       // Dump waves
    $dumpfile("dump.vcd");
    $dumpvars(1);
    end
endmodule


// File name : interface.sv
interface dff_if(input bit clk);
  logic rst;
  logic d;
  logic q;
  parameter t_setup = 4, t_hold = 2;
  clocking cb @(posedge clk);
    default input #(t_setup) output #(t_hold);
    output rst,d;
    input q;
  endclocking
  modport DUV (input d,clk,rst, output q);
  task sync_reset;
    cb.rst <= 1;
    cb.d <= $urandom;
    repeat(2)
      @(cb);
    if(cb.q !== 0)
      begin
        $display("Reset isn't working");
        $stop;
      end
    else $display("Reset is working fine");
  endtask
  task load_d;
    input data;
    cb.rst <= 0;
    cb.d <= data;
    repeat(2)
      @(cb);
    if(cb.q !== data)
      begin
        $display("Loading isn't working");
        $stop;
      end
    else $display("Loading is working fine");
  endtask
  modport TEST(clocking cb,import task sync_reset(),import task load_d());
endinterface


////////////////////////// Design Part \\\\\\\\\\\\\\\\\\\



// File name : design.sv
module dff(dff_if.DUV duv_if);
  always@(posedge duv_if.clk)
    begin
      if(duv_if.rst)
        duv_if.q <= 0;
      else duv_if.q <= duv_if.d;
    end
endmodule


///////////Error message\\\\\\\



# Loading sv_std.std
# Loading work.dff(fast)
# Loading work.testcase(fast)
# ** Fatal: (vsim-3695) The interface port 'duv_if' must be passed an actual interface.
#    Time: 0 ns  Iteration: 0  Instance: /dff File: design.sv Line: 11
# FATAL ERROR while loading design
# Error loading design
# 
# End time: 13:26:57 on Dec 23,2022, Elapsed time: 0:00:01
# Errors: 1, Warnings: 0
Exit code expected: 0, received: 1


In reply to Shubhabrata:

You should only use modports for design constructs.

I’ve uploaded the working environment on EDA Playground.

In reply to cgales:

Thank you so much for replying.
I knew that I should use modport for design. Actually, I was implementing import and export tasks through modport . I came across these two concepts/techniques on some random websites. So I was curious to know how they work.

Well, there is one more problem I am facing. Don’t know whether you bumped into the same problem or not. In the waveform window, it’s only showing clk signal. I am not getting my other inputs and the output. Could you help me with that?

In reply to Shubhabrata:

A VCD file is very limited in what it can log. It is typically limited to signals only within modules, tasks and functions. The logging of interfaces isn’t defined, so you won’t see anything within your design.

A tool’s native logging is likely to have more information, so you should use that instead of VCDs.