CN115390915A - RISC-V assembly instruction level oriented key path automatic detection method - Google Patents

RISC-V assembly instruction level oriented key path automatic detection method Download PDF

Info

Publication number
CN115390915A
CN115390915A CN202210974046.8A CN202210974046A CN115390915A CN 115390915 A CN115390915 A CN 115390915A CN 202210974046 A CN202210974046 A CN 202210974046A CN 115390915 A CN115390915 A CN 115390915A
Authority
CN
China
Prior art keywords
branch
risc
code
coding
probe
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
CN202210974046.8A
Other languages
Chinese (zh)
Other versions
CN115390915B (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.)
Information Engineering University of PLA Strategic Support Force
Original Assignee
Information Engineering University of PLA Strategic Support Force
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 Information Engineering University of PLA Strategic Support Force filed Critical Information Engineering University of PLA Strategic Support Force
Priority to CN202210974046.8A priority Critical patent/CN115390915B/en
Publication of CN115390915A publication Critical patent/CN115390915A/en
Application granted granted Critical
Publication of CN115390915B publication Critical patent/CN115390915B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30098Register arrangements
    • G06F9/3012Organisation of register space, e.g. banked or distributed register file
    • G06F9/3013Organisation of register space, e.g. banked or distributed register file according to data content, e.g. floating-point registers, address registers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a RISC-V assembly instruction level oriented key path automatic detection method. The method comprises the following steps: coding all branches in the assembly program to be detected; traversing all floating point registers related to the assembly program to be detected, and judging whether at least two global independent floating point registers exist, if so, designing a global independent pile inserting probe, and if not, designing an auxiliary register type pile inserting probe; identifying branch marks to be positioned at the first row position of each branch, and automatically inserting the global independent pile inserting probe and/or the auxiliary register type pile inserting probe to the first row position of each branch; and testing the assembly program to be detected after the pile is inserted by using the test set, outputting the coding result generated by the test set to a result file, counting the same coding result in the result file, and decoding the coding result with the largest number to obtain the key path.

Description

RISC-V assembly instruction level oriented key path automatic detection method
Technical Field
The invention relates to the technical field of automatic detection of key paths of an assembly program and assembly program testing, in particular to a key branch path problem of a large number of test sets passing through the assembly program, and particularly relates to a RISC-V assembly instruction level-oriented key path automatic detection method.
Background
In the technology related to the assembly program key path detection method, an assembly program control flow path detection method based on an auxiliary table is available at present, the method is to insert a path probe program written by c language into each branch of an assembly program to be detected, in order to ensure that the value of an original register is not covered by a register called by a path probe, the values of all integer registers need to be pushed in advance, the field of the register is saved, and the value of the original register is pushed after the calling is finished. And after the detection is finished, the line number of the control flow path is obtained by looking up the auxiliary table.
The method mainly has the following problems:
(1) In addition, the structure of the auxiliary table has no universality, and the auxiliary table is required to be reconstructed when control flow paths of different programs are required to be detected.
(2) Mainstream path control flow analysis tools IDA Pro and Intel Pin have large code volume and complex realization, and the generated intermediate data is difficult to arrange and is not suitable for the analysis of the key path of the RISC-V assembly program.
(3) Compared with the software ecology of X86 and ARM, the RISC-V instruction set architecture is not mature enough, other path analysis tools are difficult to transplant to the RISC-V architecture, and the RISC-V instruction set architecture is not easy to maintain, and some critical path automatic detection methods suitable for the RISC-V instruction set architecture are urgently needed to analyze a critical path with the highest test data passing rate so as to be used for the work of optimizing the RISC-V assembly program and the like.
Disclosure of Invention
In order to solve at least part of the problems, the invention provides a key path automatic detection method oriented to a RISC-V assembly instruction level.
The invention provides a RISC-V assembly instruction level-oriented automatic detection method for a critical path, which comprises the following steps:
step 1: coding all branches in the assembly program to be detected;
step 2: traversing all floating point registers related to the assembly program to be detected, and judging whether at least two globally independent floating point registers exist in the assembly program to be detected, if so, executing the step 3, and if not, executing the step 4;
and step 3: designing a global independent instrumentation probe based on two global independent floating point registers and branch codes;
and 4, step 4: calling other floating-point registers which are not globally independent as auxiliary registers, and designing an auxiliary register type instrumentation probe based on the auxiliary registers and branch codes;
and 5: identifying branch marks to be positioned at the first row position of each branch, and automatically inserting the global independent pile inserting probe and/or the auxiliary register type pile inserting probe to the first row position of each branch;
step 6: testing the assembly program to be detected after the pile is inserted by using the test set, outputting a coding result generated by the test set to a result file, counting the same coding result in the result file, and decoding the coding result with the largest number to obtain a key path; the test set refers to a set composed of a number of test samples for detecting critical paths.
Further, step 1 specifically includes:
according to the branch sequence, respectively carrying out binary coding, decimal coding and hexadecimal coding on each branch; aiming at the ith branch, the binary code of the ith branch consists of a first bit which is 1 and a tail which is i-1 0; the decimal code is a decimal number corresponding to the binary code, and the hexadecimal code is a hexadecimal number corresponding to the binary code; i =1,2,3 \ 8230;, n.
Further, step 3 specifically includes:
one global independent floating point register is used for storing branch codes of a branch where the instrumentation probe is located, and the other global independent floating point register is used for storing code sums; the code sum is obtained by performing accumulation operation on codes of all branches passed by the test sample.
Further, step 4 specifically includes:
a global independent floating point register is used for storing branch codes of a branch where the instrumentation probe is located, and an auxiliary register is used for storing a code sum; the code sum is obtained by performing accumulation operation on all branches passed by the test sample;
for any probe, before calling the auxiliary register, firstly, pushing the original value of the auxiliary register; then, the coding sum is pushed; after the call is completed, the original value of the auxiliary register is popped from the stack.
Further, in step 5, identifying the branch identifier specifically includes: characters of the RISC-V assembly code line are traversed, and if the recognized characters are not mnemonics, the character is considered to be identified by a branch.
Further, in step 6, decoding the coding result with the largest number to obtain the critical path specifically includes:
decoding the most hexadecimal coding result into a binary string, counting the sequence number i of the '1' in the binary string, wherein the path formed by the branches corresponding to all the sequence numbers i is the key path.
The invention has the beneficial effects that:
1. different instrumentation probes are designed according to the coverage condition of a floating point register of the RISC-V assembly program, different choices can be made during the detection of the key path of the assembly program, the instrumentation probes are designed simply and conveniently, and the memory access time can be reduced to the greatest extent.
2. The method has the advantages that the method can detect the key path which is input in the RISC-V assembly program in an automatic detection mode, solves the problem that manual line-by-line analysis of certain input is easy to make mistakes, enables related work to be more accurate and efficient to a certain extent, and has more remarkable effect especially on complex assembly programs containing a large number of branch jumps.
3. The method is only suitable for the RISC-V instruction set architecture, but can be suitable for assembly programs of other instruction set architectures by expanding based on the realization idea.
Drawings
FIG. 1 is a flowchart illustrating a method for automatically detecting a critical path oriented to RISC-V assembly instruction level according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an automatic stake forming provided by an embodiment of the present invention;
FIG. 3 is a design code of a GDIP provided by an embodiment of the present invention;
FIG. 4 is a design code of ARIP provided by an embodiment of the present invention;
fig. 5 is a schematic diagram of a critical path according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions in the embodiments of the present invention will be described clearly below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
As shown in fig. 1, an embodiment of the present invention provides a method for automatically detecting a critical path oriented to RISC-V assembly instruction level, which includes the following steps:
s101: coding all branches in the assembly program to be detected;
s102: traversing all floating point registers related to the assembly program to be detected, so as to judge whether at least two globally independent floating point registers exist in the assembly program to be detected, if so, executing the step S103, otherwise, executing the step S104;
s103: designing a Global Dependency-free Instrumentation Probe (GDIP) based on two Global Dependency-free floating point registers and branch codes;
s104: calling other floating-point registers which are not globally independent as Auxiliary registers, and designing an Auxiliary register type Instrumentation Probe (ARIP) based on the Auxiliary registers and branch codes;
s105: identifying branch marks to be positioned at the first row position of each branch, and automatically inserting the global independent pile inserting probe and/or the auxiliary register type pile inserting probe to the first row position of each branch;
specifically, traversing characters of the RISC-V assembly code line, and if the recognized characters are not mnemonics, considering the character branch identification; an automatic staking flow diagram is shown in fig. 2.
S106: testing the assembly program to be detected after the pile is inserted by using the test set, outputting a coding result generated by the test set to a result file, counting the same coding result in the result file, and decoding the coding result with the largest number to obtain a key path; the test set refers to a set composed of a number of test samples for detecting critical paths.
According to the RISC-V assembly instruction level-oriented key path automatic detection method provided by the embodiment of the invention, different pile inserting probes are designed according to the coverage condition of the floating point register of the RISC-V assembly program to be detected, different choices can be made during assembly program key path detection, and the memory access time can be reduced to the greatest extent; moreover, the method can detect the key path passed by the input in the RISC-V assembly program by adopting an automatic detection mode, solves the problem that the manual line-by-line analysis of a certain input is easy to make mistakes, ensures that the related work is more accurate and efficient to a certain extent, and has more obvious effect particularly on a complex assembly program containing a large number of branch jumps; furthermore, the method is suitable for assembly programs of emerging RISC-V instruction set architectures, has a promotion effect on improving the RISC-V software ecology, and can be suitable for assembly programs of other instruction set architectures by expanding based on the realization idea of the invention.
Example 2
On the basis of the above embodiment 1, an implementation manner of encoding branches and two design manners of the instrumentation probes are specifically given in the embodiment of the present invention.
(1) Branch coding
According to the branch sequence, respectively carrying out binary coding, decimal coding and hexadecimal coding on each branch; aiming at the ith branch, the binary code of the ith branch consists of a first bit which is 1 and a tail which is i-1 0; the decimal code is a decimal number corresponding to the binary code, and the hexadecimal code is a hexadecimal number corresponding to the binary code; i =1,2,3 \8230;, n. The decimal codes of the branches are used for representing the sequence of the branches, the binary codes are used for generating only unique results during decoding, and the hexadecimal codes are used for facilitating subsequent loading into the registers to further calculate the codes of the instrumentation probes and ensuring that the codes are coded as much as possible under the condition that the RISC-V floating point registers do not overflow to the maximum extent.
In the embodiment of the present invention, each branch Code is recorded in a form of constructing a Branch Code Table (BCT), as shown in Table 1.
TABLE 1 Branch code Table
Figure BDA0003798021850000051
In particular, the binary coding method has the advantage of facilitating the calculation of the coding results of all branches through which the test sample passes. This is because, according to table 1, it can be found that the binary codes of the branches are regular when constructing the binary codes of the branches, for example, the binary code of the first branch is 1, the binary code of the second branch is 10, and the binary code of the third branch is 100, assuming that the branch through which a certain test sample passes is the first branch and the second branch, the resulting code sum is 11 (1 + 10), and if the first branch and the third branch are passed, the resulting code sum is 101 (1 + 100), where the regularity can be found, for 11 and 101, it is not difficult to find that the order of "1" from right to left is the passed branch, and for 101, "1" is at 1 st bit and 3 rd bit, it is stated that the test set passes through the 1 st and 2 nd branches.
Further, the advantage of designing hexadecimal code is that it facilitates the register storing the coded result. This is because the storage of the register is not binary and decimal, if the number of branches of a program is too many, the corresponding binary code is too long, and the register cannot be stored, so that the binary code is converted into hexadecimal code as shown in table 1, and the result of the coding at this time is finally the sum of the hexadecimal code.
(2) Design mode of global independent pile inserting probe
Specifically, the design of the global independent instrumentation probe needs to satisfy that at least two floating-point registers are never used in the RISC-V assembly program to be tested (for example, in case of RISC-V architecture, it is assumed that there are 32 registers in total in RISC-V architecture, but 30 of them are used in the RISC-V assembly program to be tested, and the remaining two are global independent registers) because: the instrumentation probe is designed by a floating point register which is not used, the dependency relationship of the register of the assembly program to be detected cannot be influenced, and the same path of the test sample before and after instrumentation can be ensured.
The design concept of the GDIP specifically includes: one global independent floating point register is used for storing branch codes of a branch where the instrumentation probe is located, and the other global independent floating point register is used for storing code sums; the code sum is obtained by performing accumulation operation on the hexadecimal codes of all branches passed by the test sample.
GDIP is simple in structure and does not generate extra memory access time, GDIP core codes are shown in figure 3, ft1 and ft2 registers are global independent registers, wherein the 15 th row li s0,0x $, and the "$" character represents hexadecimal coding in a table 1, the number of branches of an assembly program to be detected corresponds to GDIP-n, and the dependency relationship of the following registers cannot be changed by selecting the 4 th, 9 th and 15 th row integer registers.
(3) Design mode of auxiliary register type pile inserting probe
And when the number of floating point registers which are never used in the RISC-V assembly program to be detected is less than two, selecting an auxiliary register type instrumentation probe. This type of probe requires the invocation of other registers to complete the hexadecimal loading and calculation coding and, to ensure that the value of the invoked auxiliary register is not modified, the original value of the auxiliary register needs to be pushed before the invocation, e.g. lines 10 and 11 of fig. 4, the same coded sum calculated by the probe is also pushed, e.g. line 16 of fig. 4, and after the instrumentation probe completes the invocation of the auxiliary register, the original value of the auxiliary register is taken out of the stack to restore the dependency of the register, e.g. lines 17 and 18 of fig. 4. When the next probe is encountered, the value of the previous probe needs to be taken out of the stack, e.g., line 22 of FIG. 4, and the same function as the probe is performed, as shown in FIG. 4.
(4) Result Analysis and Decoding (Result Analysis and Decoding, RAD)
The function of result analysis and decoding is to encode and decode hexadecimal obtained from the instrumented probe stream in the critical path into a binary string composed of 0 and 1, for example, using 500,000 test samples to detect the critical path of RISC-V assembler, assuming that the critical path is L, the number of test samples passing through L is the most, and the hexadecimal code sum of the probe involved in L is the same, and it can be known from table 1 that the position sequence of the decoded binary string 1 is independent, that is, the position sequence of 1 is the branch sequence of pass.
The benefits of binary and hexadecimal coding are mentioned in (1) above; when the hexadecimal code sum is used, the position of the '1' cannot be visually seen for the hexadecimal code sum, so that the hexadecimal code sum needs to be converted into a binary (decoding), a string of binary character strings combined by '0' and '1', such as 100101000101000101000101, is obtained, in order to avoid errors and improve the detection efficiency, an automatic statistical mode can be adopted to count the position of the '1' (the sequence of the character string of the '1' is a passing branch), and in the embodiment of the invention, the code 1 capable of realizing automatic statistics is provided.
The core implementation of the result analysis and decoding is shown in code 1.
Figure BDA0003798021850000071
Figure BDA0003798021850000081
Example 3
On the basis of the above embodiments, the assembly program of the cotd function of the RISC-V is used as the assembly program to be detected, and in the embodiment of the invention, the method for automatically detecting the key path of the assembly program of the cotd function of the RISC-V comprises the following steps:
s301: according to the assembly realization of the cotd function of the RISC-V, all branches of an assembly program are encoded;
specifically, as shown in table 2, a partial assembly code of the pre-instrumentation cotd function is shown as assembly code segment 1.
TABLE 2 RISC-V cotd function Branch code Table
Figure BDA0003798021850000082
Assembly code segment 1:
Figure BDA0003798021850000083
Figure BDA0003798021850000091
s302: searching whether the floating-point register related to the assembly code of the cotd function comprises all floating-point registers designed by the RISC-V instruction set architecture; after preliminary retrieval, the cotd function has more than two global independent floating point registers, namely more than two floating point registers are not used; therefore, a global independent instrumentation probe is selected, and a floating-point register in the type of instrumentation probe is the global independent register.
S303: identifying branch marks to be positioned at the first row position of each branch, and automatically inserting the global independent pile inserting probe to the first row position of each branch;
specifically, for the cotd function, the first continuous character string of each line assembler of the cotd function is read, if the identified character string is not the assembler mnemonic of the RISC-V instruction set architecture, the character string is indicated as a branch name, for example, "_ rv _ cotd:" and ". L3" in the assembler code segment 2, i.e., GDIP-1 to GDIP-n are sequentially inserted into the first line of each branch under the character string, and the instrumented program is shown as the assembler code segment 2.
It should be noted that, if the assembly program to be detected does not satisfy the condition of having more than two global independent registers, an auxiliary register type instrumentation probe is applied, and the instrumented program is shown as an assembly code segment 3.
Assembly code segment 2:
Figure BDA0003798021850000101
Figure BDA0003798021850000111
assembly code segment 3:
Figure BDA0003798021850000112
Figure BDA0003798021850000121
Figure BDA0003798021850000131
s204: 500000 test samples which accord with the uniform distribution rule of floating point numbers are randomly generated by adopting the existing method, the inserted cotd function is tested by the 500000 test samples, the number of the test samples passing through a certain path is the most, namely the test samples are the key path, and the test samples are sequentially the secondary path and other paths. The parameters of different codes, numbers, ratios and the like of the instrumented probes of the tested cotd function are shown in table 3, the position sequence of '1' in the binary string obtained by decoding is shown in table 1, and the result is that the number ratio of 100000100000000000001 is the highest, and a critical path can be obtained by combining the branch code table in table 2, as shown in fig. 5.
Specifically, because the number of test sets for testing is large and different, branches passed by different test sets may be the same or different, and then the passed instrumentation probes are the same or different, which does not need manual judgment, and only needs to obtain the encoded and output files corresponding to the instrumentation probes corresponding to the branches passed by each test sample, and then decode and judge the encoded and output files.
In this embodiment, when the test set passes through a branch of the program, the hexadecimal codes corresponding to the instrumentation probes in the branch are accumulated, and finally, the code sum obtained after the branch is ended is output. The coding result of a test set consisting of 500000 test samples is 500000 code sums; by performing statistical analysis on these 500000 code sums, the results are shown in table 3.
TABLE 3 result parameters of RISC-V cotd function
Instrumented probe coding and number of Ratio of occupation of Decoded result Sequence of "1
0x4130004100000000 480512 96.10% 100000100000000000001 1、7、21
0x4130001b00000000 14806 2.96% 110110000000000000001 1、2、4、5、21
0x4130000700000000 2128 0.43% 111000000000000000001 1、2、3、21
The present invention supports automatic detection of the path that an input traverses within a RISC-V assembler. RISC-V is a new instruction set architecture, and needs to be perfected in the aspect of RISC-V assembly path for automatically analyzing test samples. If the contents of the registers are manually checked line by line to judge the path passed by a certain input, the method is not only complicated, but also easy to make mistakes, and when the number of test sets is large and the branch jump of the RISC-V assembly program is complex, the manual analysis of the path passed by each test sample is more difficult to complete. The invention judges the path passed by the test sample in the huge test set by using an automatic pile inserting mode, has accuracy and high efficiency, and can obtain a key path and a secondary path and other paths when analyzing the result.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (6)

1. A RISC-V assembly instruction level-oriented critical path automatic detection method is characterized by comprising the following steps:
step 1: coding all branches in the assembly program to be detected;
step 2: traversing all floating point registers related to the assembly program to be detected, so as to judge whether at least two globally independent floating point registers exist in the assembly program to be detected, if so, executing the step 3, otherwise, executing the step 4;
and step 3: designing a global independent instrumentation probe based on two global independent floating point registers and branch codes;
and 4, step 4: calling other floating-point registers which are not globally independent as auxiliary registers, and designing an auxiliary register type instrumentation probe based on the auxiliary registers and branch codes;
and 5: identifying branch marks to be positioned at the first row position of each branch, and automatically inserting the global independent pile inserting probe and/or the auxiliary register type pile inserting probe to the first row position of each branch;
and 6: testing the assembly program to be detected after the pile is inserted by using the test set, outputting a coding result generated by the test set to a result file, counting the same coding result in the result file, and decoding the coding result with the largest number to obtain a key path; the test set refers to a set composed of a number of test samples for detecting critical paths.
2. A RISC-V assembler instruction level oriented critical path auto-detection method as claimed in claim 1, wherein step 1 specifically comprises:
according to the branch sequence, respectively carrying out binary coding, decimal coding and hexadecimal coding on each branch; wherein for the secondiA branch whose binary code is from the first bit of 1 to the end ofi-1 0 composition; the decimal code is a decimal number corresponding to the binary code, and the hexadecimal code is a hexadecimal number corresponding to the binary code;i=1,2,3…,n。
3. a RISC-V assembler instruction level oriented critical path auto-detection method as claimed in claim 1, wherein step 3 specifically comprises:
one global independent floating point register is used for storing branch codes of a branch where the instrumentation probe is located, and the other global independent floating point register is used for storing code sums; the code sum is obtained by performing accumulation operation on codes of all branches passed by the test sample.
4. A RISC-V assembler instruction level oriented critical path auto-detection method as claimed in claim 1, wherein step 4 specifically comprises:
a global independent floating point register is used for storing branch codes of a branch where the instrumentation probe is located, and an auxiliary register is used for storing a code sum; the code sum is obtained by performing accumulation operation on all branches passed by the test sample;
for any probe, before calling the auxiliary register, firstly, pushing the original value of the auxiliary register; then, the coding sum is pushed; after the call is completed, the original value of the auxiliary register is popped from the stack.
5. A RISC-V assembler instruction level oriented critical path auto-detection method as claimed in claim 1, wherein the step 5, the identifying the branch id specifically comprises: traversing characters of the RISC-V assembly code line, and if the recognized characters are not mnemonics, considering the character branch identification.
6. A RISC-V assembler instruction level-oriented critical path auto-detection method as claimed in claim 3 or 4, wherein the decoding of the most numerous encoding results to obtain the critical path in step 6 specifically comprises:
decoding the most numerous hexadecimal coding results into a binary string, and counting the sequence number of '1' in the binary stringiAll sequence numbersiThe path formed by the corresponding branches is the critical path.
CN202210974046.8A 2022-08-15 2022-08-15 RISC-V assembly instruction level oriented key path automatic detection method Active CN115390915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210974046.8A CN115390915B (en) 2022-08-15 2022-08-15 RISC-V assembly instruction level oriented key path automatic detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210974046.8A CN115390915B (en) 2022-08-15 2022-08-15 RISC-V assembly instruction level oriented key path automatic detection method

Publications (2)

Publication Number Publication Date
CN115390915A true CN115390915A (en) 2022-11-25
CN115390915B CN115390915B (en) 2023-03-31

Family

ID=84118944

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210974046.8A Active CN115390915B (en) 2022-08-15 2022-08-15 RISC-V assembly instruction level oriented key path automatic detection method

Country Status (1)

Country Link
CN (1) CN115390915B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7047394B1 (en) * 1999-01-28 2006-05-16 Ati International Srl Computer for execution of RISC and CISC instruction sets
CN109491918A (en) * 2018-11-22 2019-03-19 中国人民解放军战略支援部队信息工程大学 A kind of detection method and device for the redundant instruction that collects
CN112181426A (en) * 2020-09-19 2021-01-05 中国人民解放军战略支援部队信息工程大学 Assembly program control flow path detection method and device
CN112905242A (en) * 2021-03-23 2021-06-04 浙江大华技术股份有限公司 Branch path jumping method, device, storage medium and electronic device
CN114116513A (en) * 2021-12-03 2022-03-01 中国人民解放军战略支援部队信息工程大学 Register mapping method and device from multi-instruction set architecture to RISC-V instruction set architecture

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7047394B1 (en) * 1999-01-28 2006-05-16 Ati International Srl Computer for execution of RISC and CISC instruction sets
CN109491918A (en) * 2018-11-22 2019-03-19 中国人民解放军战略支援部队信息工程大学 A kind of detection method and device for the redundant instruction that collects
CN112181426A (en) * 2020-09-19 2021-01-05 中国人民解放军战略支援部队信息工程大学 Assembly program control flow path detection method and device
CN112905242A (en) * 2021-03-23 2021-06-04 浙江大华技术股份有限公司 Branch path jumping method, device, storage medium and electronic device
CN114116513A (en) * 2021-12-03 2022-03-01 中国人民解放军战略支援部队信息工程大学 Register mapping method and device from multi-instruction set architecture to RISC-V instruction set architecture

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
许瑾晨;郭绍忠;黄永忠;王磊;周蓓;: "浮点数学函数异常处理方法" *

Also Published As

Publication number Publication date
CN115390915B (en) 2023-03-31

Similar Documents

Publication Publication Date Title
CN109816112B (en) Method and device for analyzing quantum program storage file
FI118240B (en) Method and apparatus for decoding outer concatenated CRC codes
CN111625382B (en) Server fault diagnosis method, device, equipment and medium
US20070234019A1 (en) Processor apparatus and complex condition processing method
CN111611152B (en) Test case generation method and device, electronic equipment and readable storage medium
JP2006012066A (en) Trace analysis system and trace analysis method
CN111679979A (en) Destructive testing method and device
CN113190220A (en) JSON file differentiation comparison method and device
CN115390915B (en) RISC-V assembly instruction level oriented key path automatic detection method
CN112181426B (en) Assembly program control flow path detection method and device
CN113139712B (en) Machine learning-based extraction method for incomplete rules of activity attributes of process logs
CN110008236B (en) Data distributed type self-increment coding method, system, equipment and medium
CN115495082B (en) TLV format data automatic conversion method and related equipment
CN112445528B (en) Result self-checking instruction sequence filling method based on pipeline constraint
US7031407B1 (en) Apparatus and method for decoding and trace back of convolution codes using the viterbi decoding algorithm
CN107436728A (en) Rule analysis result storage method, regular retrogressive method and device
KR20000022987A (en) Encoding device and method, decoding device and method, providing medium, and method for generating data substitution position information
CN112380133B (en) Method and device for simulating instruction set simulator by utilizing function library
CN110572160A (en) Compression method for decoding module code of instruction set simulator
CN115904980B (en) Method, device, equipment and storage medium for estimating corrosion repair cost of software architecture
JPH10209882A (en) Method for decoding viterbi
CN116561005A (en) Special control flow jump procedure verification method based on semantic interpretation and legal stack constraint
CN114817045A (en) Method and system for determining source code coverage rate
CN114924986A (en) Test case screening method and device
CN118035088A (en) Fault reproduction method and device based on genetic algorithm

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