|
|
@ -51,7 +51,7 @@ MainWindow::MainWindow(QWidget *parent) |
|
|
|
ui->rbtn_reg->setChecked(_settings->value(REG_ACCESS_SEL).value<bool>()); |
|
|
|
ui->rbtn_offset->setChecked(!_settings->value(REG_ACCESS_SEL).value<bool>()); |
|
|
|
ui->tb_fpgaBit->setText(_settings->value(FPGA_FILE_PATH).value<QString>()); |
|
|
|
ui->tb_h5File->setText(_settings->value(SCENARIO_FILE_PATH).value<QString>()); |
|
|
|
ui->tb_scenFilesPath->setText(_settings->value(SCENARIO_FILE_PATH).value<QString>()); |
|
|
|
|
|
|
|
// connect(this, &MainWindow::updateBlockProgressValue, this, &MainWindow::newBlockProgressValue);
|
|
|
|
// connect(this, &MainWindow::updateFpgaProgressValue, this, &MainWindow::newFpgaProgressValue);
|
|
|
@ -76,6 +76,7 @@ MainWindow::MainWindow(QWidget *parent) |
|
|
|
ui->btn_updateRdbackValue->setText(UPDATE); |
|
|
|
ui->l_detectedProbe->setText("None"); |
|
|
|
ui->btn_dmaLogLast->setHidden(true); |
|
|
|
ui->btn_prbRomWrite->setDisabled(true); |
|
|
|
|
|
|
|
// uint32_t offsetdbgCmd[3] = {0x140000*4,0x240000*4,0x340000*4};
|
|
|
|
// auto value = 0;
|
|
|
@ -2556,7 +2557,6 @@ void MainWindow::datasetBranch(const string &branchPath, T datasetValue[MAX_ARRA |
|
|
|
/*************************************************************************************************/ |
|
|
|
void MainWindow::setScenario(const string &h5Path) |
|
|
|
{ |
|
|
|
|
|
|
|
const H5std_string filePath(h5Path); |
|
|
|
H5File file (filePath, H5F_ACC_RDONLY); |
|
|
|
_file = file; |
|
|
@ -2564,8 +2564,9 @@ void MainWindow::setScenario(const string &h5Path) |
|
|
|
try |
|
|
|
{ |
|
|
|
/****************** /sramParameters/frameType ******************/ |
|
|
|
datasetBranch <float_t>("/sramParameters/frameType", floatArray); |
|
|
|
scenParams.frameType = static_cast<quint8>(floatArray[0]); |
|
|
|
// datasetBranch <float_t>("/sramParameters/frameType", floatArray);
|
|
|
|
// scenParams.frameType = static_cast<quint8>(floatArray[0]);
|
|
|
|
scenParams.frameType = 0; |
|
|
|
|
|
|
|
/****************** /sramParameters/totalTxShotNo ******************/ |
|
|
|
datasetBranch <float_t>("/sramParameters/totalTxShotNo", floatArray); |
|
|
@ -2581,11 +2582,6 @@ void MainWindow::setScenario(const string &h5Path) |
|
|
|
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) |
|
|
|
scenParams.rxBeamFormerNumber.push_back(static_cast<quint8>(floatArray[var])); |
|
|
|
|
|
|
|
// for(auto j=0; j<scenParams.focusTypeNumber; j++)
|
|
|
|
// {
|
|
|
|
// qDebug() << scenParams.rxBeamFormerNumber[j];
|
|
|
|
// }
|
|
|
|
|
|
|
|
/**************** /sramParameters/pulseInterval ********************/ |
|
|
|
datasetBranch <float_t>("/sramParameters/pulseInterval", floatArray); |
|
|
|
scenParams.pulseInterval.clear(); |
|
|
@ -2595,43 +2591,43 @@ void MainWindow::setScenario(const string &h5Path) |
|
|
|
/**************** /sramParameters/indexParameters/shotPropertiesIndex ********************/ |
|
|
|
datasetBranch <float_t>("/sramParameters/indexParameters/shotPropertiesIndex", floatArray); |
|
|
|
scenParams.indexParams.shotPropertiesIndex.clear(); |
|
|
|
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) |
|
|
|
for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) |
|
|
|
scenParams.indexParams.shotPropertiesIndex.push_back(static_cast<quint32>(floatArray[var])); |
|
|
|
|
|
|
|
/**************** /sramParameters/indexParameters/pulsePropertiesIndex ********************/ |
|
|
|
datasetBranch <float_t>("/sramParameters/indexParameters/pulsePropertiesIndex", floatArray); |
|
|
|
scenParams.indexParams.pulsePropertiesIndex.clear(); |
|
|
|
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) |
|
|
|
for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) |
|
|
|
scenParams.indexParams.pulsePropertiesIndex.push_back(static_cast<quint32>(floatArray[var])); |
|
|
|
|
|
|
|
/**************** /sramParameters/indexParameters/receiverConfigurationIndex ********************/ |
|
|
|
datasetBranch <float_t>("/sramParameters/indexParameters/receiverConfigurationIndex", floatArray); |
|
|
|
scenParams.indexParams.receiverConfigurationIndex.clear(); |
|
|
|
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) |
|
|
|
for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) |
|
|
|
scenParams.indexParams.receiverConfigurationIndex.push_back(static_cast<quint32>(floatArray[var])); |
|
|
|
|
|
|
|
/**************** /sramParameters/indexParameters/firstLineInFrame ********************/ |
|
|
|
datasetBranch <float_t>("/sramParameters/indexParameters/firstLineInFrame", floatArray); |
|
|
|
scenParams.indexParams.firstLineInFrame.clear(); |
|
|
|
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) |
|
|
|
for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) |
|
|
|
scenParams.indexParams.firstLineInFrame.push_back(static_cast<bool>(floatArray[var])); |
|
|
|
|
|
|
|
/**************** /sramParameters/indexParameters/lastLineInFrame ********************/ |
|
|
|
datasetBranch <float_t>("/sramParameters/indexParameters/lastLineInFrame", floatArray); |
|
|
|
scenParams.indexParams.lastLineInFrame.clear(); |
|
|
|
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) |
|
|
|
for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) |
|
|
|
scenParams.indexParams.lastLineInFrame.push_back(static_cast<bool>(floatArray[var])); |
|
|
|
|
|
|
|
/**************** /sramParameters/indexParameters/dLineNum ********************/ |
|
|
|
datasetBranch <float_t>("/sramParameters/indexParameters/dLineNum", floatArray); |
|
|
|
scenParams.indexParams.dLineNum.clear(); |
|
|
|
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) |
|
|
|
for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) |
|
|
|
scenParams.indexParams.dLineNum.push_back(static_cast<quint32>(floatArray[var])); |
|
|
|
|
|
|
|
/**************** /sramParameters/indexParameters/dEnsembleNum ********************/ |
|
|
|
datasetBranch <float_t>("/sramParameters/indexParameters/dEnsembleNum", floatArray); |
|
|
|
scenParams.indexParams.dEnsembleNum.clear(); |
|
|
|
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++) |
|
|
|
for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) |
|
|
|
scenParams.indexParams.dEnsembleNum.push_back(static_cast<quint32>(floatArray[var])); |
|
|
|
|
|
|
|
/**************** /sramParameters/txParameters/txFocusXPos ********************/ |
|
|
@ -2846,6 +2842,11 @@ void MainWindow::setScenario(const string &h5Path) |
|
|
|
scenParams.hwRegister.apodizationLut.push_back(tempApodization); |
|
|
|
} |
|
|
|
|
|
|
|
// for(auto j=0; j<100; j++)
|
|
|
|
// {
|
|
|
|
// qDebug() << scenParams.hwRegister.apodizationLut[3][j];
|
|
|
|
// }
|
|
|
|
|
|
|
|
/**************** /registerParameters/aTgcLut ********************/ |
|
|
|
datasetBranch <float_t>("/registerParameters/aTgcLut", floatArray); |
|
|
|
scenParams.hwRegister.atgcLut.clear(); |
|
|
@ -2876,6 +2877,14 @@ void MainWindow::setScenario(const string &h5Path) |
|
|
|
scenParams.hwRegister.lpfLut.push_back(tempLpf); |
|
|
|
} |
|
|
|
|
|
|
|
/**************** /registerParameters/lineFilter ********************/ |
|
|
|
//datasetBranch <float_t>("/registerParameters/lpfLut", floatArray);
|
|
|
|
QVector<float> lineFilter; |
|
|
|
lineFilter.push_back(0x0); |
|
|
|
lineFilter.push_back(0x0); |
|
|
|
lineFilter.push_back(0x1); |
|
|
|
_trx.setLineFilterCoefficient(lineFilter); |
|
|
|
|
|
|
|
/**************** /registerParameters/pulseProperties/halfPeriod ********************/ |
|
|
|
datasetBranch <float_t>("/registerParameters/pulseProperties/halfPeriod", floatArray); |
|
|
|
QList<quint32> halfPeriod; |
|
|
@ -3088,31 +3097,31 @@ void MainWindow::setScenario(const string &h5Path) |
|
|
|
} |
|
|
|
|
|
|
|
/**************** /registerParameters/receiverConfigProperties/dpeEn ********************/ |
|
|
|
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/dpeEn", floatArray); |
|
|
|
QList<quint32> dpeEn; |
|
|
|
// datasetBranch <float_t>("/registerParameters/receiverConfigProperties/dpeEn", floatArray);
|
|
|
|
// QList<quint32> dpeEn;
|
|
|
|
|
|
|
|
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) |
|
|
|
{ |
|
|
|
dpeEn.push_back(static_cast<quint32>(floatArray[j])); |
|
|
|
} |
|
|
|
// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
|
|
|
|
// {
|
|
|
|
// dpeEn.push_back(static_cast<quint32>(floatArray[j]));
|
|
|
|
// }
|
|
|
|
|
|
|
|
/**************** /registerParameters/receiverConfigProperties/ddcEn ********************/ |
|
|
|
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/ddcEn", floatArray); |
|
|
|
QList<quint32> ddcEn; |
|
|
|
// datasetBranch <float_t>("/registerParameters/receiverConfigProperties/ddcEn", floatArray);
|
|
|
|
// QList<quint32> ddcEn;
|
|
|
|
|
|
|
|
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) |
|
|
|
{ |
|
|
|
ddcEn.push_back(static_cast<quint32>(floatArray[j])); |
|
|
|
} |
|
|
|
// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
|
|
|
|
// {
|
|
|
|
// ddcEn.push_back(static_cast<quint32>(floatArray[j]));
|
|
|
|
// }
|
|
|
|
|
|
|
|
/**************** /registerParameters/receiverConfigProperties/wmfEn ********************/ |
|
|
|
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/wmfEn", floatArray); |
|
|
|
QList<quint32> wmfEn; |
|
|
|
// datasetBranch <float_t>("/registerParameters/receiverConfigProperties/wmfEn", floatArray);
|
|
|
|
// QList<quint32> wmfEn;
|
|
|
|
|
|
|
|
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) |
|
|
|
{ |
|
|
|
wmfEn.push_back(static_cast<quint32>(floatArray[j])); |
|
|
|
} |
|
|
|
// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
|
|
|
|
// {
|
|
|
|
// wmfEn.push_back(static_cast<quint32>(floatArray[j]));
|
|
|
|
// }
|
|
|
|
|
|
|
|
/**************** /registerParameters/receiverConfigProperties ********************/ |
|
|
|
ReceiverConfig_t receiverCfgObj; |
|
|
@ -3122,11 +3131,14 @@ void MainWindow::setScenario(const string &h5Path) |
|
|
|
{ |
|
|
|
receiverCfgObj.mla = receiverCfgMla.at(j); |
|
|
|
receiverCfgObj.stb = stb.at(j); |
|
|
|
receiverCfgObj.ddcn = ddcEn.at(j); |
|
|
|
//receiverCfgObj.ddcn = ddcEn.at(j);
|
|
|
|
receiverCfgObj.ddcn = 1; |
|
|
|
receiverCfgObj.absEn = absEn.at(j); |
|
|
|
receiverCfgObj.dpeEn = dpeEn.at(j); |
|
|
|
//receiverCfgObj.dpeEn = dpeEn.at(j);
|
|
|
|
receiverCfgObj.dpeEn = 0; |
|
|
|
receiverCfgObj.stbEn = stbEn.at(j); |
|
|
|
receiverCfgObj.wmfEn = wmfEn.at(j); |
|
|
|
//receiverCfgObj.wmfEn = wmfEn.at(j);
|
|
|
|
receiverCfgObj.wmfEn = 0; |
|
|
|
receiverCfgObj.lpfSel = lpfSel.at(j); |
|
|
|
receiverCfgObj.aTgcSel = aTgcSel.at(j); |
|
|
|
receiverCfgObj.focusNo = focusNo.at(j); |
|
|
@ -3149,61 +3161,154 @@ void MainWindow::setScenario(const string &h5Path) |
|
|
|
qDebug() << e.what(); |
|
|
|
} |
|
|
|
|
|
|
|
ui->btn_scenStart->setText("Scenario Start"); |
|
|
|
ui->btn_emulator->setText("Emulator Start"); |
|
|
|
|
|
|
|
//QString saveFile = QFileDialog::getSaveFileName(this, "Save");
|
|
|
|
QString saveFile = "/home/hasis/Desktop/Develop_HardwareTest/saveSram.bin"; |
|
|
|
|
|
|
|
QFile sramFile(saveFile); |
|
|
|
|
|
|
|
if (!sramFile.open(QIODevice::WriteOnly)){ |
|
|
|
QMessageBox::warning(this, "Warning", "Cann't save the file: " + sramFile.errorString()); |
|
|
|
return; |
|
|
|
} |
|
|
|
ui->l_scenFillingDone->setText("done"); |
|
|
|
changeLabelTextColor(ui->l_scenFillingDone, Qt::green); |
|
|
|
} |
|
|
|
|
|
|
|
quint32 num(0); |
|
|
|
quint64 value(0); |
|
|
|
while (num < SRAM_SIZE/4) |
|
|
|
{ |
|
|
|
value = _usd->device->device.readLong(BAR_SRAM, static_cast<quint32>(num)); |
|
|
|
sramFile.write(Uint2ByteArray<quint64>(value)); |
|
|
|
num += sizeof (quint64); |
|
|
|
} |
|
|
|
/*************************************************************************************************/ |
|
|
|
void MainWindow::on_btn_setScenario_clicked() |
|
|
|
{ |
|
|
|
_timeout->stop(); |
|
|
|
ui->l_scenFillingDone->setText("doing"); |
|
|
|
changeLabelTextColor(ui->l_scenFillingDone, Qt::red); |
|
|
|
|
|
|
|
sramFile.flush(); |
|
|
|
sramFile.close(); |
|
|
|
QString sramScenario = "/scenGenOutput/scenario.h5"; |
|
|
|
QString h5Path = ui->tb_scenFilesPath->text() + sramScenario; |
|
|
|
|
|
|
|
ui->l_scenFillingDone->setText("done"); |
|
|
|
changeLabelTextColor(ui->l_scenFillingDone, Qt::green); |
|
|
|
auto scenFuture = QtConcurrent::run(this, &MainWindow::setScenario, h5Path.toStdString()); |
|
|
|
scenEndWather.setFuture(scenFuture); |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void MainWindow::on_btn_h5Browse_clicked() |
|
|
|
void MainWindow::on_btn_scenBrowse_clicked() |
|
|
|
{ |
|
|
|
QFileDialog fileDialog; |
|
|
|
fileDialog.setNameFilters({"Scenario file (*.h5)"}); |
|
|
|
fileDialog.setFileMode(QFileDialog::Directory); |
|
|
|
fileDialog.setOption(QFileDialog::ShowDirsOnly); |
|
|
|
auto result = fileDialog.exec(); |
|
|
|
|
|
|
|
if(result) |
|
|
|
{ |
|
|
|
auto selectedPath = fileDialog.selectedFiles()[0]; |
|
|
|
ui->tb_h5File->setText(selectedPath); |
|
|
|
ui->tb_scenFilesPath->setText(selectedPath); |
|
|
|
_settings->setValue(SCENARIO_FILE_PATH, selectedPath); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void MainWindow::on_btn_setScenario_clicked() |
|
|
|
void MainWindow::verifySramParams(QString& sramParamsPath) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void MainWindow::on_btn_sramParamsVerifying_clicked() |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void MainWindow::verifyRegisterParams(QString& regParamsPath) |
|
|
|
{ |
|
|
|
QString registerScenario = "/hardware/register.csv"; |
|
|
|
QString regReadParamsPath = regParamsPath + registerScenario; |
|
|
|
QFile csvReadFile(regReadParamsPath); |
|
|
|
if(!csvReadFile.open(QFile::ReadOnly)) |
|
|
|
{ |
|
|
|
MESSAGE_BOX("Could not open the register's scenario params."); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
QString registerCompareScenario = "/hardware/registerCompare.csv"; |
|
|
|
QString regCompareParamsPath = regParamsPath + registerCompareScenario; |
|
|
|
QFile csvWriteFile(regCompareParamsPath); |
|
|
|
csvWriteFile.open(QFile::WriteOnly); |
|
|
|
|
|
|
|
quint32 bar = 0; |
|
|
|
qint64 readSize = 0; |
|
|
|
QString line; |
|
|
|
|
|
|
|
auto size = csvReadFile.size(); |
|
|
|
while(readSize < size) |
|
|
|
{ |
|
|
|
line = csvReadFile.readLine(); |
|
|
|
auto sl = line.split(','); |
|
|
|
auto address = sl[0].toUInt(Q_NULLPTR, 16); |
|
|
|
auto baseValue = sl[1].toUInt(Q_NULLPTR, 16); |
|
|
|
auto boardValue = _usd->readWord(address, bar); |
|
|
|
|
|
|
|
auto res = "NOK"; |
|
|
|
if (boardValue == baseValue) |
|
|
|
{ |
|
|
|
res = "OK"; |
|
|
|
} |
|
|
|
|
|
|
|
auto str = QStringLiteral("%1,%2,%3,%4") |
|
|
|
.arg(address, 8, 16, QLatin1Char('0')) |
|
|
|
.arg(baseValue, 8, 16, QLatin1Char('0')) |
|
|
|
.arg(boardValue, 8, 16, QLatin1Char('0')).arg(res); |
|
|
|
|
|
|
|
|
|
|
|
csvWriteFile.write(str.toStdString().c_str(), str.length()); |
|
|
|
csvWriteFile.write("\r\n", 2); |
|
|
|
|
|
|
|
readSize += static_cast<qint64>(line.length()); |
|
|
|
//delay(1);
|
|
|
|
} |
|
|
|
|
|
|
|
csvReadFile.close(); |
|
|
|
|
|
|
|
csvWriteFile.flush(); |
|
|
|
csvWriteFile.close(); |
|
|
|
|
|
|
|
ui->l_verifyRegisterParams->setText("done"); |
|
|
|
changeLabelTextColor(ui->l_verifyRegisterParams, Qt::green); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void MainWindow::on_btn_registerParamsVerifying_clicked() |
|
|
|
{ |
|
|
|
_timeout->stop(); |
|
|
|
ui->l_scenFillingDone->setText("doing"); |
|
|
|
changeLabelTextColor(ui->l_scenFillingDone, Qt::red); |
|
|
|
ui->l_verifyRegisterParams->setText("doing"); |
|
|
|
changeLabelTextColor(ui->l_verifyRegisterParams, Qt::red); |
|
|
|
|
|
|
|
QString h5Path = ui->tb_h5File->text(); |
|
|
|
QString regParamsPath = ui->tb_scenFilesPath->text(); |
|
|
|
|
|
|
|
auto scenFuture = QtConcurrent::run(this, &MainWindow::setScenario, h5Path.toStdString()); |
|
|
|
auto scenFuture = QtConcurrent::run(this, &MainWindow::verifyRegisterParams, regParamsPath); |
|
|
|
scenEndWather.setFuture(scenFuture); |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void MainWindow::on_btn_sramParamsGenerating_clicked() |
|
|
|
{ |
|
|
|
//QString saveFile = QFileDialog::getSaveFileName(this, "Save");
|
|
|
|
QString saveFile = "/home/hasis/Desktop/Develop_HardwareTest/saveSram.bin"; |
|
|
|
|
|
|
|
QFile sramFile(saveFile); |
|
|
|
|
|
|
|
if (!sramFile.open(QIODevice::WriteOnly)){ |
|
|
|
QMessageBox::warning(this, "Warning", "Cann't save the file: " + sramFile.errorString()); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
quint32 num(0); |
|
|
|
quint64 value(0); |
|
|
|
while (num < SRAM_SIZE/4) |
|
|
|
{ |
|
|
|
value = _usd->device->device.readLong(BAR_SRAM, static_cast<quint32>(num)); |
|
|
|
sramFile.write(Uint2ByteArray<quint64>(value)); |
|
|
|
num += sizeof (quint64); |
|
|
|
} |
|
|
|
|
|
|
|
sramFile.flush(); |
|
|
|
sramFile.close(); |
|
|
|
} |
|
|
|
|
|
|
|
/*************************************************************************************************/ |
|
|
|
void MainWindow::on_btn_setAtgcMode_clicked() |
|
|
|
{ |
|
|
|