I am trying to create a phase accumulator using VHDL that has the following characteristics.
Inputs:
- D (Input signal)
- RESET
- CE
- CLK
Outputs:
- Q (output signal - feedback)
Source code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Phase_accu is
port (
D : in std_logic_vector(3 downto 0);
CE : in std_logic;
CLK : in std_logic;
RESET : in std_logic;
Q : out std_logic_vector(15 downto 0)
);
end Phase_accu;
architecture Behavioral of Phase_accu is
begin
process(D, CE, CLK, RESET)
begin
if RESET = '1' then
Q <= "0000000000000000";
elsif rising_edge(CLK) then
if CE = '1' then
Q <= ("000000000000" & D) + Q;
end if;
end if;
end process;
end Behavioral;
I get an error with the line trying to merge together the 2 signals for feedback...
Q <= ("000000000000" & D) + Q;
Cannot read output "Q".
use
beforelibrary
on the first line of your code and using VHDL revision -2008 your code analyzes and elaborates (evaluating a port of mode out is possible in -2008). Please provide a minimal reproducible example including complete error message and identifying the operation your tool was performing, the problem isn't guaranteed reproducible from your question as is.