From bc7e057b21d51ac17e09a9c17ed7a22ac838ac7f Mon Sep 17 00:00:00 2001 From: Tobias Klaus <klaus@cs.fau.de> Date: Mon, 30 May 2016 18:34:00 +0200 Subject: [PATCH] adds cored pseudo code --- 04_EAN/src/app.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/04_EAN/src/app.c b/04_EAN/src/app.c index 738761f..7be2fca 100644 --- a/04_EAN/src/app.c +++ b/04_EAN/src/app.c @@ -59,6 +59,47 @@ static bool equals(enc_t vc1, enc_t vc2, sig_t B1, sig_t B2, sig_t A) { #define SIG_s_YZ /* FIXME */ #define SIG_s_XZ /* FIXME */ +/** + * Pseudo-Code for the CoRed voter + * + * SIGNAL_DUE() signals a Deteceted Unrecoverable Error + * + * The function APPLY() is appended after CORED_VOTE + +Require: Bx , By , Bz #Constant signatures of Operands + +function CORED_ VOTE (xc , yc , zc ) + ZERO_LOCAL _ STORAGE() + if (xc − yc ) = (Bx − By ) then + if (xc − zc ) = (Bx − Bz ) then + winc <- APPLY(xc , (xc − yc ) + (xc − zc )) + return winc, BE <- (Bx − By ) + (Bx − Bz ) #statically computed + else + winc <- APPLY(xc , (xc − yc )) + return winc, BE <- (Bx − By ) #statically computed + end if + else if (yc − zc) = (By − Bz ) then + winc <- APPLY (yc, (yc − zc )) + return winc, BE <- (By -B z) #statically computed + else if (xc − zc) =(Bx − Bz) then + winc <- APPLY (xc , (xc − zc )) + return winc , BE <- (Bx − Bz ) #statically computed + else + winc <- ∅ #empty set + SIGNAL_DUE() + end if +end function + + +function APPLY (vc , Bdyn ) + if Bdyn > Bmax then + SIGNAL_DUE() + end if + return vc + Bdyn +end function + +**/ + static sig_t CoRedVote(void) { /* TODO: Implement CoRed Voter */ } -- GitLab