Method for determining domain-specific instruction set

Through the automated domain-specific instruction set determination method, the optimal instruction subset for the application subfield is automatically determined from the domain-specific instruction set, which solves the problem of time-consuming and error-prone selection of the instruction subset manually, and improves the construction efficiency and performance of the RISC processor.

WO2025044229A1PCT designated stage expired Publication Date: 2025-03-06CHIPEASY TECHNOLOGY (SHANGHAI) LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/086960
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-25
Filing Date
2024-04-10
Publication Date
2025-03-06

AI Technical Summary

Technical Problem

When building RISC processors targeting specific application subfields, designers need to manually analyze and select the right subset of instructions, a process that is time-consuming and error-prone.

Method used

A domain-specific instruction set determination method is provided, and the optimal instruction subset for the application subfield is determined by automated means from the domain-specific instruction set, including obtaining the instruction set, classifying instructions, determining optimization goals, filtering and optimizing the candidate instruction subset, and finally building the optimal instruction subset of the RISC processor.

Benefits of technology

It realizes rapid filtering and optimization of instruction subsets, improves the construction efficiency of RISC processors, and ensures better performance, power consumption and area balance in specific application subfields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024086960_06032025_PF_FP_ABST
    Figure CN2024086960_06032025_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing. Disclosed is a method for determining a domain-specific instruction set. The method comprises: classifying instructions in a domain-specific instruction set to obtain multiple categories of instruction subsets; determining an optimization objective for each type of workload in a target application subdomain, the optimization objective comprising at least one of three design elements, i.e., performance, power consumption, and area; for each type of workload, determining multiple groups of candidate instruction subsets, any group of candidate instruction subsets at least comprising some instructions in each instruction subset; for each type of workload, on the basis of the optimization objective, screening and optimizing the multiple groups of candidate instruction subsets to obtain an optimal instruction subset for each type of workload; and on the basis of the optimal instruction subset for each type of workload, constructing an optimal instruction subset for an RISC processor of the target application subdomain. The present invention can automatically achieve optimized selection of instruction subsets.
Need to check novelty before this filing date? Find Prior Art

Description

A method for determining domain-specific instruction sets Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a method for determining a domain-specific instruction set. Background Art

[0002] With the rapid advancement of technology, there is an increasing demand for processors designed for specialized applications. These applications can be further divided into multiple sub-applications. RISC (Reduced Instruction Set Computer) processors are designed to target specific application sub-applications, aiming to achieve superior performance within those sub-applications.

[0003] When building a RISC processor for a specific application subfield, it is necessary to select the optimal instruction subset from the instruction set for the specific field. However, the inventors have discovered that selecting the optimal instruction subset from a large number of instruction sets to build a RISC processor for a specific application subfield presents the following technical problems:

[0004] Designers typically need to manually analyze and select the appropriate instruction subset, a process that is time-consuming and error-prone.

[0005] Summary of the Invention

[0006] Based on this, an embodiment of the present invention provides a method for determining a domain-specific instruction set to automatically achieve optimal selection of an instruction subset.

[0007] To achieve the above objectives, the present invention provides the following solutions:

[0008] A method for determining a domain-specific instruction set is applied to a domain-specific instruction set determination system or electronic device, the method comprising:

[0009] Obtaining a domain-specific instruction set; the domain-specific instruction set is a dedicated instruction set for a specific domain;

[0010] Classifying the instructions in the domain-specific instruction set to obtain instruction subsets of multiple categories;

[0011] Determining an optimization target for each type of workload in a target application sub-domain; the optimization target includes at least one of three design factors: performance, power consumption, and area; the target application sub-domain is an application sub-domain in the specialized domain;

[0012] For each type of workload, multiple groups of candidate instruction subsets are determined; wherein any group of candidate instruction subsets includes at least: some instructions in each instruction subset;

[0013] For each type of workload, screening and optimizing multiple groups of candidate instruction subsets based on the optimization goal to obtain the optimal instruction subset for each type of workload;

[0014] According to the optimal instruction subsets for various workloads, an optimal instruction subset for the RISC processor targeting the target application subfield is constructed.

[0015] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0016] The domain-specific instruction set determination method of an embodiment of the present invention initially selects multiple groups of candidate instruction subsets based on characteristic parameters and corresponding optimization goals, and then further screens and optimizes the multiple groups of candidate instruction subsets to obtain a final optimal instruction subset. The two screenings improve the search efficiency and can quickly and automatically determine the optimal instruction subset from the domain-specific instruction set. The optimal instruction subset is used to construct a RISC processor, thereby improving the construction efficiency of the RISC processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] FIG1 is an exemplary structural diagram of a domain-specific instruction set determination system provided by an embodiment of the present invention;

[0019] FIG2 is an exemplary flow chart of a method for determining a domain-specific instruction set according to an embodiment of the present invention;

[0020] FIG3 is another exemplary flow chart of a method for determining a domain-specific instruction set according to an embodiment of the present invention;

[0021] FIG4 is another exemplary flow chart of a method for determining a domain-specific instruction set according to an embodiment of the present invention;

[0022] FIG5 is an exemplary structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.

[0024] Existing RISC processors, due to the universal nature of their instruction sets, may not achieve the optimal balance between performance, power consumption, and area when used in different application sub-domains. Therefore, optimizing instruction subsets for specific application sub-domains is of great significance.

[0025] The purpose of the present invention is to provide a method for determining a domain-specific instruction set. By automatically determining the optimal instruction subset for an application sub-domain from the domain-specific instruction set, rapid screening of the instruction subset is achieved. Subsequently, an optimized RISC processor can be constructed based on the optimal instruction subset to achieve a better balance between performance, power consumption and area in a specific application sub-domain.

[0026] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0027] The above-mentioned domain-specific instruction set determination method can be executed by a domain-specific instruction set determination system or electronic device.

[0028] The electronic device may be a computer (such as a special-purpose computer, a general-purpose computer) that provides domain-specific instruction set determination services, an intelligent terminal (such as a smart phone, a wearable device, etc.), or other programmable devices, etc., or a large distributed system / device, such as a computer network / cluster, or a device that constitutes a computer network / cluster, without limitation here.

[0029] Please refer to Figure 1. The domain-specific instruction set determination system may exemplarily include: an instruction set acquisition module 101, an instruction classification module 102, an optimization target determination module 103, a candidate instruction subset determination module 104, an instruction screening and optimization module 105, a processor instruction set construction module 106, etc.

[0030] The domain-specific instruction set determination system can be in software or hardware form. When in software form, it can be used as independent software in electronic devices. Of course, it can also be used as a subsystem (subcomponent) of a larger system (such as an operating system) to provide domain-specific instruction set determination services;

[0031] When in hardware form, the domain-specific instruction set determination system may illustratively be a controller / processor of an electronic device.

[0032] Of course, each module shown in FIG1 may be a separate device, or each module may be integrated into one or more devices in any combination. For example, the instruction set acquisition module 101 and the instruction classification module 102 may be integrated into a single device in the form of software or hardware, the optimization target determination module 103 may be a separate device, and the candidate instruction subset determination module 104, the instruction screening and optimization module 105, and the processor instruction set construction module 106 may be integrated into a single device in the form of software or hardware.

[0033] For another example, the instruction set acquisition module 101, the instruction classification module 102, and the optimization target determination module 103 are integrated into a single device in the form of software or hardware; the candidate instruction subset determination module 104 and the instruction screening and optimization module 105 are integrated into a single device in the form of software or hardware; the processor instruction set construction module 106 is an independent device, and so on. Those skilled in the art can integrate any number of the above modules into the same device, and detailed description is omitted here.

[0034] This article will provide a more detailed introduction to domain-specific instruction set determination systems and electronic devices later.

[0035] The following describes a method for determining a domain-specific instruction set. Referring to FIG2 , the method may include the following steps:

[0036] Step 201: Obtain a domain-specific instruction set.

[0037] Generally, domain-specific instruction sets can be pre-designed. Domain-specific instruction sets are specialized instruction sets for a specific domain. Domain-specific instruction sets will be referred to as specialized instruction sets in the following.

[0038] Taking the field of digital signal processing as an example, the domain-specific instruction set is specifically a dedicated instruction set for the field of digital signal processing.

[0039] Taking the electronic device executing step 201 as an example, the domain-specific instruction set may be stored on a local storage medium of the electronic device, or on a non-local storage medium accessible to the electronic device, or on another device accessible to the electronic device. For example, the domain-specific instruction set may be stored in a database, a storage server, or the like.

[0040] When the above method is executed by a domain-specific instruction set determination system, step 201 may be illustratively executed by the instruction set acquisition module 101 in the system.

[0041] Step 202: Classify the instructions in the domain-specific instruction set to obtain instruction subsets of multiple categories.

[0042] When the above method is executed by a domain-specific instruction set determination system, step 202 may be illustratively performed by the instruction classification module 102 in the system.

[0043] In one example, referring to FIG. 3 , step 202 specifically includes:

[0044] Step 2021: extract characteristic parameters of each instruction in the domain-specific instruction set.

[0045] In one example, the domain-specific instruction set can be statically and dynamically analyzed to obtain the structural features (Structural Features) and runtime features (Runtime Features) of each instruction. The structural features and runtime features are characteristics of different aspects of the instruction in the instruction set; then, the characteristic parameters of each instruction can be determined based on the structural features and runtime features.

[0046] Static analysis and dynamic analysis can be performed in parallel or in any order, which will not be described in detail here.

[0047] The structural features are introduced below. Structural features describe the static properties and components of instructions. Structural features may include but are not limited to the following: The function of the instruction, which indicates the role of the instruction; the function includes but is not limited to: storage, access, logical operations, etc. The operation code (Opcode) of the instruction indicates the type and function of the instruction. The operands (Operands) of the instruction indicate the registers, memory addresses or immediate values ​​involved in the instruction. The format (Format) of the instruction indicates the layout and arrangement of the instruction in the binary representation. The bit width (Bit Width) of the instruction indicates the number of bits or bytes occupied by the instruction. The addressing mode (Addressing Modes) of the instruction indicates the way the instruction accesses the operand, such as direct addressing, indirect addressing, etc.

[0048] Runtime characteristics describe the dynamic behavior and performance of instructions during execution. Runtime characteristics may include, but are not limited to, the following: the execution time of the instruction (Execution Time), which represents the time required for the instruction to execute in the processor. The power consumption of the instruction (Power), which represents the energy consumed during the execution of the instruction. The memory access type of the instruction (Memory Access Type), which represents the type of memory accessed by the instruction, such as read, write, etc. The parallelism of the instruction (Parallelism), which represents whether the instruction can be executed in parallel or overlapped with other instructions. The data dependencies of the instruction (Data Dependencies), which represent the data dependencies between instructions.

[0049] The characteristic parameters finally determined based on the above structural characteristics and runtime characteristics include but are not limited to instruction function, instruction execution time, instruction power consumption, memory access type involved in the instruction, etc.

[0050] It should be noted that there are many feature extraction methods for extracting feature parameters, including but not limited to principal component analysis (PCA) and linear discriminant analysis (LDA). In addition, deep learning networks can also be used to extract feature parameters.

[0051] Step 2022: Classify the instructions in the domain-specific instruction set according to the instruction functions in the characteristic parameters to obtain instruction subsets of multiple categories.

[0052] For example, domain-specific instruction sets can be divided into multiple instruction subsets based on instruction function classification: storage access instruction subset, logical operation instruction subset, arithmetic operation instruction subset, etc.

[0053] Instructions in different classes of instruction subsets are Turing complete.

[0054] Turing-complete instructions can compute and simulate any possible computer algorithm using a basic set of operations and rules.

[0055] Step 203: Determine the optimization target for each type of workload in the target application sub-domain.

[0056] When the domain-specific instruction set is used to determine whether the system executes the above method, step 203 may be exemplarily performed by the optimization target determination module 103 in the system.

[0057] The target application sub-fields mentioned above are application sub-fields within specialized fields. Taking the specialized field of digital signal processing as an example, this field can be subdivided into application sub-fields such as embedded image processing and real-time image processing. The target application sub-field can be any of these application sub-fields.

[0058] In one example, the optimization target includes at least one of three design elements: performance (Performance, which may be abbreviated as P), power consumption (Power, which may be abbreviated as W), and area (Area, which may be abbreviated as A); the area refers to the chip area in the processor design.

[0059] First, let's introduce the workload.

[0060] Workloads can include various types of computation, data processing, communication, and storage operations.

[0061] A workload is a set of tasks or operations performed within a specific application scenario. It represents the actual application requirements and operating mode within that specific application scenario. A workload can consist of multiple tasks, which may be sequential, parallel, or interactive. For example, within the embedded image processing application sub-area, a workload might include tasks such as image acquisition and preprocessing, feature extraction and detection, image processing and enhancement, object tracking and motion estimation, and image segmentation and recognition.

[0062] In one example, referring to FIG. 4 , step 203 specifically includes:

[0063] Step 2031: Analyze workload characteristics of each workload in the target application sub-domain.

[0064] Examples of workload characteristics include, but are not limited to, computational requirements, data access patterns, parallelism requirements, data type and precision requirements, and instruction execution frequency. Precision requirements may include data precision level, data selection and rounding rules, error tolerance, numerical stability, and quantization error.

[0065] As mentioned above, a workload may contain multiple tasks, each of which may have different computational requirements, memory access patterns, parallelism requirements, etc., and therefore different requirements for processor performance and resources. Taking into account both computational and parallel requirements can better optimize the processor design and instruction subset selection to meet the workload's performance requirements and parallel processing capabilities. Therefore, understanding and analyzing the workload characteristics of specific application sub-domains helps determine the processor optimization targets and instruction subset design to provide the best balance between performance, power consumption, and area.

[0066] The aforementioned computational requirements characterize the computational resource requirements of each task within the workload. These characteristics can further include design factors such as the computational complexity, computational effort, and computationally intensive operations of each task. Different tasks may require different algorithms and computational operations to complete their functions.

[0067] The parallelism requirements mentioned above characterize whether tasks can be executed in parallel, that is, whether there are independent subtasks that can be performed simultaneously. This is because, within a workload, some tasks may be executed in parallel, leveraging the advantages of multi-core processors or parallel computing to accelerate processing. Parallelism requirements can involve design factors such as dependencies between tasks, data dependencies, and the design of parallel algorithms.

[0068] Among them, the instruction execution frequency can be estimated by the following method:

[0069] 1. Static analysis: By analyzing the task code within a workload, we can estimate the execution frequency of different instructions within each task. For example, we can analyze the loop structure of a task to determine the number of times each instruction within the loop is executed. This can be combined with the number of loop iterations to calculate an estimate of the instruction execution frequency.

[0070] 2. Simulated execution method: Use a simulator or emulation tool to run the workload in a simulated environment and record the number of times the instructions are executed. By running the simulated execution workload multiple times, you can calculate the average execution frequency of different instructions.

[0071] 3. Actual Operation Method: Run the workload on the actual hardware platform and use performance analysis tools to monitor the number of instruction executions. Specifically, this can be achieved through hardware performance counters or other performance analysis tools.

[0072] The estimated values ​​of the above instruction execution frequencies can be used as a reference to help determine which instructions are executed more frequently in the workload, thereby affecting the optimization direction and strategy of the instruction subset.

[0073] In one example, key indicators (such as instruction execution frequency, data access pattern, etc.) can be further determined from the workload characteristics to facilitate subsequent clustering.

[0074] In addition to the instruction execution frequency and data access pattern mentioned above, key indicators may also include the following: parallelism requirement characteristics, data type and accuracy requirement characteristics, computational complexity and amount of computation characteristics, real-time requirements of tasks, and communication requirements between tasks.

[0075] Step 2032: Cluster the workloads in the target application sub-domain based on the workload characteristics to obtain multiple types of workloads.

[0076] Data mining techniques such as cluster analysis can be used to group workloads based on similarities, creating different categories. Each category represents a type of workload with certain commonalities and characteristics.

[0077] There are many ways to cluster. For example, a k-means clustering method can be used to cluster workloads in the target application sub-domain to obtain multiple categories, each of which includes at least one workload.

[0078] Specifically, when using the k-means clustering method for clustering, the clustering can be preset to k clusters. Assuming k=20, the final clustering will obtain 20 clusters (ie, categories), and each cluster includes at least one workload.

[0079] Each workload can be considered as a sample / data point. The clustering process of the k-means clustering method exemplarily includes:

[0080] (1) Initialization. Randomly select k samples as the centers of the initial clusters (referred to as cluster centers for short).

[0081] (2) Cluster the samples.

[0082] For the cluster center selected during initialization, the distance from all samples to each center is calculated. The default Euclidean distance is used, and each sample is clustered into the class with the closest center to form the clustering result.

[0083] (3) Calculate the cluster center after clustering, and calculate the centroid of each class, that is, the mean of the samples in each class, as the new class center.

[0084] (4) Then re-execute steps (2) and (3) until the clustering results no longer change.

[0085] In one example, workloads can be clustered based on key metrics such as instruction execution frequency and data access patterns to better understand and describe different types.

[0086] The workload (samples / data points) can be represented in the form of vectors (x1, x2, ... xn).

[0087] In an example, each element in the above vector representation corresponds to a task of the workload. Taking the aforementioned workload including six tasks of image acquisition and preprocessing, feature extraction and detection, image processing and enhancement, target tracking and motion estimation, and image segmentation and recognition as an example, the workload can be expressed as: (x1, x2,...x6).

[0088] Furthermore, any element in the above vector representation can be a subvector, and each element in the subvector can correspond one-to-one with each indicator in the key indicators. Taking x1 as an example, assuming that x1 corresponds to the image acquisition and preprocessing task, x1 can be specifically a subvector, and each element of x1 can correspond one-to-one with the key indicator of the image acquisition and preprocessing task, and the value of the element corresponds to the value of the corresponding indicator. To facilitate the calculation of the distance between samples / data points, the values ​​of the elements in the subvector can be quantized (normalized) to numerical values.

[0089] In another example, each element in the above vector representation may correspond one-to-one to each of the above indicators.

[0090] Assuming the total number of key indicators is 2, each workload (sample / data point) can be represented as a vector (x1, x2).

[0091] The elements in the vector (x1, x2) can be further divided into sub-vectors, including the quantitative values ​​of multiple tasks on the corresponding key indicators. Taking x2 as an example, assuming that it corresponds to the key indicator of data type, since a workload may include multiple tasks, x2 can further include the quantitative value of the data type of each task. For example, assuming that a workload includes 9 tasks, then in the vector form of its workload characteristics, the second element (x2) can include the quantitative value of the quantity type of each of the 9 tasks (can be expressed using x2). 21 -x 29 ), then the vector (x1,x2) can be expressed as (x1,(x 21 , x 22 ,……,x 29 )).

[0092] Those skilled in the art can flexibly design the range of quantization values. For example, assuming there are M data types, M different decimals between 0 and 1 can be selected to represent different data types, thereby achieving quantization of the data types. These M different decimals are the quantization values ​​of the data types.

[0093] For how to quantify the values ​​of other key indicators, please refer to the above records and will not be elaborated here.

[0094] Alternatively, in another example, each element in the above vector representation corresponds one-to-one to each key indicator, and the value of each element is the average quantized value of multiple tasks on the corresponding key indicator.

[0095] Assuming the total number of key metrics is 2, each workload (sample / data point) can be represented as a vector (x1, x2). Still using x2 as an example, assuming it corresponds to the key metric data type, and assuming a workload consists of 9 tasks, the value of x2 in this example is the average of the data type quantization values ​​of these 9 tasks.

[0096] Step 2033: Determine the optimization target for each type of workload based on the performance, power consumption, and area requirements of each type of workload.

[0097] In the aforementioned steps, workload classification is mentioned. Furthermore, each type of workload may have at least one typical workload.

[0098] Typical workloads are representative, common workload samples within a specific application subdomain. When determining typical workloads, one or more representative workloads are typically selected from each workload category as typical samples. These typical workloads are representative and reflect the characteristics and requirements of that workload category. Therefore, there is a representativeness and relevance between typical workloads and various workload categories.

[0099] Therefore, in one example, the optimization objectives and demand characteristics of a certain type of workload may be specifically the optimization objectives and demand characteristics of its typical workload.

[0100] A workload generally includes one or more tasks. The optimization objective for a typical workload may further include the optimization objectives for each task within the typical workload. For example, assuming a typical workload includes a real-time image processing task and another task, where the optimization objectives for the image processing task include performance and power consumption, and the optimization objectives for the other task also include performance, then the optimization objectives for the typical workload may include both performance and power consumption.

[0101] A typical workload includes the performance, power consumption, and area requirements of each task. Continuing with the previous example, assuming the requirements for the real-time image processing task include both performance and power consumption, and the requirements for another task also include performance, then the requirements for the typical workload include both performance and power consumption.

[0102] Step 204: For each type of workload, determine (construct) multiple groups of candidate instruction subsets.

[0103] Wherein, any group of candidate instruction subsets at least includes: some instructions in the above-mentioned instruction subsets.

[0104] Specifically, any group of candidate instruction subsets includes multiple candidate instruction subsets, and the multiple candidate instruction subsets may correspond to different categories.

[0105] The candidate instructions in the candidate instruction subset can be understood as instruction encodings or combinations of instructions. The candidate instruction subset can be regarded as a set of instruction encodings with advantages for building an optimized processor design.

[0106] The aforementioned step 202 introduces that the instructions in the dedicated instruction set are divided into multiple categories of instruction subsets according to instruction functions.

[0107] In one example, similarly, when constructing any set of candidate instruction subsets, they can also be classified according to different functions, but are not limited to classification by function. The purpose of classification is to better organize and manage instructions and optimize them for the needs of specific application sub-fields.

[0108] Taking the classification and construction based on function as an example, it was mentioned above that the instructions in the dedicated instruction set are divided into multiple categories of instruction subsets according to their functions, for example, storage access instruction subsets, logical operation instruction subsets, arithmetic operation instruction subsets and other instruction subsets of various functional categories.

[0109] When constructing any set of candidate instruction subsets according to functions, a portion of instructions may be selected from the instruction subsets of each functional category to form a candidate instruction subset corresponding to the functional category.

[0110] For example, assume that the domain-specific instruction set is divided into 10 categories based on function, where the functional category of the first category instruction subset is storage access, including storage access instructions, the functional category of the second category instruction subset is logic operation, including logic operation instructions, and so on. Then, when constructing a set of candidate instruction subsets, a portion of instructions can be selected from the first category instruction subset to form a candidate instruction subset corresponding to the storage access function; similarly, a portion of logic operation instructions can be selected from the second category instruction subset to form a candidate instruction subset corresponding to the logic operation function, and so on for other functional categories.

[0111] The above classification method can help the system better organize and describe the characteristics of the instruction set, making the candidate instruction subset more readable and manageable.

[0112] In other embodiments of the present invention, the construction of any set of candidate instruction subsets is not limited to classification by function, but should also take into account the requirements and optimization goals of specific application sub-fields. This can ensure that the candidate instruction subsets achieve a better balance in terms of performance, power consumption, and area to meet the requirements of specific application sub-fields.

[0113] For example, if the optimization goal includes optimizing performance (such as execution efficiency, real-time), instructions can be selected based on execution time to construct any set of candidate instruction subsets. Specifically, instructions with relatively short execution time can be preferentially selected to construct candidate instruction subsets.

[0114] For example, if the optimization goal includes optimizing power consumption, then any set of candidate instruction subsets can be constructed based on power consumption. Specifically, instructions with relatively low power consumption can be prioritized. For another example, if the optimization goal includes optimizing parallelism, then any set of candidate instruction subsets can be constructed based on parallelism. Specifically, instructions that support parallelism can be prioritized. This process is analogous and will not be elaborated on here.

[0115] Furthermore, in other embodiments of the present invention, all of the above embodiments may also combine workload characteristics to construct candidate instruction subsets. For example, the aforementioned estimated values ​​of instruction execution frequency may be combined with these estimated values ​​to determine which instructions are executed more frequently in the workload, thereby prioritizing instructions with relatively higher execution frequencies when constructing any set of candidate instruction subsets.

[0116] In addition to directly selecting instructions, in other embodiments of the present invention, all of the above embodiments may combine instructions to implement specific functions or operations when constructing any set of candidate instruction subsets, thereby more effectively adapting to specific application sub-fields.

[0117] For example, suppose that in a certain application subdomain, matrix multiplication and convolution are frequently performed operations, but these operations are not implemented by corresponding instructions in the domain-specific instruction set, or even if they are implemented, the number is very small.

[0118] Then, instructions can be selected from the domain-specific instruction set to form multiple instruction combinations, each of which can perform the same operation, for example, matrix multiplication. The multiple instruction combinations with the same function can then constitute a candidate instruction subset for matrix multiplication.

[0119] For example, for feature extraction in a target tracking task, instructions can be selected from an instruction set and combined to obtain multiple instruction combinations, each of which can implement the feature extraction operation. These instruction combinations constitute a subset of candidate instructions for the feature extraction operation.

[0120] Similar processing can be performed for other specific operations such as convolution operations to obtain corresponding candidate instruction subsets.

[0121] Of course, for existing functional categories, instructions can be selected from the domain-specific instruction set to form at least one instruction combination to implement the existing functional category. For example, assuming that the storage access class instructions in the domain-specific instruction set do not support parallel storage, instructions can be selected from the domain-specific instruction set to form at least one instruction combination. The resulting instruction combination can support parallel storage, which is not described in detail here.

[0122] That is, for a specific functional category or specific operation, a candidate instruction subset can be constructed. This candidate instruction subset includes multiple instruction combinations that implement the specific functional category or specific operation. Each instruction combination is a combination of instructions selected from the domain-specific instruction set. These instruction combinations should be able to effectively execute the corresponding operations and implement the corresponding functions in the specific application subdomain and meet the optimization objectives.

[0123] In other embodiments of the present invention, all of the above embodiments, when constructing any set of candidate instruction sets, may also construct a subset of candidate instructions that implements a specific task in the workload. The specific task may be a frequently executed task, a task that has a significant impact on the optimization target, or any task.

[0124] Taking the image compression task as an example, at least one instruction combination can be selected from the dedicated instruction set so that each instruction combination can implement the image compression task. Such instruction combinations constitute a candidate instruction subset for image compression in image processing.

[0125] That is, in this embodiment, a candidate instruction subset for a specific task can be constructed. This candidate instruction subset includes multiple instruction combinations that implement the specific task. Each instruction combination is a combination of instructions selected from the domain-specific instruction set. Each combination can effectively implement the corresponding task and is evaluated and selected in the subsequent optimization process.

[0126] Regardless of the method used to construct the candidate instruction subset, construction constraints can be set according to the needs of the application sub-domain, such as the maximum subset size, minimum performance requirements, etc.

[0127] The size of the largest subset and the minimum performance requirement can be determined based on instruction characteristic parameters and workload key indicators.

[0128] For example, suppose the optimization goals include performance and power consumption, where the performance metric is execution time and the power consumption metric is power consumption. The size of the maximum subset and the minimum performance requirement are determined based on the above two criteria as follows:

[0129] Determine the maximum subset size: Based on resource constraints and optimization goals, select an appropriate maximum subset size. Assuming the processor has a certain number of physical resources, such as registers and functional units, the maximum subset size can be selected within the processor's resource limits to avoid overly complex instruction subsets.

[0130] Determining the minimum performance requirement: Based on the performance goal, for example, optimizing performance, that is, shortening execution time, when evaluating each set of candidate instruction subsets, select the instruction subset that performs better in terms of execution time. Assuming an evaluation method is used, for each candidate instruction subset, a quantitative value of execution time (e.g., a value between 0 and 1) can be used to measure its execution time performance. Then, a threshold is set as the minimum performance requirement, and instruction subsets with execution time quantitative values ​​below the threshold are selected as candidate instruction subsets.

[0131] When the above method is executed by a domain-specific instruction set determination system, step 204 may be illustratively performed by the candidate instruction subset determination module 104 in the system.

[0132] Step 205: For each type of workload, multiple groups of candidate instruction subsets are screened and optimized based on the optimization goal to obtain the optimal instruction subset for each type of workload.

[0133] When the above method is executed by a domain-specific instruction set determination system, step 205 may be illustratively executed by the instruction screening optimization module 105 in the system.

[0134] In one example, screening may be performed first and then optimization, and step 205 may specifically include:

[0135] 1. Screen multiple groups of candidate instruction subsets for each type of workload to obtain an initial screened instruction subset for each type of workload.

[0136] Different screening methods can be used for screening. Two screening methods are provided below as examples. These two methods can be used alone or in combination.

[0137] Screening method 1 (verification method):

[0138] (1) Simulate or actually run each candidate instruction subset on a corresponding typical workload. By analyzing and evaluating the typical workload, we can better understand the workload characteristics of a specific application subdomain and further determine the optimization goals and instruction subset selection. Typical workloads can be used to analyze and optimize instruction subsets to meet the needs of a specific application subdomain.

[0139] As an example, in step 203, a certain workload may include tasks such as image acquisition and preprocessing, feature extraction and detection, image processing and enhancement, target tracking and motion estimation, image segmentation and recognition, etc.

[0140] In the examples above, each task can be considered a subtask or a specific operation. These tasks form a typical workload, representing the actual requirements and operating modes of a specific application domain. Therefore, the entire set of tasks in the examples above (image acquisition and preprocessing, feature extraction and detection, image processing and enhancement, object tracking and motion estimation, and image segmentation and recognition) can be considered a typical workload.

[0141] (2) Evaluate the operation evaluation results of each group of candidate instruction subsets during the operation process; the operation evaluation results are used to characterize the performance of the group of candidate instruction subsets on each design element included in the optimization target.

[0142] Assuming that the optimization target includes two design elements, the operation evaluation result includes evaluation values ​​for the two design elements. For example, if the optimization target includes performance, the operation evaluation result includes evaluation values ​​for performance.

[0143] If a design factor further includes design sub-factors, the evaluation value for that design factor in the operational evaluation results may further include evaluation values ​​for the design sub-factors. For example, assuming that the design factor "performance" further includes execution efficiency, the operational evaluation results may include an evaluation value for execution efficiency.

[0144] Those skilled in the art can flexibly design the value range of the evaluation value, for example, it can be 0-1, which will not be described in detail here.

[0145] In addition, if a design element or design sub-element has only two possibilities, "yes" and "no", then its corresponding evaluation value can be 0 or 1 (of course, it can also be two other different numerical values / characters).

[0146] (3) Determine an initial screening instruction subset for the workload type based on at least the execution evaluation results of each group of candidate instruction subsets.

[0147] In this step, each group of candidate instruction subsets can be screened according to the operation evaluation results to obtain a candidate instruction subset that performs relatively better in terms of the optimization goal as the initial screened instruction subset.

[0148] For example, assuming that the optimization objectives include power consumption and area, and assuming that there are P groups of candidate instruction subsets, the running evaluation results of each group of candidate instruction subsets represent their performance in power consumption and area. Then, from the P groups of candidate instruction subsets, at least one group of candidate instruction subsets that can reduce power consumption and area can be selected as the initial screening instruction subset.

[0149] It should be noted that the above screening process evaluates the performance of the candidate instruction subset on a specific workload through actual application or simulation operation, which is closer to the actual application scenario, but may require a longer time and resources.

[0150] Screening method 2 (evaluation method):

[0151] (1) Using an evaluation method, a quantitative evaluation is performed on each candidate instruction subset to obtain a quantitative evaluation result. The quantitative evaluation result includes a quantitative value of the candidate instruction subset on each design element included in the optimization target; each quantitative value is used to characterize the performance of the candidate instruction subset on each design element included in the optimization target.

[0152] Assuming that the optimization target includes two design elements, the quantitative evaluation result includes quantitative values ​​for the two design elements. For example, if the optimization target includes performance, the operation evaluation result includes quantitative values ​​for performance.

[0153] If a design factor further includes design sub-factors, the quantitative value for the design factor in the quantitative evaluation result may further include the quantitative values ​​for the design sub-factors. For example, assuming that the design factor performance further includes execution efficiency, the quantitative evaluation result includes the quantitative value for execution efficiency.

[0154] Those skilled in the art can flexibly design the range of the quantization value, for example, it can be 0-1; still taking execution efficiency as an example, in the quantitative evaluation results, the quantization value of execution efficiency can be any value between 0-1, which represents the quality of execution efficiency.

[0155] In addition, if a design element or design sub-element has only two possibilities, "yes" and "no", then its corresponding quantitative value can be 0 or 1 (of course, it can also be two other different numerical values / characters).

[0156] Examples of the above-mentioned evaluation methods include but are not limited to:

[0157] Simulator evaluation: Use a computer system simulator to simulate the execution of a subset of candidate instructions and collect performance, power consumption, and area metrics for evaluation. The simulator can provide detailed analysis of instruction execution behavior and performance estimates.

[0158] Hardware accelerator evaluation: Each candidate instruction subset is deployed on a hardware accelerator (such as an FPGA or ASIC) for actual execution, and its performance on different optimization targets is measured. Hardware accelerators can provide more realistic execution environments and performance data.

[0159] Benchmark evaluation: Use a series of known benchmarks to evaluate the performance of each candidate instruction subset under different workloads. Benchmarks can provide predictions of the performance of each candidate instruction subset in real-world application scenarios.

[0160] Analysis tool evaluation: Based on instruction set simulation models, performance analysis tools, debuggers, and code analysis tools, each candidate instruction subset is used to quickly simulate the implementation workload to evaluate the performance bottlenecks, memory access patterns, parallelism requirements, and other characteristics of the candidate instruction subset in the application sub-domain workload.

[0161] These evaluation methods can be used in combination or individually, and the appropriate method can be selected for evaluation based on specific needs and feasibility.

[0162] (2) Determine an initial screening instruction subset for the workload type based on at least the quantitative evaluation results of each group of candidate instruction subsets.

[0163] In this step, each group of candidate instruction subsets can be screened according to the quantitative evaluation results to obtain a candidate instruction subset that performs relatively better in terms of the optimization goal as the initial screened instruction subset.

[0164] For example, assuming that the optimization objectives include power consumption and area, and assuming that there are P groups of candidate instruction subsets, and each group of candidate instruction subsets has its own quantitative evaluation results in power consumption and area, then one or more groups of candidate instruction subsets with smaller power consumption quantization values ​​and smaller area quantization values ​​can be selected from the P groups of candidate instruction subsets as the initial screening instruction subsets.

[0165] It should be noted that the evaluation method uses simulation tools or other performance evaluation tools to perform rapid simulation and quantitative evaluation. Compared with the verification method, it is faster but may have relatively lower accuracy.

[0166] The two methods mentioned above can be combined. There are many ways to combine them, for example:

[0167] First, after obtaining the filtering instruction subsets using the two methods respectively, the intersection or union can be taken to obtain the final filtering instruction subset.

[0168] The second method is to obtain the operation evaluation results and the quantitative evaluation results corresponding to each group of candidate instruction subsets, and then use the operation evaluation results and the quantitative evaluation results to jointly determine the initial screening instruction subset.

[0169] The third method is to first use the evaluation method to determine X groups of screening instruction subsets from each group of candidate instruction subsets, and then use the verification method to further screen the X groups of screening instruction subsets:

[0170] It should be noted that if Y groups of candidate instruction subsets are constructed through step 104 , then X needs to be smaller than Y, and generally, X can be designed to be much smaller than Y.

[0171] Taking X=20 as an example, assuming that a total of 1000 candidate instruction subsets are constructed through step 104, an evaluation method can be first used to quickly screen out 20 candidate instruction subsets (referred to as target candidate instruction subsets) from these 1000 groups.

[0172] Then, the verification method is used to screen the above 20 groups of target candidate instruction subsets to obtain a screened instruction subset, which may specifically include:

[0173] Each of the 20 groups of target candidate instruction subsets is simulated or actually run on a corresponding typical workload; the operation evaluation results of each group of target candidate instruction subsets during the operation are evaluated; and an initial screening instruction subset is determined based on at least the operation evaluation results of each group of target candidate instruction subsets.

[0174] Please refer to the above records for specific details, which will not be repeated here.

[0175] The above-mentioned multiple combinations can complement each other, verifying the performance of candidate instruction subsets through actual operation and performing rapid performance quantitative evaluation through simulation and evaluation tools. This allows for a more comprehensive evaluation of the pros and cons of candidate instruction subsets and finding the optimal instruction subset in terms of PPA.

[0176] 2. Use the optimization algorithm to optimize the initial screening instruction subset of each type of workload to obtain the optimal instruction subset for each type of workload.

[0177] Specifically, an exemplary optimization process for this step may be to optimize the initial screened instruction subset for each workload type using a genetic algorithm or a simulated annealing algorithm to obtain the optimal instruction subset for each workload type. This article will provide a more detailed description later.

[0178] Step 206: Construct an optimal instruction subset for a “RISC processor targeting a target application sub-domain” based on the optimal instruction subsets for each type of workload.

[0179] When the above method is executed by a domain-specific instruction set determination system, step 206 may be exemplarily executed by the processor instruction set construction module 106 in the system.

[0180] In one example, step 206 specifically includes:

[0181] The optimal instruction subsets of all categories of workloads are unioned to obtain the optimal instruction subset of the target application subfield; the obtained optimal instruction subset is used to construct a RISC processor in the target application subfield.

[0182] The following is an application example to illustrate the method for determining the above-mentioned field-specific instruction set.

[0183] Assume that the application sub-field is embedded image processing system, as follows:

[0184] 1. Instruction set analysis and feature extraction

[0185] (1) Classify the pre-designed domain-specific instruction set. The classification yields N instruction subsets of different functional categories (e.g., a storage access instruction subset, a logic operation instruction subset, an arithmetic operation instruction subset, and multiple instruction subsets). For details, please refer to the aforementioned description and will not be elaborated on here.

[0186] (2) Using feature extraction methods such as principal component analysis (PCA), linear discriminant analysis (LDA), and deep learning networks, the instruction set is statically and dynamically analyzed to obtain feature parameters. Static and dynamic analysis can obtain structural features (such as the instruction's opcode, addressing mode, etc.) and runtime features (such as the instruction's execution time, power consumption, memory access type, etc.). For details, please refer to the above description and will not be repeated here.

[0187] 2. Workload analysis and optimization target determination

[0188] (1) Analyze the workload of application sub-domains.

[0189] This part corresponds to the aforementioned step 203. Specifically, it may include classifying the workloads of the application sub-fields, and further, determining at least one typical workload from each type of workload.

[0190] For an embedded image processing system, a workload may include the following tasks:

[0191] Image acquisition and preprocessing tasks: Acquire image data from sensors or external devices and perform preprocessing operations such as denoising, filtering, color space conversion, etc.

[0192] Feature extraction and detection tasks: Extract key features such as edges, corners, textures, etc. based on image data for applications such as target detection, target recognition, or image analysis.

[0193] Image processing and enhancement tasks: Various image processing algorithms such as image deblurring, image restoration, image enhancement, image compression, etc. can be applied to improve image quality or meet specific requirements.

[0194] Target tracking and motion estimation tasks: track the position and motion of the target in consecutive image frames, and estimate the target's trajectory, speed and other information.

[0195] Image segmentation and recognition tasks: Segment an image into different regions or objects and perform tasks such as object recognition, classification, or semantic segmentation.

[0196] (2) Extract key indicators of workload, such as instruction execution frequency, data access pattern, etc.

[0197] For details on how to extract the information, please refer to the introduction in the workload characteristics section above and will not be elaborated here.

[0198] (3) Determine the optimization goals and demand characteristics of each type of workload.

[0199] The optimization target includes at least one of performance, power consumption, and area.

[0200] Specifically, the optimization objectives and demand characteristics of a typical workload may be selected as the optimization objectives and demand characteristics of a class of workloads.

[0201] More specifically, the optimization goal of a typical workload may further include: the optimization goal of each task included in the workload. And the demand characteristics of the typical workload may include the demand characteristics of each task.

[0202] Taking a typical workload including edge detection, image compression, object tracking, and image enhancement as an example, their respective requirements and optimization goals are as follows:

[0203] The characteristics of edge detection task requirements mainly include performance requirements: sensitivity to edges, requiring high-precision edge detection algorithms and operations; high execution frequency; optimization goals are mainly aimed at performance, including: optimizing the performance and accuracy of edge detection algorithms; optimizing the execution efficiency of edge detection operations.

[0204] The characteristics of image compression task requirements mainly include performance requirements: the compression and encoding of image data requires the processing of large amounts of data; efficient compression algorithms and data processing operations are required; the optimization goals are mainly aimed at performance, including: improving the compression ratio and image quality of the image compression algorithm; and optimizing the speed and efficiency of data processing operations.

[0205] The characteristics of target tracking task requirements mainly include performance requirements: tracking and identifying targets in real-time images requires real-time and accuracy; complex target detection and tracking algorithms are required; optimization goals are mainly aimed at performance, including: improving the real-time and accuracy of target tracking algorithms; optimizing the efficiency of image processing and feature extraction operations.

[0206] Image enhancement tasks primarily require performance: enhancing, repairing, and improving images requires the application of various filtering, denoising, and restoration algorithms. Optimization objectives primarily focus on performance, including improving the effectiveness and processing speed of image enhancement algorithms and optimizing the efficiency of filtering and restoration operations.

[0207] 3. Candidate instruction subset generation and evaluation

[0208] (1) For the application sub-field of embedded image processing system, according to the results obtained in step 1 and step 2 (instruction subsets of multiple categories, characteristic parameters of instructions, optimization goals and demand characteristics of each type of workload, etc.), a part of instructions is selected from the instructions of each functional category to generate multiple groups of candidate instruction subsets.

[0209] The method for constructing any set of candidate instruction subsets can be found in the above records and will not be described in detail here.

[0210] (2) Using a verification method, at least one group (corresponding to the aforementioned filtered instruction subset) is selected from multiple groups of candidate instruction subsets.

[0211] The candidate instruction subset can be applied to a typical workload and evaluated for its performance on the optimization target through simulation or actual execution. For details, please refer to the previous section of this article and will not be repeated here.

[0212] In addition, in other embodiments of the present invention, the verification method and the evaluation method may be used in combination. The combination method can be referred to the above description and will not be described in detail here.

[0213] 4. Candidate instruction subset optimization

[0214] (1) Use optimization algorithms, such as genetic algorithms or simulated annealing algorithms, to further screen and optimize the candidate instruction subsets.

[0215] The following describes the optimization process using the simulated annealing algorithm as an example:

[0216] 1) According to the characteristics and requirements of the workload in the application sub-field of embedded image processing system, the parameters involved in the simulated annealing algorithm are set, such as objective function, initial solution state, initial temperature, temperature, and control parameters.

[0217] Define the objective function of the simulated annealing algorithm. The objective function can be determined based on the instruction characteristic parameters and workload key indicators of the aforementioned filtered instruction subset to quantify the performance of the initial filtered instruction subset in a specific application sub-field (embedded image processing system).

[0218] Furthermore, when determining the objective function, the following aspects can be considered:

[0219] Workload requirements: Based on the characteristics and requirements of the workload, determine the key metrics of the objective function. These metrics can include performance, power consumption, area, real-time performance, accuracy, etc., and are selected based on the specific application scenario.

[0220] Optimization Objective: Based on workload requirements and system performance optimization goals, determine the specific form of the objective function. The objective function can be a single metric or a comprehensive evaluation of multiple metrics. For example, methods such as weighted sum or weighted average can be used to comprehensively consider the importance of different metrics.

[0221] The impact of instruction characteristic parameters: Consider the impact of instruction characteristic parameters in the candidate instruction subset on the objective function. Instruction characteristic parameters can include instruction execution time, memory access patterns, parallelism requirements, etc. Based on the relationship between these parameters and the objective function, the objective function can be modeled accordingly.

[0222] For example, instruction execution time and parallelism requirements may be related to performance and real-time performance. Therefore, instruction execution time and parallelism requirements can be used as independent variables, and performance and real-time performance can be used as dependent variables to establish a functional relationship between the independent and dependent variables.

[0223] Initial solution state: The initial solution state is the starting point for the simulated annealing algorithm. It typically consists of a set of initial instructions from the initial screening instruction subset. The selection of the initial solution state can be based on the characteristic parameters of the candidate instruction subset and key workload indicators. For example, some commonly used instructions or instructions with high frequency can be selected as part of the initial solution state.

[0224] Initial temperature, temperature, and control parameters: These parameters determine the extent of exploration and convergence of the search space in the simulated annealing algorithm. Their selection can take into account the characteristic parameters of the candidate instruction subset and the workload's key metrics. For example, the initial temperature can be set based on metrics such as the performance and power consumption of the candidate instruction subset, while the temperature and control parameters can be adjusted based on the workload's key metrics and optimization goals to achieve better optimization results.

[0225] Furthermore, the setting of the initial temperature can be implemented in a variety of ways, for example, random setting or heuristic setting.

[0226] Random setting: You can explore the search space by randomly generating initial temperatures within a certain range. The size of the initial temperature should match the scale and characteristics of the problem. Generally speaking, a larger initial temperature can make it easier for the algorithm to escape from the local optimal solution, but may result in slower convergence.

[0227] Heuristic setting: Set a reasonable initial temperature based on the characteristics of the problem and empirical knowledge. For example, the initial temperature can be set based on the constraints of the problem, the range of the objective function, or existing heuristic information.

[0228] The above control parameters (such as cooling strategy, acceptance criteria, and number of iterations) are set as follows:

[0229] Cooling strategy: The cooling strategy determines the rate of temperature reduction. Common strategies include linear cooling, exponential cooling, and logarithmic cooling. The choice of cooling strategy and parameter settings can be adjusted based on the complexity of the problem and the characteristics of the search space.

[0230] Acceptance Criteria: The acceptance criterion defines how to accept or reject a new solution. A common acceptance criterion is the Metropolis criterion, which states that if a new solution is better than the current solution, it is accepted; otherwise, it is accepted with a certain probability, which is related to the temperature. The parameters in the acceptance criterion can be adjusted according to the characteristics of the problem to balance the capabilities of global and local search.

[0231] Iterations: Controls the total number of algorithm iterations or the termination condition. You can set an appropriate number of iterations based on the complexity of the problem and the convergence of the algorithm.

[0232] 2) Determine the relationship between the above parameters and the initial subset of screened instructions and key workload indicators, which can be adjusted and optimized through experiments and experience.

[0233] It should be noted that the setting of initial temperature and control parameters usually requires a certain amount of experience and experimental adjustment. Depending on the specific problem and actual situation, multiple experiments and optimizations can be performed to find the best parameter combination to obtain better algorithm performance and optimization results.

[0234] The following describes the optimization involving the genetic algorithm. The parameters of the genetic algorithm can be set as follows:

[0235] Population, crossover probability, and mutation probability settings: For example, the population size can be set to 50, the crossover probability to 0.8, and the mutation probability to 0.1.

[0236] The individuals in the genetic algorithm are the instructions in the selection instruction subset;

[0237] In addition, if a genetic algorithm is used for optimization, the selection operator, mutation operator, and crossover operator are methods used to operate individuals in the genetic algorithm, and they are determined as follows:

[0238] Selection Operator: The selection operator is used to select individuals for the next generation. When determining fitness, key metrics for various workloads in embedded image processing systems, such as performance, power consumption, and area, can be used to measure the quality of individuals. Based on the evaluation results of these metrics, individuals with the best performance are selected to form the next generation population.

[0239] Mutation Operator: A mutation operator is used to randomly mutate individuals, increasing the diversity of the population. Mutation methods can be determined based on the characteristic parameters of the instructions in the previously obtained filter instruction subset, including but not limited to changing the execution order of instructions, changing parameter settings within instructions, or other mutation operations. The purpose of mutation is to explore a wider solution space by introducing randomness.

[0240] Crossover Operator: The crossover operator is used to generate new individuals by exchanging certain characteristics between two individuals to produce offspring. The crossover method can consider the combination of instructions and characteristic parameters in the previously obtained filter instruction subset. For example, new individuals can be generated by exchanging certain instructions in the filter instruction subset or changing the order of the instructions.

[0241] Fitness is a metric used to evaluate the performance of an individual under a given workload. It is related to the instructions in the selected instruction subset and the data of the workload's key indicators. The specific determination method can be based on the design of a fitness function based on the workload's requirements and optimization goals. The fitness function comprehensively considers the data of key workload indicators, such as real-time performance, accuracy, and processing speed, quantifying these indicators into fitness values ​​to evaluate the performance of an individual.

[0242] It should be noted that the design of specific selection operators, mutation operators, crossover operators, and fitness functions needs to be customized according to the specific problem to ensure that they match the initial screening instruction subset and workload characteristics and achieve effective optimization.

[0243] (2) According to instruction characteristic parameters, workload key indicators and optimization goals, adjust the parameters and strategies of the optimization algorithm to obtain a better instruction subset in a specific application sub-field.

[0244] For example, using the simulated annealing algorithm as an example, during the optimization process, based on the characteristic parameters of the initial screening instruction subset, the workload's key indicators, and the optimization goal, we can select an appropriate objective function and initial solution state, adjust the initial temperature, and adjust the settings of the temperature and control parameters to find the optimal simulated annealing algorithm parameter combination and obtain the optimal instruction subset for a specific application subfield. This requires multiple experiments and repeated adjustments to obtain the best parameter configuration and optimization results, ultimately obtaining the optimal instruction subset for each workload type.

[0245] Furthermore, in other embodiments of the present invention, if there is more than one set of filtering instruction subsets, each set of filtering instruction subsets may be optimized using an optimization algorithm, and then each optimized set of filtering instruction subsets may be filtered using a screening method to obtain a final optimal instruction subset. The method for filtering using the screening method can be found in the aforementioned description and will not be further described here.

[0246] 5. Output the optimal instruction subset

[0247] (1) Output the optimized optimal instruction subset, which can be used to build a RISC processor for real-time image processing with high performance and low power consumption.

[0248] (2) Provide detailed information such as instruction encoding, instruction operation, and instruction control signals to facilitate subsequent processor design and implementation.

[0249] The above process demonstrates how, following steps 1 through 5, candidate instruction subsets are analyzed, generated, evaluated, and optimized to ultimately arrive at the optimal instruction subset for a specific application subdomain. By automating and optimizing instruction subset selection, this approach improves efficiency and accuracy while also being highly versatile and easy to implement. Furthermore, this method can be widely applied to various embedded systems, such as smartphones, IoT devices, and autonomous vehicles, helping to promote technological advancement and industrial development in related fields.

[0250] In order to execute the above-mentioned domain-specific instruction set determination method to achieve corresponding functions and technical effects, a domain-specific instruction set determination system is provided below.

[0251] Referring to FIG1 , the domain-specific instruction set determination system includes:

[0252] The instruction set acquisition module 101 is used to acquire a domain-specific instruction set; a domain-specific instruction set is a dedicated instruction set for a specific domain.

[0253] The instruction classification module 102 is used to classify the instructions in the domain-specific instruction set to obtain instruction subsets of multiple categories.

[0254] The optimization target determination module 103 is used to determine the optimization target for each type of workload in the target application sub-field; the optimization target includes at least one of the three design factors of performance, power consumption and area; the target application sub-field is an application sub-field in the dedicated field.

[0255] The candidate instruction subset determination module 104 is used to determine multiple groups of candidate instruction subsets for each type of workload based on the optimization objectives and characteristic parameters of each instruction in the domain-specific instruction set; wherein any group of candidate instruction subsets at least includes: some instructions in each instruction subset.

[0256] The instruction screening and optimization module 105 is used to screen and optimize multiple groups of candidate instruction subsets based on the optimization target for each type of workload to obtain the optimal instruction subset for each type of workload;

[0257] The processor instruction set construction module 106 is used to construct an optimal instruction subset for the RISC processor targeting a target application sub-field based on the optimal instruction subset for each type of workload.

[0258] For specific details, please refer to the previous records in this article and will not be repeated here.

[0259] Figure 5 shows a possible hardware structure of the electronic device described above, including: a bus, a processor, a memory, a communication interface, an input device, and an output device. The processor, the memory, the communication interface, the input device, and the output device are interconnected via a bus.

[0260] A bus may include a pathway that transfers information between components of a computer system.

[0261] The processor can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, etc., or it can be an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the solution of the present invention, or it can be a digital signal processor (DSP), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component.

[0262] The memory stores programs or scripts that implement the technical solutions of the present invention, and may also store an operating system and other key services. Specifically, the program may include program code, which includes computer operating instructions. Scripts are typically stored in text (e.g., ASCII) and are only interpreted or compiled when called.

[0263] Input devices may include devices that receive data and information input by the user, such as a keyboard, mouse, camera, voice input device, touch screen, etc.

[0264] Output devices may include means that allow information to be output to a user, such as a display screen or the like.

[0265] The communication interface may include any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.

[0266] The processor can implement the domain-specific instruction set determination method provided in the above embodiment by executing the program stored in the memory and calling other devices.

[0267] In addition, the domain-specific instruction set shown in FIG1 determines the functions of each module of the system, which can be implemented by the aforementioned processor executing the program stored in the memory and calling other devices.

[0268] Of course, each of the above modules can also be an independent device, or the above modules can be integrated into one or more devices in any combination. Please refer to the above description and will not be repeated here.

[0269] Professionals may further appreciate that the units and model steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0270] In the above embodiment, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product. The computer program product may be pre-written in the memory or downloaded and installed in the memory in the form of software.

[0271] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. Available media can be magnetic media, (such as floppy disk, hard disk, tape), optical media (such as DVD), or semiconductor media (such as solid state disk, SSD), etc.

[0272] When the computer instructions are executed, the domain-specific instruction set determination method described above in this document is implemented.

[0273] All of the above embodiments have the following advantages:

[0274] (1) High efficiency: By automatically selecting instruction subsets, the computer system can quickly select the optimal instruction subset for building a RISC processor from a pre-designed domain-specific instruction set. This is mainly reflected in further screening and optimization of multiple sets of selected candidate instruction subsets, which improves search efficiency.

[0275] (2) High Precision: Targeting specific application sub-fields, the system can automatically search for a subset of RISC processor instructions that exhibits advantages in PPA. This is primarily achieved by defining optimization targets and utilizing optimization algorithms for precise screening, ensuring that the selected instruction subset exhibits high precision in the specific sub-field.

[0276] (3) Strong versatility: The present invention is applicable to multiple application sub-fields and has broad practicality. This is mainly reflected in the pre-designed domain-specific instruction set, whose design ideas and characteristics enable it to cover the needs of different application sub-fields.

[0277] (4) Easy to implement and deploy: The present invention can be implemented on existing computer systems without the need for additional hardware or software support. This is mainly reflected in the fact that the entire process is executed by the computer system, making it easy to implement and deploy.

[0278] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0279] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.

Claims

1. A method for determining a domain-specific instruction set, characterized in that: Applied to a domain-specific instruction set determination system or electronic device, the domain-specific instruction set determination method includes: Acquire a domain-specific instruction set; the domain-specific instruction set is a dedicated instruction set for a specific domain; Classifying the instructions in the domain-specific instruction set to obtain instruction subsets of multiple categories; Determine an optimization target for each type of workload in a target application sub-field; the optimization target includes at least one of three design factors: performance, power consumption, and area; the target application sub-field is an application sub-field in the dedicated field; For each type of workload, multiple groups of candidate instruction subsets are determined; wherein any group of candidate instruction subsets at least includes: some instructions in each instruction subset; For each type of workload, multiple groups of candidate instruction subsets are screened and optimized based on the optimization goal to obtain the optimal instruction subset for each type of workload; According to the optimal instruction subsets of various workloads, an optimal instruction subset of the RISC processor for the target application subfield is constructed.

2. The method for determining a domain-specific instruction set according to claim 1, characterized in that: For each type of workload, multiple groups of candidate instruction subsets are screened and optimized based on the optimization goal to obtain the optimal instruction subset for each type of workload, specifically including: A screening method is used to screen multiple groups of candidate instruction subsets for each type of workload to obtain an initial screening instruction subset for each type of workload; The optimization algorithm is used to optimize the initial screening instruction subset for each type of workload to obtain the optimal instruction subset for each type of workload.

3. The method for determining a domain-specific instruction set according to claim 1, characterized in that: The instructions in the domain-specific instruction set are classified to obtain multiple categories of instruction subsets, including: Extracting characteristic parameters of each instruction in the domain-specific instruction set; the characteristic parameters include: instruction function; The instructions in the domain-specific instruction set are classified according to the instruction functions to obtain instruction subsets of multiple categories.

4. The method for determining a domain-specific instruction set according to claim 1, characterized in that: Determine optimization goals for each type of workload in the target application subdomain, including: Analyze the workload characteristics of each workload in the target application sub-domain; Based on the workload characteristics, clustering the workloads in the target application sub-field to obtain multiple types of workloads; Determine the optimization target for each type of workload based on the performance, power consumption, and area requirements of each type of workload.

5. The method for determining a domain-specific instruction set according to claim 2, characterized in that: Each workload category has at least one typical workload; A screening method is used to screen multiple candidate instruction subsets for each type of workload to obtain an initial screening instruction subset for each type of workload, specifically including: Simulate or actually run each set of candidate instruction subsets on corresponding typical workloads; The evaluation results of each candidate instruction subset during the evaluation process are used to characterize the performance of the candidate instruction subset on each design element included in the optimization target; An initial screening instruction subset for the workload type is determined based at least on the running evaluation results of each group of candidate instruction subsets.

6. The method for determining a domain-specific instruction set according to claim 2, characterized in that: A screening method is used to screen multiple candidate instruction subsets for each type of workload to obtain an initial screening instruction subset for each type of workload, specifically including: Using an evaluation method to perform quantitative evaluation on each group of candidate instruction subsets to obtain a quantitative evaluation result; the quantitative evaluation result includes a quantitative value of the group of candidate instruction subsets on each design element included in the optimization target; each quantitative value is used to characterize the performance of the group of candidate instruction subsets on each design element included in the optimization target; An initial screening instruction subset for the workload of this type is determined at least according to the quantitative evaluation results of each group of candidate instruction subsets.

7. The method for determining a domain-specific instruction set according to claim 2, characterized in that: The optimization algorithm is used to optimize the initial screening instruction subset of each type of workload to obtain the optimal instruction subset for each type of workload, including: Genetic algorithm or simulated annealing algorithm is used to optimize the initial screening instruction subset of each type of workload to obtain the optimal instruction subset of each type of workload.

8. The method for determining a domain-specific instruction set according to claim 1, characterized in that: According to the optimal instruction subsets of various workloads, the optimal instruction subsets of the RISC processor for the target application subfield are constructed, specifically including: The optimal instruction subsets of all categories of workloads are combined to obtain the optimal instruction subset of the target application subfield; the optimal instruction subset of the target application subfield is used to construct a RISC processor in the target application subfield.

9. The method for determining a domain-specific instruction set according to claim 3, characterized in that: Extract characteristic parameters of each instruction in the domain-specific instruction set, specifically including: Perform static and dynamic analysis on the domain-specific instruction set to obtain the structural and runtime characteristics of each instruction in the domain-specific instruction set; Based on the structural features and the runtime features, characteristic parameters of each instruction are determined.

10. The method for determining a domain-specific instruction set according to claim 9, characterized in that: The characteristic parameters also include: instruction execution time, instruction power consumption, and memory access type involved in the instruction.

Citation Information

Patent Citations

  • Method for generating vector processing instruction set architecture in high performance computing system

    CN101833468A

  • Parameterized specific instruction set processor design platform

    CN102446086A

  • RISC-V instruction set extension method for accelerating digital signal processing

    CN112256330A

  • Design and application method of DSP instruction set special for electric power

    CN114461277A

  • Method and system for automatically generating demand-to-software domain model based on instruction set

    CN115469860A