[sv-bc] RE: [sv-ec] svlog enum function usage

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Thu Apr 24 2008 - 11:03:54 PDT
No, "." is sometimes an operator in SV.  For example, if the value of
my_color was the handle to a class object, and prev were one of its
methods, and it returned another class handle, and so on, then this
would be legal.

 

See method_call_root in http://www.eda.org/sv-ec/Errata/ERR_47.html or

 

 
http://www.eda-stds.org/sv/SV3.1a_bnf_no_footnotes.htm#method_call_root_
DEF_

 

But the LRM says that enum methods can only be used with variables.

 

n  Brad

 

From: Rich, Dave [mailto:Dave_Rich@mentor.com] 
Sent: Thursday, April 24, 2008 10:37 AM
To: Brad Pierce; sv-ec@eda.org; sv-bc@eda.org; sv-ac@eda-stds.org
Subject: RE: [sv-ec] svlog enum function usage

 

I agree with that. This is because "." is a select, not an operator. In
Verilog, you would assume my_color.prev.next.next was a hierarchical
path and begin a search for those names.

 

Dave

 

________________________________

From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On
Behalf Of Brad Pierce
Sent: Thursday, April 24, 2008 10:05 AM
To: sv-ec@server.eda.org; sv-bc@server.eda.org;
sv-ac@server.eda-stds.org
Subject: RE: [sv-ec] svlog enum function usage

 

I think an enum method can only be used with a variable, not with an
anonymous value returned by some expression.

 

n  Brad

 

From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Kapil Kaushik
Sent: Thursday, April 24, 2008 9:57 AM
To: sv-ec@eda.org; sv-bc@eda.org; sv-ac@eda-stds.org
Subject: [sv-ec] svlog enum function usage

 

Hi,

 

System Verilog provides some enum functions(section 4.10) like: next,
prev, last, first etc. for use. I have a doubt whether the following
statement (highlighted) is valid:

 

module test(input clk, input in, output out);

 

typedef enum {red, yellow, blue, green} color;

color my_color

 

always @(clk)

begin

 

my_color = blue;

my_color = my_color.prev.next.next

 

end

endmodule

 

i.e. are stacked up function calls valid? SVlog LRM does not mention
anything about this, so it would be great to have some feedback on this.

 

Thanks,

Kapil


-- 
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 <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 Thu Apr 24 11:07:10 2008

This archive was generated by hypermail 2.1.8 : Thu Apr 24 2008 - 11:09:05 PDT