Latency meter

Latency meter is used to measure the duration of a specific event.

Key features

  • Measures the number of ticks between the start and the end of a given event

  • Multiple parallel events can be measured

  • Zero latency events can be measured (start and end occurs at the same time)

Component port and generics description

ENTITY LATENCY_METER IS
Generics

Generic

Type

Default

Description

DATA_WIDTH

integer

UNDEFINED

Tick counter width (defines max. latency)

MAX_PARALEL_EVENTS

integer

1

Defines max. number of parallel events that can be measured

DEVICE

string

“ULTRASCALE”

Ports

Port

Type

Mode

Description

CLK

std_logic

in

RST

std_logic

in

START_EVENT

std_logic

in

END_EVENT

std_logic

in

LATENCY_VLD

std_logic

out

LATENCY

std_logic_vector(DATA_WIDTH - 1 downto 0)

out

FIFO_FULL

std_logic

out

Signals that no more paralel events can be curently measured

FIFO_ITEMS

std_logic_vector(max(log2(MAX_PARALEL_EVENTS), 1) downto 0)

out

Number of paralel latencies in FIFO

Instance template

latency_meter_i : entity work.LATENCY_METER
generic map (
    DATA_WIDTH              => DATA_WIDTH,
    MAX_PARALEL_EVENTS      => MAX_PARALEL_EVENTS,
    DEVICE                  => DEVICE
)
port map (
    CLK                     => CLK,
    RST                     => RST,
    START_EVENT             => start_event,
    END_EVENT               => end_event,
    LATENCY_VLD             => latency_vld,
    LATENCY                 => latency
);