[sv-bc] Query related to interface modport

From: Surya Pratik Saha <spsaha_at_.....>
Date: Mon Aug 28 2006 - 03:34:20 PDT
Hi,
please consider the following case:

interface verilog_to_sv_if;
        //extern forkjoin task mh_reg_wr(input logic [127:0] mode, input logic [
31:0] addr, input logic [31:0] data);
        modport export_modport(export task mh_reg_wr(input logic [127:0] mode, input logic [31:0] addr, input logic [31:0] data));
        modport export_modport1(import task mh_reg_wr(input logic [127:0] mode,
input logic [31:0] addr, input logic [31:0] data));
endinterface

module bot (verilog_to_sv_if v_to_sv);
    initial begin
        v_to_sv.mh_reg_wr(1,1,1);
    end
endmodule
module sv_and_v_interface_module (verilog_to_sv_if v_to_sv);
task v_to_sv.mh_reg_wr (input logic [127:0] mode, input logic [31:0] addr, input
 logic [31:0] data);
begin
   v_to_sv.mh_reg_wr(mode, addr, data);
end
endtask
endmodule
module top;
    verilog_to_sv_if I();
    sv_and_v_interface_module m1(I);
    bot b(I);
endmodule

In this case, a task is exported with a modport. So I think for the instantiation of sv_and_v_interface_module, the moport export_modport has to be specified. VCS is passing, which I think is incorrect. MTI-Vlog is failing.

Consider another case:
interface verilog_to_sv_if;
        extern forkjoin task mh_reg_wr(input logic [127:0] mode, input logic [31
:0] addr, input logic [31:0] data);
        modport export_modport1(import task mh_reg_wr(input logic [127:0] mode,
input logic [31:0] addr, input logic [31:0] data));
endinterface

module bot (verilog_to_sv_if v_to_sv);
    initial begin
        v_to_sv.mh_reg_wr(1,1,1);
    end
endmodule
module sv_and_v_interface_module (verilog_to_sv_if v_to_sv);
task v_to_sv.mh_reg_wr (input logic [127:0] mode, input logic [31:0] addr, input
 logic [31:0] data);
begin
   v_to_sv.mh_reg_wr(mode, addr, data);
end
endtask
endmodule
module top;
    verilog_to_sv_if I();
    sv_and_v_interface_module m1(I);
    bot b(I);
endmodule

Here an extern forkjoin is used, but no export declaration is used. I think this is also not valid case, as extern forkjoin is related with export declaration inside a modport. Though if we use only 'extern' discarding forkjoin, then the case is OK.

Here also VCS behaviopur is not mathing my understanding. And MTI-Vlog is crashing at the time of simulation.

-- 
Regards
Surya.
  Received on Mon Aug 28 03:35:36 2006

This archive was generated by hypermail 2.1.8 : Mon Aug 28 2006 - 03:36:01 PDT