# TLM FIFO Classes

This section defines TLM-based FIFO classes.

Contents

TLM FIFO Classes | This section defines TLM-based FIFO classes.
uvm_tlm_fifo#(T) | This class provides storage of transactions between two independently running processes.
uvm_tlm_analysis_fifo#(T) | An analysis_fifo is a uvm_tlm_fifo#(T) with an unbounded size and a write interface.

## uvm_tlm_fifo#(T)

This class provides storage of transactions between two independently running processes. Transactions are put into the FIFO via the put_export. transactions are fetched from the FIFO in the order they arrived via the get_peek_export. The put_export and get_peek_export are inherited from the uvm_tlm_fifo_base #(T) super class, and the interface methods provided by these exports are defined by the uvm_tlm_if_base #(T1,T2) class.

Summary

uvm_tlm_fifo#(T)
This class provides storage of transactions between two independently running processes.
Methods |
new | The name and parent are the normal uvm_component constructor arguments.
size | Returns the capacity of the FIFO-- that is, the number of entries the FIFO is capable of holding.
used | Returns the number of entries put into the FIFO.
is_empty | Returns 1 when there are no entries in the FIFO, 0 otherwise.
is_full | Returns 1 when the number of entries in the FIFO is equal to its size, 0 otherwise.
flush | Removes all entries from the FIFO, after which used returns 0 and is_empty returns 1.

### Methods

### new

> function new(
> | string | name, |  |
> | uvm_component | parent | = | null,
> | int | size | = | 1
> )

The name and parent are the normal uvm_component constructor arguments. The parent should be null if the uvm_tlm_fifo#(T) is going to be used in a statically elaborated construct (e.g., a module). The size indicates the maximum size of the FIFO; a value of zero indicates no upper bound.

### size

> virtual function int size()

Returns the capacity of the FIFO-- that is, the number of entries the FIFO is capable of holding. A return value of 0 indicates the FIFO capacity has no limit.

### used

> virtual function int used()

Returns the number of entries put into the FIFO.

### is_empty

> virtual function bit is_empty()

Returns 1 when there are no entries in the FIFO, 0 otherwise.

### is_full

> virtual function bit is_full()

Returns 1 when the number of entries in the FIFO is equal to its size, 0 otherwise.

### flush

> virtual function void flush()

Removes all entries from the FIFO, after which used returns 0 and is_empty returns 1.

## uvm_tlm_analysis_fifo#(T)

An analysis_fifo is a uvm_tlm_fifo#(T) with an unbounded size and a write interface. It can be used any place a uvm_analysis_imp is used. Typical usage is as a buffer between a uvm_analysis_port in an initiator component and TLM1 target component.

Summary

uvm_tlm_analysis_fifo#(T)
An analysis_fifo is a uvm_tlm_fifo#(T) with an unbounded size and a write interface.
Ports |
analysis_export #(T) | The analysis_export provides the write method to all connected analysis ports and parent exports:
Methods |
new | This is the standard uvm_component constructor.

### Ports

### analysis_export #(T)

The analysis_export provides the write method to all connected analysis ports and parent exports:

>     function void write (T t)

Access via ports bound to this export is the normal mechanism for writing to an analysis FIFO. See write method of uvm_tlm_if_base #(T1,T2) for more information.

### Methods

### new

> function new(
> | string | name | , |  |
> |  | uvm_component | parent | = | null
> )

This is the standard uvm_component constructor. name is the local name of this component. The parent should be left unspecified when this component is instantiated in statically elaborated constructs and must be specified when this component is a child of another UVM component.

This class provides storage of transactions between two independently running processes.

> function new(
> | string | name, |  |
> | uvm_component | parent | = | null,
> | int | size | = | 1
> )

The name and parent are the normal uvm_component constructor arguments.

> virtual function int size()

Returns the capacity of the FIFO-- that is, the number of entries the FIFO is capable of holding.

> virtual function int used()

Returns the number of entries put into the FIFO.

> virtual function bit is_empty()

Returns 1 when there are no entries in the FIFO, 0 otherwise.

> virtual function bit is_full()

Returns 1 when the number of entries in the FIFO is equal to its size, 0 otherwise.

> virtual function void flush()

Removes all entries from the FIFO, after which used returns 0 and is_empty returns 1.

> virtual class uvm_tlm_fifo_base #(
> | type | T | = | int
> ) extends uvm_component

This class is the base for uvm_tlm_fifo#(T).

> virtual class uvm_tlm_if_base #(
> | type | T1 | = | int,
> | type | T2 | = | int
> )

This class declares all of the methods of the TLM API.

> function new(
> | string | name | , |  |
> |  | uvm_component | parent | = | null
> )

This is the standard uvm_component constructor.

> class uvm_analysis_imp #(
> | type | T | = | int,
> | type | IMP | = | int
> ) extends uvm_port_base #(uvm_tlm_if_base #(T,T))

Receives all transactions broadcasted by a uvm_analysis_port.

> class uvm_analysis_port # (
> | type | T | = | int
> ) extends uvm_port_base # (uvm_tlm_if_base #(T,T))

Broadcasts a value to all subscribers implementing a uvm_analysis_imp.