Re: [sv-bc] Weakly typed virtual interfaces?

From: Peter Flake <flake@elda.demon.co.uk>
Date: Sun Sep 12 2010 - 06:09:52 PDT

Replying to Jonathan Bromley's message of Friday

Given these two interfaces:

   interface IS;
     reg signed [7:0] R;
     modport M(inout R);
   endinterface

   interface IU;
     reg [7:0] R;
     modport M(inout R);
   endinterface

The two modports are not compatible because they have R with
different data types, one signed and one unsigned.

function foo (interface.M VI);
      ...
      if (VI.R < 0) ...
   endfunction

The example here is analogous to a parameter of type "type" applied
to R, which also changes the behaviour.

However, I do not like the use of the generic "interface" here, and I
am trying to get away from it with my weak typing proposal. By
choosing IU or IS for the modport type in the header, the meaning
would be settled locally.

Peter Flake

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sun Sep 12 06:10:17 2010

This archive was generated by hypermail 2.1.8 : Sun Sep 12 2010 - 06:13:11 PDT