// ************************************************************************** //
//                                                                            //
//    eses                   eses                                             //
//   eses                     eses                                            //
//  eses    eseses  esesese    eses   Embedded Systems Group                  //
//  ese    ese  ese ese         ese                                           //
//  ese    eseseses eseseses    ese   Department of Computer Science          //
//  eses   eses          ese   eses                                           //
//   eses   eseses  eseseses  eses    University of Kaiserslautern            //
//    eses                   eses                                             //
//                                                                            //
// ************************************************************************** //

package ComputerArchitecture.AsynchronousCircuits.AsyncArbiter;

// -------------------------------------------------------
// The arbiter assumes that the user behaves according to
// some protocol. In particular, the user must lower the
// request when an acknowledge is given. If no acknowledge
// is given at the moment, a request must be persistently
// held until the acknowledge eventually is given. This
// is according to the following client module.
// -------------------------------------------------------

module Client(bool ?ack,!req) {
    req = false;
    loop {
        choose {
            next(req) = true;
            await(ack);
            next(req) = false;
        } else nothing;
        nothing;
        pause;
    }
}