cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
3,181 Views
Registered: ‎11-22-2016

Does Vivado implement the SUBTYPE attribute correctly?

Jump to solution

Consider the following code:

 

library IEEE; use IEEE.STD_LOGIC_1164.ALL;

entity test is port (output : out std_logic_vector); end;

architecture arch of test is

    signal out_val : output'SUBTYPE := (others => '0');

begin

   output <= out_val;

end;

 

library IEEE; use IEEE.STD_LOGIC_1164.ALL;

entity top is port (output : out std_logic_vector(7 downto 0)); end;

architecture top of top is begin

    inst : entity work.test port map(output => output);

end;

 

This fails with the following error:

 

[Synth 8-211] could not evaluate expression: OTHERS in array aggregate without constraining context

 

(and if the default value assignment is ommited it fails with Synth 8-318 instead).

 

So here's the question.  Who is wrong here, the standard or Vivado?  If this error message is legitimate, ie if output'SUBTYPE really has no constraining range in context, then actually output'SUBTYPE can't be used to declare anything and is therefore pretty useless, and this is a weakness in the standard.  On the other hand, other tools (Questa vsim, in particular) simulate this without problems.

 

The language of the standard for 'SUBTYPE is a bit opaque:

 

The fully constrained subtype that is the subtype of O, together with constraints defining any index ranges that are determined by application of the rules of 5.3.2.2. (If O is an alias for an object, then the result is determined by the declaration of O, not that of the object.)

 

and I don't understand the rules for propagating types into parameters enough to comment, except presumably study of section 5.3.2.2 might answer the question.  Still, if it's a choice between the standard getting it wrong and Vivado, I know where I'd place my bets...

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
5,753 Views
Registered: ‎11-22-2016

Re: Does Vivado implement the SUBTYPE attribute correctly?

Jump to solution

Remarkable.  It looks as if this is actually fixed in 2016.3 (I was testing with 2016.1).  That was ... unexpected.

View solution in original post

0 Kudos
4 Replies
Highlighted
Explorer
Explorer
5,754 Views
Registered: ‎11-22-2016

Re: Does Vivado implement the SUBTYPE attribute correctly?

Jump to solution

Remarkable.  It looks as if this is actually fixed in 2016.3 (I was testing with 2016.1).  That was ... unexpected.

View solution in original post

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
3,164 Views
Registered: ‎10-24-2013

Re: Does Vivado implement the SUBTYPE attribute correctly?

Jump to solution

Hi @araneidae

Which version of Vivado are you using?

I see the following error with 2016.3

 

ERROR: [VRFC 10-85] subtype is not an attribute

 

 

Thanks,Vijay
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Highlighted
Explorer
Explorer
3,162 Views
Registered: ‎11-22-2016

Re: Does Vivado implement the SUBTYPE attribute correctly?

Jump to solution
Sorry, forgot to mention both Vivado version (2016.1 in first message, 2016.3 in second) and VHDL version, which is 2008. This attribute is new to VHDL 2008, hence the doubtful implementation...
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
3,151 Views
Registered: ‎10-24-2013

Re: Does Vivado implement the SUBTYPE attribute correctly?

Jump to solution

Hi @araneidae

It is always recommended to use the latest version for better results. :-)

Thanks,Vijay
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos