[sv-bc] Weakly typed virtual interfaces?

From: Jonathan Bromley <jonathanbromley@ymail.com>
Date: Fri Sep 10 2010 - 17:57:57 PDT

Following-up Peter Flake's message about modport
type relaxation andvirtual interfaces...

> weakening the type checking so that a match
> between port declaration and port connection
> is achieved if the types and names of all
> modport items match.
[...]
> For virtual interfaces, such a table would
> have to be built for each new assignment and
> cached for the next time.

I need some help seeing how this could work.

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
  
and this piece of code...

  // I'm guessing the desired type for VI here
  function foo (interface.M VI);
     ...
     if (VI.R < 0) ...
  endfunction
     
- what should the virtual interface type
  declaration look like if it is to restrict
  VI to be able to point to only one of the
  two kinds of interface? From Peter's
  discussion I inferred that "interface.M"
  is right, but that doesn't distinguish
  the two very different Ms. Using "IS.M"
  or "IU.M" is essentially 1800-2009.
- or, if VI is basically untyped, what is the
  expected behaviour of the reference "VI.R"
  when VI points to an IS? When VI points to
  an IU?
  
The names match; both IS::R and IU::R can
legally participate in the operation "<0";
but the behaviours in the two cases are
quite different.

-- 
Jonathan Bromley
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Sep 10 17:58:15 2010

This archive was generated by hypermail 2.1.8 : Fri Sep 10 2010 - 18:01:02 PDT