RE: [sv-bc] Re: [sv-ec] Is string valid data type for 'foreach' array

From: Warmke, Doug <doug_warmke_at_.....>
Date: Thu Jan 17 2008 - 08:59:08 PST
Hello Moumita,

 

There must be some misunderstanding.

 

I didn’t say that “formal arguments of imported tasks cannot be specified as open arrays”.

Rather, just the opposite is true:  That is the only place in the SV language that open arrays

can be specified.  

 

In addition, strings are clearly allowed as formal arguments to imported tasks.

Please give a careful read to 1800-2005 Sec 26, and Annex F.

You will find the answers to these questions in there.

All legal data type mappings are clearly specified in normative text.

Any data type not mentioned is not allowed.

 

Thanks and regards,

Doug

 

From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On Behalf Of Moumita
Sent: Thursday, January 17, 2008 2:27 AM
To: Arturo Salz
Cc: Surya Pratik Saha; sv-ec@server.eda.org; sv-bc@server.eda.org
Subject: [sv-bc] Re: [sv-ec] Is string valid data type for 'foreach' array

 

Hello,
According to  SV LRM 1800-2005 
"Formal arguments of imported functions can be specified as open arrays." and nothing is mentioned about imported task for this context and Dhiraj raised a question on this.
and Doug answers Dhiraj that-
Formal arguments of imported tasks can not be  specified as open arrays.

And  you said that "a string can be considered a dynamic array of byte's"
So string datatype can not be allowd as a formal arguments of imported task.
 
But In SV LRM 1800-2005 sec 26.4.4  we found an example-
import "DPI" task checkResults(input string s, bit [511:0] packet);

So please make a comment on this.

Thanks,
 Moumita
Arturo Salz wrote: 

Yes. The foreach should iterate over a string variable. In this respect, a string can be considered a dynamic array of byte’s.

 

            Arturo

 

________________________________

From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Surya Pratik Saha
Sent: Wednesday, January 16, 2008 10:14 PM
To: sv-ec@eda.org; sv-bc@eda.org
Subject: [sv-ec] Is string valid data type for 'foreach' array

 

Hi,
SV 1800-2008 draft LRM defines 'foreach' array as follows:
12.7.3 The foreach loop
The foreach-loop construct specifies iteration over the elements of an array. Its argument is an identifier that designates any type of array followed by a comma-separated list of loop variables enclosed in square brack-ets.

Is 'string' type allowed as array. Is the following case valid?
module top;
    string s;
    initial begin
        foreach (s[i]) begin
        end
    end
endmodule






-- 
Regards
Surya


-- 
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 <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 Jan 17 08:59:50 2008

This archive was generated by hypermail 2.1.8 : Thu Jan 17 2008 - 09:00:31 PST