Commit 0026c3da authored by Denia Bouhired-Ferrag's avatar Denia Bouhired-Ferrag

Small bug fixes, changes temperature limits and thermal model characteristics

parent cba9c6a6
......@@ -74,16 +74,16 @@ entity conv_dyn_burst_ctrl is
architecture behav of conv_dyn_burst_ctrl is
type t_temp_decre is array (0 to 6) of integer;
type t_temp_decre is array (0 to 5) of integer;
-----signals declaration----------
signal temp_decre : t_temp_decre := (0, 1668, 200, 38, 20, 4, 100);
signal temp_decre : t_temp_decre := (0, 769, 31, 104, 14, 82);
signal burst_ctrl_rst : std_logic;
signal pulse_train_in : std_logic;
signal temp_rise : unsigned (39 downto 0) ;
signal test : integer ;
--signal test : integer ;
signal temp_fall : unsigned (39 downto 0) ;
signal single_cycle_cnt : integer;
signal five_cycle_cnt : integer;
......@@ -96,32 +96,28 @@ entity conv_dyn_burst_ctrl is
begin
-- Generate the pulse on rising edge of pulse_burst_i
p_pulse_redge: process (clk_i, burst_ctrl_rst, pulse_burst_i, pulse_train_in_r_edge_p)
p_pulse_redge: process (burst_ctrl_rst, pulse_burst_i)
begin
if rising_edge(clk_i) then
if rst_n_i = '0' then
burst_err_p_o <= '0';
elsif (en_i = '1') then
if (burst_ctrl_rst = '1') then
if falling_edge(pulse_burst_i) then
pulse_train_in <= '0';
end if;
burst_err_p_o <= '0';
if pulse_train_in_r_edge_p = '1' then
burst_err_p_o <= '1';
end if;
elsif (burst_ctrl_rst = '0') then
--if rising_edge(clk_i) then
if rst_n_i = '0' then
-- burst_err_p_o <= '0';
elsif (en_i = '1') then
if (burst_ctrl_rst = '1') then
if falling_edge(pulse_burst_i) then
pulse_train_in <= '0';
end if;
-- burst_err_p_o <= '0';
-- if pulse_train_in_r_edge_p = '1' then
-- burst_err_p_o <= '1';
-- end if;
elsif (burst_ctrl_rst = '0') then
--if (pulse_burst_i = '0') then
pulse_train_in <= pulse_burst_i; --re-activate output only if input line is off
--end if;
end if;
end if;
end if;
--end if;
end process p_pulse_redge;
p_pulse_redge_detect : process (clk_i) is
......@@ -157,7 +153,7 @@ temp_rise_c <=temp_rise;
elsif pulse_train_in = '0' then
single_cycle_cnt <= single_cycle_cnt+1;
if single_cycle_cnt = 5 then
if five_cycle_cnt < 7 then
if five_cycle_cnt < 6 then
five_cycle_cnt <= five_cycle_cnt + 1;
end if;
single_cycle_cnt <= 1;
......@@ -170,7 +166,7 @@ temp_rise_c <=temp_rise;
end process p_five_cycle_cnt;
p_thermal_sim : process (clk_i, five_cycle_cnt)
p_thermal_sim : process (clk_i)
begin
if rising_edge(clk_i) then
......@@ -178,26 +174,36 @@ temp_rise_c <=temp_rise;
if rst_n_i = '0' then
temp_rise <= (others => '0');
burst_ctrl_rst <= '1';
burst_err_p_o <= '0';
else
if signed(temp_rise) >= 0 and (signed(temp_rise) <= signed(g_max_temp)) then
if pulse_burst_i = '0' then
burst_ctrl_rst <= '0';
burst_err_p_o <= '0';
end if;
if pulse_train_in_r_edge_p = '1' and burst_ctrl_rst /= '1' then -- temperature less than maximum
temp_rise <= temp_rise + g_1_pulse_temp_rise;
elsif signed(temp_rise) > 0 and pulse_train_in = '0' then --temperature fall between pulses
test <= temp_decre(five_cycle_cnt-1);
if temp_rise > 190 then
if pulse_train_in_r_edge_p = '1' then
if burst_ctrl_rst = '0' then -- temperature less than maximum
temp_rise <= temp_rise + g_1_pulse_temp_rise;
else
burst_err_p_o <= '1';
end if;
elsif signed(temp_rise) /= 0 and pulse_train_in = '0' then --temperature fall between pulses
--test <= temp_decre(five_cycle_cnt-1);
if temp_rise > temp_decre(five_cycle_cnt-1) then
temp_rise <= temp_rise - to_unsigned(temp_decre(five_cycle_cnt-1), 40);
else
temp_rise <= (others => '0');
end if;
end if;
elsif (signed(temp_rise) > signed(g_max_temp)) and pulse_train_in = '0' then -- and (pulse_train_in_f_edge_p = '1') then
burst_ctrl_rst <= '1';
burst_ctrl_rst <= '1';
burst_err_p_o <= '0';
if pulse_train_in_r_edge_p = '1' then
burst_err_p_o <= '1';
end if;
temp_rise <= temp_rise - temp_decre(five_cycle_cnt-1);
end if;
......
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