From 5ad6566abfba0f8f5e1cf1df6d0fd5de299e8f31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= <tomasz.wlostowski@cern.ch>
Date: Thu, 24 Jul 2014 09:37:45 +0200
Subject: [PATCH] gc_glitch_filt: fix comparisons to make tri-stated I2C bus
 work on a simulation

---
 modules/common/gc_glitch_filt.vhd | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/common/gc_glitch_filt.vhd b/modules/common/gc_glitch_filt.vhd
index de4627c7..1710dc65 100644
--- a/modules/common/gc_glitch_filt.vhd
+++ b/modules/common/gc_glitch_filt.vhd
@@ -104,9 +104,9 @@ begin
     if rising_edge(clk_i) then
       if (rst_n_i = '0') then
         dat_o <= '0';
-      elsif (glitch_filt = (glitch_filt'range => '1')) then
+      elsif (unsigned(glitch_filt) = (glitch_filt'range => '1')) then
         dat_o <= '1';
-      elsif (glitch_filt = (glitch_filt'range => '0')) then
+      elsif (unsigned(glitch_filt) = (glitch_filt'range => '0')) then
         dat_o <= '0';
       end if;
     end if;
-- 
GitLab