RE: {Spam?} Re: [vhdl-200x] VHDL-2008: Records and aggregates

From: <schav9035@mypacks.net>
Date: Wed Apr 15 2015 - 06:44:00 PDT
Not sure if this answers your question, but RNG_BYTE1 (below) can be used in slices.  The declaration of RNG_BYTE2 appears to be legal, but I don't know how it gets used (or is useful), as the declaration of byte2 causes an error when I compile it.

 - Woody
----------------
library ieee;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;

entity test is
end test;

architecture rtl of test is
   constant BYTE_WIDTH : natural := 8;
   subtype  RNG_BYTE1  is natural range BYTE_WIDTH-1 downto 0; -- OK 
   type     RNG_BYTE2  is         range BYTE_WIDTH-1 downto 0; -- OK - but how does this get used?
   signal byte1 : std_logic_vector(RNG_BYTE1);     -- OK
   signal byte2 : std_logic_vector(RNG_BYTE2);     -- "Type of discrete range is different from the corresponding index."
   signal bytes : std_logic_vector(15 downto 0);

begin  --rtl
   byte1 <= bytes(RNG_BYTE1);
   byte2 <= bytes(RNG_BYTE2);  -- Not sure if this is ok because of error in declaring byte2.
end architecture rtl;


-----Original Message-----
>From: "Lehmann, Patrick" <patrick.lehmann@tu-dresden.de>
>Sent: Apr 15, 2015 4:57 AM
>To: "vhdl-200x@eda.org" <vhdl-200x@eda.org>
>Subject: RE: {Spam?} Re: [vhdl-200x] VHDL-2008: Records and aggregates
>
>Hello,
>
>Sorry I was not aware of that it's possible to use range
>> type myRange is RANGE 7 downto 0;
>without any integer type/subtype or similar.
>
>Any other suggestions to declare a pure range? Or alternatively, any 
>suggestions to
>use integer type/subtype definitions as a range in slices and aggregates?
>
>Regards
>    Patrick
>
>


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Apr 15 06:44:15 2015

This archive was generated by hypermail 2.1.8 : Wed Apr 15 2015 - 06:44:59 PDT