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

From: Steven Sharp <sharp@cadence.com>
Date: Mon Sep 30 2013 - 09:13:31 PDT
It was illegal in 1800-2009, and was only made legal in 1800-2012.  You may need to wait a while for implementations to catch up with the change.


From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Ben Cohen
Sent: Monday, September 30, 2013 11:16 AM
To: sv-ec@eda.org; sv-ac@eda-stds.org
Subject: [sv-ec] Is it illegal to make nonblocking to class variables from a task?

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<http://www.mailscanner.info/>, and is
believed to be clean.

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

This archive was generated by hypermail 2.1.8 : Mon Sep 30 2013 - 09:14:13 PDT