CN108628731A - A kind of method and processing equipment of selection test instruction - Google Patents

A kind of method and processing equipment of selection test instruction Download PDF

Info

Publication number
CN108628731A
CN108628731A CN201710156359.1A CN201710156359A CN108628731A CN 108628731 A CN108628731 A CN 108628731A CN 201710156359 A CN201710156359 A CN 201710156359A CN 108628731 A CN108628731 A CN 108628731A
Authority
CN
China
Prior art keywords
segment
vector
instruction
feature
processing equipment
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
CN201710156359.1A
Other languages
Chinese (zh)
Other versions
CN108628731B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710156359.1A priority Critical patent/CN108628731B/en
Publication of CN108628731A publication Critical patent/CN108628731A/en
Application granted granted Critical
Publication of CN108628731B publication Critical patent/CN108628731B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Abstract

This application discloses a kind of method and processing equipment of selection test instruction, the time expended when causing emulator to test the test fragment to solve the problems, such as that multiple test fragments in the prior art due to screening are discrete is longer.This method includes:Instruction to be tested is split as multiple segments by processing equipment, and determines the number for including the instruction of each feature in each segment, and determines that each segment includes the average value of each feature instruction;And include the average value of each feature instruction according to number of each segment comprising the instruction of each feature and each segment, select N number of segment as test instruction in the M segment, wherein to include at least two continuous segments in N number of segment.The accuracy that can ensure the performance indicator for the instruction to be tested that the performance indicator subsequently through N number of segment determines in this way, reduces the number of emulator loading procedure, improves the testing efficiency of emulator.

Description

A kind of method and processing equipment of selection test instruction
Technical field
This application involves field of computer technology more particularly to a kind of methods and processing equipment of selection test instruction.
Background technology
In the design and development process that carry out large-scale program in research staff, it is often necessary to pass through the program of design imitative True device operation is tested, and the performance indicator of the program is then collected.For example, in design processor architectural framework, people is researched and developed Member tests the program of the processing body system structure of design, collects per clock cycle operating instruction number (Instruction Per Cycle, IPC), cache hit rate at different levels, energy consumption.
However, due in the design process of program, need repeatedly to be tested on emulator.And it is well known that operation When identical program, much longer than the run time that hardware platform needs of run time that emulator needs.Therefore this anti- Multiple test run, emulator, which is likely to require, to be expended several weeks or several months even longer time and could complete, and is seriously affected Program development process and efficiency.
Studies have shown that program is in the process of running, property indices can show apparent conditions of the current stage, because This, under the premise of ensureing the accuracy of performance indicator of finally obtained entire program as possible, research staff from simplify test The angle of program is set out, and obtains the performance indicator of entire program by the following method:
1), processor obtains the instruction stream of program to be tested, and determines the basic block (Basic for including in described instruction stream Block, BB) type;
2), instruction stream is cut into multiple segments (Interval) by the processor, and is determined in each segment comprising every It is vectorial (Basic Block Vector, BBV) to obtain the corresponding basic block of each segment for the number of kind BB;
3), the BBV of obtained each segment is carried out K mean values (K-Means) clustering processing by the processor, by what is obtained BBV points are multiclass, then filter out a BBV closest to such center in every class, final to determine multiple BBV pairs filtered out The test fragment answered;
4), emulator tests determining multiple test fragments successively, obtains the performance indicator of each test fragment;
5), the processor determines the proportion in the entire program per the corresponding segments of class BBV, that is, determines each survey The weight of the performance indicator of test piece section calculates each survey then according to the weight of the performance indicator of determining each test fragment The weighted sum of the performance indicator of test piece section, to obtain the performance indicator of the entire program.
In the above-mentioned methods, it screens to obtain test fragment using K-Means clustering methods due to the processor, To test fragment be discrete, i.e., the described emulator is when testing the multiple test fragment, the number of starts and the test The number of segment is identical;In addition, being consumed to memory since test fragment is loaded (Loading) by emulator in each start-up course The time taken is longer, and the time that emulator runs each test fragment consuming is less, in conclusion the emulator tests institute It is still longer to state the time that multiple test fragments expend.
Invention content
The application provides a kind of method and processing equipment of selection test instruction, to solve in the prior art due to screening The discrete time longer problem expended when emulator being caused to test the test fragment of multiple test fragments.
In a first aspect, this application provides a kind of method of selection test instruction, this approach includes the following steps:
After instruction to be tested is divided into M segment by processing equipment, each that each segment in the M segment includes is determined The number of feature instruction, and then determine the average value for each feature instruction that each segment includes in the M segment;Final institute Processing equipment is stated according to every in the number for each feature instruction that each segment includes in the M segment and the M segment The average value for each feature instruction that a segment includes, selection is N number of comprising at least two continuous segments in the M segment Segment is instructed as test, wherein M is the integer more than 1, and N is the integer more than 1 and less than M.
Since in the above-mentioned methods, it includes each feature that the processing equipment, which is according to each segment in the M segment, The average value of instruction selects N number of segment, therefore, the N number of segment selected by processing equipment described in the above method The distribution that feature instructs in (i.e. test instruction) is consistent with the distribution that feature in the instruction to be tested instructs, and then can ensure Subsequently through the accuracy of the performance indicator of the instruction to be tested of the performance indicator determination of N number of segment;And it is opposite In by traditional N number of discrete test fragment of method choice, due in N number of segment of processor selection comprising extremely Few two continuous segments, in this way, in subsequent test process, the number of emulator loading procedure reduces, therefore, this method The time that emulator tests N number of segment is can be reduced, the testing efficiency of emulator is improved.In conclusion this method It can ensure the accuracy of the performance indicator for the instruction to be tested that the performance indicator by N number of segment determines, and The time that emulator tests N number of segment can be reduced, the testing efficiency of emulator is improved.
In a possible design, the processing equipment can select institute by following steps in the M segment N number of segment is stated to instruct as the test:
The processing equipment selects the sum of run time to be less than preset first time threshold in the M segment, and The N number of segment for meeting first condition is instructed as the test;The first condition includes:N number of segment includes extremely Few two continuous fragments, and difference is small between the weighted sum and basis vector of the feature vector of all segments in N number of segment In preset first threshold value, wherein the feature vector of each segment is the number for each feature instruction that each segment includes The vector of composition, the basis vector are the average value composition for each feature instruction that each segment includes in the M segment Vector.
By the above method, the processing equipment in the M segment, can select the feature of the segment for including to Amount is distributed N number of segment that is similar with the distribution of feature vector in the M segment or being consistent, in this manner it is ensured that protecting The accuracy of the performance indicator for the instruction to be tested that card is determined subsequently through the performance indicator of N number of segment.
In a possible design, the processing equipment is by following steps, when selecting operation in the M segment Between be less than the first time threshold, and the N number of segment for meeting the first condition is instructed as the test:
Step a:The processing equipment initialization residual vector is the basis vector, and initializes subspace to be selected as institute There are the subspaces X-, wherein the subspaces X- are the feature vector composition of X segment of arbitrary continuation in the M segment Space, wherein X are the integer for being less than M more than 1;
Step b:The processing equipment is in subspace to be selected, the subspace of selection and the residual vector angle minimum, Determine projection vector of the residual vector in the subspace selected, and by the residual vector and the projection vector For difference as new residual vector, all subspaces after subspace to be selected is removed the subspace selected are empty as new son to be selected Between;
Step c:If the size of residual vector is less than the feature that all subspaces of the first threshold or selection include The sum of run time of the corresponding segment of vector is more than preset second time threshold, and the processing equipment is by all sons of selection The corresponding N number of segment of feature vector that space includes is instructed as the test;If the size of residual vector is not less than described The sum of run time of the corresponding segment of feature vector that all subspaces of first threshold and selection include is no more than described the Two time thresholds, the processing equipment return to step b;Wherein, the second time threshold is less than the first time threshold Value.
By the above method, N number of segment of the processing equipment selection includes at least one continuous X segment, this Sample can further decrease the number of emulator loading procedure, significantly reduce emulator in subsequent test process The time for testing N number of segment, improve the testing efficiency of emulator.
In a possible design, the second time threshold meets any one following condition:
The second time threshold is more than the difference of the first time threshold and maximum run time, when the maximum is run Between be the M segment run time in maximum value;
The second time threshold is more than the difference of the first time threshold and X times of minimum run time, the minimum Run time is the minimum value in the run time of the M segment;
The second time threshold is more than the difference of the first time threshold and the minimum run time.
The second time threshold is set by the above method, includes in all subspaces of selection in the processing equipment The sum of the run time of the corresponding segment of feature vector be more than the second time threshold in the case of, it is ensured that the place Reason equipment can not select subspace again, can stop the flow for selecting subspace.Because selecting subspace again, selection may result in The sum of all subspaces run time of the corresponding segment of feature vector for including be more than the first time threshold, be unsatisfactory for The sum of run time of N number of segment is less than the condition of the first time threshold.
In a possible design, the processing equipment can also be selected by following steps in the M segment Run time is less than the first time threshold, and the N number of segment for meeting the first condition is instructed as the test:
Step a1:The processing equipment initialization residual vector is the basis vector, and initializes subspace to be selected and be All subspaces X-, wherein the subspaces X- are the feature vector composition of X segment of arbitrary continuation in the M segment Space, wherein X be more than 1 be less than M integer;
Step b1:The processing equipment in the subspace to be selected, selection and the residual vector angle it is minimum the One subspace;
Step c1:The processing equipment determines second small with the residual vector angle time in the subspace to be selected Subspace;
Step d1:The processing equipment is empty by all sons behind the first subspace for removing selection in the subspace to be selected Between as new subspace to be selected, and in the following way, update the residual vector:
The related coefficient of institute directed quantity and the residual vector of the processing equipment in first subspace, and look for To the maximum target direction of related coefficient;The processing equipment determines object vector Y according to determining direction, the target to An endpoint for measuring Y divides Angle Position equally in first subspace and second subspace, another endpoint is described residual Difference vector and the first intersection subspace crunode;The processing equipment is using the difference of the residual vector and Y as newly residual Difference vector;
Step e1:If the size of residual vector is less than the feature that all subspaces of the first threshold or selection include The sum of run time of the corresponding segment of vector is more than preset second time threshold, and the processing equipment is by all sons of selection The corresponding N number of segment of feature vector that space includes is instructed as the test;If the size of residual vector is not less than described The sum of run time of the corresponding segment of feature vector that all subspaces of first threshold and selection include is no more than described the Two time thresholds, the processing equipment return to step b1;Wherein, the second time threshold is less than the first time threshold Value, and more than the difference of the first time threshold and maximum run time, the maximum run time is the fortune of the M segment Maximum value in the row time.
By the above method, N number of segment of the processing equipment selection includes at least one continuous X segment, this Sample can further decrease the number of emulator loading procedure, significantly reduce emulator in subsequent test process The time for testing N number of segment, improve the testing efficiency of emulator.
In a possible design, the processing equipment can also be selected by following steps in the M segment N number of segment is instructed as the test:
First, at least two continuous segments are as one group using in the M segment for the processing equipment, so that it is determined that S A segment group, wherein S is the integer more than 1 and less than M, and a segment is contained in S segment group in the M segment In one segment group;Then, the processing equipment determines the object vector of each segment group in the S segment group, wherein institute The object vector for stating any of S segment group segment group is that each feature that each segment includes in the segment group instructs The vector of average value composition;Finally, the processing equipment is in the S segment group, selection target vector and basis vector it Between difference be less than at least one segment group of default second threshold, and it is described N number of by include at least one segment group Segment is instructed as the test, and the basis vector is that each feature that each segment includes in the M segment instructs The vector of average value composition.
In the above-mentioned methods, the object vector of any one segment group can indicate special in all segments that the segment group includes The distribution situation of instruction is levied, it is therefore, every at least one segment group that the processing equipment is selected by the above method The distribution that feature instructs in the segment that a segment group includes to the distribution of feature vector in the M segment is similar or phase Symbol.Therefore, it selects N number of segment as test fragment by the above method, can not only improve the processing equipment selection Go out the speed of the test fragment, but also can ensure that the performance indicator subsequently through N number of segment waits for described in determining Test the accuracy of the performance indicator of instruction.
In a possible design, the feature instruction is the basic block for including in the M segment.
Second aspect, the embodiment of the present application also provides a kind of processing equipment, which, which has, realizes the above method The function of processing equipment in example.The function it is real can also to execute corresponding software by hardware realization by hardware It is existing.The hardware or software include one or more modules corresponding with above-mentioned function.
In a possible design, the structure of the processing equipment includes determination unit and processing unit, these lists Member can execute the corresponding function in above method example, referring specifically to the detailed description in method example, be not repeated herein.
In a possible design, the structure of the processing equipment includes processor and memory, the processor It is configured as that the processing equipment is supported to execute corresponding function in the above method.The memory is coupled with the processor, It preserves the necessary program instruction of the processor and data.
The third aspect, present invention also provides a kind of computer readable storage mediums, and above-mentioned first is executed for being stored as Computer software instructions used in the function of any one design of aspect, first aspect, it includes for executing above-mentioned first Program designed by the method for any one design of aspect, first aspect.
In the embodiment of the present application, instruction to be tested is divided into M segment by processing equipment, and is determined in each segment comprising every The number of kind feature instruction, so that it is determined that each segment includes the average value of each feature instruction;The processing equipment can root Include that each segment includes each in the number and the M segment that each feature instructs according to each segment in the M segment The average value of feature instruction, selects N number of segment to be instructed as test, wherein to be wrapped in N number of segment in the M segment Containing at least two continuous segments.In the embodiment of the present application, since the processing equipment is according to each in the M segment Segment includes that the average value of each feature instruction selects N number of segment, and therefore, the processing equipment selects described N number of The distribution that feature instructs in segment (i.e. test instruction) is consistent with the distribution of feature instruction in the instruction to be tested, and then can be with Ensure the accuracy of the performance indicator for the instruction to be tested that the performance indicator subsequently through N number of segment determines;And With respect to traditional N number of discrete test fragment of method choice, due to being wrapped in N number of segment of processor selection Containing at least two continuous segments, in this way, in subsequent test process, the number of emulator loading procedure reduces, therefore, this This method that application embodiment provides can be reduced the time that emulator tests N number of segment, improve the survey of emulator Try efficiency.Obviously, method provided by the embodiments of the present application, it is ensured that the institute determined by the performance indicator of N number of segment The accuracy of the performance indicator of instruction to be tested is stated, and the time that emulator tests N number of segment can be reduced, is improved imitative The testing efficiency of true device.
Description of the drawings
Fig. 1 is a kind of test system schematic provided by the embodiments of the present application;
Fig. 2 is a kind of method flow diagram of selection test instruction provided by the embodiments of the present application;
Fig. 3 is a kind of subspace schematic diagram provided by the embodiments of the present application;
Fig. 4 is a kind of schematic diagram of selection subspace provided by the embodiments of the present application;
Fig. 5 is a kind of schematic diagram with the maximum target direction of residual vector related coefficient provided by the embodiments of the present application;
Fig. 6 is a kind of schematic diagram of object vector provided by the embodiments of the present application;
Fig. 7 is a kind of structure chart of processing equipment provided by the embodiments of the present application;
Fig. 8 is the structure chart of another processing equipment provided by the embodiments of the present application.
Specific implementation mode
In order to keep the purpose, technical scheme and advantage of the application clearer, below in conjunction with attached drawing to the application make into One step it is described in detail.
The application provides a kind of method and processing equipment of selection test instruction, to solve in the prior art due to screening The discrete time longer problem expended when emulator being caused to test the test fragment of multiple test fragments.Wherein, method With device be based on same inventive concept, since the principle that method and apparatus solve the problems, such as is similar, apparatus and method Implementation can be with cross-reference, and overlaps will not be repeated.
In the embodiment of the present application, instruction to be tested is divided into M segment by processing equipment, and is determined in each segment comprising every The number of kind feature instruction, so that it is determined that each segment includes the average value of each feature instruction;The processing equipment can root Include that each segment includes each in the number and the M segment that each feature instructs according to each segment in the M segment The average value of feature instruction, selects N number of segment to be instructed as test, wherein to be wrapped in N number of segment in the M segment Containing at least two continuous segments.In the embodiment of the present application, since the processing equipment is according to each in the M segment Segment includes that the average value of each feature instruction selects N number of segment, and therefore, the processing equipment selects described N number of The distribution that feature instructs in segment (i.e. test instruction) is consistent with the distribution of feature instruction in the instruction to be tested, and then can be with Ensure the accuracy of the performance indicator for the instruction to be tested that the performance indicator subsequently through N number of segment determines;And With respect to traditional N number of discrete test fragment of method choice, due to being wrapped in N number of segment of processor selection Containing at least two continuous segments, in this way, in subsequent test process, the number of emulator loading procedure reduces, therefore, this This method that application embodiment provides can be reduced the time that emulator tests N number of segment, improve the survey of emulator Try efficiency.Obviously, method provided by the embodiments of the present application, it is ensured that the institute determined by the performance indicator of N number of segment The accuracy of the performance indicator of instruction to be tested is stated, and the time that emulator tests N number of segment can be reduced, is improved imitative The testing efficiency of true device.
Hereinafter, the part term in the application is explained, in order to those skilled in the art understand that.
This application involves instruction to be tested, and be properly termed as instruction stream, be a plurality of instruction in program operation process, should Instruction is generally assembly instruction.Cheng Qian is crossed in test program, needs the instruction to be tested for obtaining program to be tested;Emulator can To run the instruction to be tested of program to be tested, to obtain each performance indicator of program to be tested.
This application involves feature instruction, be instruction to be tested in instruction influential on performance indicator.Optionally, described Feature instruction is the specific instruction in the instruction to be tested, such as control instruction (such as jump instruction, interrupt instruction), or Feature instruction by two neighboring control instruction and between the basic block etc. that forms of all instructions, this application is not limited It is fixed.
This application involves segment or instruction to be tested performance indicator, to run setting for the segment or instruction to be tested The parameters such as standby IPC, cache hit rate at different levels (such as the second layer (L2) cache hit rate) or energy consumption.
It is multiple involved by the application, refer to two or more.
In addition, it is necessary to understand, in the description of the present application, the vocabulary such as " first ", " second " are only used for distinguishing description Purpose, be not understood to indicate or imply relative importance, can not be interpreted as instruction or hint sequence.
Scheme provided by the present application is specifically described below in conjunction with the accompanying drawings.
Fig. 1 shows the applicable test system of the method for selection test instruction provided by the embodiments of the present application, refering to fig. 1 institute Show, the test system includes processing equipment 101 and emulator 102.
During the test system is treated the corresponding instruction to be tested of test program and tested, the processing is set Standby 101 by the instruction to be tested for being split as M segment, and includes each in each segment in the determining M segment The number of feature instruction, so that it is determined that each segment includes the average value of each feature instruction in the M segment;And according to Each segment includes that each segment includes that each is special in the number and the M segment that each feature instructs in the M segment The average value for levying instruction selects N number of segment to be instructed as test in the M segment;Wherein, include in N number of segment At least two continuous segment M are the integer more than 1, and N is the integer more than 1 and less than M;
The emulator 102 is used to test the test instruction that the processing equipment is chosen, to obtain The performance indicator of the test instruction.
Optionally, the processing equipment 101 can also refer to according to the test instruction performance that the emulator 102 obtains Mark, obtains the performance indicator of the instruction to be tested.
Wherein, the processing equipment 101 can be the equipment such as computer or integrated circuit.The emulator 102 can be Simulator or software simulator are not construed as limiting this application.
In the test system provided by the embodiments of the present application, since the processing equipment 101 is according to the M piece Each segment includes that the average value of each feature instruction selects N number of segment in section, and therefore, the processing equipment 101 is selected The distribution phase that the distribution that feature instructs in the N number of segment (i.e. test instruction) selected is instructed with feature in the instruction to be tested Symbol, and then can ensure the performance indicator for the instruction to be tested that the performance indicator subsequently through N number of segment determines Accuracy;And with respect to traditional N number of discrete test fragment of method choice, described in processor selection Include at least two continuous segments in N number of segment, in this way, in subsequent test process, the number of emulator loading procedure It reduces, therefore, this method provided by the embodiments of the present application can be reduced the time that emulator tests N number of segment, improve The testing efficiency of emulator.Obviously, test system provided by the embodiments of the present application can ensure the property by N number of segment The accuracy of the performance indicator for the instruction to be tested that energy index determines, and described N number of of emulator test can be reduced The time of section, improve the testing efficiency of emulator.
The embodiment of the present application provides a kind of method of selection test instruction, and this method is suitable for test shown in FIG. 1 System, the invention relates to processing equipment can be the test system in processing equipment 101.As shown in fig.2, should The flow of method includes:
S201:Instruction to be tested is split as M segment by processing equipment, and M is the integer more than 1.
Optionally, the instruction to be tested can be stored in the form of multiple instruction stream file, i.e., described to be tested Instruction can be stored in multiple instruction stream file.Therefore, the processing equipment, can be to store the institute when executing S201 The instruction stream file for stating instruction to be tested is that unit splits the instruction to be tested, i.e., will be stored in each instruction stream file Instruction is used as a segment.
S202:The processing equipment determines the number for including the instruction of each feature in each segment in the M segment.
Optionally, the feature instruction is a variety of basic for include in the M segment (or in described instruction to be tested) Block or various control instruction.In the embodiment of the present application, it is only illustrated so that feature instruction is basic block as an example.
Optionally, feature instruction can be that tester is preset or the processing equipment is according to described to be measured Examination instruction determination.
For example, the processing equipment is by the following method, a variety of basic blocks are determined according to the instruction to be tested:
The processing equipment determines all basic blocks for including in the instruction to be tested, and using identical basic block as One kind, which is realized, classifies to determining all basic blocks, so that it is determined that a variety of basic blocks.
S203:The processing equipment determines the average value that each segment includes the instruction of each feature in the M segment.
Example 1, instruction to be tested are divided into 3 segments, and the feature instruction for including in the instruction to be tested is 5 kinds, and processing is set It is standby to determine that each segment separately includes the number that the 1st kind instructs to the 5th kind of feature and is:Segment 1:{ 0,2,0,4,5 }, segment 2: { 1,3,5,4,0 }, segment 3:{ 2,1,0,4,2 }, then each segment includes the average value of each feature instruction in 3 segments For { 1,2,5/3,4,7/3 }.
It, can be by the M piece since feature instruction has an impact the performance indicator of the instruction to be tested Section (the i.e. described instruction to be tested) in each feature instruction distribution situation as benchmark, thereby may be ensured that select with it is described The distribution situation that each feature instructs in M segment is the most similar or N number of segment for being consistent is instructed as test, and then after ensureing The accuracy of the performance indicator for the instruction to be tested that the continuous performance indicator by N number of segment determines.In the application reality It applies in example, the distribution situation that each feature instructs in the M segment can include every by each segment in the M segment The average value of kind feature instruction indicates.
S204:The processing equipment is according to number and the institute that each segment in the M segment includes the instruction of each feature The average value that each segment in M segment includes the instruction of each feature is stated, selects N number of segment as survey in the M segment Examination instruction, N number of segment include at least two continuous segments, wherein N is the integer more than 1 and less than M.
The processing equipment can select N number of segment, and ensure institute by a variety of methods in the M segment The distribution that the distribution that feature instructs in N number of segment is instructed with the M segment characterizations is stated to be consistent.Wherein, special in the M segment The distribution situation for levying instruction, can be indicated by basis vector.The basis vector includes every by each segment in the M segment The average value composition of kind feature instruction, for example, each segment includes that the average value of each feature instruction is in the M segment { 1,2,5/3,4,7/3 } in example 1, then the basis vector is [1,2,5/3,4,7/3] or [1,2,5/3,4,7/3]T
Optionally, the processing equipment can select N number of segment with by the following method one in the M segment It is instructed as the test, including:
The processing equipment selects the sum of run time to be less than preset first time threshold in the M segment, and The N number of segment for meeting first condition is instructed as the test;
The first condition includes:N number of segment includes at least two continuous fragments, and is owned in N number of segment Difference is less than preset first threshold value between the weighted sum and basis vector of the feature vector of segment.
Wherein, the feature vector of each segment be each segment include each feature instruction number composition to Amount, illustrates by taking the segment 1 in example 1 as an example, and the number comprising the instruction of each feature in segment 1 is { 0,2,0,4,5 }, then The feature vector of segment 1 is [0,2,0,4,5], or [0,2,0,4,5]T
The first threshold is to be arranged according to specific test scene, when the first threshold value is smaller, the place The distribution that feature instructs in N number of segment that reason equipment is selected in the above-mentioned methods refers to the feature in the M segment The distribution of order is more similar.
Optionally, the run time of each segment can be processing equipment prediction in the M segment.It is optional , the processing equipment can be considered the instruction of each segment item number, instruction the characteristics of and emulator working performance etc. At least one of, the run time of each segment is predicted, this embodiment of the present application is not construed as limiting.
In the above-mentioned methods, the distribution situation that feature instructs in N number of segment can be by all in N number of segment The weighted sum of the feature vector of section indicates.Due to the weighted sum of the feature vector of all segments in N number of segment and the base Difference between this vector is less than the first threshold, i.e., in described N number of segment the weighted sum of the feature vector of all segments with The basis vector fitting, therefore, point of the distribution of feature vector and feature vector in the M segment in N number of segment Cloth is similar or is consistent.Therefore, select N number of segment as test fragment by the above method, it is ensured that subsequently through institute State the accuracy of the performance indicator of the instruction to be tested of the performance indicator determination of N number of segment.
In the above-mentioned methods, with respect to traditional N number of discrete test fragment of method choice, due to the processor Include at least two continuous segments in N number of segment of selection, in this way, in subsequent test process, continuous segment It can once be loaded into emulator, due to the working characteristics of emulator, the emulator is once used in one segment of load Load time is close with load time used in multiple segments is once loaded, but the load time used is longer every time, therefore This method can be such that the number of emulator loading procedure reduces, so as to reduce emulator test N number of segment when Between, improve the testing efficiency of emulator.
In addition, in the method, the sum of run time of N number of segment of the processing equipment selection is less than described the One time threshold can ensure that the emulator is testing the time of N number of segment in the first time threshold model in this way In enclosing, the phenomenon for causing the testing time long is avoided.
In the above method one, when the processing equipment selects run time to be less than described first in the M segment Between threshold value, and the N number of segment for meeting the first condition is instructed as the test, i.e., the described processing equipment selection includes All segments feature vector the fitting of weighted sum and the basis vector N number of segment.Optionally, the processing is set It is standby N number of segment to be selected in the M segment by subspace regression algorithm.
Optionally, this application provides a kind of methods selecting N number of segment using subspace regression algorithm, specific to wrap Include following steps:
Step a:The processing equipment initialization residual vector is the basis vector, and initializes subspace to be selected as institute There are the subspaces X-, wherein the subspaces X- are the feature vector composition of X segment of arbitrary continuation in the M segment Space, wherein X are the integer for being less than M more than 1;
Step b:For the processing equipment in the subspace to be selected, the selection son minimum with the residual vector angle is empty Between, determine projection vector of the residual vector in the subspace selected, and by the residual vector with it is described project to The difference of amount is as new residual vector, and all subspaces after subspace to be selected is removed the subspace selected are as newly to be selected Subspace;
Step c:If the size of residual vector is less than the feature that all subspaces of the first threshold or selection include The sum of run time of the corresponding segment of vector is more than preset second time threshold, and the processing equipment is by all sons of selection The corresponding N number of segment of feature vector that space includes is instructed as the test;If the size of residual vector is not less than described The sum of run time of the corresponding segment of feature vector that all subspaces of first threshold and selection include is no more than described the Two time thresholds, the processing equipment return to step b;Wherein, the second time threshold is less than the first time threshold Value.
Optionally, the second time threshold is more than the difference of the first time threshold and maximum run time, it is described most Big run time is the maximum value in the run time of the M segment, or
The second time threshold is more than the difference of the first time threshold and X times of minimum run time, the minimum Run time is the minimum value in the run time of the M segment, or
The second time threshold is more than the difference of the first time threshold and the minimum run time.
The second time threshold is set by the above method, includes in all subspaces of selection in the processing equipment The sum of the run time of the corresponding segment of feature vector be more than the second time threshold in the case of, it is ensured that the place Reason equipment can not select subspace again, can stop the flow for selecting subspace.Because selecting subspace again, selection may result in The sum of all subspaces run time of the corresponding segment of feature vector for including be more than the first time threshold, be unsatisfactory for The sum of run time of N number of segment is less than the condition of the first time threshold.
According to the Vector Theory in art of mathematics it is found that the processing equipment selection any sub-spaces on projection to Amount is the weighted sum for the X feature vector that the subspace includes, and in the above-mentioned methods, all sons of the processing equipment selection The size of difference is less than the first threshold, i.e., the described processing between the sum of projection vector spatially, with the basis vector The weighted sum of all subspaces X feature vector (feature vector of N number of segment) for including of equipment selection and it is described substantially to Difference is less than the first threshold between amount.
By the above method, N number of segment of the processing equipment selection includes at least one continuous X segment, this Sample can further decrease the number of emulator loading procedure, significantly reduce emulator in subsequent test process The time for testing N number of segment, improve the testing efficiency of emulator.
Wherein, in the above-mentioned methods, X be can continuous segment number, X can have according to the demand of specific test scene Body is arranged, and can improve the degree of freedom of the processing equipment selection continuous fragment in this way.
Optionally, before step a, the processing equipment can determine all subspaces X- by the following method, packet It includes:
The processing equipment is divided into the M segment one group per continuous X segment, generates multigroup segment;
The feature vector group for X segment for including in every group of segment is become a subspace X- by the processing equipment.
Since in art of mathematics, vector can be a directive line, multiple vectors can determine a plane, because This, in the embodiment of the present application, the corresponding subspaces the X- planar representation determined by X feature vector of one group of segment.Such as Fig. 3 It is shown, include two segments in certain group segment, the feature vector of one of segment is a1, and the feature vector of another segment is A2, in this way the two vectors can determine a plane C1, which is subspace.
Optionally, based on principle same as mentioned above, the processing equipment can also select institute by following steps State N number of segment:
Step 1:The processing equipment initialization residual vector is the basis vector, and initializes subspace to be selected as institute There are the subspaces X-, wherein the subspaces X- are the feature vector composition of X segment of arbitrary continuation in the M segment Space, wherein X are the integer for being less than M more than 1;
Step 2:For the processing equipment in the subspace to be selected, the selection son minimum with the residual vector angle is empty Between, determine projection vector of the residual vector in the subspace selected, and by the residual vector with it is described project to The difference of amount is as new residual vector, and all subspaces after subspace to be selected is removed the subspace selected are as newly to be selected Subspace;
Step 3:If the size of residual vector is less than the first threshold, and the feature that all subspaces selected include The sum of the run time of the corresponding segment of vector is less than the first time threshold, and the processing equipment returns to step 2;Such as The size of fruit residual vector is not less than the corresponding segment of feature vector that all subspaces of the first threshold or selection include The sum of run time be not less than the first time threshold, the processing equipment abandons the subspace of this selection, by this The corresponding N number of segment of feature vector that all subspaces selected before include is instructed as the test.
Example 2, the processing equipment initialization residual vector R is basis vector B, and it is all 2- to initialize subspace to be selected Space.Since subspace can be understood as a plane, vector can be understood as a straight line.The processing equipment is in selection When space, as shown in figure 4, the processing equipment firstly the need of determine most be fitted with R subspace (i.e. with the son of R angle minimums Space), it is assumed that the subspace is C1.At this point, the processing equipment can determine C1In include two feature vectors corresponding 2 A segment can be used as test fragment, and continue to update the residual vector and the subspace to be selected, and continue to select sub- sky Between, until the size of the residual vector of final updating is less than the first threshold, or the run time of test fragment selected The sum of be more than the second time threshold.Wherein, the processing equipment is in selection C1Afterwards, it is R-U to update the residual vector, more The new subspace to be selected is to remove C in subspace to be selected1All subspaces afterwards.
Optionally, the embodiment of the present application also provides another kinds selects N number of segment using subspace regression algorithm Method specifically includes following steps:
Step a1:The processing equipment initialization residual vector is the basis vector, and initializes subspace to be selected and be All subspaces X-, wherein the subspaces X- are the feature vector composition of X segment of arbitrary continuation in the M segment Space, wherein X be more than 1 be less than M integer;
Step b1:The processing equipment in the subspace to be selected, selection and the residual vector angle it is minimum the One subspace;
Step c1:The processing equipment determines second small with the residual vector angle time in the subspace to be selected Subspace;
Step d1:The processing equipment is empty by all sons behind the first subspace for removing selection in the subspace to be selected Between as new subspace to be selected, and in the following way, update the residual vector:
The related coefficient of institute directed quantity and the residual vector of the processing equipment in first subspace, and look for To the maximum target direction of related coefficient, as shown in Figure 5;The processing equipment determines object vector Y according to determining direction, An endpoint of the object vector Y divides Angle Position U equally first subspace and second subspace, another end Point is the residual vector and the first intersection subspace crunode, as shown in Figure 6;The processing equipment is by the residual vector Difference with Y is as new residual vector;
Step e1:If the size of residual vector is less than the feature that all subspaces of the first threshold or selection include The sum of run time of the corresponding segment of vector is more than preset second time threshold, and the processing equipment is by all sons of selection The corresponding N number of segment of feature vector that space includes is instructed as the test;If the size of residual vector is not less than described The sum of run time of the corresponding segment of feature vector that all subspaces of first threshold and selection include is no more than described the Two time thresholds, the processing equipment return to step b1;Wherein, the setting of the second time threshold is with method one, this Place repeats no more.
By the above method, the processing equipment, which can also be selected accurately in the M segment, meets above two N number of segment of a condition.
It is according to the Vector Theory in art of mathematics it is found that any one in any sub-spaces of processing equipment selection A vector is the weighted sum for the X feature vector that the subspace includes, and in the above-mentioned methods, the institute of the processing equipment selection There is the sum of the object vector on subspace, the size of difference is less than the first threshold between the basis vector, i.e., described The weighted sum for the X feature vector (feature vector of N number of segment) that all subspaces of processing equipment selection include and the base Difference is less than the first threshold between this vector.
Optionally, the processing equipment can select N number of segment with by the following method two in the M segment It is instructed as the test, including:
The processing equipment determines S segment group in the M segment, wherein S is the integer more than 1 and less than M, Each segment group includes at least two continuous segments in the S segment group, and a segment is contained in S in the M segment In a segment group in a segment group;
The processing equipment is in the S segment group, and difference is less than default between selection target vector and basis vector At least one segment group of second threshold, and using the N number of segment for including at least one segment group as the survey Examination instruction;Wherein, each segment includes in the object vector segment group of any of described S segment group segment group Each feature instruction average value composition vector, the basis vector be the M segment in each segment include each The vector of the average value composition of feature instruction.
Wherein, the second threshold is to be arranged according to specific test scene, when the second threshold value is smaller, institute State the distribution and the spy in the M segment that feature in N number of segment that processing equipment is selected in the above-mentioned methods instructs The distribution for levying instruction is more similar.
In the above-mentioned methods, the object vector of any one segment group can indicate special in all segments that the segment group includes The distribution situation of instruction is levied, it is therefore, every at least one segment group that the processing equipment is selected by the above method The distribution that feature instructs in the segment that a segment group includes to the distribution of feature vector in the M segment is similar or phase Symbol.Therefore, it selects N number of segment as test fragment by the above method, can not only improve the processing equipment selection Go out the speed of the test fragment, but also can ensure that the performance indicator subsequently through N number of segment waits for described in determining Test the accuracy of the performance indicator of instruction.
Below with specific example, the test for using conventional methods with method choice provided by the embodiments of the present application is referred to The simulation time of order is compared.
Example 3, it is assumed that the primary test instruction of emulator load (loads a discrete segment, or loads simultaneously several Continuous segment) needed for load time be 25 minutes, and it is 1 minute to run the run time needed for primary segment to be tested.
Processing equipment use K-Means clustering methods, selected in multiple segments test instruction in comprising 24 from Under the scene of scattered test fragment, the emulator tests the total time S=25*24 needed for 24 discrete test fragments + 1*24=624 minutes;
Method provided by the embodiments of the present application is used in the processing equipment, the test instruction packet selected in multiple segments Containing 6 groups of segments, and under scene of the 6 groups of segment groups comprising 24 segments, the emulator is tested needed for 6 groups of segments Total time S=25*6+1*24=174 minute.
It can be seen by comparing above, equal number of test fragment is being selected by two methods in the processing equipment In the case of, it is tested and is instructed using method choice provided by the embodiments of the present application, the emulator can be substantially reduced and test the survey Try the total time of instruction.
In the embodiment of the present application, include each since the processing equipment is according to each segment in the M segment The average value of feature instruction selects N number of segment, and therefore, (i.e. test refers to N number of segment of the processing equipment selection Enable) in feature instruct distribution in the instruction to be tested feature instruction distribution be consistent, and then can ensure subsequently through The accuracy of the performance indicator for the instruction to be tested that the performance indicator of N number of segment determines;And with respect to biography The N number of discrete test fragment of method choice of system, due to connecting comprising at least two in N number of segment of processor selection Continuous segment, in this way, in subsequent test process, the number of emulator loading procedure reduces, and therefore, the embodiment of the present application carries This method of confession can be reduced the time that emulator tests N number of segment, improve the testing efficiency of emulator.Obviously, Method provided by the embodiments of the present application, it is ensured that the instruction to be tested determined by the performance indicator of N number of segment Performance indicator accuracy, and the time that emulator tests N number of segment can be reduced, improve the test effect of emulator Rate.
Method in the processing equipment is using above-described embodiment, selects N number of segment in the M segment After being instructed as test, emulator can carry out Q test to N number of segment of selection, and test every time needs emulator will One discrete segment or one group of segment (including at least two continuous segments) are loaded into memory and run, described to obtain The performance indicator (performance indicator of each discrete segment and every group of segment in N number of segment) of N number of segment;Wherein, Q is big In 1 and less than N integer.
Optionally, the processing equipment can with but be not limited to following methods, according in N number of segment each from The performance indicator of scattered segment and every group of segment obtains the performance indicator of the instruction to be tested:
The processing equipment can obtain the performance indicator of each discrete segment and every group of segment in N number of segment Weight, the performance indicator of each discrete segment in N number of segment is then multiplied by corresponding weight respectively, and by institute The performance indicator for stating every group of segment in N number of segment is multiplied by corresponding weight, and obtained result of calculation is added as described to be measured Try the performance indicator of instruction;Or
The processing equipment determines the quotient of M and N, and determines all discrete segments and all pack in N number of segment The summation of the performance indicator of section, and by the product of the summation and the quotient, the performance indicator as the instruction to be tested.
Wherein, the weight of the performance indicator of each discrete segment and every group of segment can be to survey in N number of segment What examination personnel setting the or described processing equipment determined, the application is not construed as limiting this.
By the above method, the processing equipment can accurately according to N number of segment of selection be can index obtain To the performance indicator of the instruction to be tested.
Based on inventive concept same as embodiment of the method, present invention also provides a kind of processing equipment, the processing is set It is ready for use on the method for realizing selection test instruction shown in Fig. 2, as shown in fig. 7, the processing equipment 700 includes:Determination unit 701 And processing unit 702, wherein
Determination unit 701, for instruction to be tested to be divided into M segment, wherein M is the integer more than 1;And
Determine the number for each feature instruction that each segment includes in the M segment;And
Determine the average value for each feature instruction that each segment includes in the M segment;
Processing unit 702, the number for being instructed according to each feature that each segment includes in the M segment and institute The average value for stating the instruction of each segment includes in M segment each feature, selected in the M segment N number of segment as Test instruction, N number of segment include at least two continuous segments, and wherein N is the integer more than 1 and less than M.
Optionally, the processing unit 702, is specifically used for:
It selects the sum of run time to be less than preset first time threshold in the M segment, and meets first condition N number of segment instructed as the test;
The first condition includes:N number of segment includes at least two continuous fragments, and is owned in N number of segment Difference is less than preset first threshold value between the weighted sum and basis vector of the feature vector of segment, wherein the feature of each segment Vector is the vector of the number composition for each feature instruction that each segment includes, and the basis vector is the M piece The vector of the average value composition for each feature instruction that each segment includes in section.
Optionally, the processing unit 702 selects run time to be less than the first time threshold in the M segment Value, and when the N number of segment for meeting the first condition instruct as the test, specifically for execution step:
Step a:Initialization residual vector is the basis vector, and it is all subspaces X- to initialize subspace to be selected, Wherein, the subspaces X- are the space of the feature vector composition of X segment of arbitrary continuation in the M segment, and wherein X is It is less than the integer of M more than 1;
Step b:In subspace to be selected, the subspace of selection and the residual vector angle minimum determines the residual error Projection vector of the vector in the subspace selected, and by the difference of the residual vector and the projection vector as newly residual Difference vector, all subspaces after subspace to be selected is removed the subspace selected are as new subspace to be selected;
Step c:If the size of residual vector is less than the feature that all subspaces of the first threshold or selection include The sum of the run time of the corresponding segment of vector is more than preset second time threshold, the spy for including by all subspaces of selection The corresponding N number of segment of sign vector is instructed as the test;If the size of residual vector is not less than the first threshold and choosing The sum of run time of the corresponding segment of feature vector that all subspaces selected include is not more than the second time threshold, returns Receipt row step b;Wherein, the second time threshold is less than the first time threshold.
Optionally, the processing unit 702, is specifically used for:
In the M segment, S segment group is determined, wherein S is the integer more than 1 and less than M, the S segment Each segment group includes at least two continuous segments in group, and a segment is contained in S segment group in the M segment In one segment group;
In the S segment group, difference is less than default second threshold extremely between selection target vector and basis vector A few segment group, and the N number of segment for including at least one segment group is instructed as the test;Wherein, The object vector of any of S segment group segment group is each feature instruction that each segment includes in the segment group Average value composition vector, the basis vector is putting down for each feature instruction that each segment includes in the M segment The vector of mean value composition.
Optionally, the feature instruction is the basic block for including in the M segment.
In the embodiment of the present application, include each since the processing equipment is according to each segment in the M segment The average value of feature instruction selects N number of segment, and therefore, (i.e. test refers to N number of segment of the processing equipment selection Enable) in feature instruct distribution in the instruction to be tested feature instruction distribution be consistent, and then can ensure subsequently through The accuracy of the performance indicator for the instruction to be tested that the performance indicator of N number of segment determines;And with respect to biography The N number of discrete test fragment of method choice of system, due to connecting comprising at least two in N number of segment of processor selection Continuous segment, in this way, in subsequent test process, the number of emulator loading procedure reduces, and therefore, the embodiment of the present application carries The processing equipment supplied can be reduced the time that emulator tests N number of segment, improve the testing efficiency of emulator. Obviously, the processing equipment provided by the embodiments of the present application, it is ensured that the institute determined by the performance indicator of N number of segment The accuracy of the performance indicator of instruction to be tested is stated, and the time that emulator tests N number of segment can be reduced, is improved imitative The testing efficiency of true device.
It is schematical, only a kind of division of logic function to the division of module in the embodiment of the present application, it is practical to realize When there may be another division manner, in addition, each function module in each embodiment of the application can be integrated at one Manage device in, can also be to physically exist alone, can also two or more modules be integrated in a module.It is above-mentioned integrated Module both may be used hardware form realize, can also be realized in the form of software function module.
Wherein, when integrated module is realized in the form of hardware, as shown in figure 8, processing equipment 800 may include place Manage device 801 and memory 802.The hardware of the corresponding entity of above-mentioned module can be the processor 801.The processor 801, It can be a central processing module (Central Processing Unit, CPU), or be digital signal processing module etc..Institute Memory 802 is stated, the program for storing the execution of the processor 801.The memory 802 can be non-volatile memories Device, such as hard disk (Hard Disk Drive, HDD) or solid state disk (Solid-State Drive, SSD) etc., can also be Volatile memory (volatile memory), such as random access memory (Random-Access Memory, RAM).Institute It states memory 802 and can also be and can be used in carrying or store the program code with instruction or data structure form and can be by Any other medium of computer access, but not limited to this.
The processor 801 is used to execute the program code of the storage of memory 802, is specifically used for executing shown in Fig. 2 and implement Method described in example.The method described in embodiment illustrated in fig. 2 is may refer to, details are not described herein by the application.
Optionally, the processing equipment 800 provided by the embodiments of the present application can also include communication interface 803, described logical Letter interface 803 with other equipment (such as emulator) for being communicated.
The communication interface 803, the processor 801 and the memory 802 are not limited in the embodiment of the present application Between specific connection medium.The embodiment of the present application is connect with the processor 801, the memory 802 and communication in fig. 8 It is connected by bus 804 between mouth 803, bus 804 is indicated with thick line in fig. 8, and the connection type between other components is only It is schematically illustrated, is not regarded it as and be limited.The bus 804 can be divided into address bus, data/address bus, controlling bus etc.. For ease of indicating, only indicated with a thick line in Fig. 8, it is not intended that an only bus or a type of bus.
The embodiment of the present invention additionally provides a kind of computer readable storage medium, and above-mentioned processor institute is executed for being stored as The computer software instructions that need to be executed, it includes for executing the program executed needed for above-mentioned processor.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application Apply the form of example.Moreover, the application can be used in one or more wherein include computer usable program code computer The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of product.
The application be with reference to according to the present processes, equipment (system) and computer program product flow chart and/or Block diagram describes.It should be understood that each flow that can be realized by computer program instructions in flowchart and/or the block diagram and/or The combination of flow and/or box in box and flowchart and/or the block diagram.These computer program instructions can be provided to arrive All-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices processor to generate one Machine so that the instruction executed by computer or the processor of other programmable data processing devices generates flowing The device for the function of being specified in one flow of journey figure or multiple flows and/or one box of block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a box or multiple boxes.
Obviously, those skilled in the art can carry out the application essence of the various modification and variations without departing from the application God and range.In this way, if these modifications and variations of the application belong to the range of the application claim and its equivalent technologies Within, then the application is also intended to include these modifications and variations.

Claims (11)

1. a kind of method of selection test instruction, which is characterized in that the method includes:
Instruction to be tested is divided into M segment by processing equipment, wherein M is the integer more than 1;
The processing equipment determines the number for each feature instruction that each segment includes in the M segment;
The processing equipment determines the average value for each feature instruction that each segment includes in the M segment;
Number and the M piece of the processing equipment according to each feature instruction that each segment includes in the M segment The average value for each feature instruction that each segment includes in section, selects N number of segment to refer to as test in the M segment It enables, N number of segment includes at least two continuous segments, wherein N is the integer more than 1 and less than M.
2. according to the method described in claim 1, it is characterized in that, the processing equipment is according to each piece in the M segment The average value for each feature instruction that each segment includes in the number and the M segment of each feature instruction that section includes, N number of segment is selected to be instructed as the test in the M segment, including:
The processing equipment selects the sum of run time to be less than preset first time threshold in the M segment, and meets N number of segment of first condition is instructed as the test;
The first condition includes:N number of segment includes at least two continuous fragments, and all segments in N number of segment Feature vector weighted sum and basis vector between difference be less than preset first threshold value, wherein the feature vector of each segment The vector of the number composition for each feature instruction for including for each segment, the basis vector are in the M segment The vector of the average value composition for each feature instruction that each segment includes.
3. method according to claim 2, which is characterized in that when the processing equipment selects operation in the M segment Between be less than the first time threshold, and the N number of segment for meeting the first condition is instructed as the test, including:
Step a:The processing equipment initialization residual vector is the basis vector, and it is all X- to initialize subspace to be selected Subspace, wherein the subspaces X- are the space of the feature vector composition of X segment of arbitrary continuation in the M segment, Wherein X is the integer for being less than M more than 1;
Step b:In subspace to be selected, the subspace of selection and the residual vector angle minimum determines the processing equipment Projection vector of the residual vector in the subspace selected, and the difference of the residual vector and the projection vector is made For new residual vector, all subspaces after subspace to be selected is removed the subspace selected are as new subspace to be selected;
Step c:If the size of residual vector is less than the feature vector that all subspaces of the first threshold or selection include The sum of run time of corresponding segment is more than preset second time threshold, and the processing equipment is by all subspaces of selection Including the corresponding N number of segment of feature vector instructed as the test;If the size of residual vector is not less than described first When the sum of run time of the corresponding segment of feature vector that all subspaces of threshold value and selection include is not more than described second Between threshold value, the processing equipment returns to step b;Wherein, the second time threshold is less than the first time threshold.
4. according to the method described in claim 1, it is characterized in that, the processing equipment is according to each piece in the M segment The average value for each feature instruction that each segment includes in the number and the M segment of each feature instruction that section includes, N number of segment is selected to be instructed as the test in the M segment, including:
The processing equipment determines S segment group in the M segment, wherein S is the integer more than 1 and less than M, described Each segment group includes at least two continuous segments in S segment group, and a segment is contained in the S in the M segment In a segment group in a segment group;
The processing equipment is in the S segment group, and difference is less than default second between selection target vector and basis vector At least one segment group of threshold value, and refer to the N number of segment for including at least one segment group as the test It enables;Wherein, the object vector of any of described S segment group segment group be in the segment group each segment include each The vector of the average value composition of feature instruction, the basis vector are each feature that each segment includes in the M segment The vector of the average value composition of instruction.
5. according to claim 1-4 any one of them methods, which is characterized in that the feature instruction is in the M segment Including basic block.
6. a kind of processing equipment, which is characterized in that including:
Determination unit, for instruction to be tested to be divided into M segment, wherein M is the integer more than 1;And
Determine the number for each feature instruction that each segment includes in the M segment;And
Determine the average value for each feature instruction that each segment includes in the M segment;
Processing unit, the number for being instructed according to each feature that each segment includes in the M segment and the M piece The average value for each feature instruction that each segment includes in section, selects N number of segment to refer to as test in the M segment It enables, N number of segment includes at least two continuous segments, and wherein N is the integer more than 1 and less than M.
7. processing equipment according to claim 6, which is characterized in that the processing unit is specifically used for:
It selects the sum of run time to be less than preset first time threshold in the M segment, and meets the institute of first condition N number of segment is stated to instruct as the test;
The first condition includes:N number of segment includes at least two continuous fragments, and all segments in N number of segment Feature vector weighted sum and basis vector between difference be less than preset first threshold value, wherein the feature vector of each segment The vector of the number composition for each feature instruction for including for each segment, the basis vector are in the M segment The vector of the average value composition for each feature instruction that each segment includes.
8. processing equipment according to claim 7, which is characterized in that the processing unit selects fortune in the M segment The row time is less than the first time threshold, and when the N number of segment for meeting the first condition is instructed as the test, Specifically for executing step:
Step a:Initialization residual vector is the basis vector, and it is all subspaces X- to initialize subspace to be selected, wherein The subspaces X- are the space of the feature vector composition of X segment of arbitrary continuation in the M segment, and wherein X is more than 1 Integer less than M;
Step b:In subspace to be selected, the subspace of selection and the residual vector angle minimum determines the residual vector Projection vector in the subspace selected, and using the difference of the residual vector and the projection vector as new residual error to Amount, all subspaces after subspace to be selected is removed the subspace selected are as new subspace to be selected;
Step c:If the size of residual vector is less than the feature vector that all subspaces of the first threshold or selection include The sum of run time of corresponding segment be more than preset second time threshold, the feature for including by all subspaces of selection to Corresponding N number of segment is measured to instruct as the test;If the size of residual vector not less than the first threshold and selection The sum of run time for the corresponding segment of feature vector that all subspaces include is not more than the second time threshold, and return is held Row step b;Wherein, the second time threshold is less than the first time threshold.
9. processing equipment according to claim 6, which is characterized in that the processing unit is specifically used for:
In the M segment, S segment group is determined, wherein S is the integer more than 1 and less than M, in the S segment group Each segment group includes at least two continuous segments, and a segment is contained in one in S segment group in the M segment In segment group;
In the S segment group, difference is less than at least the one of default second threshold between selection target vector and basis vector A segment group, and the N number of segment for including at least one segment group is instructed as the test;Wherein, the S The object vector of any of a segment group segment group is the flat of each feature instruction that each segment includes in the segment group The vector of mean value composition, the basis vector are the average value for each feature instruction that each segment includes in the M segment The vector of composition.
10. according to claim 6-9 any one of them processing equipments, which is characterized in that the feature instruction is the M piece The basic block for including in section.
11. a kind of processing equipment, which is characterized in that the processing equipment includes:Processor, bus and memory, feature It is,
The memory is connected with the memory by the bus;
The processor calls the instruction being stored in the memory, perform claim to require 1-5 any one of them methods.
CN201710156359.1A 2017-03-16 2017-03-16 Method for selecting test instruction and processing equipment Expired - Fee Related CN108628731B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710156359.1A CN108628731B (en) 2017-03-16 2017-03-16 Method for selecting test instruction and processing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710156359.1A CN108628731B (en) 2017-03-16 2017-03-16 Method for selecting test instruction and processing equipment

Publications (2)

Publication Number Publication Date
CN108628731A true CN108628731A (en) 2018-10-09
CN108628731B CN108628731B (en) 2020-12-22

Family

ID=63686550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710156359.1A Expired - Fee Related CN108628731B (en) 2017-03-16 2017-03-16 Method for selecting test instruction and processing equipment

Country Status (1)

Country Link
CN (1) CN108628731B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090055153A1 (en) * 2007-08-21 2009-02-26 Bell Jr Robert H Augmenting of Automated Clustering-Based Trace Sampling Methods by User-Directed Phase Detection
US7757065B1 (en) * 2000-11-09 2010-07-13 Intel Corporation Instruction segment recording scheme
CN103049310A (en) * 2012-12-29 2013-04-17 中国科学院深圳先进技术研究院 Multi-core simulation parallel accelerating method based on sampling
CN105630458A (en) * 2015-12-29 2016-06-01 东南大学—无锡集成电路技术研究所 Prediction method of out-of-order processor steady-state average throughput rate based on artificial neural network
CN105654120A (en) * 2015-12-25 2016-06-08 东南大学—无锡集成电路技术研究所 Two-step cluster software load feature extraction method based on SOM and K-means

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7757065B1 (en) * 2000-11-09 2010-07-13 Intel Corporation Instruction segment recording scheme
US20090055153A1 (en) * 2007-08-21 2009-02-26 Bell Jr Robert H Augmenting of Automated Clustering-Based Trace Sampling Methods by User-Directed Phase Detection
CN103049310A (en) * 2012-12-29 2013-04-17 中国科学院深圳先进技术研究院 Multi-core simulation parallel accelerating method based on sampling
CN105654120A (en) * 2015-12-25 2016-06-08 东南大学—无锡集成电路技术研究所 Two-step cluster software load feature extraction method based on SOM and K-means
CN105630458A (en) * 2015-12-29 2016-06-01 东南大学—无锡集成电路技术研究所 Prediction method of out-of-order processor steady-state average throughput rate based on artificial neural network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
高伟: "面向SIMD的自动向量化优化技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Also Published As

Publication number Publication date
CN108628731B (en) 2020-12-22

Similar Documents

Publication Publication Date Title
US11757982B2 (en) Performing load balancing self adjustment within an application environment
US9544367B2 (en) Automated server cluster selection for virtual machine deployment
CN105745868B (en) The method and apparatus of abnormality detection in network
CN104484220A (en) Method and device for dispatching dynamic resources of virtual cluster
CN106980571A (en) The construction method and equipment of a kind of test use cases
CN111381147B (en) Many-core chip testing method, many-core chip testing device and many-core chip testing equipment
CN109918292A (en) A kind of processor instruction set test method and device
KR101886317B1 (en) Apparatus and method for selecting placement of virtual machine
CN110389822A (en) The node scheduling method, apparatus and server of execution task
CN110188862A (en) Searching method, the device, system of model hyper parameter for data processing
WO2016018352A1 (en) Platform configuration selection based on a degraded makespan
US20110218795A1 (en) Simulator of multi-core system employing reconfigurable processor cores and method of simulating multi-core system employing reconfigurable processor cores
CN114327824A (en) Method and device for determining service host and electronic equipment
CN110414569A (en) Cluster realizing method and device
CN114297008A (en) Cloud host performance prediction method and device, terminal and storage medium
EP1920367A1 (en) Electronic circuit design
CN108628731A (en) A kind of method and processing equipment of selection test instruction
Reisch et al. Asynchronous optimization techniques for distributed computing applications
JP6722345B2 (en) Sign detection device and sign detection method
Vu et al. High-performance mesoscopic traffic simulation with GPU for large scale networks
Liao et al. GPU-based N-detect transition fault ATPG
CN108008999B (en) Index evaluation method and device
CN109086137A (en) GPU concurrent computation resource configuration method and device
CN106789289A (en) For the method and apparatus of virtual network mapping
Papadopoulou et al. A machine-learning approach for communication prediction of large-scale applications

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
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201222

CF01 Termination of patent right due to non-payment of annual fee