Uvm - Assignment - 3 - Rahul SS

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Training

UVM ASSIGNMENT-3
Question
1) a) Create a producer, consumer and transfer the transaction from producer to
consumer.
i) Write tx class for sequence_item
- declare a property „data‟ as rand int
- register object and fields to factory
- write constraint if needed
- write new constructor ii) Write producer class extends from
uvm_component
- register producer to factory
- declare uvm_blocking_put_port
- write new constructor: inside create object for port using new()
- In build phase, create object for tx handle
- write a task send()
- 5 times randomize tx and put in tlm port
- using `uvm_info print value to be transmitted iii) Write consumer class
extends from uvm_component
- register consumer to factory
- declare uvm_blocking_put_imp
- write new constructor: inside create object for export using new()
- Implement put function: print the tx value using reporting macro iv)
Write test extends from uvm_test
- register test to factory
- instantiate producer and consumer
- write new constructor
- In build_phase create object for producer and consumer handle
- In connect_phase make the connection between port and export
- In run_phase call the send task which is present in the producer
v) Write top module
- import uvm_pkg::*;
- include “uvm_macros.svh”
- with in initial block initiate test by run_test(“test”);
- arrange the files in a proper hierarchy for compilation (before module top)
https://www.edaplayground.com/x/T7Ck

Note: If you are using EDA playground: Select UVM 1.2; Tool: Synopsys VCS

You might also like