I would think that the second approach is correct, as in 1800-2005, 8.13.1, in the paragraph beginning, "For type:value," ends, "If more than one type matches the same element, the last value shall be used." Shalom > Consider the scenario, > > typedef struct { > bit r1; > logic r2; > } node; > ..................... > node p[1:0]; > ..................... > ....................... > p = '{'{ bit:1'b0, logic: 1'b1, bit: 1'b1, logic: 1'b0 > },'{bit : > 1'b0, logic : 1'b1 , bit : 1'b1 , logic : 1'b0 } } ; > > The value of the of p after assigning the assignement > pattern '{'{ bit : 1'b0, logic : 1'b1 , bit : 1'b1 , logic : > 1'b0 }, '{bit : 1'b0, logic : 1'b1 , bit : 1'b1 , logic : > 1'b0 } can be different if we follow two different approachs > for evaluation of the above assignment pattern for p. > > First approach : > > if we consider bit : 1'b0 and bit : 1'b0 > for structure member r1 of p[1] and p[0] & logic : 1'b1 and > logic : 1'b1 for structure member r2 of p[1] and p[0] then > the resulting array p will contains value '{'{1'b0, > 1'b1},'{1'b0, 1'b1}}, as we take the value associated with > key, which matches with the type of the r1 and r2 for p[1] > and p[0] first. > > Second approach : > > if we consider bit : 1'b1 and bit : 1 'b1 > for structure member r1 of p[1] and p[0] & logic : 1'b0 and > logic : 1'b0 for structure member r2 of p[1] and p[0] > then the resulting array p will contains value '{'{1'b1, > 1'b0},'{1'b1, 1'b0}} as we take the value associated with > key, which matches with the type of the r1 and r2 for p[1] > and p[0] last. > > Can someone tell me what would be the right behaviour for > the above scenario. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Thu Aug 30 06:11:51 2007
This archive was generated by hypermail 2.1.8 : Thu Aug 30 2007 - 06:11:59 PDT