CIRCT 24.0.0git
Loading...
Searching...
No Matches
tests.integration.test_backpressure Namespace Reference

Classes

class  TestBackpressure

Functions

int _fill (try_write, int start)
 _wait_stable (read_value, float settle=1.0, float timeout=60.0)

Variables

int DEFAULT_TO_SERVER_MAX_IN_FLIGHT = 16
int HW_SLACK = 8

Detailed Description

Cosim integration tests for channel backpressure (cosim protocol v4 flow
control), using the DUTs in `hw/backpressure.py`.

  * Host -> simulation: with the loopback's gate closed the hardware never
    consumes `in`, so `try_write` must start failing after roughly the
    default in-flight limit (16) plus the endpoint's internal buffering, and
    recover once the gate opens.

  * Simulation -> host: with `stream` connected with a small buffer and not
    read, the producer must stall (its `Cosim_Endpoint_ToHost` deasserts
    ready) instead of pushing everything into host memory.

Function Documentation

◆ _fill()

int tests.integration.test_backpressure._fill ( try_write,
int start )
protected
Call `try_write(value)` with increasing values from `start` until it keeps
failing for a while, so credits for anything the hardware takes in the
meantime are observed. Returns the next unwritten value.

Definition at line 34 of file test_backpressure.py.

Referenced by tests.integration.test_backpressure.TestBackpressure.test_host_to_sim().

◆ _wait_stable()

tests.integration.test_backpressure._wait_stable ( read_value,
float settle = 1.0,
float timeout = 60.0 )
protected
Poll `read_value()` until it stops changing for `settle` seconds.

Definition at line 50 of file test_backpressure.py.

Referenced by tests.integration.test_backpressure.TestBackpressure.test_sim_to_host().

Variable Documentation

◆ DEFAULT_TO_SERVER_MAX_IN_FLIGHT

int tests.integration.test_backpressure.DEFAULT_TO_SERVER_MAX_IN_FLIGHT = 16

Definition at line 28 of file test_backpressure.py.

◆ HW_SLACK

int tests.integration.test_backpressure.HW_SLACK = 8

Definition at line 31 of file test_backpressure.py.