CN110990279A - Method for jointly verifying DSP codes - Google Patents

Method for jointly verifying DSP codes Download PDF

Info

Publication number
CN110990279A
CN110990279A CN201911212622.XA CN201911212622A CN110990279A CN 110990279 A CN110990279 A CN 110990279A CN 201911212622 A CN201911212622 A CN 201911212622A CN 110990279 A CN110990279 A CN 110990279A
Authority
CN
China
Prior art keywords
dsp
matlab
ceva
operation result
use case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911212622.XA
Other languages
Chinese (zh)
Other versions
CN110990279B (en
Inventor
葛磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiaotang Technology Shanghai Co ltd
Original Assignee
Xiaotang Technology Shanghai Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiaotang Technology Shanghai Co ltd filed Critical Xiaotang Technology Shanghai Co ltd
Priority to CN201911212622.XA priority Critical patent/CN110990279B/en
Publication of CN110990279A publication Critical patent/CN110990279A/en
Application granted granted Critical
Publication of CN110990279B publication Critical patent/CN110990279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method for jointly verifying DSP codes, which comprises the following steps: creating a DSP use case parameter table set; creating an MATLAB reference model of DSP codes to be verified by using MATLAB; defining data interacting with MATLAB in DSP code; MATLAB reads a case of parameter of the DSP in sequence, and calls a CEVA DSP debugging process to carry out operation after each reading; using the same use case parameters to call an MATLAB reference model to carry out operation; and comparing the operation result of the MATLAB reference model with the operation result of the CEVA DSP debugging process, storing the current comparison result, and if the comparison result is inconsistent, simultaneously storing the current case parameters, the input data, the operation result of the MATLAB reference model and the operation result of the CEVA DSP debugging process. And if the current use case parameter is not the tail of the use case parameter table set, reading the next use case parameter to continue verification, otherwise, terminating the verification. By using the method, manual participation is not needed after the verification is started, the reliability and the efficiency of the DSP code verification process are improved, and the time and the human resources are saved.

Description

Method for jointly verifying DSP codes
Technical Field
The invention relates to the technical field of computer programs, in particular to a method for jointly verifying DSP codes.
Background
MATLAB is a commercial mathematical software produced by MathWorks company in America, and because the basic data unit of the MATLAB is a matrix, the MATLAB is high in computing capability and is commonly used for algorithm development, data verification and the like. DSP (digital signal processing) chips from CEVA are increasingly used for their high performance, low power consumption and powerful computing power. DSP verification is also attracting more and more attention as a means of ensuring the correctness of DSP functions. As shown in fig. 2, a conventional DSP code verification method is disclosed, in which DSP software is manually started, parameters are set in DSP codes, data is read in, and parameter cases are run, and after the running is completed, whether the running result of the DSP is consistent with expectations is manually checked. If the use set is huge, huge manpower and time are consumed, the efficiency is low, and errors are easy to occur.
Disclosure of Invention
The invention aims to provide a method for jointly verifying DSP codes, which improves the reliability and efficiency of a DSP code verification process and saves time and human resources.
The technical scheme for realizing the purpose is as follows:
a method for jointly verifying DSP codes is based on MATLAB and CEVA DSP chips and comprises the following steps:
step S1, creating a DSP use case parameter table set;
step S2, creating an MATLAB reference model of the DSP code to be verified by using the MATLAB;
step S3, defining data interacting with MATLAB in DSP code;
step S4, the MATLAB reads the parameters of one instance of the DSP in sequence and generates random data as input data, calls a CEVA DSP debugging process to carry out operation after each reading, and keeps the operation result;
step S5, using the same use case parameters and input data to call the compiled MATLAB reference model to carry out operation, and keeping the operation result;
step S6, comparing the operation result of the MATLAB reference model with the operation result of the CEVA DSP debugging process, storing the current comparison result, and if the comparison result is inconsistent, storing the current case parameters, the input data, the operation result of the MATLAB reference model and the operation result of the CEVA DSP debugging process;
and step S7, if the current use case parameter is not the end of the use case parameter table set, returning to step S4, reading the next use case parameter to continue verification, otherwise, terminating verification.
Preferably, the step S1 includes: establishing an Excel file, and writing all use case parameters into the Excel file, wherein each set of use case parameters in the Excel file corresponds to one verification use case.
Preferably, the step S2 is: and analyzing the functions of the DSP codes to be verified, and writing an MATLAB reference model with the same functions by using MATLAB.
Preferably, the data interacted in step S3 refers to: and the input and output data and parameters are used for transmitting the parameters of the case to be verified between the MATLAB process and the DSP process.
Preferably, the step S4 includes:
MATLAB reads the parameters of the current use case;
MATLAB generates random data as input data of the current use case;
the MATLAB calls a session establishing interface provided by the CEVA to establish a session between the MATLAB and the DSP, and opens a CEVA DSP debugging process;
the MATLAB calls a data writing interface provided by the CEVA to write the use case parameters and the input data into the parameter section and the input data section planned by the DSP;
the MATLAB calls a command line interface provided by the CEVA to load a DSP executable program;
the MATLAB calls a command line interface provided by the CEVA to run a DSP program;
the MATLAB calls a data acquisition interface provided by the CEVA to read the DSP operation result into the MATALB from the output data segment planned by the DSP and store the DSP operation result;
MATLAB calls a command line interface provided by CEVA to reset the CEVA DSP debugging process.
Preferably, the step S5 includes:
reading the current case parameters;
and configuring the current use case parameters and the input data to an MATLAB reference model for operation, and storing an operation result.
Preferably, in the step S6,
if the operation result of the MATLAB reference model is consistent with the operation result of the CEVA DSP debugging process, directly writing the comparison result into a log file;
and if the operation result of the MATLAB reference model is inconsistent with the operation result of the CEVA DSP debugging process, writing the comparison result into a log file, and storing the current case parameters, the input data, the operation result of the MATLAB reference model and the operation result of the CEVA DSP debugging process.
The invention has the beneficial effects that: the invention utilizes the respective advantages of the MATLAB and the CEVA DSP, realizes the verification of the DSP code function by comparing the operation result of the MATLAB reference model with the operation result of the CEVA DSP debugging process, has simple realization and complete case coverage, improves the reliability and efficiency of the DSP code verification process, and saves time and manpower resources.
Drawings
FIG. 1 is a flow chart of a method of jointly validating DSP code of the present invention;
fig. 2 is a flow chart of a DSP code verification method in the prior art.
Detailed Description
The invention will be further explained with reference to the drawings.
Referring to fig. 1, the method for jointly verifying DSP codes according to the present invention, based on MATLAB and CEVA DSP chips, includes the following steps:
and step S1, creating a DSP use case parameter table set. Namely: find out all the expected parameters of the DSP and analyze the number of parameter combinations. Establishing an Excel file, and writing all use case parameters into the Excel file, wherein each set of use case parameters in the Excel file corresponds to one verification use case.
Step S2, create an MATLAB reference model using MATLAB that requires verification of DSP code. Namely: and analyzing the functions of the DSP codes to be verified, and writing an MATLAB reference model with the same functions by using MATLAB.
Step S3, data interacting with MATLAB is defined in the DSP code. The data refer to: and the input and output data and parameters are used for transmitting the parameters of the case to be verified between the MATLAB process and the DSP process. For example: the following structure is declared in the DSP code:
int in __attribute__((section(".DSECT in_var")))
int out __attribute__((section(".DSECT out_var")))
struct para_t para __attribute__((section(".DSECT para_var")))
wherein in is input data interacted with the MATLAB, out is output data interacted with the MATLAB, and para is a use case parameter interacted with the MATLAB. The DSP uses the data in, out, para respectively as the input, output and parameters of the current verification.
And step S4, the MATLAB reads the parameters of one instance of the DSP in sequence and generates random data as input data, the CEVA DSP debugging process is called to carry out operation after each reading, and the operation result is reserved. The method specifically comprises the following steps:
1) MATLAB reads the current use case parameters. The code is for example:
para ═ xlsread ('para.xlsx'); % read-in case set
CurrentPara ═ Para { i }; the ith row in the% use case set is used as the current parameter, and i is the number of the currently executed use case.
2) MATLAB generates random data as input data of the current use case. The code is for example:
in=randi([0 1],Length,1);
the Length is the Length of the generated data and is determined by the configuration in Para.
3) And the MATLAB calls a session establishing interface provided by the CEVA to establish a session between the MATLAB and the DSP, and opens a debugging process of the CEVADSP.
4) And the MATLAB calls a data writing interface provided by the CEVA to write the use case parameters and the input data into the parameter section and the input data section planned by the DSP.
5) MATLAB calls the command line interface provided by CEVA to load the DSP executable.
6) MATLAB calls a command line interface provided by CEVA to run a DSP program.
7) And the MATLAB calls a data acquisition interface provided by the CEVA to read the DSP operation result from the output data segment planned by the DSP into the MATALB and store the DSP operation result. The code is for example:
% set session and open process in background
openDbg3('example',0,'cevax16');
% load DSP executable
runCliCmd('load coff expdbg.a');
% setting input, output and parameters of DSP current case
setData('in_var',in);
setData('out_var',out);
setData('para_var',para);
% execution of current use case
runCliCmd('run');
% obtaining DSP operating results
DspOut=getData('out_var',1);
res(i)=DspOut;
8) MATLAB calls a command line interface provided by CEVA to reset the CEVA DSP debugging process. The code is for example:
runCliCmd('reset')。
and step S5, reading the current use case parameters and the input data, configuring the current use case parameters and the input data to an MATLAB reference model for operation, and storing the operation result. The MATLAB reference model is called in MATLAB, the code is as follows: MatlabOut ═ dspfix model (in, para).
And step S6, comparing the operation result of the MATLAB reference model with the operation result of the CEVA DSP debugging process, storing the current comparison result, and if the comparison result is inconsistent, storing the current case parameters, the input data, the operation result of the MATLAB reference model and the operation result of the CEVA DSP debugging process for subsequently locating and comparing the inconsistent reasons. Whether consistent or not, the comparison result is written into the log file. The code is as follows:
if(isequal(DspOut,MatlabOut))
save_normal_log(i);
else
save_wrong_case(i,in,DspOut,MatlabOut,CurrentPara);
end
wherein, the save _ normal _ log is a function for saving normal use case log files, and the key codes are as follows:
fid=fopen(‘log.dat’,’a’);
fprintf (fid, 'case% d success \ n', i); % i is the number of the current case
fclose(fid);
Wherein, save _ wrong _ case is a function for saving abnormal use case log files, and the key codes are as follows:
fid=fopen(‘log.dat’,’a’);
fprintf (fid, 'case% d fail \ n', i); % i is the number of the current case
fclose(fid);
fid=fopen([‘case_’num2str(i)’_in.dat’],’w’);
for idx=1:length(in)
fprintf(fid,'0x%08X\n',in(idx));
end
fclose(fid);
fid=fopen([‘case_’num2str(i)’_out.dat’],’w’);
for idx=1:length(out)
fprintf(fid,'0x%08X\n',out(idx));
end
fclose(fid);
fid=fopen([‘case_’num2str(i)’_para.dat’],’w’);
for idx=1:length(CurrentPara)
fprintf(fid,'0x%08X\n',CurrentPara(idx));
end
fclose(fid);
And step S7, if the current use case parameter is not the end of the use case parameter table set, returning to step S4, reading the next use case parameter to continue verification, otherwise, terminating verification.
The above embodiments are provided only for illustrating the present invention and not for limiting the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and therefore all equivalent technical solutions should also fall within the scope of the present invention, and should be defined by the claims.

Claims (7)

1. A method for jointly verifying DSP codes is based on MATLAB and CEVA DSP chips and is characterized by comprising the following steps:
step S1, creating a DSP use case parameter table set;
step S2, creating an MATLAB reference model of the DSP code to be verified by using the MATLAB;
step S3, defining data interacting with MATLAB in DSP code;
step S4, the MATLAB reads the parameters of one instance of the DSP in sequence and generates random data as input data, calls a CEVA DSP debugging process to carry out operation after each reading, and keeps the operation result;
step S5, using the same use case parameters and input data to call the compiled MATLAB reference model to carry out operation, and keeping the operation result;
step S6, comparing the operation result of the MATLAB reference model with the operation result of the CEVA DSP debugging process, storing the current comparison result, and if the comparison result is inconsistent, storing the current case parameters, the input data, the operation result of the MATLAB reference model and the operation result of the CEVA DSP debugging process;
and step S7, if the current use case parameter is not the end of the use case parameter table set, returning to step S4, reading the next use case parameter to continue verification, otherwise, terminating verification.
2. The method for jointly verifying DSP codes according to claim 1, wherein said step S1 includes: establishing an Excel file, and writing all use case parameters into the Excel file, wherein each set of use case parameters in the Excel file corresponds to one verification use case.
3. The method for jointly verifying DSP codes according to claim 1, wherein said step S2 refers to: and analyzing the functions of the DSP codes to be verified, and writing an MATLAB reference model with the same functions by using MATLAB.
4. The method for jointly verifying DSP codes according to claim 1, wherein the data interacted in the step S3 refer to: and the input and output data and parameters are used for transmitting the cases to be verified between the MATLAB process and the DSP process.
5. The method for jointly verifying DSP codes according to claim 1, wherein said step S4 includes:
MATLAB reads the parameters of the current use case;
MATLAB generates random data as input data of the current use case;
the MATLAB calls a session establishing interface provided by the CEVA to establish a session between the MATLAB and the DSP, and opens a CEVA DSP debugging process;
the MATLAB calls a data writing interface provided by the CEVA to write the use case parameters and the input data into the parameter section and the input data section planned by the DSP;
the MATLAB calls a command line interface provided by the CEVA to load a DSP executable program;
the MATLAB calls a command line interface provided by the CEVA to run a DSP program;
the MATLAB calls a data acquisition interface provided by the CEVA to read the DSP operation result into the MATALB from the output data segment planned by the DSP and store the DSP operation result;
MATLAB calls a command line interface provided by CEVA to reset the CEVA DSP debugging process.
6. The method for jointly verifying DSP codes according to claim 1, wherein said step S5 includes:
reading the current case parameters;
and configuring the current use case parameters and the input data to an MATLAB reference model for operation, and storing an operation result.
7. The method for jointly verifying DSP codes according to claim 1, wherein in said step S6,
if the operation result of the MATLAB reference model is consistent with the operation result of the CEVA DSP debugging process, directly writing the comparison result into a log file;
and if the operation result of the MATLAB reference model is inconsistent with the operation result of the CEVA DSP debugging process, writing the comparison result into a log file, and storing the current case parameters, the input data, the operation result of the MATLAB reference model and the operation result of the CEVA DSP debugging process.
CN201911212622.XA 2019-12-02 2019-12-02 Method for joint verification of DSP codes Active CN110990279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911212622.XA CN110990279B (en) 2019-12-02 2019-12-02 Method for joint verification of DSP codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911212622.XA CN110990279B (en) 2019-12-02 2019-12-02 Method for joint verification of DSP codes

Publications (2)

Publication Number Publication Date
CN110990279A true CN110990279A (en) 2020-04-10
CN110990279B CN110990279B (en) 2023-05-12

Family

ID=70089047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911212622.XA Active CN110990279B (en) 2019-12-02 2019-12-02 Method for joint verification of DSP codes

Country Status (1)

Country Link
CN (1) CN110990279B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102375778A (en) * 2010-08-17 2012-03-14 中兴通讯股份有限公司 Method and system for automatically testing digital signal processor (DSP)
WO2012129844A1 (en) * 2011-03-29 2012-10-04 上海雷诺尔科技股份有限公司 Intelligent synthesis system for developing and testing high-voltage frequency converter and establishment method thereof
CN102750143A (en) * 2012-05-31 2012-10-24 武汉邮电科学研究院 Digital signal processing (DSP) developing method based on matrix laboratory (MATLAB) component object model (COM) component calling
CN105844066A (en) * 2016-06-07 2016-08-10 无锡键桥电子科技有限公司 Design verification method for passive tag chip
WO2017113912A1 (en) * 2015-12-30 2017-07-06 中兴通讯股份有限公司 Physical layer software automation test method and device
CN108959103A (en) * 2018-07-31 2018-12-07 西安电子科技大学 Method for testing software based on BWDSP library function
CN109597733A (en) * 2018-12-04 2019-04-09 航天恒星科技有限公司 A kind of multifunctional efficient dynamic chip verifying emulation mode and equipment
CN110083880A (en) * 2019-04-02 2019-08-02 江苏理工学院 Combined optimization design method based on MATLAB and ABAQUS

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102375778A (en) * 2010-08-17 2012-03-14 中兴通讯股份有限公司 Method and system for automatically testing digital signal processor (DSP)
WO2012129844A1 (en) * 2011-03-29 2012-10-04 上海雷诺尔科技股份有限公司 Intelligent synthesis system for developing and testing high-voltage frequency converter and establishment method thereof
CN102750143A (en) * 2012-05-31 2012-10-24 武汉邮电科学研究院 Digital signal processing (DSP) developing method based on matrix laboratory (MATLAB) component object model (COM) component calling
WO2017113912A1 (en) * 2015-12-30 2017-07-06 中兴通讯股份有限公司 Physical layer software automation test method and device
CN106933734A (en) * 2015-12-30 2017-07-07 中兴通讯股份有限公司 A kind of physical layer software automated testing method and device
CN105844066A (en) * 2016-06-07 2016-08-10 无锡键桥电子科技有限公司 Design verification method for passive tag chip
CN108959103A (en) * 2018-07-31 2018-12-07 西安电子科技大学 Method for testing software based on BWDSP library function
CN109597733A (en) * 2018-12-04 2019-04-09 航天恒星科技有限公司 A kind of multifunctional efficient dynamic chip verifying emulation mode and equipment
CN110083880A (en) * 2019-04-02 2019-08-02 江苏理工学院 Combined optimization design method based on MATLAB and ABAQUS

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
冷斌;李学勇;刘建华;: "一种基于Matlab的DSP调试及直接代码生成方法" *
杜磊;薛重德;任志国;: "基于DSP的自动代码生成及应用" *
王顺锋;孙培德;: "基于MATLAB的DSP实时控制软件自动生成" *
薛丰廷;常勇;: "利用MATLAB生成红外探测系统一点校正DSP代码" *

Also Published As

Publication number Publication date
CN110990279B (en) 2023-05-12

Similar Documents

Publication Publication Date Title
CN111625289B (en) Method and device for quickly starting application program and electronic equipment
CN109299530A (en) A kind of emulation testing case generation method, system, storage medium and terminal
CN110569158A (en) method and device for testing abnormal power failure in SSD random scene and computer equipment
CN109358805A (en) A kind of data cache method
CN108446224B (en) Performance analysis method of application program on mobile terminal and storage medium
CN114047968B (en) Method, system, storage medium and equipment for automatic hardware adaptation
CN109684152B (en) RISC-V processor instruction downloading method and device
CN110990279B (en) Method for joint verification of DSP codes
CN110569038B (en) Random verification parameter design method, device, computer equipment and storage medium
US20230101154A1 (en) Resumable instruction generation
CN109783417B (en) Serial port communication device and method
CN114238107A (en) Tracking debugging method, system and computer readable storage medium
CN105516158A (en) Configurable protocol conversion state machine circuit structure and protocol configuration method
CN111694727A (en) Network card firmware upgrading and downgrading test method, system, terminal and storage medium
CN110908821A (en) Method, device, equipment and storage medium for task failure management
CN114968689B (en) FPGA device, MIPI protocol layer testing device and method based on FPGA device
CN116860323B (en) P4-based compiling and FPGA configuration method
CN116562204B (en) Chip verification method and device, electronic equipment and computer readable storage medium
CN112527680B (en) Project API level full-link automatic test method and system based on Fitnesse framework
CN114356610A (en) Control method, device and equipment for interface calling and storage medium
CN112788141B (en) File downloading method, device, equipment and computer readable storage medium
CN115794605A (en) Firmware upgrading test verification method and device, computer equipment and storage medium
CN114896642A (en) Method for improving MCU bus efficiency and data transmission safety
CN114265629A (en) Method for finally unifying distributed transactions
CN118233297A (en) Gateway machine and initialization method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 372, building 3, 333 Hongqiao Road, Xuhui District, Shanghai 200233

Applicant after: Xiaotang Technology (Shanghai) Co.,Ltd.

Address before: Room 372, building 3, 333 Hongqiao Road, Xuhui District, Shanghai 200233

Applicant before: XIAOTANG TECHNOLOGY (SHANGHAI) Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method for jointly verifying DSP code

Granted publication date: 20230512

Pledgee: Shanghai Pudong Development Bank Co.,Ltd. Xuhui sub branch

Pledgor: Xiaotang Technology (Shanghai) Co.,Ltd.

Registration number: Y2024310000482