Verification #54 · 2026-11-16 · UVM monitor from pins · Medium · about 35 min
Build the monitor and scoreboard for a serial transmitter
uart_tx.sv is a serial transmitter. When it is free (busy = 0) and start = 1 at a clock edge, it takes data and sends one frame on txd. The line idles at 1. Every bit lasts exactly 4 clocks, and a frame is 10 bits, 40 clocks in all, with no gap inside it:
- the start bit,
0 data[0]first up todata[7]last- the stop bit,
1
The first clock where txd = 0 is the start of a frame. A new frame may begin on the clock right after the stop bit, or later. busy is 1 while a frame is going out.
Write the verification components in components.sv. The driver, a request monitor and the environment in env.sv are provided. The request monitor reports every byte the transmitter accepts as a uart_item. Your classes are connected by name.
uart_monitor: watches onlytxd(notbusy), on every rising edge oncerst_nis 1, and rebuilds each frame. When it sees a start bit it takes the 40 samples of the frame. Every bit must be stable for all 4 of its clocks, and the stop bit must be 1. A good frame becomes auart_itemwithdatafilled in, sent out ofap, and counted inframes. A frame that breaks a rule is counted inbad_frames(report the first few withuvm_error) and sends nothing. Either way the monitor then looks for the next start bit after those 40 samples.uart_scoreboard: gets the bytes asked for inwrite_expand the bytes decoded inwrite_act. Frames come out in the order the bytes went in. For each decoded frame, count it inchecked, and count a mismatch (or a frame with nothing pending) inerrors, reporting the first few withuvm_error.
Run uses tb.sv: 20 random bytes into a correct transmitter. Submit runs your components against the correct transmitter, which they must treat as clean, and against five faulty ones. For each fault, your monitor or scoreboard must report at least one problem.
Write and run your answer in the browser. The hidden tests check it, and it’s free.