Re: What does 'last_event really return?

From: Ernst Christen <Ernst.Christen_at_.....>
Date: Wed Feb 15 2006 - 11:50:00 PST
Hi Arpad,

I believe the answer to your question is related to the VHDL language version supported by 
your tool. 

The VHDL language, defined by IEEE Std. 1076, defines S'LAST_EVENT to be a function whose 
result type is the predefined type TIME. All tools compliant with any version of VHDL will 
support this function. 

VHDL-AMS, defined by IEEE Std. 1076.1, is an extension of VHDL and as such supports 
everything defined in VHDL (currently the 1993 version). VHDL-AMS defines another function 
S'LAST_EVENT whose result type is the predefined type REAL. All tools supporting VHDL-AMS 
will support this function, but tools supporting the base language will not.

In the case of VHDL-AMS, the two overloaded functions are disambiguated based on their 
signature, which for the S'LAST_EVENT function in essence means its result type. In your 
example, you are looking for a function whose return type is REAL. This function is only 
available in tools compliant with VHDL-AMS. Your second attempt, based on TIME'Pos, will 
always force the version of S'LAST_EVENT returning TIME to be called, so it is expected to 
work in all tools.



On Wed, 15 Feb 2006 10:37:24 -0800, Muranyi, Arpad wrote:
> Hello everyone,
>
> I would like to find out what the return type of the 'last_event
> attribute really should be according to the LRM.  The reason I am
> asking is because different tools behave differently on a piece
> of code I am wrestling with.
>
> I have a function in which one of the inputs is declared as a real.
>
>     function MyFunction (X : real) return real is
>
> When I call it I am trying to pass the time of an event into it
> using the return value of 'last_event.
>
>     SomeReal == MyFunction(SomeSignal'last_event);
>
> Some of the tools I use take the above line, but others will generate
> a type mismatch error and will only work if I do it with an explicit
> type conversion.
>
>     SomeReal == MyFunction(time'pos(SomeSignal'last_event)*1.0e-15);
>
> The tool that works with the first example will also work with the
> second, but I would like to find out which one is the PROPER syntax
> according to the language reference manual.  I read something about
> the two different representations of time in the analog and digital
> solvers, but I don't understand it completely.  Could someone please
> explain this to me?
>
> Thanks,
>
> Arpad Muranyi
> Intel Corporation
> ======================================================================
Received on Wed Feb 15 11:50:05 2006

This archive was generated by hypermail 2.1.8 : Wed Feb 15 2006 - 11:50:32 PST