From c5c757f1ff35e5ef900862aa7bd9d68f3f853104 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 26 Sep 2023 11:58:30 +0200 Subject: [PATCH] errors sig --- ReceptionTrame_lib/receptionTrame_com.vhd | 30 ++++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/ReceptionTrame_lib/receptionTrame_com.vhd b/ReceptionTrame_lib/receptionTrame_com.vhd index 4c2b689..74d2f58 100644 --- a/ReceptionTrame_lib/receptionTrame_com.vhd +++ b/ReceptionTrame_lib/receptionTrame_com.vhd @@ -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;