From fa15f8d0b5a40eef465686d4338a9377ae28123c Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 30 Jun 2015 17:52:10 +0200 Subject: [PATCH] axi_hdmi_rx: Add full range support to the TPM Check for both full range and limited range test-pattern sequences and only if both don't match assert the tpm_oos signal. Signed-off-by: Lars-Peter Clausen --- library/axi_hdmi_rx/axi_hdmi_rx_tpm.v | 31 +++++++++++++++++++-------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/library/axi_hdmi_rx/axi_hdmi_rx_tpm.v b/library/axi_hdmi_rx/axi_hdmi_rx_tpm.v index 6adf2fe74..b5d21b251 100644 --- a/library/axi_hdmi_rx/axi_hdmi_rx_tpm.v +++ b/library/axi_hdmi_rx/axi_hdmi_rx_tpm.v @@ -49,27 +49,40 @@ module axi_hdmi_rx_tpm ( input [15:0] hdmi_data; output hdmi_tpm_oos; - wire [15:0] hdmi_tpm_data_s; - wire hdmi_tpm_mismatch_s; + wire [15:0] hdmi_tpm_lr_data_s; + wire hdmi_tpm_lr_mismatch_s; + wire [15:0] hdmi_tpm_fr_data_s; + wire hdmi_tpm_fr_mismatch_s; reg [15:0] hdmi_tpm_data = 'd0; - reg hdmi_tpm_mismatch = 'd0; + reg hdmi_tpm_lr_mismatch = 'd0; + reg hdmi_tpm_fr_mismatch = 'd0; reg hdmi_tpm_oos = 'd0; - assign hdmi_tpm_data_s[15:8] = (hdmi_tpm_data[15:8] < 8'h10) ? 8'h10 : + // Limited range + assign hdmi_tpm_lr_data_s[15:8] = (hdmi_tpm_data[15:8] < 8'h10) ? 8'h10 : ((hdmi_tpm_data[15:8] > 8'heb) ? 8'heb : hdmi_tpm_data[15:8]); - assign hdmi_tpm_data_s[ 7:0] = (hdmi_tpm_data[ 7:0] < 8'h10) ? 8'h10 : + assign hdmi_tpm_lr_data_s[ 7:0] = (hdmi_tpm_data[ 7:0] < 8'h10) ? 8'h10 : ((hdmi_tpm_data[ 7:0] > 8'heb) ? 8'heb : hdmi_tpm_data[ 7:0]); - assign hdmi_tpm_mismatch_s = (hdmi_tpm_data_s == hdmi_data) ? 1'b0 : 1'b1; + assign hdmi_tpm_lr_mismatch_s = (hdmi_tpm_lr_data_s == hdmi_data) ? 1'b0 : 1'b1; + + // Full range + assign hdmi_tpm_fr_data_s[15:8] = (hdmi_tpm_data[15:8] < 8'h01) ? 8'h01 : + ((hdmi_tpm_data[15:8] > 8'hfe) ? 8'hfe : hdmi_tpm_data[15:8]); + assign hdmi_tpm_fr_data_s[ 7:0] = (hdmi_tpm_data[ 7:0] < 8'h01) ? 8'h01 : + ((hdmi_tpm_data[ 7:0] > 8'hfe) ? 8'hfe : hdmi_tpm_data[ 7:0]); + assign hdmi_tpm_fr_mismatch_s = (hdmi_tpm_fr_data_s == hdmi_data) ? 1'b0 : 1'b1; always @(posedge hdmi_clk) begin if (hdmi_sof == 1'b1) begin hdmi_tpm_data <= 16'd0; - hdmi_tpm_mismatch <= 1'd0; - hdmi_tpm_oos <= hdmi_tpm_mismatch; + hdmi_tpm_lr_mismatch <= 1'd0; + hdmi_tpm_fr_mismatch <= 1'd0; + hdmi_tpm_oos <= hdmi_tpm_lr_mismatch & hdmi_tpm_fr_mismatch; end else if (hdmi_de == 1'b1) begin hdmi_tpm_data <= hdmi_tpm_data + 1'b1; - hdmi_tpm_mismatch <= hdmi_tpm_mismatch | hdmi_tpm_mismatch_s; + hdmi_tpm_lr_mismatch <= hdmi_tpm_lr_mismatch | hdmi_tpm_lr_mismatch_s; + hdmi_tpm_fr_mismatch <= hdmi_tpm_fr_mismatch | hdmi_tpm_fr_mismatch_s; end end