-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
attached mail follows:
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 Wed Aug 15 23:54:32 2007
This archive was generated by hypermail 2.1.8 : Wed Aug 15 2007 - 23:55:05 PDT