errors sig

This commit is contained in:
leo 2023-09-26 11:58:30 +02:00
parent 898727d9cf
commit c5c757f1ff
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB

View File

@ -32,6 +32,14 @@ END receptionTrame_com;
ARCHITECTURE arch of receptionTrame_com IS
TYPE state IS (waiting, syncBreak0, syncBreak1, syncFieldWait, syncFieldStart, syncFieldData, syncFieldStop, idFieldWait, idFieldStart, idFieldData, idFieldStop, dataFieldWait, dataFieldStart, dataFieldData, dataFieldStop, checksumFieldWait, checksumFieldStart, checksumFieldData, checksumFieldStop);
SIGNAL cState, nState : state;
type errors is record
ErrorStartBit: std_logic;
ErrorStopBit: std_logic;
ErrorSync: std_logic;
end record errors;
SIGNAL errs: errors;
BEGIN
stateUpd : PROCESS(H, nRST)
@ -202,7 +210,7 @@ BEGIN
n_LOAD <= '1';
n_SELECT <= '0';
else
-- ERROR sync break
errs.ErrorSync <= '1';
end if;
else
if(n_0 = '1') then
@ -220,7 +228,7 @@ BEGIN
WHEN syncBreak1 =>
if(n_0 = '1') then
if(LinSynchro = '0') then
-- ERROR sync stop
errs.ErrorStopBit <= '1';
end if;
else
n_LOAD <= '0';
@ -241,7 +249,7 @@ BEGIN
nbBit_SELECT <= '1';
nbBit_LOAD <= '1';
else
-- ERROR start bit
errs.ErrorStartBit <= '1';
end if;
else
n_LOAD <= '0';
@ -272,7 +280,7 @@ BEGIN
if(LinSynchro = '1') then
else
-- ERROR sync stop
errs.ErrorStopBit <= '1';
end if;
else
n_LOAD <= '0';
@ -321,7 +329,7 @@ BEGIN
if(LinSynchro = '1') then
nbData_LOAD <= '1';
else
-- ERROR id stop
errs.ErrorStopBit <= '1';
end if;
else
n_LOAD <= '0';
@ -373,7 +381,7 @@ BEGIN
if(LinSynchro = '1') then
nbData_EN <= '1';
else
-- ERROR data stop
errs.ErrorStopBit <= '1';
end if;
else
n_LOAD <= '0';
@ -418,6 +426,16 @@ BEGIN
end if;
WHEN checksumFieldStop =>
if(n_0 = '1') then
if(LinSynchro = '1') then
else
errs.ErrorStopBit <= '1';
end if;
else
n_LOAD <= '0';
n_EN <= '1';
end if;
end CASE;