Register configuration method and device, equipment and storage medium
By determining the target configuration mode of the register based on the current running frame number and environment parameters, the problem of inefficient register configuration in the prior art is solved, and efficient register configuration and flexible scenario support are achieved.
Patent Information
- Application Number
- CN202411905005.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art has scenario limitations in register configuration, resulting in inefficient configuration, especially when using APB interfaces.
By obtaining the current running frame number and environment parameters, the target configuration mode of the register is determined, including preset linked list mode or preset APB mode, and register configuration is performed according to this mode.
It improves the efficiency of register configuration, supports compatibility and switching between preset APB mode and preset linked list mode, and enhances the flexibility of scenario support.
Smart Images

Figure CN119829132A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a register configuration method, device, equipment and storage medium. Background Art
[0002] In image-related chip applications, there are usually many parameters that need to be configured in registers, and the APB (Advanced Peripheral Bus) interface is a low-speed interface. If the APB interface is used for configuration, it takes a lot of time to configure the registers, resulting in reduced overall chip performance. For this reason, the linked list mode is introduced. The linked list mode means that the register configuration is written into the DDR (Double Data Rate SDRAM) in a certain format, and then the chip loads the register configuration through the AXI (Advanced eXtensible Interface) interface. The AXI interface is a high-speed interface, which will greatly improve the configuration efficiency of the entire chip, and can write multiple frame configurations at one time. However, there are still a small number of registers that always need to be configured using the APB mode. These registers may be related to the AXI bus or frame start configuration.
[0003] In order to ensure the correctness of the function and configuration of the registers, it is necessary to verify the configuration method of the registers and clarify the configuration method at any time. In the existing verification, the linked list mode loading and the APB mode loading are separated, but this method will have defects in the scenario. Summary of the invention
[0004] The present invention provides a register configuration method, device, equipment and storage medium, which are used to solve the defect of scene limitation when configuring registers in the prior art.
[0005] The present invention provides a register configuration method, comprising: Get the current running frame number; Based on the current running frame number and the environmental parameters, determining the current target configuration mode of the register; wherein the target configuration mode includes a preset linked list mode or a preset APB mode; Register configuration is performed based on the target configuration mode.
[0006] According to a register configuration method provided by the present invention, the environmental parameter includes a switching cycle, and determining the current target configuration mode of the register based on the current running frame number and the environmental parameter includes: If the switching period satisfies a first preset rule, determining that the target configuration mode is a first configuration mode; If the switching cycle satisfies the second preset rule, the target configuration mode is determined to be the second configuration mode; wherein the first configuration mode is the preset linked list mode, and the second configuration mode is the preset APB mode; or, the first configuration mode is the preset APB mode, and the second configuration mode is the preset linked list mode; the first preset rule and the second preset rule are related to the current running frame number.
[0007] According to a register configuration method provided by the present invention, the first preset rule and the second preset rule include: Compare the current running frame number with the switching period to obtain a comparison result; Based on the comparison result, determining that the target configuration mode is the first configuration mode or the second configuration mode; Correspondingly, if the switching period satisfies a first preset rule, determining that the target configuration mode is the first configuration mode includes: If the comparison result satisfies the first preset rule, determining that the target configuration mode is the first configuration mode; Correspondingly, if the switching period satisfies a second preset rule, determining that the target configuration mode is the second configuration mode includes: If the comparison result satisfies the second preset rule, the target configuration mode is determined to be the second configuration mode.
[0008] According to a register configuration method provided by the present invention, the environmental parameter also includes the number of mode operation frames, and the register configuration method further includes: After entering the target configuration mode, start counting the current mode to obtain the number of frames running in the mode; When the number of frames running in the mode reaches a preset value, the current mode is exited.
[0009] According to a register configuration method provided by the present invention, the environmental parameters also include a mode exit frame number. After entering the target configuration mode, when the mode running frame number is equal to the mode exit frame number, the current mode is exited and another target configuration mode different from the current mode is entered, and counting of the current target configuration mode is started.
[0010] According to a register configuration method provided by the present invention, the environmental parameter also includes a preset total number of running frames, and the register configuration method also includes: After exiting the current mode, determine whether the current running frame number reaches the preset total running frame number. If not, clear the mode running frame number, and determine the current target configuration mode of the register based on the current running frame number and environmental parameters for the next frame.
[0011] According to a register configuration method provided by the present invention, the register configuration based on the target configuration mode includes: If the target configuration mode is the preset APB mode, configuring the first register through the write function of regmodel; After the first register is configured, the frame start register is configured; wherein the frame start register only supports configuration in the preset APB mode.
[0012] The present invention also provides a register configuration device, comprising: The acquisition module is used to obtain the current running frame number; A determination module, configured to determine a current target configuration mode of a register based on the current running frame number and the environmental parameter; wherein the target configuration mode includes a preset linked list mode or a preset APB mode; A configuration module is used to perform register configuration based on the target configuration mode.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the register configuration methods described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the register configuration method described in any one of the above is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the register configuration method described above is implemented.
[0016] The register configuration method, apparatus, device and storage medium provided by the present invention determine the current target configuration mode of the register through the generated environmental parameters and the current running frame number, and realize the compatibility and switching of the preset APB mode and the preset linked list mode through the setting of the environmental parameters. It can support the configuration register of only the preset APB mode, the configuration register of only the preset linked list mode, and the random combination switching configuration register of the preset APB mode and the preset linked list mode, so as to achieve directional or random control of the two modes, achieve a greater degree of commonality, and improve the flexibility of scene support. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a flow chart of the register configuration method provided by the present invention.
[0019] Figure 2 It is a structural schematic diagram of the register configuration device provided by the present invention.
[0020] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] Combine the following Figure 1-Figure 3 The register configuration method, device, equipment and storage medium of the present invention are described.
[0023] Figure 1 FIG. 1 is a flow chart of a register configuration method according to an exemplary embodiment. Figure 1 As shown, in an exemplary embodiment, the register configuration method includes steps 110 to 180, which are described in detail as follows.
[0024] Step 110, obtaining the current running frame number.
[0025] In the embodiment of the present invention, environmental parameters are predefined: switching cycle, mode running frame number, mode exit frame number, and preset total running frame number. Before obtaining the current running frame number, the specific values of the switching cycle and mode exit frame number are randomly generated, and the randomly generated specific values must be positive integers. At the same time, the register configuration parameters required by the current chip are randomly generated. The current running frame number is the running frame number that enters the register configuration process.
[0026] Step 120, based on the current running frame number and environmental parameters, determine the current target configuration mode of the register; wherein the target configuration mode includes a preset linked list mode or a preset APB mode.
[0027] In the embodiment of the present invention, the current target configuration mode of the register is determined based on the current running frame number and environmental parameters. The target configuration mode includes a preset linked list mode or a preset APB mode. The preset linked list mode refers to writing the register configuration parameters into the DDR in a certain format, and then the chip loads the register configuration parameters through the axi bus interface. The preset APB mode writes the register configuration parameters in real time through a low-speed interface.
[0028] Step 130: Perform register configuration based on the target configuration mode.
[0029] In the embodiment of the present invention, after the current target configuration mode of the register is determined, the configuration mode of the register is set to the determined target configuration mode, and the register is configured based on the target configuration mode.
[0030] In an exemplary embodiment of the present invention, the environmental parameter includes a switching cycle, and determining the current target configuration mode of the register based on the current running frame number and the environmental parameter includes: If the switching period satisfies a first preset rule, determining that the target configuration mode is a first configuration mode; If the switching cycle satisfies the second preset rule, the target configuration mode is determined to be the second configuration mode; wherein the first configuration mode is the preset linked list mode, and the second configuration mode is the preset APB mode; or, the first configuration mode is the preset APB mode, and the second configuration mode is the preset linked list mode; the first preset rule and the second preset rule are related to the current running frame number.
[0031] In an embodiment of the present invention, as mentioned above, a switching period is predefined, and the switching period can generate a specific value in a random manner, wherein the switching period includes a linked list period (list_period) or an APB period (APB_period), and the switching period represents the period information corresponding to entering the corresponding configuration mode. At the same time, a first preset rule and a second preset rule are predefined. It is detected whether the switching period satisfies the first preset rule or the second preset rule, and the corresponding target configuration mode is determined according to the preset rule satisfied by the switching period. Specifically, the first preset rule corresponds to the preset linked list mode or the preset APB mode. When the first preset rule corresponds to the preset linked list mode, the second preset rule corresponds to the preset APB mode. When the first preset rule corresponds to the preset APB mode, the second preset rule corresponds to the preset linked list mode.
[0032] In an embodiment of the present invention, when the switching cycle is a linked list cycle and the switching cycle satisfies the first preset rule, the first configuration mode corresponds to the preset linked list mode; conversely, when the switching cycle is an APB cycle and the switching cycle satisfies the first preset rule, the first configuration mode corresponds to the preset APB mode.
[0033] In an exemplary embodiment of the present invention, the first preset rule and the second preset rule include: Compare the current running frame number with the switching period to obtain a comparison result; Based on the comparison result, determining that the target configuration mode is the first configuration mode or the second configuration mode; Correspondingly, if the switching period satisfies a first preset rule, determining that the target configuration mode is the first configuration mode includes: If the comparison result satisfies the first preset rule, determining that the target configuration mode is the first configuration mode; Correspondingly, if the switching period satisfies a second preset rule, determining that the target configuration mode is the second configuration mode includes: If the comparison result satisfies the second preset rule, the target configuration mode is determined to be the second configuration mode.
[0034] In an embodiment of the present invention, the current running frame number is compared with the switching period to obtain a comparison result, and then based on the comparison result, the target configuration mode is determined to be the first configuration mode or the second configuration mode. Specifically, if the comparison result satisfies the first preset rule, the target configuration mode is determined to be the first configuration mode. If the comparison result satisfies the second preset rule, the target configuration mode is determined to be the second configuration mode.
[0035] In an embodiment of the present invention, the current running frame number is compared with the switching period to obtain a comparison result, and based on the comparison result, the target configuration mode is determined to be the first configuration mode or the second configuration mode. This can be achieved specifically by determining the numerical relationship between the current running frame number and the switching period, performing mode judgment according to the numerical relationship, and determining that the current target configuration mode of the register is the first configuration mode or the second configuration mode based on the mode judgment result; wherein, the numerical relationship between the current running frame number and the switching period may refer to the remainder between the current running frame number and the switching period, then comparing the current running frame number with the switching period may be calculating the remainder between the current running frame number and the switching period, and determining that the target configuration mode is the first configuration mode or the second configuration mode based on the comparison result may be: determining that the target configuration mode is the first configuration mode or the second configuration mode based on the comparison result of the remainder and the switching threshold, and the switching threshold is obtained based on the switching period.
[0036] It should be noted that the switching cycle can be set to a variety of values as long as it can trigger the entry into the target configuration mode. This embodiment does not limit this. The switching threshold can be pre-set to the switching cycle minus 1, and the pre-set environmental parameters also include a preset total number of running frames; the target configuration mode is determined based on the numerical relationship between the current number of running frames and the switching cycle. For example, the first preset rule includes a switching cycle of 1, and the second preset rule includes a switching cycle greater than the preset total number of running frames. If the switching cycle is 1, it is determined that the switching cycle satisfies the first preset rule, and the target configuration mode is determined to be the first configuration mode; if the switching cycle is greater than the preset total number of running frames, specifically, when the switching cycle is set to 1, since the remainder of the current number of running frames and the switching cycle is always the switching cycle minus 1, the configuration mode of the register can be always in the first configuration mode, and the exit of the first configuration mode can be accurately controlled by setting the mode exit condition, and the first configuration mode is exited when the mode exit condition is met, and the first configuration mode is entered again in the next frame, and then the first configuration mode is exited when the mode exit condition is repeatedly met and the first configuration mode is entered in the next frame until the first configuration mode is finally exited, and the purpose of not exiting the first configuration mode can also be achieved by setting the mode exit condition; and when the switching cycle is greater than the preset total number of running frames, it can be always in the second configuration mode; when the switching cycle is set between 1 and the preset total number of running frames, it will switch between the first configuration mode and the second configuration mode, that is, if the switching cycle is greater than 1 and less than or equal to the preset total number of running frames, based on the current number of running frames and environmental parameters, it is determined that the current target configuration mode of the register is the first configuration mode or the second configuration mode.
[0037] In an embodiment of the present invention, the first preset rule also includes that the numerical relationship between the current running frame number and the switching period satisfies the first preset relationship, and the second preset rule also includes that the numerical relationship between the current running frame number and the switching period satisfies the second preset relationship.
[0038] Specifically, if the current running frame number starts counting from 0, the first preset relationship is that the current running frame number is between (nt-1) and (nt-1+p), where n is an integer not less than 1, and the value of n is increased by 1 each time the first configuration mode is entered and exited, t is the switching period, and p is the mode exit frame number; the second preset relationship is that the current running frame number is not between (nt-1) and (nt-1+p). If the switching period is set to 5, the mode exit frame number is set to 2, and the current running frame number starts counting from 0, when the current running frame number is counted between 0 and 3, n is 1, and the current running frame number is not between (1×5-1=4) and (1×5-1+2=6), the numerical relationship between the current running frame number and the switching period satisfies the second preset relationship, and the target configuration mode is the second configuration mode; when the current running frame number is counted between 4 and 6, the numerical relationship between the current running frame number and the switching period satisfies the first preset relationship, and the target configuration mode is the first configuration mode. When the current running frame count is between 7 and 8, n is 2, the current running frame count is not between (2×5-1=9) and (2×5-1+2=11), the numerical relationship between the current running frame count and the switching period satisfies the second preset relationship, and the target configuration mode is the second configuration mode; when the current running frame count is between 9 and 11, the numerical relationship between the current running frame count and the switching period satisfies the first preset relationship, and the target configuration mode is the first configuration mode, and so on, until the current running frame count reaches the preset total running frame count.
[0039] By analogy, if the current running frame number starts counting from 1, the first preset relationship is that the current running frame number is between (nt) and (nt+p), where n is an integer not less than 1, and the value of n is increased by 1 each time the first configuration mode is entered and exited, t is the switching period, and p is the mode exit frame number; the second preset relationship is that the current running frame number is not between (nt) and (nt+p).
[0040] In the embodiment of the present invention, it can be known from the above that if the current running frame number starts counting from 1, if the current running frame number is equal to the switching period or a positive integer multiple of the switching period, the target configuration mode is determined to be the first configuration mode.
[0041] In an embodiment of the present invention, the numerical relationship between the current running frame number and the switching cycle is the remainder of the current running frame number and the switching cycle. Mode judgment is performed according to the numerical relationship, and based on the mode judgment result and the mode running frame number, the current target configuration mode of the register is determined to be the first configuration mode or the second configuration mode. Specifically, the first preset relationship is that the remainder of the current running frame number and the switching cycle is equal to the switching threshold, and the switching threshold is the switching cycle minus 1; if the remainder is equal to the switching threshold, the target configuration mode is determined to be the first configuration mode, and when the current running frame number runs to the mode running frame number equal to the mode exit frame number, the first configuration mode is exited; otherwise, the target configuration mode is determined to be the second configuration mode. If the current running frame number is equal to the switching cycle, the target configuration mode is determined to be the first configuration mode, and it is the first time to enter the first configuration mode; if the switching cycle is the switching cycle of the linked list mode, if the current running frame number is equal to the switching cycle, the target configuration mode is determined to be the linked list mode, and if the switching cycle is the switching cycle of the APB mode, if the current running frame number is equal to the switching cycle, the target configuration mode is determined to be the APB mode.
[0042] In an exemplary embodiment of the present invention, the environmental parameter further includes the number of mode operation frames, and the register configuration method further includes: After entering the target configuration mode, start counting the current mode to obtain the number of frames running in the mode; When the number of frames running in the mode reaches a preset value, the current mode is exited.
[0043] In the embodiment of the present invention, after entering the target configuration mode, the timing is started to obtain the mode running frame number corresponding to the current target configuration mode, and when the mode running frame number reaches the preset value, the current target configuration mode is exited. As mentioned above, if the current running frame number starts counting from 0, the switching cycle is set to 5, and the mode exit frame number is set to 2, if the current running frame number is 4, the first configuration mode is entered, and then the counting is started to obtain the mode running frame number. When the mode running frame number reaches the preset value, the preset value is set to 2, that is, the mode running frame number reaches 2, the current mode is exited, at this time, the count of the current running frame number reaches 6, and when the count of the current running frame number reaches 7, the target configuration mode is set to the second configuration mode.
[0044] In an exemplary embodiment of the present invention, the environmental parameters also include a mode exit frame number. After entering the target configuration mode, when the mode running frame number is equal to the mode exit frame number, the current mode is exited and another target configuration mode different from the current mode is entered, and counting of the current target configuration mode is started.
[0045] In the embodiment of the present invention, a mode exit frame number is predefined, and the mode exit frame number represents the number of frames after entering the target configuration mode to exit the target configuration mode. After entering the target configuration mode, the timing is started, that is, the aforementioned mode operation frame number is obtained, and the mode operation frame number is compared with the mode exit frame number. If the mode operation frame number is equal to the mode exit frame number, the current mode is exited, and the configuration mode of the register is set to another mode. For example, if the current target configuration mode is the preset APB mode, when the mode operation frame number is equal to the mode exit frame number, the configuration mode of the register is set to the preset linked list mode.
[0046] In an exemplary embodiment of the present invention, the environmental parameters further include a preset total number of running frames, and the register configuration method further includes: After exiting the current mode, determine whether the current running frame number reaches the preset total running frame number. If not, clear the mode running frame number, and determine the current target configuration mode of the register based on the current running frame number and environmental parameters for the next frame.
[0047] In an embodiment of the present invention, a preset total running frame number is pre-set. After exiting the current mode, it is determined whether the current running frame number reaches the preset total running frame number. If not, the mode running frame number is cleared, and the next frame is determined based on the current running frame number and environmental parameters to determine the current target configuration mode of the register. If reached, the register configuration process is terminated.
[0048] In an exemplary embodiment of the present invention, the register configuration based on the target configuration mode includes: If the target configuration mode is the preset APB mode, configuring the first register through the write function of regmodel; After the first register is configured, the frame start register is configured; wherein the frame start register only supports configuration in the preset APB mode.
[0049] In the embodiment of the present invention, in UVM (Universal Verification Methodology), regmodel (register model) is an important component, which allows verification engineers to verify the design by simulating the behavior of hardware registers.
[0050] The write function is the key method to implement register write operations, which allows verification engineers to write data values to specified registers in hardware or design models through frontdoor or backdoor access. This operation is crucial to verify whether the register can store data correctly and whether the corresponding hardware behavior is as expected.
[0051] In an embodiment of the present invention, if the target configuration mode is the preset APB mode, the first register is configured through the write function of regmodel, that is, the front door access is performed through the write function, and the first register is configured according to the APB timing. During configuration, a mapping relationship between the first register and the corresponding register configuration parameters is established through the write function, so that the register configuration parameters corresponding to the first register can be read and written to other modules in real time using a low-speed interface in the future. The first register can be all the registers in the chip, or it can be a register in the chip except for registers such as the frame start register (start) that must be configured by the APB interface.
[0052] After the first register configuration is completed, the frame start register (start) is configured. The frame start register only supports configuration in the preset APB mode. During the entire configuration process, because it is unknown whether the preset linked list mode will be entered, in order to facilitate and quickly enter the preset linked list mode, when entering the preset linked list mode for the first time, it is necessary to configure frame_start and other registers that must be configured by the preset APB mode through the preset APB mode before entering the preset linked list mode. If it is not the first time to enter the preset linked list mode, you can not configure frame_start and other registers that must be configured by the preset APB mode.
[0053] In an exemplary embodiment of the present invention, if the target configuration mode is a preset linked list mode, the first register is configured through the set function of regmodel, and the first register configuration parameters are stored, that is, the first register is backdoor configured using the set function, that is, the register mode generated by UVM stores the register configuration parameters generated by the backdoor configuration. During the configuration process, a mapping relationship between the corresponding register and the corresponding register configuration parameter is established through the set function, and the register configuration parameters corresponding to the first register are stored in the register model, so as to facilitate the subsequent loading of the register configuration parameters through the axi bus interface.
[0054] The set function is a key method in regmodel, which is mainly used to set the expected values in the register mode so that subsequent operations can be performed based on these expected values.
[0055] After configuring the first register in the preset linked list mode and storing the first register configuration parameters, obtain the first register configuration parameters in the preset linked list mode through the get function of regmodel; arrange the first register configuration parameters in the preset linked list mode according to the data format of the preset linked list mode, and write the first register configuration parameters in the preset linked list mode into the corresponding DDR. The preset linked list mode writes the corresponding register configuration parameters into the DDR in a certain format, which is convenient for the chip to load the register configuration parameters configured in the preset linked list mode through the axi bus interface. Therefore, it is necessary to write its configuration parameters into the DDR in advance, which is convenient for the chip to load the register configuration parameters through the axi bus interface when in the preset linked list mode. However, the APB mode does not need to write the corresponding configurator parameters into the DDR, because the APB mode uses a low-speed interface and is written in real time.
[0056] In an embodiment of the present invention, randomly generated environmental parameters are used to determine when to enter the corresponding target configuration mode. Through the setting of environmental parameters, compatibility and switching between the preset APB mode and the preset linked list mode are achieved. Only preset APB mode configuration registers, only preset linked list mode configuration registers, and random combination switching configuration registers of the preset APB mode and the preset linked list mode can be supported to achieve directional or random control of the two modes, achieve a greater degree of commonality, and improve the flexibility of scenario support.
[0057] In an exemplary embodiment of the present invention, see Figure 2 , Figure 2 A register configuration device according to an exemplary embodiment includes: The acquisition module 210 is used to obtain the current running frame number; A determination module 220, configured to determine a current target configuration mode of a register based on the current running frame number and the environmental parameter; wherein the target configuration mode includes a preset linked list mode or a preset APB mode; The configuration module 230 is used to perform register configuration based on the target configuration mode.
[0058] In an exemplary embodiment of the present invention, the environmental parameter includes a switching period, and the determination module 220 includes: A first determination submodule, configured to determine that the target configuration mode is a first configuration mode if the switching period satisfies a first preset rule; The second determination submodule is configured to determine that the target configuration mode is the second configuration mode if the switching cycle satisfies a second preset rule; wherein the first configuration mode is the preset linked list mode, and the second configuration mode is the preset APB mode; or, the first configuration mode is the preset APB mode, and the second configuration mode is the preset linked list mode; the first preset rule and the second preset rule are related to the current running frame number.
[0059] In an exemplary embodiment of the present invention, the first preset rule and the second preset rule include: A comparison unit, configured to compare the current running frame number with the switching period to obtain a comparison result; A first determining unit, configured to determine, based on the comparison result, that the target configuration mode is the first configuration mode or the second configuration mode; Accordingly, the first determination submodule includes: a second determining unit, configured to determine that the target configuration mode is the first configuration mode if the comparison result satisfies the first preset rule; Accordingly, the second determination submodule includes: The third determining unit is configured to determine that the target configuration mode is the second configuration mode if the comparison result satisfies the second preset rule.
[0060] In an exemplary embodiment of the present invention, the environmental parameter further includes the mode operation frame number, and the register configuration device further includes: A counting module is configured to start counting the current mode after entering the target configuration mode to obtain the number of frames running in the mode; The exit module is configured to exit the current mode when the number of frames running in the mode reaches a preset value.
[0061] In an exemplary embodiment of the present invention, the environmental parameters also include a mode exit frame number. After entering the target configuration mode, when the mode running frame number is equal to the mode exit frame number, the current mode is exited and another target configuration mode different from the current mode is entered, and counting of the current target configuration mode is started.
[0062] In an exemplary embodiment of the present invention, the environmental parameters further include a preset total number of running frames, and the register configuration device further includes: The judgment module is configured to judge whether the current running frame number reaches the preset total running frame number after exiting the current mode. If not, the running frame number of the mode is cleared, and the next frame is determined based on the current running frame number and environmental parameters to determine the current target configuration mode of the register.
[0063] In an exemplary embodiment of the present invention, the configuration module 230 includes: A first configuration submodule is configured to configure a first register through a write function of regmodel if the target configuration mode is the preset APB mode; The second configuration submodule is configured to configure the frame start register after the first register is configured; wherein the frame start register only supports configuration in the preset APB mode.
[0064] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communications interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communications interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the register configuration method, which includes: obtaining the current running frame number; Based on the current running frame number and the environmental parameters, determining the current target configuration mode of the register; wherein the target configuration mode includes a preset linked list mode or a preset APB mode; Register configuration is performed based on the target configuration mode.
[0065] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0066] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the register configuration method provided by the above methods, the method includes: obtaining the current running frame number; Based on the current running frame number and the environmental parameters, determining the current target configuration mode of the register; wherein the target configuration mode includes a preset linked list mode or a preset APB mode; Register configuration is performed based on the target configuration mode.
[0067] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, the computer program being implemented when executed by a processor to execute the register configuration method provided by the above methods, the method comprising: obtaining the current running frame number; Based on the current running frame number and the environmental parameters, determining the current target configuration mode of the register; wherein the target configuration mode includes a preset linked list mode or a preset APB mode; Register configuration is performed based on the target configuration mode.
[0068] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0069] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A register configuration method, characterized in that: include: Get the current running frame number; Based on the current running frame number and the environmental parameters, determining the current target configuration mode of the register; wherein the target configuration mode includes a preset linked list mode or a preset APB mode; Register configuration is performed based on the target configuration mode.
2. The register configuration method according to claim 1, characterized in that: The environmental parameters include a switching cycle, and determining the current target configuration mode of the register based on the current running frame number and the environmental parameters includes: If the switching period satisfies a first preset rule, determining that the target configuration mode is a first configuration mode; If the switching cycle satisfies the second preset rule, the target configuration mode is determined to be the second configuration mode; wherein the first configuration mode is the preset linked list mode, and the second configuration mode is the preset APB mode; or, the first configuration mode is the preset APB mode, and the second configuration mode is the preset linked list mode; the first preset rule and the second preset rule are related to the current running frame number.
3. The register configuration method according to claim 2, characterized in that: The first preset rule and the second preset rule include: Compare the current running frame number with the switching period to obtain a comparison result; Based on the comparison result, determining that the target configuration mode is the first configuration mode or the second configuration mode; Correspondingly, if the switching period satisfies a first preset rule, determining that the target configuration mode is the first configuration mode includes: If the comparison result satisfies the first preset rule, determining that the target configuration mode is the first configuration mode; Correspondingly, if the switching period satisfies a second preset rule, determining that the target configuration mode is the second configuration mode includes: If the comparison result satisfies the second preset rule, the target configuration mode is determined to be the second configuration mode.
4. The register configuration method according to claim 1, characterized in that: The environmental parameters also include the number of mode operation frames, and the register configuration method also includes: After entering the target configuration mode, start counting the current mode to obtain the number of frames running in the mode; When the number of frames running in the mode reaches a preset value, the current mode is exited.
5. The register configuration method according to claim 4, characterized in that: The environmental parameters also include a mode exit frame number. After entering the target configuration mode, when the mode running frame number is equal to the mode exit frame number, the current mode is exited and another target configuration mode different from the current mode is entered, and counting of the current target configuration mode is started.
6. The register configuration method according to claim 4, characterized in that: The environmental parameters also include a preset total number of running frames, and the register configuration method also includes: After exiting the current mode, determine whether the current running frame number reaches the preset total running frame number. If not, clear the mode running frame number, and determine the current target configuration mode of the register based on the current running frame number and environmental parameters for the next frame.
7. The register configuration method according to any one of claims 1 to 6, characterized in that: The register configuration based on the target configuration mode includes: If the target configuration mode is the preset APB mode, configuring the first register through the write function of regmodel; After the first register is configured, the frame start register is configured; wherein the frame start register only supports configuration in the preset APB mode.
8. A register configuration device, characterized in that: include: The acquisition module is used to obtain the current running frame number; A determination module, configured to determine a current target configuration mode of a register based on the current running frame number and the environmental parameter; wherein the target configuration mode includes a preset linked list mode or a preset APB mode; A configuration module is used to perform register configuration based on the target configuration mode.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the register configuration method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the register configuration method according to any one of claims 1 to 7 is implemented.