Quartus VHDL problem with aggregate and type cast

Here is some code showing a problem I am having with Quartus. Seems using a type cast with an aggregate throws it all off. This is just a simple test case which uses a 16 bit bidir bus to write to an 8 bit register and read it back.

-- VHDL created by Rick Collins Library ieee; Use ieee.std_logic_1164.all; Use ieee.numeric_std.all;

ENTITY Test1 is PORT ( Data : INOUT STD_LOGIC_VECTOR (15 DOWNTO 0); Addr : IN STD_LOGIC_VECTOR (7 DOWNTO 0); CSN : IN STD_LOGIC; RDN : IN STD_LOGIC; WRN : IN STD_LOGIC;

LED : OUT STD_LOGIC;

Reset : IN STD_LOGIC; SysClk : IN STD_LOGIC); -- 50 MHz Clock END Test1;

ARCHITECTURE behavior OF Test1 IS

constant SysClkRate : real := 50000.0; -- Rate in KHz signal ScratchReg : STD_LOGIC_VECTOR (7 downto 0); signal DataOut : STD_LOGIC_VECTOR (15 downto 0); signal ReadScratchReg : STD_LOGIC;

BEGIN

ReadScratchReg 'Z');

-- Data (7 downto 0) 'Z');

-- VERSION 2

-- This line fails by disabling the tristate buffers

-- Data '0') & ScratchReg;

ScratchRegister: process (SysClk, Reset) begin if (Reset = '1') then ScratchReg '0'); elsif (rising_edge(SysClk)) then if (Addr = "00001000") THEN if (WRN = '0' and CSN = '0') THEN ScratchReg

Reply to
rickman
Loading thread data ...

'1')

Hallo Rick, just out of curiosity, have you tried using a named subtype? E.g.

architecture... subtype vec8 is std_logic_vector(7 downto 0); begin

...

-- VERSION 3

-- This version produces open drain outputs Data 'Z');

-- This seems to work ok

-- DataOut

Reply to
Alan Fitch

Alan, yes, that worked. Is this a bug that I should report to Altera? Or is this to be expected in VHDL?

--

Rick "rickman" Collins

rick.collins@XYarius.com
Ignore the reply address. To email me use the above address with the XY
removed.

Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design      URL http://www.arius.com
4 King Ave                               301-682-7772 Voice
Frederick, MD 21701-3110                 301-682-7666 FAX
Reply to
rickman

To answer my own question, I heard back from Altera today that it is invalid syntax under VHDL, but not providing an error message is an Altera bug. So they should be telling me to not use this syntax and I need to use a named type here.

The actual illegal syntax is the range in the type cast. Is that what you meant be anonymous subtype?

--

Rick "rickman" Collins

rick.collins@XYarius.com
Ignore the reply address. To email me use the above address with the XY
removed.

Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design      URL http://www.arius.com
4 King Ave                               301-682-7772 Voice
Frederick, MD 21701-3110                 301-682-7666 FAX
Reply to
rickman

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.