57 ret |= ((ap_uint<8>) sts.
okay) << 7;
67 ap_uint<2> DIAG_CTRL_IN,
68 ap_uint<2> *DIAG_STAT_OUT,
71 ap_uint<16> *debug_out,
77 stream<DmCmd> &soMemRdCmdP0,
78 stream<DmSts> &siMemRdStsP0,
81 stream<DmCmd> &soMemWrCmdP0,
82 stream<DmSts> &siMemWrStsP0,
88 #pragma HLS INTERFACE ap_vld register port=sys_reset name=piSysReset
89 #pragma HLS INTERFACE ap_vld register port=DIAG_CTRL_IN name=piMMIO_diag_ctrl
90 #pragma HLS INTERFACE ap_ovld register port=DIAG_STAT_OUT name=poMMIO_diag_stat
91 #pragma HLS INTERFACE ap_ovld register port=debug_out name=poDebug
94 #pragma HLS INTERFACE axis register both port=soMemRdCmdP0
95 #pragma HLS INTERFACE axis register both port=siMemRdStsP0
96 #pragma HLS INTERFACE axis register both port=siMemReadP0
98 #pragma HLS DATA_PACK variable=soMemRdCmdP0 instance=soMemRdCmdP0
99 #pragma HLS DATA_PACK variable=siMemRdStsP0 instance=siMemRdStsP0
102 #pragma HLS INTERFACE axis register both port=soMemWrCmdP0
103 #pragma HLS INTERFACE axis register both port=siMemWrStsP0
104 #pragma HLS INTERFACE axis register both port=soMemWriteP0
106 #pragma HLS DATA_PACK variable=soMemWrCmdP0 instance=soMemWrCmdP0
107 #pragma HLS DATA_PACK variable=siMemWrStsP0 instance=siMemWrStsP0
141 switch(DIAG_CTRL_IN) {
144 *DIAG_STAT_OUT = (0 << 1) |
wasError;
157 *DIAG_STAT_OUT = 0b10;
182 *DIAG_STAT_OUT = (1 << 1) |
wasError;
185 *DIAG_STAT_OUT = (0 << 1) |
wasError;
196 *DIAG_STAT_OUT = (1 << 1) |
wasError;
209 *DIAG_STAT_OUT = (0 << 1) |
wasError;
222 if (!soMemWrCmdP0.full()) {
231 if (!soMemWriteP0.full()) {
235 ap_uint<8> keepVal = 0xFF;
236 memP0.
tkeep = (ap_uint<64>) (keepVal, keepVal, keepVal, keepVal, keepVal, keepVal, keepVal, keepVal);
247 soMemWriteP0.write(memP0);
253 if (!siMemWrStsP0.empty()) {
255 siMemWrStsP0.read(memWrStsP0);
280 if (!soMemRdCmdP0.full()) {
288 if (!siMemReadP0.empty()) {
290 siMemReadP0.read(memP0);
294 printf(
"error in pattern reading!\n");
302 if (memP0.
tlast == 1)
311 if (!siMemRdStsP0.empty()) {
313 siMemRdStsP0.read(memRdStsP0);
337 if (!soMemWrCmdP0.full()) {
347 if (!soMemWriteP0.full()) {
354 memP0.
tdata = (currentAntiPattern,currentAntiPattern,currentAntiPattern,currentAntiPattern,currentAntiPattern,currentAntiPattern,currentAntiPattern,currentAntiPattern);
355 ap_uint<8> keepVal = 0xFF;
356 memP0.
tkeep = (ap_uint<64>) (keepVal, keepVal, keepVal, keepVal, keepVal, keepVal, keepVal, keepVal);
367 soMemWriteP0.write(memP0);
373 if (!siMemWrStsP0.empty()) {
375 siMemWrStsP0.read(memWrStsP0);
390 if (!soMemRdCmdP0.full()) {
399 if (!siMemReadP0.empty()) {
401 siMemReadP0.read(memP0);
405 if (memP0.
tdata != ((ap_uint<512>) (currentAntiPattern,currentAntiPattern,currentAntiPattern,currentAntiPattern,currentAntiPattern,currentAntiPattern,currentAntiPattern,currentAntiPattern)) )
407 printf(
"error in antipattern reading!\n");
415 if (memP0.
tlast == 1)
424 if (!siMemRdStsP0.empty()) {
426 siMemRdStsP0.read(memRdStsP0);
ap_uint< 8 > STS_to_Vector(DmSts sts)
ap_uint< 33 > lastCheckedAddress
void mem_test_flash_main(ap_uint< 1 > sys_reset, ap_uint< 2 > DIAG_CTRL_IN, ap_uint< 2 > *DIAG_STAT_OUT, ap_uint< 16 > *debug_out, stream< DmCmd > &soMemRdCmdP0, stream< DmSts > &siMemRdStsP0, stream< Axis< 512 > > &siMemReadP0, stream< DmCmd > &soMemWrCmdP0, stream< DmSts > &siMemWrStsP0, stream< Axis< 512 > > &soMemWriteP0)
ap_uint< 32 > patternWriteNum
ap_uint< 64 > currentMemPattern
ap_uint< 33 > currentPatternAdderss
#define CHECK_CHUNK_SIZE
This define configures tha AXI burst size of DDRM memory-mapped interfaces AXI4 allows 4KiB,...
#define TRANSFERS_PER_CHUNK
#define CYCLES_UNTIL_TIMEOUT