[sv-ec] Is it illegal to make nonblocking to class variables from a task?

From: Ben Cohen <hdlcohen@gmail.com>
Date: Mon Sep 30 2013 - 08:16:23 PDT
The example in 8.2 Overview shows:
*class Packet ;*
*  //data or class properties*
*  bit [3:0] command;*
*  bit [40:0] address;*
*  bit [4:0] master_id;
*
*  // ..*
*  task clean();*
*    command = 0; address = 0; master_id = 5'bx;*
*  endtask*
*endclass*
*
*
But nothing in 1800 states that It shall be illegal to make nonblocking
assignments to class variables.  Instead, I found
in *10.4.2 Nonblocking procedural assignments*
*It shall be illegal to make nonblocking assignments to automatic variables.
*
*
*
[Ben] I am raising this question because I am experiencing one tool that
claims that it is illegal to make nonblocking assignments to class
variables, while another tool accepts it willingly,  Note that one can make
nonblocking assignments to interface variables as shown below:
task mem_driver::read(input [ADDR_WIDTH - 1 : 0] addr);
    begin
        @(this.vif.mem_cb);
        this.vif.mem_cb.rd   <= 1'b1;
        this.vif.mem_cb.addr <= addr;
        this.vif.mem_cb.data <= 'Z;
        @(this.vif.mem_cb);
        @(this.vif.mem_cb);
        this.vif.mem_cb.rd   <= 1'b0;
        @(this.vif.mem_cb);
    end
Ben Cohen

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Sep 30 08:17:16 2013

This archive was generated by hypermail 2.1.8 : Mon Sep 30 2013 - 08:17:54 PDT