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

Classes

class  _Dut
class  TestHostMemReadOneOutstanding
class  TestHostMemReadFourOutstanding
class  TestHostMemRead8
class  TestHostMemRead512
class  TestHostMemRead2048
class  TestHostMemRead4096

Functions

 read_frame_log (monkeypatch)
bytes _pattern (int num_bytes)
int _as_int (v)
int _wait_for_accepted (_Dut dut, int target, float timeout_s=30)
 _check_frames (expected_reads, bus_width)
None _run (AcceleratorConnection conn, int max_outstanding, int bus_width=64)

Variables

list ELEMENT_WIDTHS = [24, 32, 96]
list GATED_READS
list STREAMED_READS = [(i * 7 % 50, 1 + i % 3) for i in range(24)]
int BUFFER_ELEMENTS = 4096

Detailed Description

Cosim tests for configurable widths and multiple outstanding HostMem reads.

`hw/hostmem_read.py` builds one host-driven `read_list` client per element
width under `CosimBSP(max_outstanding_reads=N)`. Each test closes the client's
response gate, queues several reads of varied lengths, checks that exactly
min(#reads, N) are accepted while nothing drains (so that many logical requests
are genuinely in flight inside `HostMemReadReqSplitter`), then opens the gate
and checks every returned element, the per-request element counts and that
`last` lands exactly on each request's final element.

Function Documentation

◆ _as_int()

int tests.integration.test_hostmem_read._as_int ( v)
protected

◆ _check_frames()

tests.integration.test_hostmem_read._check_frames ( expected_reads,
bus_width )
protected
Check actual transport requests and responses, including zero padding.

Definition at line 129 of file test_hostmem_read.py.

Referenced by _run().

◆ _pattern()

bytes tests.integration.test_hostmem_read._pattern ( int num_bytes)
protected

Definition at line 60 of file test_hostmem_read.py.

Referenced by _run().

◆ _run()

◆ _wait_for_accepted()

int tests.integration.test_hostmem_read._wait_for_accepted ( _Dut dut,
int target,
float timeout_s = 30 )
protected

Definition at line 120 of file test_hostmem_read.py.

Referenced by _run().

◆ read_frame_log()

tests.integration.test_hostmem_read.read_frame_log ( monkeypatch)

Definition at line 56 of file test_hostmem_read.py.

Variable Documentation

◆ BUFFER_ELEMENTS

int tests.integration.test_hostmem_read.BUFFER_ELEMENTS = 4096

Definition at line 52 of file test_hostmem_read.py.

◆ ELEMENT_WIDTHS

list tests.integration.test_hostmem_read.ELEMENT_WIDTHS = [24, 32, 96]

Definition at line 30 of file test_hostmem_read.py.

◆ GATED_READS

list tests.integration.test_hostmem_read.GATED_READS
Initial value:
1= [
2 (0, 120),
3 (5, 1),
4 (17, 3),
5 (40, 7),
6 (3, 90),
7 (300, 2),
8 (11, 33),
9 (64, 5),
10]

Definition at line 37 of file test_hostmem_read.py.

◆ STREAMED_READS

list tests.integration.test_hostmem_read.STREAMED_READS = [(i * 7 % 50, 1 + i % 3) for i in range(24)]

Definition at line 49 of file test_hostmem_read.py.