[sv-bc] Is modport variable allowed to be declared later?

From: Surya Pratik Saha <spsaha_at_.....>
Date: Mon Jan 28 2008 - 04:15:36 PST
Hi,
As per LRM (section 20.4 Modports)
*All of the names used in a modport declaration shall be declared by the 
same interface as the modport itself. In particular, the names used 
shall not be those declared by another enclosing interface, and a 
modport dec-laration shall not implicitly declare new ports.

*It seems to me, the names should be previously declared before usage of 
modport. With that consideration, following case should fail:
interface intf ;
    modport master (
      input cl
     );

    int cl = 1;
endinterface

module mod;
    intf fg();
    mod1 md1(fg.master);
        int x;
    initial
        begin
            x = fg.cl;
        end
endmodule

module mod1(intf.master ms);
    int x;
    initial
        x = ms.cl;
endmodule


Note 'cl' is declared later after modport declaration 'master'. But some 
simulators are passing the case.

-- 
Regards
Surya





-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Jan 28 04:16:17 2008

This archive was generated by hypermail 2.1.8 : Mon Jan 28 2008 - 04:17:39 PST