UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
311 Views
Registered: ‎09-13-2011

Detecting VHDL-2008

This is not a too serious problem more like fun to know.

I'm looking for a way to detect whether an interpreter understands VHDL-2008 or basic VHDL-1993. The code must be VHDL-1993 but must produce a different result depending on the VHDL-2008 capabillity of the compiler/simulator.

Something similar to this:

    function is_sim return boolean is
    variable result     : boolean;
    begin
        result := false;
        -- synthesis translate_off
        result := true;
        -- synthesis translate_on
        return result;
    end function is_sim;

this just returns true if simulation and false if synthesis.

Can such a thing exist?

0 Kudos
3 Replies
Scholar richardhead
Scholar
297 Views
Registered: ‎08-01-2012

Re: Detecting VHDL-2008

Short answer is No. I also dont know any tool that would do this (it will just throw syntax errors if you try and compile VHDL 2008 code in VHDL 93 mode)

VHDL 2019 does add some interesting features, like access to environmental variables and some pre-defined environmental variables:

impure function VHDL_VERSION return string ;
function TOOL_TYPE return string ;
function TOOL_VENDOR return string ;
function TOOL_NAME return string ;
function TOOL_EDITION return string ;
function TOOL_VERSION return string ;

But dont expect any Xilinx support any time soon (they're still trying to implement 2008).

Link to all VHDL 2019 Features:

https://vhdlwhiz.com/vhdl-2019/

Explorer
Explorer
256 Views
Registered: ‎09-13-2011

Re: Detecting VHDL-2008

I also believe the answer is no. Unless there's some trick or bug in the implementation (feature) that would enable a function to return something unexpected under VHDL-93. Because the code must be VHDL-93 compliant as you also pointed out, it must be able to run in an VHDL-93 environment just checking if the simulator supports VHDL-2008 and return another result in this case.
Yeah, VHDL-2019 will probably not be implemented in Vivado the next 20 years if ever.

Teacher drjohnsmith
Teacher
240 Views
Registered: ‎07-09-2009

Re: Detecting VHDL-2008

@tsjorgensen dont be pessimistic, it will be implemented
but as its VHDL, only in part, and wrongly with ,minimal testing,

:->
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos