Re: [sv-ac] SVA 16.17: Is the expect statement legal in a class using virtual interface?

From: Ben Cohen <hdlcohen@gmail.com>
Date: Wed Apr 25 2012 - 08:39:36 PDT

 Got the following comment: "Regarding virtual interfaces, these are
dynamic types, since the interface can be reassigned during run time. " So
virtual interface is not supported in SVA, thouh that is not mentioned in
the LRM.
 I tried a direct connection as follows (also in the code as comments) :
 exp0: expect ( @(top.v_if.driver_cb)
           top.v_if.mst_abt ##[5:8] v_if.slv_resp)
Here top.v_if is not a virtual interface, since it is instanced in the top
module.
The simulator I used had issues with the expect.
Once could argue that a class is instanced, and if instanced, the tasks
(where the expect can reside) would be active.
As far as the virtual interface, it is connected to a real interface like:
// in top module
   master_if v_if(clk);
    c_driver c_dvr=new(); // new class instanced
    // ..
    initial c_dvr.v_if=v_if; // connection of virtual interface to actual
interface.
Now one could dynamically change the interface at a later time, but that
almost never happens.
If it does the expect (or even a concurrent assertion) would mess up if it
is waiting on some signals. That would be a dynamic error.
It seems that we should (in next version) support concurrent assertions in
classes with signals off of virtual interfaces.
Ben

On Tue, Apr 24, 2012 at 9:04 AM, Ben Cohen <hdlcohen@gmail.com> wrote:

> Question relates to file uploaded at
> http://www.eda-stds.org/svdb/view.php?id=4119
>
> LRM states that "The expect statement can appear anywhere a wait statement
> (see 9.4.3) can appear".
> A wait statement can appear in a class within a task. Frameworks, like
> UVM, use virtual interfaces.
> Thus, I would think that the following code is legal, from an LRM
> viewpoint. Below is a copy of the class
> with the expect statement. If a simulator does not compile/elaborate on
> this code, would that be a not supported feature or simply because it is a
> violation of the LRM? I think that this code should be legal. I need
> your feedback as to why it is (or it is not) legal.
>
> class c_driver;
> virtual interface master_if.drvr_if_mp v_if;
> function new(); endfunction : new
>
> task continue2(); //..
> $display("%t, continue2", $time);
> endtask : continue2 // What to do if response to abt is the abtED
> task abt_error();
> $display("%t, abt_error", $time); //…
> endtask : abt_error // What to do if response to abt is not abtED
>
> task drive();
> // code..
> v_if.data_in <= 4'b1010;
> v_if.ld <= 1'b1;
> @(v_if.driver_cb)
> v_if.ld <= 1'b0;
> exp0: expect ( @(v_if.driver_cb)
> v_if.mst_abt ##[2:8] v_if.slv_resp)
> continue2(); // pass action block
> else abt_error(); // fail action block
> endtask : drive
>
> endclass : c_driver
> Ben
>
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Apr 25 08:40:30 2012

This archive was generated by hypermail 2.1.8 : Wed Apr 25 2012 - 08:41:21 PDT