Modify conditional operators in moving_average.vhd for Quartus compatibility
This commit is contained in:
parent
a20890e126
commit
66ed1d846b
@ -66,13 +66,22 @@ begin
|
|||||||
overflow <= '1';
|
overflow <= '1';
|
||||||
end if;
|
end if;
|
||||||
if (enable = '1') then
|
if (enable = '1') then
|
||||||
accumulator <= accumulator + unsigned("0" & data_in) - unsigned("0" & fifo_out) when (fifo_full = '1') else accumulator + unsigned("0" & data_in);
|
if (fifo_full = '1') then
|
||||||
|
accumulator <= accumulator + unsigned("0" & data_in) - unsigned("0" & fifo_out);
|
||||||
|
else
|
||||||
|
accumulator <= accumulator + unsigned("0" & data_in);
|
||||||
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end process;
|
end process;
|
||||||
|
|
||||||
average <= std_logic_vector(((log2c(WINDOW_SIZE)-1 downto 0 => '0') & accumulator(DATA_WIDTH-1 downto log2c(WINDOW_SIZE))) + 1)
|
average_prc: process(all)
|
||||||
when (ENABLE_ROUNDING and accumulator(log2c(WINDOW_SIZE)-1) = '1')
|
begin
|
||||||
else std_logic_vector(((log2c(WINDOW_SIZE)-1 downto 0 => '0') & accumulator(DATA_WIDTH-1 downto log2c(WINDOW_SIZE))));
|
if (ENABLE_ROUNDING and accumulator(log2c(WINDOW_SIZE)-1) = '1') then
|
||||||
|
average <= std_logic_vector(((log2c(WINDOW_SIZE)-1 downto 0 => '0') & accumulator(DATA_WIDTH-1 downto log2c(WINDOW_SIZE))) + 1);
|
||||||
|
else
|
||||||
|
average <= std_logic_vector(((log2c(WINDOW_SIZE)-1 downto 0 => '0') & accumulator(DATA_WIDTH-1 downto log2c(WINDOW_SIZE))));
|
||||||
|
end if;
|
||||||
|
end process;
|
||||||
end architecture;
|
end architecture;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user