Register access method, processor and electronic equipment

By designing preset instructions inside the processor and using offset addresses to access registers within the confbus address range, the problem of low development efficiency and high cost caused by different base addresses of different chips is solved, and efficient register access is achieved.

CN118535222APending Publication Date: 2024-08-23LOONGSON TECH CORP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410501362.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-24
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

During the chip development process, the register base addresses of different chips are different, resulting in the need to modify the base address of the access register every time, which is prone to modification omissions, increases development costs and reduces development efficiency.

Method used

A preset instruction is used to directly access a specific space in the memory, such as the address range space of confbus, through the internal hardware design of the processor. The offset address is used for register access to avoid modifying the base address each time.

Benefits of technology

It reduces omissions caused by modifying the base address, reduces chip development costs, improves development efficiency, and achieves a unified access method to different chip registers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535222A
    Figure CN118535222A
Patent Text Reader

Abstract

The embodiment of the invention provides a register access method, a processor and electronic equipment, and the method comprises the steps: receiving a preset instruction, the preset instruction carries an offset address, and the offset address is based on a specified initial address corresponding to the preset instruction; the preset instruction is used for executing an access operation on a target register; determining a target address of the target register according to the specified initial address and the offset address; and executing the access operation on the target register according to the target address. According to the embodiment of the invention, in the chip development process, the base address of the access register does not need to be modified every time for different chips, so that omissions caused by modification can be reduced, the chip development cost can be reduced, and the development efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a register access method, a processor and an electronic device. Background Art

[0002] Registers are an important part of the CPU, used to store and operate various states and control information of the chip, thereby realizing the control and configuration of the chip. Each register usually has a unique name and a fixed memory address, and the processor accesses the corresponding register by accessing the memory address.

[0003] However, the base addresses of registers in different chips may be different. For example, for the interrupt control register, the base address in chip A is 0x1fe11400; the base address in chip B is 0x14001400; the base address in chip C is 0x16001400; and so on. The base address refers to the starting address of the register space in the chip determined when the chip address space is divided. The memory address of the interrupt control register can be determined through the base address and the corresponding offset address, thereby accessing the interrupt control register.

[0004] During the chip development process, for different chips, the base address of the register to be accessed needs to be modified each time, which not only makes it easy for modification omissions to occur, but also increases the chip development cost and reduces development efficiency. Summary of the invention

[0005] In view of the above problems, an embodiment of the present invention is proposed to provide a register access method that overcomes the above problems or at least partially solves the above problems, which can avoid modifying the base address of the access register, not only can reduce omissions caused by modification, but also can reduce chip development costs and improve development efficiency.

[0006] Correspondingly, the embodiment of the present invention also provides a processor and an electronic device to ensure the implementation and application of the above method.

[0007] In a first aspect, an embodiment of the present invention discloses a register access method, the method comprising:

[0008] Receiving a preset instruction, the preset instruction carrying an offset address, the offset address being based on a specified starting address corresponding to the preset instruction; the preset instruction being used to perform an access operation on a target register;

[0009] Determining a target address of the target register according to the specified starting address and the offset address;

[0010] The access operation is performed on the target register according to the target address.

[0011] In a second aspect, an embodiment of the present invention discloses a processor, including:

[0012] A set of configuration registers;

[0013] General registers;

[0014] a decoder for decoding an instruction sequence, the instruction sequence including a preset instruction having a first operand indicating an offset address of a configuration register and a second operand indicating a general register; and

[0015] The execution unit is used to execute the preset instruction to identify the target address of the configuration register indicated by the start address of the configuration bus and the offset address, and to transfer data between the general register and the identified configuration register.

[0016] In the third aspect, an embodiment of the present invention discloses an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the steps of the register access method as described in any of the above.

[0017] The embodiments of the present invention include the following advantages:

[0018] The embodiment of the present invention provides a preset instruction based on the hardware design inside the processor, so that the processor can directly access a specific space in the memory (such as the address range space of confbus) through the preset instruction. For the target register whose address is within the specific space range, it can be accessed by using the preset instruction to carry the offset address. Through the embodiment of the present invention, during the chip development process, for different chips, it is not necessary to modify the base address of the access register every time, which can not only reduce omissions caused by modifications, but also reduce the chip development cost and improve development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of steps of an embodiment of a register access method of the present invention;

[0020] Figure 2 It is a schematic diagram of a chip structure of the present invention;

[0021] Figure 3 is a structural block diagram of an embodiment of a processor 300 device of the present invention;

[0022] Figure 4 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0023] 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.

[0024] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of the present invention, the term "multiple" refers to two or more, and other quantifiers are similar.

[0025] Figure 1 A flowchart of a register access method embodiment of the present invention is shown. The method is applied to a processor and may include the following steps:

[0026] Step 101: receiving a preset instruction, wherein the preset instruction carries an offset address, and the offset address is based on a specified starting address corresponding to the preset instruction; the preset instruction is used to perform an access operation on a target register;

[0027] Step 102: Determine the target address of the target register according to the specified starting address and the offset address;

[0028] Step 103: Perform the access operation on the target register according to the target address.

[0029] The register access method of the present invention can be applied to a processor, and realizes a universal method for a processor to quickly access a target register. For different chips, the base address of the target register does not need to be modified each time.

[0030] In the embodiment of the present invention, the target register refers to the register to be accessed by the processor. The embodiment of the present invention does not limit the type of the target register.

[0031] A chip is an integrated circuit that can contain one or more processors (Central Processing Unit, CPU), memory and other circuits, and is used to control and process information in electronic devices. A chip can include multiple functional modules, each of which usually contains a large number of registers, including control registers for reading and writing to control the working mode of each module and status registers for reading and marking the working status of the module, which can all be used as target registers.

[0032] Each functional module in the chip may include multiple registers. Registers with different functions in the same functional module have different numbers, and registers with the same function in different functional modules have the same number.

[0033] In an optional embodiment of the present invention, the target register may include a configuration register in a processor core; or the target register may include a chip-related register outside the processor core. That is, the target register may be an internal register (a register in the processor core) or an external register (a register outside the processor core).

[0034] The internal registers include configuration registers in the processor core for configuring the processor core, such as configuration registers that provide a mechanism for reading and writing configurations of various functions and states of the chip, such as exception configuration registers, exception entry address registers, mapping window registers, etc.

[0035] The external registers include chip-related registers outside the processor core, which are used to implement various functions of the chip, such as control registers for controlling various functions and modes of the chip, status registers for storing various status information of the chip, data registers for storing various data of the chip, etc.

[0036] An embodiment of the present invention provides a preset instruction (such as an IOCSR instruction), which can directly access a specified starting address, such as the starting address of a bus (such as confbus) through the hardware design inside the chip; for all registers mounted on the bus, it is only necessary to specify the corresponding offset address to perform the access operation.

[0037] Reference Figure 2 , shows a schematic diagram of a chip structure in an embodiment of the present invention. Figure 2 As shown in the figure, the processor is connected to the confbus through a multi-level interconnect bus, and the processor can use the IOCSR instruction to access the address space of the confbus. Registers 1 to n are mounted on the confbus, and the processor can use the IOCSR instruction to carry the offset address to access any register in registers 1 to n. It should be noted that Figure 2The chip shown may also include other functional modules (not shown in the figure).

[0038] In an example, assuming that the target register is an interrupt enable status register, in chip A, the address of the interrupt enable status register accessed by the processor is 0x1fe11424; in chip B, the address of the interrupt enable status register accessed by the processor is 0x14001424; in chip C, the address of the interrupt enable status register accessed by the processor is 0x16001424.

[0039] If the interrupt enable status register is accessed directly by using the base address plus the offset address, in chip A, the processor uses the base address 0x1fe10000 + offset address 0x1424 to access the interrupt enable status register; in chip B, the processor uses the base address 0x14000000 + offset address 0x1424 to access the interrupt enable status register; in chip C, the processor uses the base address 0x16000000 + offset address 0x1424 to access the interrupt enable status register.

[0040] It can be seen that the interrupt enable status register has different corresponding base addresses in chip A, chip B and chip C. The base address in the instruction for accessing the interrupt enable status register needs to be modified each time, which is not only prone to modification omissions, but also increases chip development costs and reduces development efficiency.

[0041] The present invention proposes a preset instruction (IOCSR instruction), which can directly access the starting address of confbus in different chips through the hardware design inside the chip. For example, in chip A, the starting address of confbus is 0x1fe10000; in chip B, the starting address of confbus is 0x14000000; in chip C, the starting address of confbus is 0x16000000.

[0042] Although the starting address of confbus is different in chip A, chip B and chip C, the preset instruction can directly access the starting address of confbus of the chip through the hardware design inside the chip. Therefore, in chip A, chip B and chip C, when accessing the interrupt enable status register, the preset instruction can be directly used to carry a fixed offset address to access the interrupt enable status register without caring about the base address of the target register.

[0043] For example, in chip A, the processor receives the IOCSR instruction and the offset address 0x1424, and can add the specified starting address 0x1fe10000 corresponding to the IOCSR instruction plus the offset address 0x1424 to obtain the target address of the target register (interrupt enable status register) as 0x1fe11424, so that the target address can be accessed to implement the access operation to the interrupt enable status register.

[0044] Similarly, in chip B, the processor receives the IOCSR instruction and the offset address 0x1424 to access the interrupt enable status register; in chip C, the processor receives the IOCSR instruction and the offset address 0x1424 to access the interrupt enable status register. For chip A, chip B, and chip C, the IOCSR instruction carrying the offset address can be used to access the interrupt enable status register.

[0045] The embodiment of the present invention provides a preset instruction based on the hardware design inside the processor, so that the processor can directly access a specific space in the memory (such as the address range space of confbus) through the preset instruction. For the target register whose address is within the specific space range, it can be accessed by using the preset instruction to carry the offset address. Through the embodiment of the present invention, during the chip development process, for different chips, it is not necessary to modify the base address of the access register every time, which can not only reduce omissions caused by modifications, but also reduce the chip development cost and improve development efficiency.

[0046] In an optional embodiment of the present invention, the specified starting address may be a starting address of a configuration bus (confbus) of a chip where the processor is located. The target register is a register mounted on the confbus.

[0047] The configuration bus (confbus) of the chip is used to configure the relevant registers of the chip's own functions, such as clock configuration, interrupt configuration, window configuration, etc.

[0048] Through the implementation of the present invention, the processor can use a preset instruction to carry an offset address to access any register mounted on the confbus and whose target address is within the address range of the confbus.

[0049] In an optional embodiment of the present invention, the preset instruction may include a read instruction for the target register or a write instruction for the target register; the read instruction is used to read a value from the target address (confbus start address + offset address) and save it to a specified register; the write instruction is used to write the value in the specified register to the target address. The specified register may be any register, such as a general register.

[0050] In one example, the preset instruction is defined as follows:

[0051] IOCSR{RD / WR}.{B / H / W / D}

[0052] Among them, the suffix of the form of ".XX" is used to indicate the type of the instruction operation object. For example, if the operation object is an integer type, the instruction name suffix .B, .H, .W, .D, .BU, .HU, .WU, .DU respectively indicates that the data type operated by the instruction is signed byte, signed halfword, signed word, signed doubleword, unsigned byte, unsigned halfword, unsigned word, unsigned doubleword.

[0053] According to the above definition of preset instructions, preset instructions can specifically include the following:

[0054] iocsrrd.b rd,rj

[0055] iocsrrd.h rd,rj

[0056] iocsrrd.wrd,rj

[0057] iocsrrd.d rd,rj

[0058] iocsrwr.brd,rj

[0059] iocsrwr.h rd,rj

[0060] iocsrwr.wrd,rj

[0061] iocsrwr.d rd,rj

[0062] In an embodiment of the present invention, the processor can perform a read access operation on the target register through a read instruction (IOCSRRD.B / H / W / D) in a preset instruction, and perform a write access operation on the target register through a write instruction (IOCSRWR.B / H / W / D) in a preset instruction.

[0063] The usage format of the read instruction IOCSRRD.B / H / W / D is as follows:

[0064] IOCSRRD.B / H / W / D rd,rj

[0065] Among them, the source operand rj register stores the offset address of the target register to be accessed relative to the starting address of confbus, and the read back content is written into the rd register.

[0066] The usage format of the write instruction IOCSRWR.B / H / W / D is as follows:

[0067] IOCSRWR.B / H / W / D rd,rj

[0068] The source operand rj register stores the offset address of the target register to be accessed relative to the starting address of confbus, and the rd register stores the value to be written into the target register.

[0069] The present invention uses a read instruction IOCSRRD.B / H / W / D and a write instruction IOCSRWR.B / H / W / D to carry an offset address, which can replace the original method of accessing a target register by adding a base address and an offset address.

[0070] It should be noted that the access operation to the target register may include a read operation to the target register or a write operation to the target register. In the embodiment of the present invention, the read operation is taken as an example for description.

[0071] Further, the preset instruction has a first operand indicating an offset address and a second operand indicating a designated register. Optionally, the first operand may be an immediate number or a general register.

[0072] The preset instruction can use an immediate addressing mode or a register addressing mode. The immediate addressing mode refers to directly giving the value of the first operand in the preset instruction. The register addressing mode refers to the first operand being stored in a general register, and the first operand is obtained through the name of the general register.

[0073] In the above example, the interrupt enable status register can be accessed by using a preset instruction carrying an offset address. Taking the read operation as an example, the processor can receive the following preset instruction:

[0074] iocsrrd.wrd 0x1424

[0075] This instruction indicates that the specified starting address corresponding to the IOCSR instruction (such as the confbus starting address) plus the offset address 0x1424 is used as the target address, and the value is taken from the target register at the target address and written into the general register rd. Among them, 0x1424 is an immediate value.

[0076] The above three chips, Chip A, Chip B and Chip C, can all use this instruction to read the interrupt enable status register without modifying the base address in the access instruction, which facilitates chip development and maintenance.

[0077] In an optional embodiment of the present invention, the offset addresses of the target registers in different chips relative to the specified starting address are the same.

[0078] During the iterative development of chips, when the registers are not updated, that is, the offset addresses of the registers relative to the confbus are the same, the same set of codes can be used to access the same registers for different chips, so that the chip code can be optimized by using preset instructions to carry the offset addresses, which can improve the compatibility of the chip code, further reduce omissions caused by modifications, reduce chip development costs, and improve development efficiency.

[0079] In an optional embodiment of the present invention, the method may further include:

[0080] Get the access address of the target register to be accessed;

[0081] Determine whether the access address is within the access address range of the preset instruction; if within the range, access the target register by using the preset instruction carrying the offset address; if not within the range, access the target register by using the base address plus the offset address.

[0082] Furthermore, the embodiment of the present invention can provide two ways to access the target register: one is to access the target register by using a preset instruction carrying an offset address; the other is to access the target register by using a base address plus an offset address.

[0083] For the target register to be accessed, the access address of the target register to be accessed can be obtained; the access address refers to the address of the target register in the memory. Determine whether the access address is within the access address range of the preset instruction. The access address range of the preset instruction refers to the address range of confbus. The embodiment of the present invention does not limit the address range of confbus. Assuming that the address range of confbus is 0x1FE0_0000-0x1FEF_FFFF, determine whether the access address of the target register is within the address range. If the access address of the target register is within the address range of confbus, the target register can be accessed by using a preset instruction carrying an offset address. In the above example, a preset instruction for accessing the target register is generated, such as iocsrrd.wrd,0x1424.

[0084] If the access address of the target register is not within the address range of confbus, the base address plus the offset address can be used to access the target register. In this case, the load / store instruction can be used for memory access. For example, for chip D, the access address of the target register is not within the address range of confbus, the base address of the target register is 0x40000000, the offset address is 0x1424, and the access address of the target register is 0x40001424. The following instruction can be generated: li.w rd, 0x40001424, which accesses the target register by adding the base address to the offset address. The li.w rd, 0x40001424 instruction is a load instruction, which is used to take the value from the target register at the address 0x40001424 and write it to the general register rd.

[0085] In the embodiment of the present invention, the access operation is mainly described as a read operation. For the write operation, the processing process is similar and will not be repeated here. For reference, for example, when the access address of the target register to be accessed is within the address range of confbus, the IOCSRWR.B / H / W / D instruction can be used to perform a write operation on the target register; when the access address of the target register to be accessed is within the address range of confbus, the store instruction can be used to perform a write operation on the target register.

[0086] It should be noted that the target registers listed in the embodiments of the present invention are only for illustrative purposes, and other types of registers also fall within the protection scope of the present invention.

[0087] In an optional embodiment of the present invention, the method may further include:

[0088] Multiple pre-set instructions for the same target register are received simultaneously and executed according to sequential consistency conditions.

[0089] In the embodiment of the present invention, the processor can simultaneously receive multiple preset instructions for the same target register, but should execute them according to the sequential consistency condition to avoid access errors. Sequential consistency means that different operations on the same processor are performed according to program order.

[0090] In summary, the embodiment of the present invention provides a preset instruction based on the hardware design inside the processor, so that the processor can directly access a specific space in the memory (such as the address range space of confbus) through the preset instruction. For the target register whose address is within the specific space range, it can be accessed by using the preset instruction to carry the offset address. Through the embodiment of the present invention, during the chip development process, for different chips, it is not necessary to modify the base address of the access register every time, which can not only reduce omissions caused by modifications, but also reduce the chip development cost and improve development efficiency.

[0091] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0092] Reference Figure 3 , shows a structural block diagram of a processor 300 device embodiment of the present invention, and the processor may include:

[0093] a set of configuration registers 301;

[0094] General register 302;

[0095] A decoder 303, configured to decode an instruction sequence, the instruction sequence comprising a preset instruction, the preset instruction having a first operand indicating an offset address of a configuration register and a second operand indicating a general register; and

[0096] The execution unit 304 is used to execute the preset instruction to identify the target address of the configuration register indicated by the configuration bus according to the start address of the configuration bus and the offset address, and to transfer data between the general register and the identified configuration register.

[0097] The configuration register refers to an internal register in the processor core used to configure the processor core, such as an exception configuration register, an exception entry address register, a mapping window register, etc. The configuration register provides a mechanism for reading and writing configurations of various functions and states of the chip.

[0098] The embodiment of the present invention provides a preset instruction (such as an IOCSR instruction), which can directly access the starting address of a configuration bus (such as confbus) through the hardware design inside the chip; for all registers mounted on the configuration bus, only the corresponding offset address needs to be specified to perform the access operation. In the embodiment of the present invention, the configuration register is a register mounted on the configuration bus.

[0099] In the embodiment of the present invention, the configuration register identified by the execution unit based on the preset instruction is called the target register. Based on the preset instruction, a read or write operation can be performed on the target register.

[0100] Optionally, the preset instruction includes a read instruction for a target register or a write instruction for a target register; the target register is the identified configuration register; the read instruction is used to read a value from the target address and save it to the general register; the write instruction is used to write the value in the general register to the target address.

[0101] Optionally, the first operand may be an immediate value or a general register.

[0102] The preset instruction can use an immediate addressing mode or a register addressing mode. The immediate addressing mode refers to directly giving the value of the first operand in the preset instruction. The register addressing mode refers to the first operand being stored in a general register, and the first operand is obtained through the name of the general register.

[0103] Optionally, the execution unit is also used to: obtain the access address of the target register to be accessed; determine whether the access address is within the access address range of the preset instruction; if within the range, access the target register using the preset instruction carrying the offset address; if not within the range, access the target register using the base address plus the offset address; the target register can be any preset register.

[0104] Optionally, the offset addresses of the same preset registers in different chips relative to the start address are the same.

[0105] Optionally, the execution unit is further configured to: simultaneously receive multiple preset instructions for the same preset register, and execute them according to sequential consistency conditions.

[0106] The embodiment of the present invention provides a preset instruction based on the hardware design inside the processor, so that the processor can directly access a specific space in the memory (such as the address range space of confbus) through the preset instruction. For the target register whose address is within the specific space range, it can be accessed by using the preset instruction to carry the offset address. Through the embodiment of the present invention, during the chip development process, for different chips, it is not necessary to modify the base address of the access register every time, which can not only reduce omissions caused by modifications, but also reduce the chip development cost and improve development efficiency.

[0107] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0108] Reference Figure 4 , is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, the electronic device includes: a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the steps of the register access method of any of the aforementioned embodiments.

[0109] An embodiment of the present invention provides a non-temporary computer-readable storage medium. When instructions in the storage medium are executed by a program or processor of a terminal, the terminal is enabled to execute the steps of the register access method of any of the aforementioned embodiments.

[0110] An embodiment of the present invention provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, the steps of the register access method in any of the above embodiments are performed.

[0111] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0112] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0113] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0114] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0116] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0117] Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A register access method, It is characterized in that Applied to a processor, the method comprises: Receiving a preset instruction, the preset instruction carrying an offset address, the offset address being based on a specified starting address corresponding to the preset instruction; the preset instruction being used to perform an access operation on a target register; Determining a target address of the target register according to the specified starting address and the offset address; The access operation is performed on the target register according to the target address.

2. The method according to claim 1, It is characterized in that The specified starting address is the starting address of the configuration bus of the chip where the processor is located.

3. The method according to claim 1, It is characterized in that The preset instruction includes a read instruction for the target register or a write instruction for the target register; the read instruction is used to read a value from the target address and save it to a specified register; the write instruction is used to write the value in the specified register to the target address.

4. The method according to claim 1, It is characterized in that The method further comprises: Get the access address of the target register to be accessed; Determine whether the access address is within the access address range of the preset instruction; if within the range, access the target register by using the preset instruction carrying the offset address; if not within the range, access the target register by using the base address plus the offset address.

5. The method according to claim 1, It is characterized in that The offset addresses of the target registers in different chips relative to the specified starting address are the same.

6. The method according to claim 1, It is characterized in that The target register is a configuration register in a processor core; or, the target register is a chip-related register outside the processor core.

7. The method according to claim 1, It is characterized in that The method further comprises: Multiple pre-set instructions for the same target register are received simultaneously and executed according to sequential consistency conditions.

8. A processor, It is characterized in that The processor comprises: A set of configuration registers; General registers; a decoder for decoding an instruction sequence, the instruction sequence including a preset instruction having a first operand indicating an offset address of a configuration register and a second operand indicating a general register; and The execution unit is used to execute the preset instruction to identify the target address of the configuration register indicated by the start address of the configuration bus and the offset address, and to transfer data between the general register and the identified configuration register.

9. The processor according to claim 8, It is characterized in that The preset instruction includes a read instruction for a target register or a write instruction for a target register; the target register is the identified configuration register; the read instruction is used to read a value from the target address and save it to the general register; the write instruction is used to write the value in the general register to the target address.

10. The processor according to claim 8, It is characterized in that The first operand is an immediate value or a general register.

11. An electronic device, It is characterized in that include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the steps of the register access method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Method and system for storing and recovering control information of chip kernel cluster

    CN121658281A