HOME       UP       PREV       NEXT (Transactor Configurations)  

Example H/W Protocol: 4/P Handshake

A common asynchronous protocol is the simple, four-phase handshake. Data is transferred once per complete handshake operation, which involves four phases.

Simple transactor code to convert the pin-level implementation so that software can call it can be implemented as follows:

  putbyte(char d)
    data = d;
    req = 1;
    req = 0;

  char getbyte()   
    wait_until(req);        // NB: wait_until not in SystemC 2.0
    char r = data;          // See full code on web site, practical section.
    ack = 1;
    ack = 0;
    return r;

Other forms of transactor keep their own thread and make up-calls to user callbacks for each transaction.

10: (C) 2008-11, DJ Greaves, University of Cambridge, Computer Laboratory.