[sv-ec] dynamic arrays and queues vs array literals

From: Daniel Mlynek <daniel.mlynek_at_.....>
Date: Fri May 08 2009 - 01:58:29 PDT
1. imo there is a typo in chapter 7.11 queues:
There is {} described as array literal - while {} is a concatenation. not
literal

The empty array literal {} is used to denote an empty queue

Question is what should be there - "empty array  concatenation {}", or
"empty array literal '{}" ?

My question is are literal allowed to directly drive queues and dynamic
arrays? LRM has special chapter about literal behaviour for associative
arrays but is silent about literal and dynamic array and associative array.
What would be behaviour of default if this is legal and so on?

module top;

   int da[];

   int q[$];

   initial begin

        da = new [3]('{1,2,3}); //this is legal.

        da = new [5]('{1,2,3, default:123}); //is this legal?

                da = '{1,2,3, default:123};// is this legal da[3] and da[4]
would be assigned with 123??

                da = '{4:2};// is this legal? da size is bigger than literal
size should it be raported as error or da should be silently resized?

                da = '{1:0, 4:2};// is this legal? indexes are not
consecutive

            //same question raising for queues

    end

endmodule

 

 

 

DANiel

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri May 8 02:02:55 2009

This archive was generated by hypermail 2.1.8 : Fri May 08 2009 - 02:03:19 PDT