1
0
This commit is contained in:
Rémi Heredero 2024-04-17 12:50:48 +02:00
parent 8a64f5c04b
commit 14f542a674
3 changed files with 431 additions and 410 deletions

View File

@ -94,6 +94,15 @@ BEGIN
process(reset, clock) begin process(reset, clock) begin
if reset = '1' then
register1 <= SPACE;
register2 <= SPACE;
register3 <= SPACE;
register4 <= SPACE;
register5 <= SPACE;
signSendRegisters <= '0';
elsif rising_edge(clock) then
case general_current_state is case general_current_state is
when waitForChar => when waitForChar =>
--report "General current state is wait for char" severity note; --report "General current state is wait for char" severity note;
@ -339,9 +348,11 @@ BEGIN
--report "General current state is send registers" severity note; --report "General current state is send registers" severity note;
readChar <= '0'; readChar <= '0';
signSendRegisters <= '0'; signSendRegisters <= '0';
if signRegistersSended then if signRegistersSended = '1' then
general_next_state <= sended; general_next_state <= sended;
report "Char is send" severity note; report "Char is send" severity note;
else
general_next_state <= sendRegisters;
end if; end if;
when sended => when sended =>
@ -358,9 +369,18 @@ BEGIN
general_next_state <= waitForChar; general_next_state <= waitForChar;
end case; end case;
end if;
end process; end process;
process(reset, clock) begin process(reset, clock) begin
if reset = '1' then
morseOut <= '0';
startCounter <= '0';
unitNb <= "000";
signRegistersSended <= '0';
elsif rising_edge(clock) then
case sending_current_state is case sending_current_state is
when waiting => when waiting =>
@ -376,7 +396,7 @@ BEGIN
end if; end if;
when sendR1 => when sendR1 =>
report "Send register1" severity note; --report "Send register1" severity note;
startCounter <= '1'; startCounter <= '1';
morseOut <= '1'; morseOut <= '1';
case register1 is case register1 is
@ -398,7 +418,7 @@ BEGIN
end case; end case;
when waitR1 => when waitR1 =>
report "Wait register1" severity note; --report "Wait register1" severity note;
startCounter <= '0'; startCounter <= '0';
if counterDone = '1' then if counterDone = '1' then
morseOut <= '0'; morseOut <= '0';
@ -406,7 +426,7 @@ BEGIN
end if; end if;
when sendR2 => when sendR2 =>
report "Send register2" severity note; --report "Send register2" severity note;
startCounter <= '1'; startCounter <= '1';
morseOut <= '1'; morseOut <= '1';
case register2 is case register2 is
@ -428,7 +448,7 @@ BEGIN
end case; end case;
when waitR2 => when waitR2 =>
report "Wait register2" severity note; --report "Wait register2" severity note;
startCounter <= '0'; startCounter <= '0';
if counterDone = '1' then if counterDone = '1' then
morseOut <= '0'; morseOut <= '0';
@ -436,7 +456,7 @@ BEGIN
end if; end if;
when sendR3 => when sendR3 =>
report "Send register3" severity note; --report "Send register3" severity note;
startCounter <= '1'; startCounter <= '1';
morseOut <= '1'; morseOut <= '1';
case register3 is case register3 is
@ -520,6 +540,7 @@ BEGIN
sending_next_state <= waiting; sending_next_state <= waiting;
end case; end case;
end if;
end process; end process;

Binary file not shown.

Binary file not shown.