CN102799528B - A kind of script debugging method for circuit board level test, device and system thereof - Google Patents

A kind of script debugging method for circuit board level test, device and system thereof Download PDF

Info

Publication number
CN102799528B
CN102799528B CN201210242397.6A CN201210242397A CN102799528B CN 102799528 B CN102799528 B CN 102799528B CN 201210242397 A CN201210242397 A CN 201210242397A CN 102799528 B CN102799528 B CN 102799528B
Authority
CN
China
Prior art keywords
parameter
script
statement
list
name
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.)
Expired - Fee Related
Application number
CN201210242397.6A
Other languages
Chinese (zh)
Other versions
CN102799528A (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.)
Institute of Acoustics CAS
Original Assignee
Institute of Acoustics CAS
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 Institute of Acoustics CAS filed Critical Institute of Acoustics CAS
Priority to CN201210242397.6A priority Critical patent/CN102799528B/en
Publication of CN102799528A publication Critical patent/CN102799528A/en
Application granted granted Critical
Publication of CN102799528B publication Critical patent/CN102799528B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to a kind of script debugging method for circuit board level test, device and system thereof.The method comprises the following steps: identify the script command in statement; Obtain the parameter of this script command; Query argument definition list resolves this parameter, and calculates numerical value corresponding to this parameter; According to the bottom function that the name query of script command maps, and numerical value corresponding for parameter is passed to the execution of bottom function.This device comprises identification module, acquisition module, parsing module sum functions execution module.Extensibility of the present invention is strong, and the script debugging operation of the more effective support circuit board level test of energy, simplifies the operation of user.

Description

A kind of script debugging method for circuit board level test, device and system thereof
Technical field
The present invention relates to script debugging technology, particularly a kind of script debugging method for circuit board level test, device and system thereof.
Background technology
Circuit board level debugging is the important step in CPU design process, the current debugging apparatus for circuit board level debugging and method thereof need to coordinate multiple development environment just can complete host computer and transmit to the data of slave computer, download, the operation that control program performs, its operation is very loaded down with trivial details.
Computer program and the multiple different program language of applications exploiting realize desired function, in some environment, the code call C++(of the script of such as Python or Perl and so on or other native code), the external function of other language of VisualBasic and so on, its script environment will provide the debugging experience of corresponding scripted code usually, but these scripts or script environment seem awkward in circuit board level debugging, cannot provide and serve easily.
Summary of the invention
The object of the invention is the problem in order to solve script debugging complex operation in circuit board level test.
For achieving the above object, on the one hand, the invention provides a kind of script debugging method for circuit board level test, the method comprises the following steps:
Identify the script command in each bar statement; Obtain the parameter of described script command; Query argument definition list resolves described parameter, and calculates numerical value corresponding to described parameter; According to the bottom function that the name query of described script command maps, and numerical value corresponding for described parameter is passed to the execution of described bottom function.
On the other hand, the invention provides a kind of script debugging device for circuit board level test, this device comprises identification module, for identifying the script command in statement; Acquisition module, for obtaining the parameter of described script command; Parsing module, resolves described parameter for query argument definition list, and calculates numerical value corresponding to described parameter; Function execution module, for the bottom function according to described script command query mappings, and passes to the execution of described bottom function by numerical value corresponding for described each parameter.
Again on the one hand, the invention provides a kind of script debugging system for circuit board level test.
The embodiment of the present invention solves the problem that in prior art, circuit board level test operation is loaded down with trivial details, the more effective support circuit board level test operation of energy, simplifies the script debugging operation of user.
Accompanying drawing explanation
A kind of script debugging system for circuit board level test that Fig. 1 provides for the invention process;
Fig. 2 is the structural representation of parameter definition list;
A kind of script debugging method for circuit board level test that Fig. 3 provides for the embodiment of the present invention;
A kind of script debugging device for circuit board level test that Fig. 4 provides for the embodiment of the present invention.
Embodiment
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
A kind of script debugging system for circuit board level test that Fig. 1 provides for the embodiment of the present invention.This system proposes a set of independently Script Programming grammer, and be equipped with corresponding script debugging device, compare traditional scripting programming language, the more effective support circuit board level debugging operations of its energy, its programming mode is also simpler, the communication pattern of various host computer, slave computer can be supported, significantly can reduce the redundance of circuit board level debugging, facilitate circuit board level developer.
As shown in Figure 1, this script debugging system 100 comprises user operation module 110, script debugging device 120, host computer 130 and slave computer 140, wherein user operation module 110 provides programmed environment for user, and the shell script file write is sent to script debugging device 120; The shell script file of reception is explained by script debugging device 120 line by line, therefrom gets parms, and performs by calling the bottom function that maps one by one, and the realization of bottom function to be completed by higher level lanquage according to the agreement of circuit board level communication to write; Host computer 130 instructs slave computer 140 to work according to function execution result.Communication between host computer 130 and slave computer 140 then processes according to the communication protocol in specific boards level design process, but can not affect the work of script debugging system.
Be described for embodiment of the present invention script debugging system 100 above, be described for Script Programming grammer below.
The design of script, on the basis being normally based upon other higher level lanquages, therefore, inevitably needs the corresponding relation setting up script command and bottom function.Following table 1 lists the onboard data variable that the various user of being used to guide carries out programming, such as, onboard data variable " name ", its data type is character pointer, major function is used for defining variable title, and these onboard data variablees can set up mapping relations with numerous types of data and input pattern, with the input pattern of extending user parameter on the one hand, on the other hand, the parameter that can be used as corresponding bottom function is transmitted.
Table 1
Onboard data variable Data type Input format Functional description
time int %d Time correlation
num int %d Chip selection signal
addr unsigned int 0x%X,0x%04X,0x%08X,%d Destination address
size unsigned int 0x%X,0x%08X,%d Target word joint number
ofst unsigned int 0x%X,0x%08X,%d Side-play amount
name const char* %s Name variable
message const char* %s Output information
value unsigned int %C,0x%X,0x%08X,%d Value
varval struct varval t %C,0x%vX,0x%v08X,%vd,%vs Variate-value
count unsigned int 0x%X,0x%08X,%d Statistics number
countout unsigned int 0x%X,0x%08X,%d The circulation upper limit
string const char* %s Character string
Following table 2 list various in circuit board level debugging the script command that frequently uses, in view of the difference of Hardware Design and host computer and slave computer communication pattern, the realization of bottom function is inevitable also be there are differences.But how concrete bottom function realizes not affecting the function that this script provides in the embodiment of the present invention.
Table 2
In table 2, illustrate with script command " defvar ", the parameter that " defvar " orders it to support comprises " name " and " varval ", and variable is stated in this order.
Following table 3 lists the various embedded power function provided in this cover script, and embedded power function is the built-in function that in the embodiment of the present invention, script provides, and the realization of embedded power function needs the mapping of one or more bottom function.In actual applications, embedded power function can simplify the operation of user.
Table 3
In table 3, illustrate with embedded power function " plusvar ", the function of embedded power function plusvar is add operation, and this embedded power function can carry out phase add operation to the value of the variable passed over, and its result again can as the value of another variable.
Be described for the functional operator in script below.
In other programming language, all provide the operational character being used to guide compiling and explaining, such as, in C language, " ++ " operational character represents from add operation, and in Perl language, " # " operational character represents annotation.The script that the embodiment of the present invention provides defines these special operational characters (see table 4) equally, in order to strengthen the function of script, to make an explanation work with instructing script debugging device.
Table 4
Special operational accords with Functional description
Represent embedded power function to call
The first # of row This row of representative annotation
# in row Parameter call in cycling
! The acquisition of character string
$ Parameter call in general expression
Specific implementation below for the special operational symbol listed in table 4 is described.Now be illustrated with "" operational character in table 4.Script debugging device is when first "" operational character occurred in statement being detected, then start matched character string until next "" operational character, the character string intercepted and captured for centre carries out the coupling of embedded power function and the calculating of parameter and transmission.
The script dispatching system that the embodiment of the present invention provides also establish every onboard data and its data structure, bottom function realize between mapping relations, and bottom function name and its tool stop the mapping between realizing.The use of parameter can be embodied from the calling of bottom function, and therefore, parameter definition list can be designed to a secondary structure.As shown in Figure 2, bottom function parameter sets parameter 1, parameter 2 ..., parameter n constitute first order parameter list, definition set that the concrete element in parameter sets is corresponding definition 1, definition 2 ..., definition n constitute second level parameter list.
Grammar design above for Script Programming is described, and the concrete grammar below for script debugging is described.A kind of script debugging method for circuit board level test that Fig. 3 provides for the embodiment of the present invention, the method comprising the steps of 301-304.
In step 301, identify the script command in statement.
User completes writing of shell script by the programmed environment that script debugging system provides, and the shell script write transfers to script debugging device to make an explanation.Script debugging device is explained line by line for shell script, and by searching the script command in predefined parameter definition list (as shown in Figure 2) identification statement.
In step 302, obtain the parameter that described script command carries.
The parameter that script debugging device is carried by query argument definition list acquisition script command.Particularly, script debugging device is by the parameter of first order parameter list acquisition entrained by script command of query argument definition list.
In step 303, query argument definition list analytic parameter, and the numerical value that calculating parameter is corresponding;
Script debugging device is by query argument definition list analytic parameter, and the numerical value that calculating parameter is corresponding.Particularly, script debugging device is by the second level parameter list analytic parameter of parameter definition list.
It should be noted that, the script debugging method that the embodiment of the present invention provides is after having calculated numerical value corresponding to parameter, whether detection script order is present in script function inside, this script function is the function defined by scripting programming language, if, by the title of the parameter entrained by script command and the value storage of correspondence in local parameter table, otherwise, by the title of the parameter entrained by script command and the value storage of correspondence in global parameter table.For the ease of subsequent operation searching the parameter entrained by script command, Hash mapping relation need be set up, for local parameter list, character string for calculating cryptographic hash is chosen as " bottom function name+parameter name ", and for global parameter table, be chosen as " shell script filename (being defaulted as NULL)+parameter name " for the character string calculating cryptographic hash.The reading of parameter is according to first local parameter table, and the order of rear global parameter table is inquired about.
In step 304, according to the bottom function that the name query of script command maps, and numerical value corresponding for described parameter is passed to the execution of described bottom function.
The bottom function that script debugging device is corresponding according to script command name query, and the value transmit of parameters is performed to function.It should be noted that, be mapping relations one by one between the title of script command and bottom function.
Below by way of the concrete script debugging process implemented to fall to describe the embodiment of the present invention and provide.
Shell script is as follows:
-defvarname=avarval=test.bin1
-defvarname=bvarval=1002
-defvarname=cvarval=0x100003
-defvarname=dvarval=plusvar($b$,$c$)4
-setflagaddr=$d$value=filersize($a$)5
For statement 1 to statement 3, statement order " defvar " is in order to state that (a, b, c), onboard data varval represents the initial value of name variable to name variable name.First script debugging device identifies the script command " defvar " in script sentence after "-" symbol, then according to the bottom function name mapped one by one, as " defvar " searches parameter definition list, and each parameter " name " obtained entrained by this script command and " varval ", and calculate numerical value corresponding to parameter.
For statement 4, between two operational characterrepresentative, call embedded power function plusvar, and information being representative between two operational character $ is the name variable needing to transmit.Therefore, the function of this statement representative is defining variable d, and its initial value is b+c.
For statement 5, setflag bottom function is called in the representative of this statement, and its destination address is the value of variable d, and value is the byte number of file test.bin.
Embodiment of the present invention script debugging device can support cycling and nested circulation.When script debugging device recognizes loop statement, then record the every statement between circulation start statement to circulation end statement, and perform according to cycle index circulation the every statement be recorded.
In one example in which, loop statement is as follows:
-labelname=rsram1
-readsramaddr=#rsram#num=02
-superwritefilename=frame$count$.binsize=filesize($a$)3
-loopname-rsramcount=204
Above-mentioned loop statement with-label statement for begin, till-loop statement.Define the name of this circulation and the value of name in Label statement, the name variable in loop statement in name variable and label needs to set up relation one to one, and the representative of count value is the number of times circulated.
Specific implementation process is as described below:
The above-mentioned loop statement 1 of script debugging device identification, then start to record follow-up every statement, i.e. statement 2 and statement 3, and perform the every statement be recorded, i.e. statement 2 and statement 3 according to the value count circulation of cycle index.
The script debugging method that the embodiment of the present invention provides solves the problem of script debugging complex operation in prior art circuits board level test, can test by more effective support circuit board level, can simplify the operation of user.
A kind of script debugging device for circuit board level test that Fig. 4 provides for the embodiment of the present invention.As shown in Figure 4, this script debugging device 420 comprises identification module 421, acquisition module 422, parsing module 423 sum functions execution module 424.
Identification module 421 is for identifying the bottom function representated by the script command in statement according to predefined parameter definition list (as shown in table 2).Such as, for statement :-defvarname=PRJTESTvarval=test.bin, first identification module 421 analyzes the bottom function representated by command name " defvar " in this statement after operational character "-", and the function of this order is statement variable.
Acquisition module 422 is for obtaining the parameter entrained by above-mentioned script command.Such as, the parameter " name " in statement-defvarname=PRJTESTvarval=test.bin and " varval ".
Parsing module 423 is for the parameter " name " that obtained by acquisition module 422 according to the inquiry of predefined parameter definition list (as shown in table 2) and " varval ", and calculating parameter " name " and numerical value corresponding to " varval ".
Particularly, the each parameter of parsing module 423 entrained by script command, such as " name " and " varval " travel through the second level parameter list (definition set list) of parameter definition list (as shown in table 2) successively, and calculate according to the every definition found out the numerical value that in definition set, each element is corresponding successively.
The script debugging device that the embodiment of the present invention provides also comprises judge module (not shown), this judge module is used for detection script order and whether is present in script function inside, if, by the title of the parameter entrained by script command and the value storage of correspondence in local parameter table, otherwise, by the title of the parameter entrained by script command and the value storage of correspondence in global parameter table.For the ease of subsequent operation searching parameter, Hash mapping relation need be set up, for local parameter list, character string for calculating cryptographic hash is chosen as " bottom function name+parameter name ", and for global parameter table, be chosen as " shell script filename (being defaulted as NULL)+parameter name " for the character string calculating cryptographic hash.The reading of parameter is according to first local parameter table, and the order of rear global parameter table is inquired about.
Function execution module 424 is for the bottom function corresponding according to script command, and the numerical value corresponding to parameter of being resolved by parsing module 423 passes to the execution of this bottom function.
Particularly, function execution module 424 inquires about bottom function corresponding to this script command according to script command, and sends to bottom function to perform numerical value corresponding for the every ginseng parsed by parsing module 423.
The script debugging device that the embodiment of the present invention provides also comprises logging modle (not shown), and this module is for recording the every statement between circulation start statement to circulation end statement.Script debugging device performs according to cycle index circulation the every statement be recorded.
The script debugging device that the embodiment of the present invention provides solves the problem of script debugging complex operation in prior art circuits board level test, can test by more effective support circuit board level, can simplify the operation of user.
Professional should recognize further, in conjunction with unit and the algorithm steps of each example of embodiment disclosed herein description, can realize with electronic hardware, computer software or the combination of the two, in order to the interchangeability of hardware and software is clearly described, generally describe composition and the step of each example in the above description according to function.These functions perform with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can use distinct methods to realize described function to each specifically should being used for, but this realization should not thought and exceeds scope of the present invention.
Above-described embodiment; object of the present invention, technical scheme and beneficial effect are further described; be understood that; the foregoing is only the specific embodiment of the present invention; the protection domain be not intended to limit the present invention; within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (9)

1., for a script debugging method for circuit board level test, it is characterized in that, described method comprises:
Identify the script command in statement;
Obtain the parameter of described script command;
Query argument definition list resolves described parameter, and calculates numerical value corresponding to described parameter;
According to the bottom function that the name query of described script command maps, and by corresponding for described parameter
Numerical value passes to described bottom function and performs;
Also comprise after the numerical operation that the described parameter of described calculating is corresponding:
Judge whether described script command is present in script function inside, if so, by the title of described parameter and the value storage of correspondence in local parameter table, otherwise, be stored in global parameter table;
Described local parameter table is using described bottom function name and parameter name as the character string of calculating cryptographic hash;
Described global parameter table is using shell script filename and parameter name as the character string of calculating cryptographic hash.
2. method according to claim 1, is characterized in that, described parameter definition list comprises first order parameter list and second level parameter list, and described first order parameter list is made up of the parameter sets of bottom function; Described second level parameter list is made up of the definition set that element in described parameter sets is corresponding.
3. method according to claim 1, is characterized in that, also comprises after the script command operation in described identification statement:
Each bar statement between record circulation start statement to circulation end statement, each bar statement be recorded described in performing according to cycle index circulation.
4. method according to claim 1, is characterized in that, is map one by one between the title of described script command and bottom function.
5., for a script debugging device for circuit board level test, it is characterized in that, described device comprises:
Identification module, for identifying the script command in statement;
Acquisition module, for obtaining the parameter of described script command;
Parsing module, resolves described parameter for query argument definition list, and calculates numerical value corresponding to described parameter;
Function execution module, for the bottom function mapped one by one according to the name query of described script command, and passes to the execution of described bottom function by numerical value corresponding for described each parameter;
Judge module is after having calculated numerical value corresponding to described parameter, for judging whether described script command is present in script function inside, if, by the title of described parameter and the value storage of correspondence in local parameter table, otherwise, be stored in global parameter table; Wherein,
Described local parameter table is using described bottom function name and parameter name as the character string of calculating cryptographic hash;
Described global parameter table is using described shell script filename and parameter name as the character string of calculating cryptographic hash.
6. device according to claim 5, is characterized in that, described parameter definition list comprises first order parameter list and second level parameter list, and described first order parameter list is made up of the parameter sets of bottom function; Described second level parameter list is made up of the definition set that element in parameter sets is corresponding.
7. device according to claim 5, is characterized in that, also comprises:
Record cell, after identification circulation start statement, for recording each bar statement between circulation start statement to circulation end statement, described device can perform according to cycle index circulation each bar statement be recorded.
8., for a script debugging system for circuit board level test, comprise script debugging device as claimed in claim 5.
9. system according to claim 8, is characterized in that, also comprises:
User operation module, for inputting and sending the shell script file that user writes.
CN201210242397.6A 2012-07-12 2012-07-12 A kind of script debugging method for circuit board level test, device and system thereof Expired - Fee Related CN102799528B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210242397.6A CN102799528B (en) 2012-07-12 2012-07-12 A kind of script debugging method for circuit board level test, device and system thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210242397.6A CN102799528B (en) 2012-07-12 2012-07-12 A kind of script debugging method for circuit board level test, device and system thereof

Publications (2)

Publication Number Publication Date
CN102799528A CN102799528A (en) 2012-11-28
CN102799528B true CN102799528B (en) 2015-12-09

Family

ID=47198641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210242397.6A Expired - Fee Related CN102799528B (en) 2012-07-12 2012-07-12 A kind of script debugging method for circuit board level test, device and system thereof

Country Status (1)

Country Link
CN (1) CN102799528B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104680096A (en) * 2013-11-26 2015-06-03 英业达科技有限公司 Reading system of corresponding detection script of circuit board and method thereof
CN105138364B (en) * 2015-08-21 2019-03-01 Oppo广东移动通信有限公司 A kind of method and device of terminal system upgrading
CN107563025B (en) * 2017-08-18 2021-08-20 北京东土军悦科技有限公司 Verification platform management method and device
CN109460351B (en) * 2018-12-16 2021-08-10 西南电子技术研究所(中国电子科技集团公司第十研究所) Method for debugging electronic product process script by running ATS software platform

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402480A (en) * 2011-10-12 2012-04-04 吴华中 Tool for debugging (testing) command line of circuit board firmware
CN102567065A (en) * 2010-12-10 2012-07-11 北京旋极信息技术股份有限公司 Method for operating development tool of embedded computer system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8677198B2 (en) * 2009-03-04 2014-03-18 Alcatel Lucent Method and apparatus for system testing using multiple processors

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567065A (en) * 2010-12-10 2012-07-11 北京旋极信息技术股份有限公司 Method for operating development tool of embedded computer system
CN102402480A (en) * 2011-10-12 2012-04-04 吴华中 Tool for debugging (testing) command line of circuit board firmware

Also Published As

Publication number Publication date
CN102799528A (en) 2012-11-28

Similar Documents

Publication Publication Date Title
CN102375778B (en) Method and system for automatically testing digital signal processor (DSP)
CN111970267B (en) Data protocol conversion method and device, electronic equipment and storage medium
CN111752843B (en) Method, apparatus, electronic device and readable storage medium for determining influence surface
CN108334465A (en) Configuration method, device, equipment and the computer readable storage medium of communication interface
CN103164300A (en) Mobile terminal touch screen automatic testing method and device
CN102799528B (en) A kind of script debugging method for circuit board level test, device and system thereof
CN104239158A (en) Analysis engine for automatic analysis and error log linking
CN105094707A (en) Method and device for storing and reading data
CN104978258A (en) Software automation test method and system
CN107958365B (en) Material information changing method and device, storage medium and electronic equipment
CN102279749A (en) Method and equipment for merging codes
CN102495797A (en) Smart card testing device and method
CN111475192B (en) Method, device, storage medium and system for performing thermal augmentation on game server
CN105760289A (en) Debugging method and device of embedded system
CN107908407A (en) Compilation Method, device and terminal device
CN103905231A (en) Method and device for unified management of device types
CN103077062A (en) Method and device for detecting code change
CN108255602A (en) Task combined method and terminal device
KR20150061203A (en) Method for providing embedded software development tools for supporting embedded software development environment based on native building and apparatus thereof
CN106021101A (en) Method and device for testing mobile terminal
CN109947432A (en) Assembler processing method and relevant apparatus
CN108089870A (en) For repairing the method and apparatus of application
CN111651397B (en) Method and equipment for accessing peripheral module of PXIe
US10606569B2 (en) Declarative configuration elements
CN104572638A (en) Data reading and writing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20151209

Termination date: 20200712