[sv-bc] Mantis 1563: allow to pass macro arguments by name

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Fri Aug 18 2006 - 02:22:54 PDT
  

I have filed Mantis 1563, an enhancement request to pass macro arguments
by name. For consistency, the language is similar to that of 12.4.4 for
tasks and functions.

In 23.2, INSERT

23.2.1 Argument binding by name

SystemVerilog allows arguments to tasks and functions to be bound by
name as well as by position. This allows specifying the arguments in any
order and easily specifying the argument to be passed at the call. For
example:

`define fun(j, s)  $display("%d %s", j, s)

The fun macro can be called as follows:

`fun( .j(2), .s("yes") ); 

`fun( .s("yes"), .j(2) ); 

`fun( 2, "yes" ); 

If both positional and named arguments are specified in a single macro
call, then all the positional arguments must come before the named
arguments. Then, using the same example as above:

`fun( .s("yes"), 2 ); // illegal

`fun( 2, .s("yes") ); // OK

 

Shalom

Shalom Bresticker

Intel Jerusalem LAD DA

+972 2 589-6852

+972 54 721-1033

I don't represent Intel 

 



image001.gif
Received on Fri Aug 18 02:23:13 2006

This archive was generated by hypermail 2.1.8 : Fri Aug 18 2006 - 02:23:36 PDT