Commit 31b66a77 authored by Tristan Gingold's avatar Tristan Gingold

vtuCore: simplify HDL.

parent 7efea296
......@@ -1443,108 +1443,51 @@ begin
-- LowFreq: post processing to generate a square wave from pulses.
blk_lowfreq: block
is
signal FilledMuxSel : std_logic;
signal DataOutPulse : std_logic;
signal DataFilled : std_logic_vector(7 downto 0 );
signal DataAllEqual : std_logic_vector(7 downto 0 );
signal ClkValueSwitch : std_logic;
begin
-- Detect a pulse on seq output.
DataOutPulse <= DataOut_seq(7) or DataOut_seq(6) or DataOut_seq(5)
or DataOut_seq(4) or DataOut_seq(3) or DataOut_seq(2)
or DataOut_seq(1) or DataOut_seq(0);
-- Toggle when a pulse is detected.
process (Clk, RstOrStopSeq)
begin
if RstOrStopSeq = '1' then
ClkValueSwitch <= '0';
elsif (Clk'event and Clk = '1') then
if DataOutPulse = '1' then
if DataOut_seq /= x"00" then
ClkValueSwitch <= not ClkValueSwitch;
end if;
end if;
end process;
process (ClkValueSwitch)
begin
case ClkValueSwitch is
when '0' =>
DataAllEqual <= (others => '0');
when others =>
DataAllEqual <= (others => '1');
end case;
end process;
process (DataAllEqual, DataFilled, FilledMuxSel)
begin
case FilledMuxSel is
when '0' =>
DataOutLowFreq <= DataAllEqual;
when others =>
DataOutLowFreq <= DataFilled;
end case;
end process;
-- Fill data with ones or zeros after one when DataOutPulse='1'
process (DataOut_seq, DataOutPulse, ClkValueSwitch)
process (DataOut_seq, RstorStopSeq)
begin
if DataOutPulse = '1' then
if RstOrStopSeq = '1' then
-- Value at rest.
DataFilled <= "00000000";
else
-- In case of pulse, start the wave.
if DataOut_seq(7)='1' then
if ClkValueSwitch='1' then
DataFilled <= "10000000";
else
DataFilled <= "01111111";
end if;
DataFilled <= "01111111";
elsif DataOut_seq(6)='1' then
if ClkValueSwitch='1' then
DataFilled <= "11000000";
else
DataFilled <= "00111111";
end if;
DataFilled <= "00111111";
elsif DataOut_seq(5)='1' then
if ClkValueSwitch='1' then
DataFilled <= "11100000";
else
DataFilled <= "00011111";
end if;
DataFilled <= "00011111";
elsif DataOut_seq(4)='1' then
if ClkValueSwitch='1' then
DataFilled <= "11110000";
else
DataFilled <= "00001111";
end if;
DataFilled <= "00001111";
elsif DataOut_seq(3)='1' then
if ClkValueSwitch='1' then
DataFilled <= "11111000";
else
DataFilled <= "00000111";
end if;
DataFilled <= "00000111";
elsif DataOut_seq(2)='1' then
if ClkValueSwitch='1' then
DataFilled <= "11111100";
else
DataFilled <= "00000011";
end if;
DataFilled <= "00000011";
elsif DataOut_seq(1)='1' then
if ClkValueSwitch='1' then
DataFilled <= "11111110";
else
DataFilled <= "00000001";
end if;
DataFilled <= "00000001";
else
if ClkValueSwitch='1' then
DataFilled <= "11111111";
else
DataFilled <= "00000000";
end if;
-- Either no pulse or start the wave on the next cycle.
DataFilled <= "00000000";
end if;
else
DataFilled <= (others => '0');
end if;
end process;
FilledMuxSel <= (not RstOrStopSeq) and DataOutPulse;
DataOutLowFreq <= DataFilled when ClkValueSwitch = '0' else not DataFilled;
end block blk_lowfreq;
DataOut <= DataOutHTSyncLess when Mode = C_Code_ctuAsVtu_control2_mode_syncLessOperation else
......
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