Reading draft 8, (same in draft 7), I found the following, which sounds like contradictions in that type event, declared as illegal in 16.6.1 Operand types, is used as formal argument, but is illegal in local variable formal argument. Specifically: 16.8.1 Typed formal arguments in sequence declarations If a formal argument of a named sequence is typed, then the type shall be sequence, event, or one of the types allowed in 16.6.1 [Ben Cohen] Interestingly, 16.6.1 specifies "event" as illegal. Thus, this is an exception. p321 The following shows an example of a formal argument with event type: sequence event_arg_example (event ev); @(ev) x ##1 y; endsequence 16.8.2 Local variable formal arguments in sequence declarations p322 sequence illegal_loc_var_formal ( output logic a, // illegal: local must be specified with ... local event e, // illegal: event is a type disallowed in // 16.6.1 --- 16.6.1 Operand types The following types are not allowed: Noninteger types (shortreal, real, and realtime) string event chandle class Associative arrays Dynamic arrays [Ben Cohen] So, If I understand this correctly, a typed formal argument that is declared with local is illegal, but if declared without the local is lega l. Thus, updating the example on page 321, I can say the following: sequence event_arg_example_Ben ( local inout logic a, logic e, f, local event evt, // illegal: event is a type disallowed in 16.6.1 event ev); // Legal: Exception to rules in 16.6.1, as per 16.8.1 @(ev) a ##1 e; endsequence It strikes me as odd, particularly, the way I view it, a formal argument, by default of direction input, acts the same as a local variable formal argument of direction input. Yet, type argument of type event is legal if formal argument is not declared as a local variable formal argument. Where am wet here? Ben -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Sat May 9 22:03:04 2009
This archive was generated by hypermail 2.1.8 : Sat May 09 2009 - 22:04:33 PDT