Thursday, March 17, 2016

Random Verification Entries



General Verification Topics
1. Difference between byte and bit
2. mailbox & queue
3. $cast, $root
4. bidirectional constraints
5. solve before
6. UVM phases, phases in uvm-run_phase.
7. p_sequencer & v_sequencer
8. DPI's

Good Verification Questions
1. What is the communication channel from testcase to driver.
2. What are the communication channels between classes. how are these achieved.
3. Type pf port declaration in monitor.
4. Abstract class in SV.
5. Virtual and pure virtual
6. dynamic array: declaration, creation, assignment and deletion.
7. Static variable in class.

Illustrations
1. simple pkt class:
   8bit data field. 5 bit length field, 4 bytes fcs.
  
    soln:
    - declare addr, length & data as rand vars.
    - data as a dynamic array.
    - constraint for size of dynamic array = length; use solve before for length randomizing before data.
2. monitor1 -> puts (pkt) -> monitor2 -> puts (pkt) -> monitor3
    -If monitor2 processes the pkt, same changes are reflected in monitor3. So how to avoid it?
    Copy the pkt object in monitor2.
   
    In general whenever you get a pkt from some one else do a copy, also when you give a pkt to someone else, also do a copy.
3. Use of Public, local and prot variables in class.
    pkt_cnt within  a monitor can be a local variable. A task can be used to read this variable externally. This variable cannot be modified.
4. inp: req; op: ack
    ack has to go high within 64clocks of req going high.
    ack has to go low within 64clocks of req going low.
    What would be the basic checks
   - The first two givens should be obvious checks
   - The toggling of ack even though req is not present is an important error condition check.