From 810477978428527f9cb9d03e357dd1d056eea564 Mon Sep 17 00:00:00 2001 From: David Banks Date: Mon, 3 Dec 2018 15:51:33 +0000 Subject: [PATCH] Atom CPLD: Made C/L noise filters configurable Change-Id: I92f6346f74dc1647fc2507df1f0b212399b359ef --- vhdl_atom/RGBtoHDMI.vhdl | 32 ++++++++++++++++++++++++-------- vhdl_atom/fitting.notes | 11 +++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/vhdl_atom/RGBtoHDMI.vhdl b/vhdl_atom/RGBtoHDMI.vhdl index b7234cbb..1634a71e 100644 --- a/vhdl_atom/RGBtoHDMI.vhdl +++ b/vhdl_atom/RGBtoHDMI.vhdl @@ -61,7 +61,7 @@ architecture Behavorial of RGBtoHDMI is constant atom_clamp_end : unsigned(8 downto 0) := to_unsigned(512 - 255 + 248, 9); -- Sampling points - constant INIT_SAMPLING_POINTS : std_logic_vector(3 downto 0) := "0000"; + constant INIT_SAMPLING_POINTS : std_logic_vector(5 downto 0) := "110000"; signal shift_R : std_logic_vector(1 downto 0); signal shift_G : std_logic_vector(1 downto 0); @@ -81,10 +81,12 @@ architecture Behavorial of RGBtoHDMI is signal counter : unsigned(8 downto 0); -- Sample point register; - signal sp_reg : std_logic_vector(3 downto 0) := INIT_SAMPLING_POINTS; + signal sp_reg : std_logic_vector(5 downto 0) := INIT_SAMPLING_POINTS; -- Break out of sp_reg signal offset : unsigned (3 downto 0); + signal filter_C : std_logic; + signal filter_L : std_logic; -- Sample pixel on next clock; pipelined to reduce the number of product terms signal sample_C : std_logic; @@ -132,6 +134,8 @@ architecture Behavorial of RGBtoHDMI is begin offset <= unsigned(sp_reg(3 downto 0)); + filter_C <= sp_reg(4); + filter_L <= sp_reg(5); -- Shift the bits in LSB first process(sp_clk) @@ -199,15 +203,27 @@ begin LH3 <= LH2; if sample_C = '1' then - AL <= (AL1 AND AL2) OR (AL1 AND AL3) OR (AL2 AND AL3); - AH <= (AH1 AND AH2) OR (AH1 AND AH3) OR (AH2 AND AH3); - BL <= (BL1 AND BL2) OR (BL1 AND BL3) OR (BL2 AND BL3); - BH <= (BH1 AND BH2) OR (BH1 AND BH3) OR (BH2 AND BH3); + if filter_C = '1' then + AL <= (AL1 AND AL2) OR (AL1 AND AL3) OR (AL2 AND AL3); + AH <= (AH1 AND AH2) OR (AH1 AND AH3) OR (AH2 AND AH3); + BL <= (BL1 AND BL2) OR (BL1 AND BL3) OR (BL2 AND BL3); + BH <= (BH1 AND BH2) OR (BH1 AND BH3) OR (BH2 AND BH3); + else + AL <= AL2; + AH <= AH2; + BL <= BL2; + BH <= BH2; + end if; end if; if sample_L = '1' then - LL <= (LL1 AND LL2) OR (LL1 AND LL3) OR (LL2 AND LL3); - LH <= (LH1 AND LH2) OR (LH1 AND LH3) OR (LH2 AND LH3); + if filter_L = '1' then + LL <= (LL1 AND LL2) OR (LL1 AND LL3) OR (LL2 AND LL3); + LH <= (LH1 AND LH2) OR (LH1 AND LH3) OR (LH2 AND LH3); + else + LL <= LL2; + LH <= LH2; + end if; end if; -- YUV to RGB diff --git a/vhdl_atom/fitting.notes b/vhdl_atom/fitting.notes index 1590d14b..223401a9 100644 --- a/vhdl_atom/fitting.notes +++ b/vhdl_atom/fitting.notes @@ -107,3 +107,14 @@ FB3 18/18* 28/54 63/90 8/ 9 FB4 18/18* 29/54 39/90 7/ 7* ----- ----- ----- ----- 69/72 109/216 175/360 28/34 + +10. Atom CPLD: Made C/L noise filters configurable + +Function Mcells FB Inps Pterms IO +Block Used/Tot Used/Tot Used/Tot Used/Tot +FB1 18/18* 29/54 49/90 8/ 9 +FB2 17/18 26/54 29/90 5/ 9 +FB3 18/18* 28/54 63/90 8/ 9 +FB4 18/18* 31/54 44/90 7/ 7* + ----- ----- ----- ----- + 71/72 114/216 185/360 28/34