Commit 289c8e93 authored by Evangelia Gousiou's avatar Evangelia Gousiou

correction on glitch filter test; added two more tests of glitch filter with TTL bar

parent 198e95b5
This diff is collapsed.
...@@ -47,7 +47,8 @@ package testbench_pkg is ...@@ -47,7 +47,8 @@ package testbench_pkg is
constant C_NR_MASTERS : positive := 1; constant C_NR_MASTERS : positive := 1;
constant C_NR_SLAVES : positive := 1; constant C_NR_SLAVES : positive := 1;
constant C_RTM : std_logic_vector(5 downto 0) := "010101"; constant C_NO_RTM : std_logic_vector(5 downto 0) := "000000";
constant C_RTM_DB9 : std_logic_vector(5 downto 0) := "000101";
constant C_INITIAL_TST_VALUE : std_logic_vector(31 downto 0) := x"FFFFFFF0"; constant C_INITIAL_TST_VALUE : std_logic_vector(31 downto 0) := x"FFFFFFF0";
constant C_I2C_MASTER_SLV_ADDR: std_logic_vector(6 downto 0) := "1011110"; constant C_I2C_MASTER_SLV_ADDR: std_logic_vector(6 downto 0) := "1011110";
...@@ -259,6 +260,7 @@ end component conv_ttl_rs485; ...@@ -259,6 +260,7 @@ end component conv_ttl_rs485;
procedure settings_config (constant glitch_filter_en : in std_logic; procedure settings_config (constant glitch_filter_en : in std_logic;
constant ttl_out_bar_en : in std_logic; constant ttl_out_bar_en : in std_logic;
constant rtm_value : in std_logic_vector(5 downto 0);
signal sw_gp_n : out std_logic_vector(7 downto 0); signal sw_gp_n : out std_logic_vector(7 downto 0);
signal sw_other : out std_logic_vector(31 downto 0); signal sw_other : out std_logic_vector(31 downto 0);
signal pcbrev : out std_logic_vector(5 downto 0); signal pcbrev : out std_logic_vector(5 downto 0);
...@@ -297,23 +299,30 @@ package body testbench_pkg is ...@@ -297,23 +299,30 @@ package body testbench_pkg is
--================================================================================================== --==================================================================================================
procedure settings_config (constant glitch_filter_en : in std_logic; procedure settings_config (constant glitch_filter_en : in std_logic;
constant ttl_out_bar_en : in std_logic; constant ttl_out_bar_en : in std_logic;
signal sw_gp_n : out std_logic_vector(7 downto 0); constant rtm_value : in std_logic_vector(5 downto 0);
signal sw_other : out std_logic_vector(31 downto 0); signal sw_gp_n : out std_logic_vector(7 downto 0);
signal pcbrev : out std_logic_vector(5 downto 0); signal sw_other : out std_logic_vector(31 downto 0);
signal rtm : out std_logic_vector(5 downto 0)) is signal pcbrev : out std_logic_vector(5 downto 0);
signal rtm : out std_logic_vector(5 downto 0)) is
begin begin
sw_gp_n(0) <= not glitch_filter_en; sw_gp_n(0) <= not glitch_filter_en;
if glitch_filter_en = '1' then if glitch_filter_en = '1' then
print_now("Glitch filter enabled"); print_now("- Glitch filter enabled");
else else
print_now("Glitch filter disabled"); print_now("- Glitch filter disabled");
end if; end if;
sw_gp_n(7) <= ttl_out_bar_en; sw_gp_n(7) <= ttl_out_bar_en;
if ttl_out_bar_en = '1' then if ttl_out_bar_en = '1' then
print_now("TTL output BAR enabled"); print_now("- TTL output BAR enabled");
else
print_now("- TTL output BAR disabled");
end if;
if rtm_value = C_RTM_DB9 then
print_now("- DB9 RTM plugged in");
else else
print_now("TTL output BAR disabled"); print_now("- No particular RTM");
end if; end if;
--print_now_s_std("RTMP & RTMM set to x", C_RTM); --print_now_s_std("RTMP & RTMM set to x", C_RTM);
...@@ -321,7 +330,9 @@ package body testbench_pkg is ...@@ -321,7 +330,9 @@ package body testbench_pkg is
sw_gp_n(6 downto 1) <= (others => '0'); -- not used sw_gp_n(6 downto 1) <= (others => '0'); -- not used
sw_other <= (others => '0'); -- not used sw_other <= (others => '0'); -- not used
pcbrev <= "111100"; -- not used pcbrev <= "111100"; -- not used
rtm <= C_RTM; -- not used rtm <= rtm_value;
end procedure; end procedure;
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment