Re: [sv-bc] which name space belongs task/funcition ports in NON-ANSI style

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Tue Mar 03 2009 - 08:44:20 PST
Daniel,

There is no consideration in the LRM for port versus local variable
type resolution.  The type selected is the type that is visible at
the point that the type reference is seen.  In this case, I would expect
both "i" and "loc" to have a width of 8 since the visible "TR" at
the point of reference is the one inside the function.

Gord.


Daniel Mlynek wrote:
> See below code  - question is what should be the types of the 'i' and 
> 'loc'?
> 1. Should type TR for 'i' be resolved as external typedef  (typedef 
> reg[1:0] TR;) as this is port?
> 2. Should type TR for 'loc' be resolved as internal typedef ( typedef 
> reg[7:0] TR;)as this is local variable?
>  
> module top;
>  
> typedef reg[1:0] TR;
> int y;
>  
> function int f1;
>  typedef TR;
>  input i;
>  TR loc; //<<<<<<<<<<local variable internal typedef
>  TR i; //<<<<<<<<<<<<<port outside typedef.
>  typedef reg[7:0] TR;
>  $display(,,$bits(i));
>  $display(,,$bits(loc));
>  return 1;
>  
> endfunction
>  
> initial #1 y=f1(-1);
>  
> endmodule
>  
> DANiel
>  
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
> 
> 
> ------------------------------------------------------------------------
> 
> This email was Anti Virus checked by Astaro Security Gateway. http://www.astaro.com

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Mar 3 08:45:27 2009

This archive was generated by hypermail 2.1.8 : Tue Mar 03 2009 - 08:46:12 PST