DescriptionQ026
Q026DVASIC interview problem
Four-Phase Request/Acknowledge Monitor
TechniquesDVHandshakeProtocol monitorData stabilityTimeout
DifficultyMedium
TopicProtocol Checking
LanguageSystemVerilog
Requirements4 checkpoints
01
Problem
Check a four-phase handshake whose legal sequence is request rise, acknowledge rise, request fall, acknowledge fall. Data is launched with request and held until acceptance.
Class declarationSystemVerilog
class ReqAckMonitor #(int DATA_W = 32);
void sample(bit req, bit ack, bit [DATA_W-1:0] data);
int completed_count();
int error_count();
endclassExample input and output
Use this case to check your interpretationInput
cycles: (req,ack) = (0,0), (1,0), (1,1), (0,1), (0,0)Output
one legal four-phase handshake; no errorExplanation
The request rises before acknowledge, then request falls before acknowledge returns low.
02
Requirements (4)
- Reject acknowledge before request and request withdrawal before acknowledge.
- Require data stability from request assertion through acknowledge assertion.
- Do not allow a new request until both signals have returned low.
- Detect a timeout in each non-idle phase without repeatedly counting the same violation.
