Class to test memory devices by writing/reading random data blocks. More...

#include <MemCheckState.h>

Collaboration diagram for HSPI::Test::MemCheckState:

Public Member Functions

 MemCheckState (MemoryDevice &device)
 
virtual ~MemCheckState ()
 
void execute ()
 

Public Attributes

InterruptDelegate onComplete
 

Protected Member Functions

virtual void fillBlock (uint32_t addr, uint32_t *buffer, size_t size)
 Fill buffer with test data. More...
 

Detailed Description

Class to test memory devices by writing/reading random data blocks.

B: Build outgoing block C: Check received block W: Start write of outgoing block R: Start read of incoming block

CPU B, B C, B C, B | ^ ^ | | | SPI -> W-> R-> W-> R-> W...

Interrupt version, 433ms Additional time due to setup code. A 512 byte buffer creates 772 requests, for each of write/read, a total of 1544 requests. So the additional (433 - 383) = 50ms is from 32us per request. 1024 byte: 443ms 256 byte: 423ms 128 byte: 404ms 64 bytes: ms FAIL

With task queue and packet chaining:

1024 byte: 387ms 512 byte: 391ms 256 byte: 400ms 128 byte: 418ms 64 byte: 452ms

So how come it's faster? Who cares - awesome, way to go :-)

Constructor & Destructor Documentation

◆ MemCheckState()

HSPI::Test::MemCheckState::MemCheckState ( MemoryDevice device)
inline

◆ ~MemCheckState()

virtual HSPI::Test::MemCheckState::~MemCheckState ( )
inlinevirtual

Member Function Documentation

◆ execute()

void HSPI::Test::MemCheckState::execute ( )
inline

◆ fillBlock()

virtual void HSPI::Test::MemCheckState::fillBlock ( uint32_t  addr,
uint32_t *  buffer,
size_t  size 
)
inlineprotectedvirtual

Fill buffer with test data.

Parameters
addrStarting address where data will be written
bufferBuffer to store data
sizeSize of buffer in 32-bit words (i.e. byte count = size * 4)

Method is virtual so display devices can be tested which may have quirks in their memory layout.

Member Data Documentation

◆ onComplete

InterruptDelegate HSPI::Test::MemCheckState::onComplete

The documentation for this class was generated from the following file: