[sv-bc] Re: [sv-ec] query regarding pattern matching

From: Moumita <moumita_at_.....>
Date: Thu Aug 16 2007 - 22:29:20 PDT
So you mean to say  that constant_expression is not allowed  with  
tagged_expression but
'{ pattern { , pattern } } is allowed.

Thanks,

Moumita

Brad Pierce wrote:

> You're still missing an apostrophe at the start of the pattern 
> '{8'b11001101, 8'b00110011, 8'b00110010}.
>  
> -- Brad
>
> ------------------------------------------------------------------------
> *From:* Moumita [mailto:moumita@cal.interrasystems.com]
> *Sent:* Wednesday, August 15, 2007 11:33 PM
> *To:* Steven Sharp
> *Cc:* sv-ec@eda-stds.org; Brad.Pierce@synopsys.COM; nikhil@bluespec.com
> *Subject:* Re: [sv-ec] query regarding pattern matching
>
> Hello,
>
> Let me be clear about my actual question-
>
> In LRM pattern rule is  -
>
> pattern ::= . variable_identifier
> | .*
> | constant_expression
> | tagged member_identifier [ pattern ]
>
> that is  pattern can be  "tagged member_identifier  constant_expression "
> But LRM also says that -
> "A tagged union pattern succeeds if the value has the same tag and, 
> recursively, if the nested pattern matches the member value of the 
> tagged union."
> My understanding is  there is no place to keep  constant_expression or 
> .* or structure_pattern
>  with  tagged_expression.
> tagged_expression  will have either .variable_identifier or  nothing 
> which will be suceeded
> when the member_identifier is tagged by some other process.
>
> testcase:
> -------
> module top;
> typedef union tagged{
>       bit[7:0] t1;
>       logic[2:0]t2[5];
> }T12;
>
>       T12 t12;
>
> initial
> t12  = tagged t1  (23+34);
>
> initial
> begin
>   if (t12 matches (tagged t1 {8'b11001101, 8'b00110011, 8'b00110010})) 
> //this is error
>      begin
>     end
>   if (t12 matches (tagged t1 .n))  //valid
>   begin
>   end
> end
> endmodule
>
> Thanks,
>
> Moumita
>
> Steven Sharp wrote:
>
>>>Also, immediately before the "Pattern syntax" box the text says that
>>>"For tagged union patterns, the identifier following the tagged keyword
>>>is a union member name."  But 't1' is not a union member name.
>>>    
>>>
>>
>>Isn't it?  It is obscured by the unpacked dimension range after it,
>>but it sure looks like the name of a member to me.
>>
>>Steven Sharp
>>sharp@cadence.com
>>
>>
>>  
>>
>




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Aug 16 22:34:03 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 16 2007 - 22:35:34 PDT