Method and apparatus for generating reconfigurable processor functions

By configuring the row and column items in the spreadsheet, defining numerical validation conditions, and generating refactorable processor functions, the problem of low execution efficiency caused by non-compliance with programming standards in the source code is solved, and efficient code execution is achieved.

CN114936027BActive Publication Date: 2025-10-24SHANGHAI QINGWEI INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210261536.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-16
Publication Date
2025-10-24
Estimated Expiration
2042-03-16

AI Technical Summary

Technical Problem

In the prior art, if the source code written by the user does not comply with the programming specifications of the reconfigurable processor, the code execution efficiency is low.

Method used

By configuring the row and column items in the spreadsheet, defining numerical verification conditions based on reconfigurable processor resource information and assembly instructions, receiving input values, generating reconfigurable processor functions, using an Excel spreadsheet as the input interface, and reading and converting the data into JSON format using a Python library.

Benefits of technology

It solves the problem of low code execution efficiency, provides a formatted table that can be used by multiple users, avoids program compatibility issues, and improves code execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114936027B_ABST
    Figure CN114936027B_ABST
Patent Text Reader

Abstract

The application discloses a reconfigurable processor function generation method and device, a storage medium and an electronic device. The reconfigurable processor function generation method comprises the following steps: obtaining a current assembly instruction according to an assembly language of a current reconfigurable processor function; configuring row and column items in a spreadsheet according to the current assembly instruction and reconfigurable processor resource information involved; defining a numerical verification condition in a current assembly instruction row according to an effective numerical condition of the current assembly instruction; receiving an input numerical value according to the numerical verification condition; and generating a reconfigurable processor function according to the row and column items in the spreadsheet and the input numerical value. The spreadsheet document can be read by various tools and converted into an input available for an assembler tool, so that the technical problem of low code execution efficiency caused by the fact that the source code written by a user does not conform to the programming specification of the reconfigurable processor in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computers, and in particular, to a method and device for generating a reconfigurable processor function, a storage medium and an electronic device. BACKGROUND

[0002] A computing organization form that can realize spatial mapping of algorithms to computing engines and has customization capability after being manufactured into integrated circuits is referred to as reconfigurable computing. A computer can be composed of a main processor and a set of reconfigurable hardware. The main processor is responsible for controlling the behavior of the reconfigurable hardware, and the reconfigurable hardware can achieve the purpose of accelerating the execution of a specific task through tailoring and reorganization according to the computing characteristics of the task. Because a different architecture from a general-purpose processor is adopted, existing general-purpose processing compilers cannot be used, and in order to use the reconfigurable processor hardware more efficiently and conveniently, some library functions customized based on the characteristics of the reconfigurable architecture need to be provided for users to use.

[0003] Existing compilers based on the architecture of reconfigurable processors can provide executable programs of reconfigurable computing processors through processes such as division, analysis, conversion, optimization, and mapping of high-level language (C) code. Because the hardware resources of the reconfigurable processor are often limited, and the computing resources required by the computing task often exceed the resources of the reconfigurable processor, it is necessary to divide the input computing task to obtain a series of subtask sets that have a dependency relationship with each other.

[0004] Because the current reconfigurable processor compiler converts the analysis process of high-level language (C) code into an executable program of a reconfigurable processor, the execution efficiency of the executable program is closely related to the writing method of the code. If the source code written by the user does not conform to the programming specifications of the reconfigurable processor, the execution efficiency of the final code will be reduced.

[0005] In view of the above problems, no effective solutions have been proposed so far. SUMMARY

[0006] The embodiments of the present application provide a method and device for generating a reconfigurable processor function, a storage medium and an electronic device to at least solve the technical problem in the prior art that the execution efficiency of the code is low if the source code written by the user does not conform to the programming specifications of the reconfigurable processor.

[0007] According to an aspect of the embodiments of the present application, a method for generating a reconfigurable processor function is provided, comprising: obtaining a current assembly instruction according to an assembly language of the current reconfigurable processor function; configuring a row and column item in a spreadsheet according to the current assembly instruction and reconfigurable processor resource information involved; defining a numerical verification condition in the current assembly instruction row according to an effective numerical condition of the current assembly instruction; receiving an input numerical value according to the numerical verification condition; and generating the reconfigurable processor function according to the row and column item in the spreadsheet and the input numerical value.

[0008] Optionally, the configuring the row and column item in the spreadsheet according to the current assembly instruction and the reconfigurable processor resource information involved comprises: configuring the reconfigurable processing resource in the row item in the spreadsheet according to the reconfigurable processor resource information and a preset rule; configuring the assembly instruction in the column item in the spreadsheet according to an indicated meaning of the current assembly instruction; and establishing a target correspondence between a cell in the spreadsheet and the reconfigurable processor resource, wherein the cell is composed of the row item and the column item.

[0009] Optionally, the defining the numerical verification condition in the current assembly instruction row according to the effective numerical condition of the current assembly instruction and the receiving the input numerical value according to the numerical verification condition comprise: in a case where the effective numerical condition of the current assembly instruction is a numerical value, obtaining a maximum value and a minimum value of the current assembly instruction; and defining the numerical verification condition in the current assembly instruction row based on the maximum value and the minimum value.

[0010] Optionally, the defining the numerical verification condition in the current assembly instruction row based on the maximum value and the minimum value comprises: determining a data verification range based on the maximum value and the minimum value; and defining the data verification range as the numerical verification condition in the current assembly instruction row.

[0011] Optionally, after the defining the data verification range as the numerical verification condition in the current assembly instruction row, the method further comprises: in response to an input numerical value of a user in the spreadsheet, if the input numerical value meets the numerical verification condition, inputting the input numerical value into the spreadsheet; or if not, outputting a prompt information.

[0012] Optionally, the defining the numerical verification condition in the current assembly instruction row according to the effective numerical condition of the current assembly instruction and the receiving the input numerical value according to the numerical verification condition comprise: in a case where the effective numerical condition of the current assembly instruction is a character, defining the numerical verification condition in the current assembly instruction row based on a preset character set.

[0013] Optionally, after the current assembly instruction is obtained according to the assembly language of the current reconfigurable processor function, the method further comprises: expanding a plurality of blank forms according to the current assembly instruction type, wherein each blank form is used to configure a plurality of sub-tasks.

[0014] Optionally, the generating the reconfigurable processor function according to the row, column item in the electronic form and the input value comprises: reading the electronic form into an assembler input format, reading the document according to a json document format using an xlrd library provided by python, and storing the meaning indicated by the current assembly instruction and the value of each part of the assembly instruction into a json file in a one-to-one correspondence manner.

[0015] Optionally, after the target correspondence between the cells in the electronic form and the reconfigurable processor resources is established, the method further comprises: constructing a batch file; and writing a specified input / output file name parameter into the batch file, so that the batch command file needs to be run only when the batch file is executed each time.

[0016] According to an aspect of an embodiment of the present application, a reconfigurable processor function generation device is provided, comprising: an obtaining unit, configured to obtain a current assembly instruction according to an assembly language of a current reconfigurable processor function; a configuration unit, configured to configure row and column items in an electronic form according to the current assembly instruction and reconfigurable processor resource information; a receiving unit, configured to define a value verification condition in a current assembly instruction row according to a valid value condition of the current assembly instruction, and receive an input value according to the value verification condition; and a generating unit, configured to generate the reconfigurable processor function according to the row and column items in the electronic form and the input value.

[0017] Optionally, the configuration unit comprises: a first configuration module, configured to configure the reconfigurable processor resources in the row items in the electronic form according to a preset rule according to the reconfigurable processor resource information; a second configuration module, configured to configure the assembly instruction in the column items in the electronic form according to a meaning indicated by the current assembly instruction; and an establishing module, configured to establish a target correspondence between cells in the electronic form and the reconfigurable processor resources, wherein the cells are composed of the row items and the column items.

[0018] Optionally, the receiving unit comprises: an obtaining module, configured to obtain a maximum value and a minimum value of the current assembly instruction in a case where the valid value condition of the current assembly instruction is a value; and a defining module, configured to define the value verification condition in the current assembly instruction row based on the maximum value and the minimum value.

[0019] Optionally, the first defining module comprises a determining submodule for determining a data verification range based on the maximum value and the minimum value; and a defining submodule for defining the data verification range as a numerical verification condition in the current assembly instruction line.

[0020] Optionally, the device further comprises a responding unit for, after the data verification range is defined as the numerical verification condition in the current assembly instruction line, responding to an input numerical value of a user in the electronic table, and if the input numerical value meets the numerical verification condition, inputting the input numerical value into the electronic table; and if not, outputting prompt information.

[0021] Optionally, the receiving unit comprises a second defining module for, in a case where the valid numerical condition of the current assembly instruction is a character, defining the numerical verification condition in the current assembly instruction line based on a preset character set.

[0022] Optionally, the device further comprises an expanding unit for, after the current assembly instruction is obtained by expanding the assembly language of the current reconfigurable processor function, expanding the current assembly instruction according to the type of the current assembly instruction.

[0023] Optionally, the device further comprises a constructing unit for, after the target correspondence between the cells in the electronic table and the reconfigurable processor resources is established, constructing a batch processing file; and a writing unit for writing a specified input and output file name parameter into the batch processing file, so that each time the batch processing file is executed, only the batch processing command file needs to be run.

[0024] According to a first aspect of embodiments of the present application, a computer readable storage medium is provided, characterized in that the storage medium stores a computer program, wherein the computer program is configured to execute the above-mentioned method for generating a reconfigurable processor function when running.

[0025] According to a first aspect of embodiments of the present application, an electronic device is provided, comprising a memory and a processor, characterized in that the memory stores a computer program, and the processor is configured to execute the computer program to execute the above-mentioned method for generating a reconfigurable processor function.

[0026] In the embodiment of the present application, the current assembly instruction is obtained according to the current assembly language of the reconfigurable processor function; the row and column items in the electronic form are configured according to the current assembly instruction and the information of the reconfigurable processor resource involved; the value verification condition in the row of the current assembly instruction is defined according to the effective value condition of the current assembly instruction; the input value is received according to the value verification condition; and the reconfigurable processor function is generated according to the row and column items in the electronic form and the input value, that is, only one table with set format is provided by using the electronic form table editing instruction, so that the table can be used by multiple persons and the program compatibility problem is avoided. The electronic form document can be read by multiple tools and converted into the input available for the assembly tool, so that the technical problem of low code execution efficiency in the prior art caused by the source code written by the user not conforming to the programming specification of the reconfigurable processor is solved. BRIEF DESCRIPTION OF DRAWINGS

[0027] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the present application. In the drawings:

[0028] Figure 1 is a hardware structure block diagram of a mobile terminal according to an optional reconfigurable processor function generation method according to the embodiment of the present application;

[0029] Figure 2 is a flow chart of an optional reconfigurable processor function generation method according to the embodiment of the present application;

[0030] Figure 3 is a flow chart of an optional table-based reconfigurable processor function library generation method according to the embodiment of the present application;

[0031] Figure 4 is an optional reconfigurable processor function generation device diagram according to the embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the protection scope of the present application.

[0033] It should be noted that the terms "first," "second," and the like in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a sequence of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.

[0034] The embodiment of the method for generating a reconfigurable processor function provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure diagram of a mobile terminal according to an embodiment of the present invention, which is a method for generating a reconfigurable processor function. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0035] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for generating a reconfigurable processor function in an embodiment of the present invention. The processor 102 executes the computer program stored in the memory 104 to execute various functional applications and the generation of reconfigurable processor functions, thereby implementing the above-mentioned method. The memory 104 can include a high-speed random access memory and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 can further include a memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0036] The transmission device 106 is configured to receive or send data via a network. The network can include a wireless network provided by a communication provider of the mobile terminal. In one embodiment, the transmission device 106 includes a network interface controller (NIC) configured to connect to other network devices via a base station to communicate with the Internet. In one embodiment, the transmission device 106 can be a radio frequency (RF) module configured to communicate with the Internet via a wireless network.

[0037] The embodiment also provides a method for generating a reconfigurable processor function, Figure 2 is a flow chart of the method for generating a reconfigurable processor function according to an embodiment of the present application, as shown in the figure, the method for generating a reconfigurable processor function includes the following steps: Figure 2

[0038] In step S202, the current assembly instruction is obtained according to the current assembly language of the reconfigurable processor function.

[0039] In step S204, the row and column items in the spreadsheet are configured according to the current assembly instruction and the reconfigurable processor resource information involved.

[0040] In step S206, the value verification condition in the current assembly instruction row is defined according to the effective value condition of the current assembly instruction.

[0041] In step S208, the input value is received according to the value verification condition, and the reconfigurable processor function is generated according to the row and column items in the spreadsheet and the input value.

[0042] In the embodiment, the spreadsheet includes but is not limited to an excel document. The excel document is described as follows.

[0043] The row items and column items can constitute a two-dimensional excel table, and the intersection of the row items and column items constitutes a cell. In the excel table, a reconfigurable resource label is filled in the row, and an assembly language instruction is filled in the column. The parameters are filled in the intersection. Further, the library function developed without the aid of a reconfigurable processor compiler needs to use the assembly language based on the target architecture to edit the assembly instruction on a suitable editing tool (excel table).

[0044] ​It should be noted that the assembly instruction can contain values and characters, both of which are within a certain range. Considering the characteristics of excel table, which can limit the input value and select the input character through the drop-down menu, and most PC using windows system will install excel software. If you want to use excel table to edit the instruction, you only need to provide a well-formatted table for multiple people to use and avoid program compatibility problems. Excel document can be read by various tools and converted into input for assembly tools.

[0045] In this embodiment, the excel table is taken as an example as follows.

[0046] The first row and the first column of the excel document are set. The document needs to show which resource of the reconfigurable processor each cell to be edited belongs to, so the individual alias of the resource is arranged in the cells of the first row in turn. The meaning of each part of the instruction is given an individual alias, and the alias is arranged in the cells of the first column in turn. In order to prompt the programmer the meaning of each alias, the description is filled in the "input information" box through "excel->data->data validation->input information".

[0047] The format of the cells of the excel document is set. Different processing is needed according to whether the part of the assembly instruction to be input is a value. If it is a value, "allow: integer, data: between" is selected through "excel->data->data validation->settings->validation condition", and "maximum value" and "minimum value" are set according to the range of the data. When the input value is not within the data range, the prompt information is set through "excel->data->data validation->error warning->error information" to prompt the programmer why the input value is illegal, which is convenient for him to modify. If the input is a character, "allow: sequence" is selected through "excel->data->data validation->settings->validation condition", and the set of characters available for selection is input in "source". If some parts of the assembly instruction do not need to be changed, they need to be kept as the default value, so "allow: custom" is selected through "excel->data->data validation->settings->validation condition", and the default value is input in "formula".

[0048] The format of the sheet of the excel document is set. According to the type of the assembly instruction, multiple sheets are extended, and the names of the sheets are changed for distinction. In the subsequent use process, if it is needed to extend according to the number of the divided task sets, the sheet of the corresponding type can be directly copied, and the sheet name is modified according to the task number.

[0049] Reading excel document conversion to assembler input format, using python provides xlrd library to read the document according to the format of the json document, the alias and instruction of column A are combined in a one-to-one corresponding manner to store in the json file, in order to facilitate the use of PC without installing python, the python program is packaged as a windows executable program.

[0050] Configure batch processing command, because python reads excel file, output json file execution needs to make some input, output file name, in order to reduce the use of python when inputting these parameters, you need a batch file, write the input and output file name and other parameters to be specified in the file, each time you only need to run the batch command file.

[0051] In this embodiment, excel table is used as the input interface of assembly instruction instead of the software interface developed by the individual, and the data processing and format conversion are performed by reading the excel table through python.

[0052] According to the current reconfigurable processor function assembly language, the current assembly instruction is obtained; according to the current assembly instruction and the reconfigurable processor resource information involved, the row and column items in the electronic table are configured; according to the effective numerical value condition of the current assembly instruction, the numerical value verification condition in the current assembly instruction row is defined; the input numerical value is received according to the numerical value verification condition; and the reconfigurable processor function is generated according to the row and column items in the electronic table and the input numerical value, that is, using the electronic table editing instruction only needs to provide a table with a set format, which can be used by multiple people and avoids the program compatibility problem. The electronic table document can be read by various tools and converted into input for assembler tools, solving the technical problems of low code execution efficiency in the prior art if the source code written by the user does not conform to the programming specification of the reconfigurable processor.

[0053] Optionally, according to the current assembly instruction and the reconfigurable processor resource information involved, the row and column items in the electronic table are configured, including: according to the reconfigurable processor resource information, the reconfigurable processing resource is configured in the row item in the electronic table according to the preset rule; according to the meaning indicated by the current assembly instruction, the assembly instruction is configured in the column item in the electronic table; and the target correspondence between the cells in the electronic table and the reconfigurable processor resources is established, wherein the cell is composed of the row item and the column item.

[0054] Optionally, the method can further include defining the numerical verification condition in the current assembly instruction line according to the valid numerical condition of the current assembly instruction, and receiving the input numerical value according to the numerical verification condition.

[0055] Optionally, the method can further include defining the numerical verification condition in the current assembly instruction line according to the valid numerical condition of the current assembly instruction, and receiving the input numerical value according to the numerical verification condition.

[0056] Optionally, the method can further include defining the numerical verification condition in the current assembly instruction line according to the valid numerical condition of the current assembly instruction, and receiving the input numerical value according to the numerical verification condition.

[0057] Optionally, the method can further include defining the numerical verification condition in the current assembly instruction line according to the valid numerical condition of the current assembly instruction, and receiving the input numerical value according to the numerical verification condition.

[0058] Optionally, the method can further include expanding a plurality of blank forms according to the current assembly instruction type after obtaining the current assembly instruction according to the assembly language of the current reconfigurable processor function, wherein each blank form is used to configure a plurality of sub-tasks.

[0059] In the embodiment, the blank form can include one or more, and the blank form can be regarded as a sheet form.

[0060] Optionally, the method can further include reading the electronic table into an assembler input format, reading the document according to the json document format using the xlrd library provided by python, and storing the meaning indicated by the current assembly instruction and the value of each part of the assembly instruction in a one-to-one corresponding manner into a json file.

[0061] Optionally, the method can further include constructing a batch file and writing the input and output file name parameters to be specified into the batch file, so that only the batch command file needs to be run each time the batch file is executed.

[0062] In the embodiment, after configuring the cell format of the spreadsheet document, the method further comprises: compiling the assembly instruction in the case that the value carried in the received assembly instruction is in a preset range; and compiling the assembly instruction by judging the condition in the case that the character is carried in the received assembly instruction.

[0063] Optionally, the cell in the spreadsheet document and the resource of the reconfigurable processor have a corresponding relationship, which can comprise: labeling an identifier for the resource of the reconfigurable processor; and arranging the identifier in the cells in the first row in sequence to establish a target corresponding relationship between the cell in the spreadsheet document and the resource of the reconfigurable processor.

[0064] Optionally, converting the spreadsheet document into the target format document can comprise: reading the spreadsheet document into an assembler input format, using the xlrd library provided by python to read the document according to the format of the json document, and combining the alias of the column and the value of each part of the assembly instruction in a one-to-one corresponding manner to store them into the json file.

[0065] Optionally, configuring the batch processing command based on the target format document can comprise: constructing a batch processing file; and writing the input and output file name parameters that need to be specified into the batch processing file, wherein only the batch processing command file needs to be run each time.

[0066] As an optional embodiment, the application further provides a table-based reconfigurable processor function library generation method. As shown in the table-based reconfigurable processor function library generation method flow chart. Specifically, it includes setting the format of the first row and the first column, setting the cell format, setting the sheet format, reading the excel document conversion format, and configuring the batch command. The details are as follows. Figure 3

[0067] Step 1, setting the format of the first row and the first column of the excel document stage, which needs to reflect in the document which resource of the reconfigurable processor each cell to be edited belongs to, so it is necessary to arrange the aliases of the resources in the cells of the first row in sequence. And give an alias to the meaning represented by each part of the instruction, arrange the alias in the cells of column A in sequence, in order to prompt the programmer the meaning of each alias, fill in the description in the "input information" box through "excel->data->data validation->input information".

[0068] ​Step 2, set the excel document cell format stage, according to whether the assembly instruction part to be input is a numerical value, different processing is needed, if it is a numerical value, through "excel-> data-> data validation-> set-> validation condition" to select "allow: integer, data: between", and set "maximum value" and "minimum value" according to the range of data. When the input value is not within the data range, through "excel-> data-> data validation-> error warning-> error information" to set the prompt information, prompt the programmer why the input value is not legal, and facilitate its modification. If the input is a character, through "excel-> data-> data validation-> set-> validation condition" to select "allow: sequence", and input the character set available for selection in "source". If some parts of the assembly instruction do not need to be changed, you need to keep the default value, then through "excel-> data-> data validation-> set-> validation condition" to select "allow: custom", and input the default value in "formula".

[0069] Step 3, set the excel document sheet format stage, according to the type of assembly instruction, expand multiple sheets, and change the sheet name to distinguish. If you need to expand according to the number of subtask sets in the future use, you can directly copy the corresponding type of sheet and modify the sheet name according to the subtask serial number.

[0070] Step 4, read the excel document and convert it into the input format of the assembler, use the xlrd library provided by python to read the document according to the format of the json document, combine the alias in column A and the value of each part of the instruction in a one-to-one correspondence way and store it in the json file. In order to facilitate the use of PC without installing python, the python program is packaged as a windows executable program.

[0071] Step 4, configure batch processing command stage, since python reads excel file, output json file execution needs to make some input, output file name, in order to reduce the number of times of inputting these parameters when using python, a batch file is needed, the input and output file name and other parameters need to be specified are written into the file, each time you only need to run the batch command file.

[0072] It should be noted that a desktop front-end interface can be made by QT / C# to edit assembly instructions, and the input value is directly read by the front-end interface to store and integrate the json file in a suitable data structure.

[0073] In the embodiment, the development of the library function without the help of the reconfigurable processor compiler needs to edit the assembly instructions on a suitable editing tool using the assembly language based on the target architecture. The application designs a special editing tool according to the characteristics of the target architecture assembly instructions. Since the assembly instructions contain values and characters, both the values and the characters are within a certain range. Considering that the excel table has the characteristics of limiting the input values and selecting the input characters through the drop-down menu, and most of the PCs using the windows system will install the excel software. If the excel table is used to edit the instructions, only a table with a set format needs to be provided for multiple people to use and avoid program compatibility problems. The excel document can be read by various tools and converted into an input for the assembler tool.

[0074] Through the embodiments provided in the application, by limiting the input values and limiting the drop-down selection range of the input characters, the possibility of errors can be reduced. Since the detection of input value errors is increased, the possibility of inputting unreasonable values can be effectively reduced. Since the mature excel table is used as the carrier of the assembly program, a front-end interface does not need to be developed separately, the time cost of development is reduced, and the readability is improved to facilitate subsequent debugging. With the help of the flexible third-party library of python, reading, integration, and saving as a json format document can be quickly realized.

[0075] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device) to execute the method described in each embodiment of the application.

[0076] In the embodiment, a reconfigurable processor function generation device is also provided, which is used to implement the above embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.

[0077] Figure 4 is a structure block diagram of the reconfigurable processor function generation device according to the embodiment of the application, as Figure 4As shown, the reconfigurable processor function generation apparatus comprises:

[0078] The obtaining unit 41 is configured to obtain the current assembly instruction according to the assembly language of the current reconfigurable processor function.

[0079] The configuration unit 43 is configured to configure the row and column items in the spreadsheet according to the current assembly instruction and the reconfigurable processor resource information involved.

[0080] The receiving unit 44 is configured to define the value verification condition in the current assembly instruction row according to the effective value condition of the current assembly instruction, and receive the input value according to the value verification condition.

[0081] The generation unit 47 is configured to generate the reconfigurable processor function according to the row and column items in the spreadsheet and the input value.

[0082] According to the embodiments provided in the present application, the obtaining unit 41 obtains the current assembly instruction according to the assembly language of the current reconfigurable processor function, the configuration unit 43 configures the row and column items in the spreadsheet according to the current assembly instruction and the reconfigurable processor resource information involved, the receiving unit 44 defines the value verification condition in the current assembly instruction row according to the effective value condition of the current assembly instruction, and receives the input value according to the value verification condition, and the generation unit 47 generates the reconfigurable processor function according to the row and column items in the spreadsheet and the input value, that is, only one table with a set format needs to be provided using the spreadsheet table editing instruction, which can be used by multiple people and avoids the program compatibility problem. The spreadsheet document can be read by multiple tools and converted into an input that can be used by the assembler tool, thereby solving the technical problem of low code execution efficiency in the prior art if the source code written by the user does not conform to the programming specification of the reconfigurable processor.

[0083] Optionally, the configuration unit 43 can include a first configuration module configured to configure the reconfigurable processing resource in the row item in the spreadsheet according to the reconfigurable processor resource information and a preset rule, a second configuration module configured to configure the assembly instruction in the column item in the spreadsheet according to the meaning indicated by the current assembly instruction, and an establishment module configured to establish a target correspondence relationship between the cells in the spreadsheet and the reconfigurable processor resource, wherein the cells are composed of the row item and the column item.

[0084] Optionally, the receiving unit 44 can include an acquisition module configured to acquire the maximum value and the minimum value of the current assembly instruction in a case where the effective value condition of the current assembly instruction is a value, and a definition module configured to define the value verification condition in the current assembly instruction row based on the maximum value and the minimum value.

[0085] Optionally, the first defining module comprises a determining sub-module configured to determine the data verification range based on the maximum value and the minimum value; and a defining sub-module configured to define the data verification range as the value verification condition in the current assembly instruction line.

[0086] Optionally, the device further comprises a responding unit configured to, after the data verification range is defined as the value verification condition in the current assembly instruction line, respond to the input value of the user in the electronic table, and if the input value meets the value verification condition, input the input value into the electronic table, and if not, output a prompt information.

[0087] Optionally, the receiving unit 44 can comprise a second defining module configured to, in the case that the valid value condition of the current assembly instruction is a character, define the value verification condition in the current assembly instruction line based on a preset character set.

[0088] Optionally, the device further comprises: expanding the assembly language of the current reconfigurable processor function to obtain the current assembly instruction, and expanding the reconfigurable processor function according to the current assembly instruction type, including: reading the electronic table converted into an assembler input format, reading the document using the xlrd library provided by python, and storing the meaning indicated by the current assembly instruction and the value of each part of the assembly instruction in a one-to-one corresponding manner into a json file according to the format of the json document.

[0089] Optionally, the device further comprises: a constructing unit configured to, after establishing the target correspondence relationship between the cells in the electronic table and the reconfigurable processor resources, construct a batch processing file; and a writing unit configured to write the input and output file name parameters to be specified into the batch processing file, so that only the batch processing command file needs to be run each time the batch file is executed.

[0090] It should be noted that each of the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: all the above modules are located in the same processor; or the above modules are located in different processors in any combination.

[0091] Embodiments of the present application also provide a storage medium having a computer program stored therein, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.

[0092] Optionally, in the present embodiment, the storage medium can be configured to store a computer program for executing the following steps:

[0093] S1, obtaining a current assembly instruction according to an assembly language of a current reconfigurable processor function;

[0094] S2, configuring row and column items in the electronic table according to the current assembly instruction and the information about the reconfigurable processor resources involved;

[0095] S3, defining a value verification condition in the current assembly instruction row according to an effective value condition of the current assembly instruction, and receiving an input value according to the value verification condition;

[0096] S4, generating the reconfigurable processor function according to the row and column items in the electronic table and the input value.

[0097] Optionally, in the embodiment, the storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various computer program storage media.

[0098] The embodiment of the application further provides an electronic device including a memory and a processor, the memory storing a computer program, and the processor being configured to execute the computer program to perform the steps in any of the method embodiments.

[0099] Optionally, the electronic device can further include a transmission device and an input / output device, wherein the transmission device is connected with the processor, and the input / output device is connected with the processor.

[0100] Optionally, in the embodiment, the processor can be configured to execute the following steps through the computer program:

[0101] S1, obtaining a current assembly instruction according to an assembly language of a current reconfigurable processor function;

[0102] S2, configuring row and column items in the electronic table according to the current assembly instruction and the information about the reconfigurable processor resources involved;

[0103] S3, defining a value verification condition in the current assembly instruction row according to an effective value condition of the current assembly instruction, and receiving an input value according to the value verification condition;

[0104] S4, generating the reconfigurable processor function according to the row and column items in the electronic table and the input value.

[0105] Optionally, specific examples in the embodiment can refer to the examples described in the above embodiments and optional implementation manners, and the embodiment will not be described here again.

[0106] It should be apparent to those skilled in the art that the modules or steps of the application described above can be implemented with general computing devices, which can be centralized on a single computing device or distributed over a network of multiple computing devices, and optionally implemented with program code executable by a computing device, which can be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described can be performed in a different order than shown, or made into individual integrated circuit modules, or multiple modules or steps made into a single integrated circuit module. Thus, the application is not limited to any particular combination of hardware and software.

[0107] The preferred embodiments of the application described above are intended to be merely illustrative, and not limiting. Having now described some embodiments of the application, it will be apparent to those of ordinary skill in the art that many modifications, substitutions, improvements, and other changes can be made to the application without deviating from the spirit and scope of the application.

Claims

1. A method of generating a reconfigurable processor function, characterized by, The method comprises the following steps: According to the current assembly language of the reconfigurable processor function, a current assembly instruction is obtained; According to the current assembly instruction and the related reconfigurable processor resource information, a row and a column item in a spreadsheet are configured; According to the valid numerical condition of the current assembly instruction, a numerical verification condition in the row of the current assembly instruction is defined; An input numerical value is received according to the numerical verification condition; The reconfigurable processor function is generated according to the row and the column item in the spreadsheet and the input numerical value. According to the current assembly language of the reconfigurable processor function, a current assembly instruction is obtained; According to the current assembly instruction and the related reconfigurable processor resource information, a row and a column item in a spreadsheet are configured; According to the valid numerical condition of the current assembly instruction, a numerical verification condition in the row of the current assembly instruction is defined; An input numerical value is received according to the numerical verification condition; 2. The method of claim 1, wherein, The reconfigurable processor function is generated according to the row and the column item in the spreadsheet and the input numerical value. According to the current assembly language of the reconfigurable processor function, a current assembly instruction is obtained; According to the current assembly instruction and the related reconfigurable processor resource information, a row and a column item in a spreadsheet are configured; According to the valid numerical condition of the current assembly instruction, a numerical verification condition in the row of the current assembly instruction is defined; 3. The method of claim 2, wherein, An input numerical value is received according to the numerical verification condition; The reconfigurable processor function is generated according to the row and the column item in the spreadsheet and the input numerical value. According to the current assembly language of the reconfigurable processor function, a current assembly instruction is obtained; 4. The method of claim 3, wherein, According to the current assembly instruction and the related reconfigurable processor resource information, a row and a column item in a spreadsheet are configured; According to the valid numerical condition of the current assembly instruction, a numerical verification condition in the row of the current assembly instruction is defined; 5. The method of claim 1, wherein, An input numerical value is received according to the numerical verification condition; The reconfigurable processor function is generated according to the row and the column item in the spreadsheet and the input numerical value. According to the current assembly language of the reconfigurable processor function, a current assembly instruction is obtained; 6. The method of claim 1, wherein, According to the current assembly instruction and the related reconfigurable processor resource information, a row and a column item in a spreadsheet are configured; According to the valid numerical condition of the current assembly instruction, a numerical verification condition in the row of the current assembly instruction is defined; 7. The method of claim 1, wherein, An input numerical value is received according to the numerical verification condition; The reconfigurable processor function is generated according to the row and the column item in the spreadsheet and the input numerical value. According to the current assembly language of the reconfigurable processor function, a current assembly instruction is obtained; According to the current assembly instruction and the related reconfigurable processor resource information, a row and a column item in a spreadsheet are configured; According to the valid numerical condition of the current assembly instruction, a numerical verification condition in the row of the current assembly instruction is defined; An input numerical value is received according to the numerical verification condition; The reconfigurable processor function is generated according to the row and the column item in the spreadsheet and the input numerical value. The reading of the spreadsheet is converted into an assembler input format, and the xlrd library provided by Python is used to read the document according to the format of the json document, and the meaning indicated by the current assembly instruction and the value of each part of the assembly instruction are combined in a one-to-one corresponding manner and stored into a json file.

8. An apparatus for generating a reconfigurable processor function, characterized by Comprise: A obtaining unit is configured to obtain a current assembly instruction according to an assembly language of a current reconfigurable processor function; A configuration unit is configured to configure row and column items in a spreadsheet according to the current assembly instruction and reconfigurable processor resource information involved; A receiving unit is configured to define a numerical verification condition in a row of the current assembly instruction according to a valid numerical condition of the current assembly instruction; Input numerical values are received according to the numerical verification condition; A generating unit is configured to generate the reconfigurable processor function according to the row and column items in the spreadsheet and the input numerical values; The configuration unit comprises: According to the reconfigurable processor resource information, the reconfigurable processing resource is configured in the row item in the spreadsheet according to a preset rule; According to the meaning indicated by the current assembly instruction, the assembly instruction is configured in the column item in the spreadsheet; A target correspondence relationship between a cell in the spreadsheet and the reconfigurable processor resource is established, wherein the cell is composed of a row item and a column item.

Citation Information

Patent Citations

  • Simulator based automatic functional test implementation method for central processing unit instruction sets

    CN104317715A

  • Test data introduction method and device, equipment and storage medium

    CN113961443A