工具与软件:
您好!
我修改了mcu_plus_sdk_j722s_10_00_00_25/examples/drivers/ipc/ipc_rpmsg_echo_linux c75ss0-0_freertos/ti-c7000目标示例、使其链接到 TISP 库中、并 tisp/test/misc/TISP_blockCopy_superNode/TISP_blockCopy_superNode_test.cpp test. 可以使用 Linux remoteproc 框架加载另一个具有所生成二进制文件的精简版源文件、如果将 TISP::execute::graph(mySuperNodeVec);调用注释掉、则运行正常、否则 DSP 最终将永远循环进入 mcu_plus_sdk_j722s_10_00_00_25/source/drivers/dmautils/src/dmautils_autoincrement_3d.c::DmaUtilsAutoInc3d_wait().
的符号mcu_plus_sdk_j722s_10_00_00_25/source/drivers/dmautils/src/dmautils_autoincrement_3d.c::DmaUtilsAutoInc3d_wait():
waitWord = dmautilsContext -> channelContext[channelId] -> waitWord;
eflRegisterVal = __get_indexed(__EFR, 0);
while ((eflRegisterVal & waitWord) != waitWord) {
eflRegisterVal = __get_indexed(__EFR, 0);
}
waitWord is 0x1 and eflRegisterVal 始终读为0。 在此之前、DMA 传输设置功能不会报告任何错误。
Any suggestion as to what might be causing this? Any help would be very apreciated, thank you.
#ifdef __cplusplus
extern "C" {
#endif
#include <kernel/dpl/DebugP.h>
#ifdef __cplusplus
}
#endif
#include "TISP_superNode.hpp"
//#include "TISP_test.h"
#include "TISP_types.hpp"
#include "TISP_util.hpp"
#include <fftlib.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <tisp.hpp>
#include <drivers/hw_include/csl_clec.h>
#define WIDTH (16)
#define HEIGHT (16)
#define BLOCK_WIDTH (8)
#define BLOCK_HEIGHT (2)
#define TOTAL_DMA_CHANNELS (2)
#define NUM_REPS (1024)
#define DDR_SIZE (4 * 1024 * 1024) // 4 MB
Udma_DrvHandle TISP::SuperNode::appDrvHandle;
static __attribute__((aligned(128))) uint8_t ddrBuffer[DDR_SIZE];
#define RESTRICT restrict
void TISP_blockCopy_test_cn(float *RESTRICT pX,
float *RESTRICT pY,
size_t width,
size_t height,
size_t inPitch,
size_t outPitch)
{
for (int32_t i = 0; i < height; i++) {
for (int32_t j = 0; j < width; j++) {
pY[i * outPitch + j] = pX[i * inPitch + j];
}
}
}
#ifdef __cplusplus
extern "C" {
#endif
int32_t tisp_test_main()
{
DebugP_log((char *)"Init local vars\n");
struct Udma_DrvObj appUdmaDrvObj;
TISP::SuperNode::appDrvHandle = TISP::SuperNode::superNode::setUdmaDrvHandle(appUdmaDrvObj);
/* DebugP_log((char *)"\nTISP demo with FFTLIB_1dBatched\n"); */
uint32_t blockWidth = BLOCK_WIDTH;
uint32_t blockHeight = BLOCK_HEIGHT;
/* size_t dataMemSize = width * height * sizeof(float); */
uint32_t blockSize = blockHeight * blockWidth * sizeof(float);
float *pInputBlock = (float *) memalign(128, blockSize * 2);
float *pOutputBlock = (float *) memalign(128, blockSize * 2);
DebugP_log((char *)"Init mem to copy\n");
uint32_t width = WIDTH;
uint32_t height = HEIGHT;
float *input = (float *) ddrBuffer;
float *inputCn = input + width * height;
for (uint32_t i = 0; i < width * height; i++) {
/* input[i] = (float)rand() / (float)(RAND_MAX / (2 * 8)) - 8; */
input[i] = i;
inputCn[i] = input[i];
}
DebugP_log((char *)"\n--------------------------------------------------");
DebugP_log((char *)"\n Memcopy Demo using TISP ");
DebugP_log((char *)"\n--------------------------------------------------\n");
float *output = inputCn + width * height;
// float *refOut = output + width * height;
DebugP_log((char *)"\nCreating Graph:\n");
DebugP_log((char *)"\nDDR-->L2-->blockCopy-->L2-->DDR\n");
auto k0 = new TISP::misc::blockCopy<float, TISP::DMA_IN_OUT>(pInputBlock, pOutputBlock, blockWidth, blockHeight);
TISP::opVec myOpVec;
myOpVec.push_back(k0);
auto s0 = new TISP::SuperNode::i2d_to_o2d<float, float>(myOpVec, input, output, pInputBlock, pOutputBlock, width,
height, blockWidth, blockHeight, width * sizeof(float),
width * sizeof(float), (TOTAL_DMA_CHANNELS));
uint64_t startTime, endTime;
startTime = (__get_GTSC(1), __STSC);
TISP::SuperNode::superNodeVec mySuperNodeVec;
mySuperNodeVec.push_back(s0);
DebugP_log((char *)"\nExecuting graph\n");
/* s0->exec(); */
// TISP::execute::graph(mySuperNodeVec); // Uncommenting this line reesults in an infinite loop
endTime = (__get_GTSC(1), __STSC);
uint64_t totalTime = (endTime - startTime);
DebugP_log((char *)"Cycles - Using Opvec = %llu\n", totalTime);
DebugP_log((char *)"Bandwidth: %.2f GB/sec\n", ((float) WIDTH * HEIGHT * sizeof(float)) / (totalTime));
DebugP_log((char *)"\nFreeing resources...\n");
free(pInputBlock);
free(pOutputBlock);
delete (k0);
/* delete (k1); */
delete (s0);
DebugP_log((char *)"\nDemo complete!");
return 1;
}
#ifdef __cplusplus
}
#endif