CN111651384B - Register reading and writing method, chip, subsystem, register set and terminal - Google Patents
Register reading and writing method, chip, subsystem, register set and terminal Download PDFInfo
- Publication number
- CN111651384B CN111651384B CN202010508128.4A CN202010508128A CN111651384B CN 111651384 B CN111651384 B CN 111651384B CN 202010508128 A CN202010508128 A CN 202010508128A CN 111651384 B CN111651384 B CN 111651384B
- Authority
- CN
- China
- Prior art keywords
- register
- target
- control module
- data
- central control
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/1668—Details of memory controller
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30098—Register arrangements
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M9/00—Parallel/series conversion or vice versa
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Information Transfer Systems (AREA)
Abstract
Description
技术领域technical field
本申请实施例涉及寄存器读写技术领域,特别涉及一种寄存器的读写方法、芯片、子系统、寄存器组及终端。The embodiments of the present application relate to the technical field of register reading and writing, and in particular to a method for reading and writing registers, a chip, a subsystem, a register set, and a terminal.
背景技术Background technique
在SoC(System on Chip,系统级芯片)设计领域中,为了实现指定的各个功能,在一个芯片上通常设计有多个子系统,每一个子系统通常包括若干个寄存器组。中央处理器(CPU)通过总线(bus)访问内部的各个子系统。In the field of SoC (System on Chip, system-on-chip) design, in order to realize various specified functions, multiple subsystems are usually designed on one chip, and each subsystem usually includes several register groups. The central processing unit (CPU) accesses various internal subsystems through the bus (bus).
相关技术中,当中央处理器需要访问子系统时,通过并行的方式将数据发送至子系统,子系统再通过总线进行译码。当总线完成译码时,寄存器组能够对完成译码的信息进行识别,从而进行信息的读写。In the related art, when the central processing unit needs to access the subsystem, it sends data to the subsystem in parallel, and the subsystem decodes it through the bus. When the decoding of the bus is completed, the register group can identify the decoded information, so as to read and write the information.
发明内容Contents of the invention
本申请实施例提供了一种寄存器的读写方法、芯片、子系统、寄存器组及终端。所述技术方案如下:Embodiments of the present application provide a method for reading and writing registers, a chip, a subsystem, a register set, and a terminal. Described technical scheme is as follows:
根据本申请的一方面内容,提供了一种寄存器的读写方法,应用于芯片中,所述芯片包括中央处理器、中央控制模块和子系统,所述子系统包括至少两个寄存器组,所述中央控制模块设置于所述中央处理器和所述子系统之间,且所述中央控制模块用于控制所述中央处理器与所述子系统之间的数据交互,所述方法包括:According to one aspect of the present application, a register reading and writing method is provided, which is applied in a chip, and the chip includes a central processing unit, a central control module and a subsystem, and the subsystem includes at least two register groups, the The central control module is arranged between the central processor and the subsystem, and the central control module is used to control the data interaction between the central processor and the subsystem, and the method includes:
所述中央控制模块并行接收所述中央处理器发送的目标标识信息和对应的目标命令;The central control module receives target identification information and corresponding target commands sent by the central processor in parallel;
所述中央控制模块将所述目标标识信息和所述对应的目标命令,转换为串行的数据,其中,所述串行的数据中,所述目标标识信息位于所述目标命令之前;The central control module converts the target identification information and the corresponding target command into serial data, wherein in the serial data, the target identification information is located before the target command;
所述中央控制模块向所控制的所述子系统中的寄存器组,通过串行的方式广播目标标识信息和对应的目标命令;The central control module broadcasts target identification information and corresponding target commands to the register groups in the controlled subsystem in a serial manner;
所述子系统中的第一寄存器组执行所述目标命令,所述目标命令用于指示所述寄存器组写入第一数据,或,用于指示所述寄存器组输出保存的第二数据,所述第一寄存器组是所述至少两个寄存器组中与所述目标标识信息对应的寄存器组。The first register group in the subsystem executes the target command, the target command is used to instruct the register group to write the first data, or is used to instruct the register group to output the saved second data, the The first register group is a register group corresponding to the target identification information among the at least two register groups.
根据本申请的另一方面内容,提供了一种寄存器的读写方法,应用于子系统中,所述子系统包括至少两个寄存器组,所述方法包括:According to another aspect of the present application, a register reading and writing method is provided, which is applied in a subsystem, the subsystem includes at least two register groups, and the method includes:
所述子系统中的寄存器组通过串行的方式接收目标标识信息,所述目标标识信息是中央控制模块广播的寄存器组的标识,所述中央控制模块设置于中央处理器和所述寄存器组之间,且所述中央控制模块用于控制所述中央处理器与所述寄存器之间的数据交互;The register group in the subsystem receives target identification information in a serial manner, and the target identification information is the identification of the register group broadcast by the central control module, and the central control module is arranged between the central processing unit and the register group time, and the central control module is used to control the data interaction between the central processing unit and the register;
所述子系统中的寄存器组通过串行的方式接收目标命令,所述目标命令用于指示所述寄存器组写入第一数据,或,用于指示所述寄存器组输出保存的第二数据,在串行的数据中,所述目标标识信息位于所述目标命令之前;The register group in the subsystem receives a target command in a serial manner, and the target command is used to instruct the register group to write the first data, or to instruct the register group to output the saved second data, In the serial data, the target identification information is located before the target command;
所述子系统中的第一寄存器组执行所述目标命令,所述第一寄存器组的标识与所述目标标识信息匹配;The first register group in the subsystem executes the target command, and the identifier of the first register group matches the target identification information;
所述子系统中的第二寄存器组不响应所述目标命令,所述第二寄存器组的标识与所述目标标识信息不匹配。The second register set in the subsystem does not respond to the target command, and the identification of the second register set does not match the target identification information.
根据本申请的另一方面内容,提供了一种寄存器的读写方法,应用于寄存器组中,所述方法包括:According to another aspect of the present application, a method for reading and writing a register is provided, which is applied to a register set, and the method includes:
通过串行的方式接收目标标识信息,所述目标标识信息是中央控制模块广播的寄存器组的标识,所述中央控制模块设置于中央处理器和所述寄存器组之间,且所述中央控制模块用于控制所述中央处理器与所述寄存器组之间的数据交互;The target identification information is received in a serial manner, the target identification information is the identification of the register group broadcast by the central control module, the central control module is arranged between the central processing unit and the register group, and the central control module for controlling data interaction between the central processing unit and the register set;
通过串行的方式接收目标命令,所述目标命令用于指示所述寄存器组写入第一数据,或,用于指示所述寄存器组输出保存的第二数据;receiving a target command in a serial manner, where the target command is used to instruct the register bank to write the first data, or to instruct the register bank to output the saved second data;
当所述目标标识信息与所述寄存器组的标识匹配时,执行所述目标命令。When the target identification information matches the register set identification, execute the target command.
根据本申请的另一方面内容,提供了一种芯片,所述芯片包括中央处理器、中央控制模块和子系统,所述子系统包括至少两个寄存器组,所述中央控制模块设置于所述中央处理器和所述子系统之间,且所述中央控制模块用于控制所述中央处理器与所述子系统之间的数据交互,According to another aspect of the present application, a chip is provided, the chip includes a central processing unit, a central control module, and a subsystem, the subsystem includes at least two register groups, and the central control module is set in the central between the processor and the subsystem, and the central control module is used to control the data interaction between the central processor and the subsystem,
所述中央控制模块,用于并行接收所述中央处理器发送的所述目标标识信息和对应的目标命令;The central control module is configured to receive the target identification information and the corresponding target command sent by the central processor in parallel;
所述中央控制模块,用于将所述目标标识信息和所述对应的目标命令,转换为串行的数据,其中,所述串行的数据中,所述目标标识信息位于所述目标命令之前;The central control module is configured to convert the target identification information and the corresponding target command into serial data, wherein, in the serial data, the target identification information is located before the target command ;
所述中央控制模块,用于向所控制的至少两个寄存器组,通过串行的方式广播目标标识信息和对应的目标命令;The central control module is configured to serially broadcast target identification information and corresponding target commands to at least two controlled register groups;
所述子系统中的第一寄存器组执行所述目标命令,所述目标命令用于指示所述寄存器组写入第一数据,或,用于指示所述寄存器组输出保存的第二数据,所述第一寄存器组是所述至少两个寄存器组中与所述目标标识信息对应的寄存器组。The first register group in the subsystem executes the target command, the target command is used to instruct the register group to write the first data, or is used to instruct the register group to output the saved second data, the The first register group is a register group corresponding to the target identification information among the at least two register groups.
根据本申请的另一方面内容,提供了一种子系统,所述芯片包括至少两个寄存器组:According to another aspect of the present application, a subsystem is provided, the chip includes at least two register groups:
所述子系统中的寄存器组通过串行的方式接收目标标识信息,所述目标标识信息是中央控制模块广播的寄存器组的标识,所述中央控制模块设置于中央处理器和所述寄存器组之间,且所述中央控制模块用于控制所述中央处理器与所述寄存器组之间的数据交互;The register group in the subsystem receives target identification information in a serial manner, and the target identification information is the identification of the register group broadcast by the central control module, and the central control module is arranged between the central processing unit and the register group time, and the central control module is used to control the data interaction between the central processing unit and the register set;
所述子系统中的寄存器组通过串行的方式接收目标命令,所述目标命令用于指示所述寄存器组写入第一数据,或,用于指示所述寄存器组输出保存的第二数据,在串行的数据中,所述目标标识信息位于所述目标命令之前;The register group in the subsystem receives a target command in a serial manner, and the target command is used to instruct the register group to write the first data, or to instruct the register group to output the saved second data, In the serial data, the target identification information is located before the target command;
所述子系统中的第一寄存器组用于执行所述目标命令,所述第一寄存器组的标识与所述目标标识信息匹配;The first register group in the subsystem is used to execute the target command, and the identifier of the first register group matches the target identification information;
所述子系统中的第二寄存器组不响应所述目标命令,所述第二寄存器组的标识与所述目标标识信息不匹配。The second register set in the subsystem does not respond to the target command, and the identification of the second register set does not match the target identification information.
根据本申请的另一方面内容,提供了一种寄存器组,所述寄存器组用于通过串行的方式接收目标标识信息,所述目标标识信息是中央控制模块广播的寄存器组的标识,所述中央控制模块设置于中央处理器和所述寄存器组之间,且所述中央控制模块用于控制所述中央处理器与所述寄存器组之间的数据交互;According to another aspect of the present application, a register set is provided, the register set is used to receive target identification information in a serial manner, and the target identification information is the identification of the register set broadcast by the central control module, the The central control module is arranged between the central processor and the register set, and the central control module is used to control the data interaction between the central processor and the register set;
通过串行的方式接收目标命令,所述目标命令用于指示所述寄存器组写入第一数据,或,用于指示所述寄存器组输出保存的第二数据;receiving a target command in a serial manner, where the target command is used to instruct the register bank to write the first data, or to instruct the register bank to output the saved second data;
当所述目标标识信息与所述寄存器组的标识匹配时,执行所述目标命令。When the target identification information matches the register set identification, execute the target command.
根据本申请的另一方面内容,提供了一种终端,所述终端包括本申请实施例中提供的芯片。According to another aspect of the present application, a terminal is provided, and the terminal includes the chip provided in the embodiment of the present application.
根据本申请的另一方面内容,本申请实施例还提供了一种计算机程序产品,该计算机程序产品存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现如本申请实施例提供的寄存器的读写方法。According to another aspect of the present application, the embodiment of the present application also provides a computer program product, the computer program product stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the program described in the embodiment of the present application. Read and write methods for the provided registers.
本申请提供的寄存器的读写方法,应用于芯片中,芯片包括中央控制模块和寄存器组,中央控制模块并行接收中央处理器发送的目标标识信息和对应的目标命令,中央控制模块将上述信息转换为串行的数据,在串行数据中,目标标识信息位于目标命令之前,中央控制模块向所控制的至少两个寄存器组,通过串行的方式广播上述信息,至少两个寄存器组中对应目标标识信息的寄存器组执行目标命令,实现了在不借助总线系统的情况下完成寄存器组与中央处理器之间的信息交互,通过增设中央控制模块,将CPU以并行方式发出的数据转换为串行方式,后续在增加寄存器组时将寄存器组通过信号线连接至中央控制模块即可,在减少寄存器组时相应移除寄存器组和信号线即可,无需像以往那样需重新设计所有寄存器组与总线、CPU的连接方式,降低了芯片设计中新增或者减少寄存器组的设计难度。The register reading and writing method provided by this application is applied to the chip. The chip includes a central control module and a register group. The central control module receives the target identification information and the corresponding target command sent by the central processor in parallel, and the central control module converts the above information. It is serial data. In the serial data, the target identification information is located before the target command. The central control module broadcasts the above information in a serial manner to at least two controlled register groups. The corresponding target in at least two register groups The register group of identification information executes the target command, and realizes the information interaction between the register group and the central processing unit without the help of the bus system. By adding a central control module, the data sent by the CPU in parallel is converted into serial In the following way, when increasing the register group, the register group can be connected to the central control module through the signal line. When the register group is reduced, the register group and the signal line can be removed correspondingly. It is not necessary to redesign all the register groups and buses as in the past. , The connection mode of the CPU reduces the design difficulty of adding or reducing the register set in the chip design.
附图说明Description of drawings
为了更清楚地介绍本申请实施例中的技术方案,下面将对本申请实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还能够根据这些附图获得其它的附图。In order to more clearly introduce the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments of the present application will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present application , for those skilled in the art, other drawings can also be obtained based on these drawings without creative work.
图1是本申请一个示例性实施例提供的终端的结构框图;FIG. 1 is a structural block diagram of a terminal provided in an exemplary embodiment of the present application;
图2是一种基于标准总线的寄存器访问架构的示意图;FIG. 2 is a schematic diagram of a register access architecture based on a standard bus;
图3是本申请一个示例性实施例提供的一种寄存器访问架构的示意图;FIG. 3 is a schematic diagram of a register access architecture provided by an exemplary embodiment of the present application;
图4是本申请一个示例性实施例提供的一种寄存器访问架构的示意图;FIG. 4 is a schematic diagram of a register access architecture provided by an exemplary embodiment of the present application;
图5是本申请一个示例性实施例提供的一种寄存器访问架构的示意图;FIG. 5 is a schematic diagram of a register access architecture provided by an exemplary embodiment of the present application;
图6是本申请一个示例性实施例提供的一种寄存器的读写方法的流程图;FIG. 6 is a flow chart of a register reading and writing method provided by an exemplary embodiment of the present application;
图7是本申请实施例提供的一种寄存器组的有限状态机的示意图;FIG. 7 is a schematic diagram of a finite state machine of a register bank provided by an embodiment of the present application;
图8是本申请一个示例性实施例提供的一种寄存器的读写方法的流程图;FIG. 8 is a flow chart of a register reading and writing method provided by an exemplary embodiment of the present application;
图9是本申请实施例提供的一种中央控制模块的有限状态机的示意图;FIG. 9 is a schematic diagram of a finite state machine of a central control module provided by an embodiment of the present application;
图10是本申请另一个示例性实施例提供的一种寄存器的读写方法流程图;FIG. 10 is a flow chart of a register reading and writing method provided by another exemplary embodiment of the present application;
图11是本申请另一个示例性实施例提供的一种寄存器的读写方法流程图;FIG. 11 is a flow chart of a register reading and writing method provided by another exemplary embodiment of the present application;
图12是基于图4示出的一种寄存器组写入串行信号时序的示意图;FIG. 12 is a schematic diagram based on the timing sequence of a register bank write serial signal shown in FIG. 4;
图13是基于图4示出的一种从寄存器组中串行读取数据的时序的示意图。FIG. 13 is a schematic diagram based on the timing sequence of serially reading data from the register set shown in FIG. 4 .
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below in conjunction with the accompanying drawings.
下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present application as recited in the appended claims.
在本申请的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。在本申请的描述中,需要说明的是,除非另有明确的规定和限定,术语“相连”、“连接”应做广义理解,例如,能够是固定连接,也能够是可拆卸连接,或一体地连接;能够是机械连接,也能够是电连接;能够是直接相连,也能够通过中间媒介间接相连。对于本领域的普通技术人员而言,能够具体情况理解上述术语在本申请中的具体含义。此外,在本申请的描述中,除非另有说明,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示能够存在三种关系,例如,A和/或B,能够表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In the description of the present application, it should be understood that the terms "first", "second" and so on are used for descriptive purposes only, and should not be understood as indicating or implying relative importance. In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integrated Ground connection; can be mechanical connection, can also be electrical connection; can be directly connected, can also be indirectly connected through an intermediate medium. Those of ordinary skill in the art can understand the specific meanings of the above terms in this application in specific situations. In addition, in the description of the present application, unless otherwise specified, "plurality" means two or more. "And/or" describes the association relationship of associated objects, which means that there can be three kinds of relationships, for example, A and/or B, can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the contextual objects are an "or" relationship.
为了本申请实施例所示方案易于理解,下面对本申请实施例中出现的若干名词进行介绍。In order to make the solutions shown in the embodiments of the present application easy to understand, several terms appearing in the embodiments of the present application are introduced below.
串行的方式:在一条信号线中,数据通过队列的方式从中央控制模块传输到寄存器组中。例如,数据“010101”将在信号线中逐个从中央控制模块传输到寄存器组中。Serial way: In a signal line, data is transmitted from the central control module to the register group through a queue. For example, the data "010101" will be transferred one by one in the signal line from the central control module to the register bank.
目标标识信息:该信息是中央控制模块广播的寄存器组的标识。在一种可能的实现方式中,目标标识信息包括目标关键字和标识数据。例如,目标信息为“111+010”,则表示目标关键字是“111”,标识数据是“010”。在本申请中,不同数值的目标关键字用于表示不同的关键字。当目标关键字的是数值“111”时,表示该目标关键字是目标关键字,寄存器的标识是“010”。Target identification information: this information is the identification of the register group broadcast by the central control module. In a possible implementation manner, the target identification information includes target keywords and identification data. For example, if the target information is "111+010", it means that the target keyword is "111" and the identification data is "010". In this application, target keywords with different values are used to represent different keywords. When the value of the target key is "111", it means that the target key is a target key, and the identifier of the register is "010".
目标命令:包括读数据和写数据两种作用,当目标命令用于从寄存器组中读数据时,该命令用于指示寄存器组输出保存的第二数据。当目标命令用于向寄存器组中写数据时,该命令用于指示寄存器组中写入第一数据。Target command: includes two functions of reading data and writing data. When the target command is used to read data from the register bank, the command is used to instruct the register bank to output the saved second data. When the target command is used to write data into the register group, the command is used to instruct the first data to be written into the register group.
可选地,目标命令包括命令关键字。可选地,该命令关键字包括写入关键字和读取关键字。当命令关键字是写入关键字时,目标命令的类型是写入类型。当命令关键字是读取关键字时,目标命令的类型是读取类型。Optionally, the target command includes command keywords. Optionally, the command keywords include write keywords and read keywords. When the command keyword is the write keyword, the type of the target command is the write type. When the command keyword is a read keyword, the type of the target command is a read type.
可选地,当目标命令的类型是写入类型时,目标命令包括写入关键字和第一数据。寄存器组能够根据写入关键字确定需要往寄存器组自身中存储的数据,也即第一数据,进而将第一数据存入寄存器组中。Optionally, when the type of the target command is a write type, the target command includes a write keyword and the first data. The register set can determine the data to be stored in the register set itself according to the write keyword, that is, the first data, and then store the first data in the register set.
可选地,当目标命令的类型是读取类型时,目标命令包括读取关键字和第二数据。寄存器组能够根据读取关键字得知自身需要向外输出第二数据,进而该寄存器组将向外输出第二数据。Optionally, when the type of the target command is a read type, the target command includes a read keyword and the second data. The register set can know that it needs to output the second data to the outside according to the read keyword, and then the register set will output the second data to the outside.
示例性地,本申请实施例所示的寄存器的读写方法,能够应用在终端中,该终端包括本申请实施例中示出的芯片,且在本申请实施例所示的芯片中包括寄存器组。可选地,终端包括手机、平板电脑、膝上型电脑、台式电脑、电脑一体机、服务器、工作站、电视、机顶盒、智能眼镜、智能手表、数码相机、MP4播放终端、MP5播放终端、学习机、点读机、电纸书、电子词典、车载终端、虚拟现实(Virtual Reality,VR)播放终端或增强现实(AugmentedReality,AR)播放终端等。Exemplarily, the register reading and writing method shown in the embodiment of the present application can be applied in a terminal, the terminal includes the chip shown in the embodiment of the present application, and the chip shown in the embodiment of the present application includes a register group . Optionally, the terminals include mobile phones, tablet computers, laptop computers, desktop computers, all-in-one computers, servers, workstations, TVs, set-top boxes, smart glasses, smart watches, digital cameras, MP4 playback terminals, MP5 playback terminals, learning machines , point reader, electronic paper book, electronic dictionary, vehicle-mounted terminal, virtual reality (Virtual Reality, VR) playback terminal or augmented reality (Augmented Reality, AR) playback terminal, etc.
另一方面,本申请实施例还能够应用在芯片中,该芯片可以应用在上述终端中。On the other hand, the embodiment of the present application can also be applied in a chip, and the chip can be applied in the above-mentioned terminal.
请参考图1,图1是本申请一个示例性实施例提供的终端的结构框图,如图1所示,该终端10包括芯片100,芯片100包括处理器120、存储器140、子系统160和中央控制模块180,所述存储器140中存储有至少一条指令,所述指令由所述处理器120加载并执行以实现如本申请各个方法实施例所述的寄存器的读写方法。可选地,处理器120是中央处理器。芯片100包括中央处理器、中央控制模块180和子系统160,中央控制模块180设置于中央处理器和子系统160之间,且中央控制模块180用于控制中央处理器与子系统160之间的数据交互。Please refer to FIG. 1. FIG. 1 is a structural block diagram of a terminal provided by an exemplary embodiment of the present application. As shown in FIG. The
处理器120能够包括一个或者多个处理核心。处理器120利用各种接口和线路连接整个终端100内的各个部分,通过运行或执行存储在存储器140内的指令、程序、代码集或指令集,以及调用存储在存储器140内的数据,执行终端100的各种功能和处理数据。可选的,处理器120能够采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable LogicArray,PLA)中的至少一种硬件形式来实现。处理器120可集成中央处理器(CentralProcessing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示屏所需要显示的内容的渲染和绘制;调制解调器用于处理无线通信。能够理解的是,上述调制解调器也能够不集成到处理器120中,单独通过一块芯片进行实现。
存储器140能够包括随机存储器(Random Access Memory,RAM),也能够包括只读存储器(Read-Only Memory,ROM)。可选的,该存储器140包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器140可用于存储指令、程序、代码、代码集或指令集。存储器140可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等;存储数据区可存储下面各个方法实施例中涉及到的数据等。The
子系统160中能够设置在处理器外部。可选地,中央控制模块180设置在处理器和子系统之间,用于控制中央控制模块180与各个子系统的数据交互,在子系统中写入数据或者从子系统中读取数据。示意性的,子系统160可以实现为一组实体的电路。子系统160中包括至少两个寄存器组。例如,子系统160包括寄存器组161和寄存器组162。The
在本申请中,芯片100执行下列步骤:中央控制模块并行接收中央处理器发送的目标标识信息和对应的目标命令;中央控制模块将目标标识信息和对应的目标命令,转换为串行的数据,其中,串行的数据中,目标标识信息位于目标命令之前;中央控制模块向所控制的至少两个寄存器组,通过串行的方式广播目标标识信息和对应的目标命令;第一寄存器组执行目标命令,目标命令用于指示寄存器组写入第一数据,或,用于指示寄存器组输出保存的第二数据,第一寄存器组是至少两个寄存器组中与目标标识信息对应的寄存器组。In this application, the chip 100 performs the following steps: the central control module receives the target identification information and the corresponding target command sent by the central processor in parallel; the central control module converts the target identification information and the corresponding target command into serial data, Among them, in the serial data, the target identification information is located before the target command; the central control module broadcasts the target identification information and the corresponding target command to at least two controlled register groups in a serial manner; the first register group executes the target The command, the target command is used to instruct the register group to write the first data, or to instruct the register group to output the saved second data, the first register group is the register group corresponding to the target identification information among the at least two register groups.
在本申请中,子系统160执行下列步骤:所述子系统中的寄存器组通过串行的方式接收目标标识信息,所述目标标识信息是中央控制模块广播的寄存器组的标识;所述子系统中的寄存器组通过串行的方式接收目标命令,所述目标命令用于指示所述寄存器组写入第一数据,或,用于指示所述寄存器组输出保存的第二数据,在串行的数据中,所述目标标识信息位于所述目标命令之前;第一寄存器组用于执行所述目标命令,所述第一寄存器组的标识与所述目标标识信息匹配;第二寄存器组不响应所述目标命令,所述第二寄存器组的标识与所述目标标识信息不匹配。In this application, the
在本申请中,寄存器组161或寄存器组162执行下列步骤:通过串行的方式接收目标标识信息,所述目标标识信息是中央控制模块广播的寄存器组的标识,所述中央控制模块设置于中央处理器和所述寄存器组之间,且所述中央控制模块用于控制所述中央处理器与所述寄存器之间的数据交互;通过串行的方式接收目标命令,所述目标命令用于指示所述寄存器组写入第一数据,或,用于指示所述寄存器组输出保存的第二数据;当所述目标标识信息与所述寄存器组的标识匹配时,执行所述目标命令。In the present application, the
请参考图2,图2是一种基于标准总线的寄存器访问架构的示意图。在图2中,中央处理器210通过顶层总线220与各个子系统进行数据交互。在图2中,包括子系统1、子系统2和子系统共3个子系统。其中,以子系统1为例,介绍子系统1中的寄存器组和中央处理器进行数据交互的过程。Please refer to FIG. 2 , which is a schematic diagram of a register access architecture based on a standard bus. In FIG. 2 , the
当中央处理器210需要向子系统1中的寄存器组_2写入数据时,中央处理器210将子系统1中的寄存器组_2的地址添加在需要写入的数据头部,发送至顶层总线220,顶层总线220将该数据分别传送至子系统总线231、子系统总线241和子系统总线251中。由各个子系统总线和标准总线进行配合,对数据进行译码。当译码得到的寄存器组_2的地址与标准总线对应的寄存器组的地址相同时,标准总线2A将数据写入寄存器组_2中。示意性的,标准总线的线缆条数的数量级为101,标准总线较为复杂。当芯片中需要增加新的子系统或者新的寄存器组时,调试对应子系统总线和标准总线的工作量加大,使得芯片模块化开发的难度提高。可选地,标准总线是AHB(Advanced High performance Bus,高性能线缆)、APB(Advanced Peripheral Bus,外围总线)或者其它能够实现总线功能的线缆。When the
针对上述寄存器读写架构中存在的局限性,本申请提出了一种新的寄存器读写的架构,又称寄存器读写的控制协议,介绍如下。In view of the limitations in the above-mentioned register reading and writing architecture, this application proposes a new register reading and writing architecture, also known as a register reading and writing control protocol, which is introduced as follows.
请参考图3,图3是本申请一个示例性实施例提供的一种寄存器访问架构的示意图。在图3中,中央处理器210通过总线3A与中央控制模块(center control)310通信,中央控制模块310通过信号线320与子系统1、子系统2和子系统k通信。需要说明的是,信号线320是1位(bit)的线缆。需要说明的是,图3中的箭头指向表示数据流动方向。在图3中,中央控制模块设置在中央处理器和寄存器组之间,且中央控制模块用于控制中央处理器与寄存器之间的数据交互。Please refer to FIG. 3 , which is a schematic diagram of a register access architecture provided by an exemplary embodiment of the present application. In FIG. 3 , the
在另一种可能的方式中,信号线320是2位(bit)的线缆。请参见图4,图4是本申请一个示例性实施例提供的一种寄存器访问架构的示意图。其中,2位信号线(line)包括命令(CMD)线410和数据(DAT)线420。可选地,在图4中,命令线410是位[0],数据线420是位[1],图4所示架构是2位串行控制协议下的寄存器组的读写架构。需要说明的是,图4中的箭头指向表示数据流动方向。其中,命令线410传输数据的方向是从中央控制模块传向寄存器组单向传输。数据线420传输数据的方向是在中央控制模块和寄存器组之间双向传输的。In another possible manner, the
在另一种可能的方式中,信号线320是3位(bit)的线缆。请参见图5,图5是本申请一个示例性实施例提供的一种寄存器访问架构的示意图。其中,3位信号线(line)包括命令(CMD)线510、写入数据线520和输出数据线530。需要说明的是,图5中的箭头指向表示数据流动方向。其中,命令线510传输数据的方向是从中央控制模块传向寄存器组单向传输。写入数据线520传输数据的方向是从中央控制模块传向寄存器组单向传输。输出数据线530传输数据的方向是从寄存器组传向中央控制模块单向传输。In another possible manner, the
可选地,在图3至图5所示的寄存器组中,各个寄存器组共享相同的重置和时钟。也即,当其中寄存器组需要进行重置时,图3至图5中任意一个图中的全部寄存器组都将被重置。同时,图3至图5中任意一个图中的全部寄存器组共享同一个时钟。Optionally, in the register sets shown in FIG. 3 to FIG. 5 , each register set shares the same reset and clock. That is, when the register sets need to be reset, all the register sets in any one of Figures 3 to 5 will be reset. At the same time, all register groups in any one of FIGS. 3 to 5 share the same clock.
可选地,所述寄存器组与所述中央控制模块之间通过信号线进行数据交互,所述信号线用于串行传输数据。Optionally, data interaction is performed between the register set and the central control module through a signal line, and the signal line is used for serially transmitting data.
请参考图6,图6是本申请一个示例性实施例提供的寄存器的读写方法的流程图。该寄存器的读写方法能够应用在上述图1、图3至图5任一所示的芯片中。在图6中,寄存器的读写方法包括:Please refer to FIG. 6 . FIG. 6 is a flowchart of a method for reading and writing registers provided by an exemplary embodiment of the present application. The method for reading and writing the register can be applied to any of the chips shown in FIG. 1 , FIG. 3 to FIG. 5 . In Figure 6, the register reading and writing methods include:
步骤610,通过串行的方式接收目标标识信息,目标标识信息是中央控制模块广播的寄存器组的标识。
在本申请实施例中,寄存器组能够通过串行的方式接收目标标识信息。其中,寄存器组能够通过图3至图5任意一种架构获得中央控制模块广播的目标标识信息。In the embodiment of the present application, the register set can receive the target identification information in a serial manner. Wherein, the register group can obtain the target identification information broadcast by the central control module through any one of the architectures shown in FIG. 3 to FIG. 5 .
在本申请实施例中,中央控制模块设置于中央处理器和寄存器组之间,且中央控制模块用于控制中央处理器与寄存器之间的数据交互。In the embodiment of the present application, the central control module is arranged between the central processing unit and the register set, and the central control module is used to control data interaction between the central processing unit and the registers.
可选地,以图4所示架构为例,寄存器组将通过命令线410获得目标关键字,将通过数据线420获得标识数据。其中,以寄存器组为从机(slave)为例,介绍寄存器组侧的控制协议。Optionally, taking the architecture shown in FIG. 4 as an example, the register set will obtain the target key through the
需要说明的是,在本申请实施例中,将寄存器组设计为包含N个寄存器的组件,每个寄存器包括M位的存储空间。在本申请中,寄存器组能够将N*M位数据全部读取出,或者,将需要写入的数据写入N*M位空间中。需要说明的是,N和M的取值是正整数,且N和M均为实例化参数(instantiation parameter),本申请不对N和M具体的取值进行限定。It should be noted that, in the embodiment of the present application, the register set is designed as a component including N registers, and each register includes a storage space of M bits. In this application, the register set can read out all the N*M-bit data, or write the data to be written into the N*M-bit space. It should be noted that the values of N and M are positive integers, and both N and M are instantiation parameters, and the present application does not limit the specific values of N and M.
在表一中,数据方向表示以寄存器组为参考点,数据流动的方向。例如,写入表示从中央控制模块向寄存器组写入数据,读取表示从寄存器组中向外读取数据。在本申请实施例中,当命令线中出现数据“111”时,表示数据线中将传送寄存器标识。此时,寄存器组将从数据线中读取到k位长的寄存器组标识。需要说明的是,k也为实例化参数。In Table 1, the data direction indicates the direction of data flow with the register bank as a reference point. For example, writing means writing data from the central control module to the register set, and reading means reading data from the register set. In the embodiment of the present application, when the data "111" appears in the command line, it means that the register identifier will be transmitted in the data line. At this time, the register set will read a k-bit long register set identifier from the data line. It should be noted that k is also an instantiation parameter.
可选地,当命令线中出现数据“101”时,表示数据线中将传送N*M位写入的数据。Optionally, when the data "101" appears in the command line, it means that the data written in N*M bits will be transmitted in the data line.
步骤620,通过串行的方式接收目标命令,目标命令用于指示寄存器组写入第一数据,或,用于指示寄存器组输出保存的第二数据。Step 620: Receive a target command in a serial manner, the target command is used to instruct the register bank to write the first data, or is used to instruct the register bank to output the stored second data.
在本申请实施例中,寄存器组将通过串行的方式接收目标命令。可选地,寄存器组中包括译码模块。译码模块能够通过串行的方式接收目标标识信息,并在当目标标识信息与寄存器组的标识匹配时,接收目标命令。In the embodiment of the present application, the register group will receive the target command in a serial manner. Optionally, the register set includes a decoding module. The decoding module can receive the target identification information in a serial manner, and when the target identification information matches the identification of the register group, receive the target command.
步骤630,当目标标识信息与寄存器组的标识匹配时,执行目标命令。
在本申请实施例中,可选地,寄存器组能够当目标标识信息与寄存器组的标识匹配,且目标命令的类型是写入类型时,将中央控制模块发送来的数据写入整个寄存器组的存储空间中。可选地,寄存器组能够当目标标识信息与寄存器组的标识匹配,且目标命令的类型是读取类型时,将存在寄存器组中的全部数据,向中央控制模块输出。In the embodiment of the present application, optionally, the register group can write the data sent by the central control module into the entire register group when the target identification information matches the identification of the register group and the type of the target command is a write type. in storage space. Optionally, the register group can output all the data in the register group to the central control module when the target identification information matches the register group identification and the type of the target command is a read type.
可选地,寄存器组在本申请提供的寄存器的读写方法中,包括一个有限状态机,介绍如下。Optionally, the method for reading and writing registers provided by the present application includes a finite state machine, which is introduced as follows.
请参见图7,图7是本申请实施例提供的一种寄存器组的有限状态机的示意图。在图7中,寄存器组在空闲态710中,能够在从命令线接收数据“111”后从数据线中接收k位长的数据(也即步骤720)。当寄存器组在该k位长的数据与该寄存器组的标识不匹配(也即ID_match=‘0’)时,继续转为空闲态。当寄存器组在该k位长的数据与该寄存器组的标识匹配(也即ID_match=‘1’)时,执行接收目标命令(也即步骤730)。随后,当从命令线中接收到数据“101”时,进入写数据状态(也即步骤740),将N*M位数据写入寄存器组,之后进入空闲态。另一方面,当从命令线中接收到数据“110”时,进入读数据状态,将寄存器组中的N*M位数据取出(也即步骤750),之后进入空闲态。Please refer to FIG. 7 . FIG. 7 is a schematic diagram of a finite state machine of a register bank provided by an embodiment of the present application. In FIG. 7 , the register group is in the
综上所述,本实施例提供的寄存器的读写方法,寄存器组通过串行的方式接收目标标识信息,该目标标识信息是中央控制模块广播的寄存器组的标识,通过串行的方式接收目标命令,该目标命令用于指示寄存器组写入第一数据,或,用于指示寄存器组输出保存的第二数据,当目标标识信息与寄存器组的标识匹配时,执行该目标命令。由于本申请能够通过串行的方式令寄存器组接收中央控制模块广播的标识,并在标识匹配时通过串行的方式接收读写命令并执行,将CPU以并行方式发出的数据转换为串行方式,后续在增加寄存器组时将寄存器组通过信号线连接至中央控制模块即可,在减少寄存器组时,无需像以往那样重新设计所有寄存器组与总线、CPU的连接方式,降低了芯片中新增或者减少寄存器组的设计难度。To sum up, in the method for reading and writing registers provided by this embodiment, the register group receives target identification information in a serial manner, and the target identification information is the identification of the register group broadcast by the central control module, and receives target identification information in a serial manner. A command, the target command is used to instruct the register bank to write the first data, or is used to instruct the register bank to output the saved second data, and when the target identification information matches the register bank identification, the target command is executed. Since the application can make the register group receive the identifier broadcast by the central control module in a serial manner, and receive and execute the read and write commands in a serial manner when the identifier matches, and convert the data sent by the CPU in a parallel manner into a serial manner , when increasing the register group, the register group can be connected to the central control module through the signal line. Or reduce the design difficulty of the register set.
可选地,由于本申请提供了信号线作为连接中央控制模块与寄存器组的连接,因此,本申请实施例还能够有效降低相关技术中,通过总线进行数据传输所造成的总线位宽过高,给寄存器组的布线工作带来空间上的压力并增加排线设计的复杂度的问题,有效降低了从中央控制模块到寄存器组的路由难度。Optionally, since the present application provides a signal line as a connection between the central control module and the register bank, the embodiment of the present application can also effectively reduce the excessive bus bit width caused by data transmission through the bus in the related art, The problem of bringing space pressure to the wiring work of the register set and increasing the complexity of the wiring design effectively reduces the difficulty of routing from the central control module to the register set.
请参见图8,图8是本申请一个示例性实施例提供的寄存器的读写方法的流程图。该寄存器的读写方法能够应用在上述图1、图3至图5任一所示的芯片中,芯片包括中央控制模块和寄存器组。在图8中,寄存器的读写方法包括:Please refer to FIG. 8 . FIG. 8 is a flowchart of a method for reading and writing registers provided by an exemplary embodiment of the present application. The method for reading and writing the registers can be applied to any of the chips shown in FIG. 1 , FIG. 3 to FIG. 5 , and the chip includes a central control module and a register set. In Figure 8, the register reading and writing methods include:
步骤810,中央控制模块并行接收中央处理器发送的目标标识信息和对应的目标命令。
在本申请实施例中,中央控制模块接收中央处理器发送的数据是通过并行的方式接收的。相应的,中央处理器在需要向寄存器组写入数据或者从寄存器组中读出数据时,中央处理器将向中央控制模块并行发送目标标识信息和对应于目标标识信息的目标命令。In the embodiment of the present application, the central control module receives the data sent by the central processor in a parallel manner. Correspondingly, when the central processing unit needs to write data into or read data from the register group, the central processing unit will send the target identification information and the target command corresponding to the target identification information to the central control module in parallel.
步骤820,中央控制模块将目标标识信息和对应的目标命令,转换为串行的数据,其中,串行的数据中,目标标识信息位于目标命令之前。
在本申请实施例中,中央控制模块具有数据转换的功能,能够将并行接收到的数据转换为串行的数据。在中央控制模块转换后的串行的数据中,目标标识信息位于目标命令之前。In the embodiment of the present application, the central control module has a data conversion function, and can convert data received in parallel into serial data. In the serial data converted by the central control module, the target identification information is located before the target command.
步骤830,中央控制模块向所控制的子系统中的寄存器组,通过串行的方式广播目标标识信息和对应的目标命令。
示意性的,若中央控制模块控制有m个寄存器组,则中央控制模块能够向上述m个寄存器组均通过串行的方式广播目标标识信息和对应的目标命令。需要说明的是,m个寄存器组可以分别属于若干个子系统。其中,一个子系统包括至少两个寄存器组。Schematically, if the central control module controls m register groups, the central control module can broadcast target identification information and corresponding target commands to the above m register groups in a serial manner. It should be noted that the m register groups may respectively belong to several subsystems. Wherein, a subsystem includes at least two register groups.
步骤840,子系统中的第一寄存器组执行目标命令,目标命令用于指示寄存器组写入第一数据,或,用于指示寄存器组输出保存的第二数据,第一寄存器组是至少两个寄存器组中与目标标识信息对应的寄存器组。
请参见图9,图9是本申请实施例提供的一种中央控制模块的有限状态机的示意图。在图9中,中央控制模块在空闲态910开始,向所控制的寄存器组广播目标关键字,也即从命令线传送数据“111”(也即执行步骤920);随后,从数据线发送k位长的数据(也即执行步骤930);随后向所控制的寄存器组广播目标命令(也即执行步骤940)。当从命令线上发送的数据是“101”时,中央控制模块从数据线上向寄存器组中写入N*M位数据(也即执行步骤950)。当从命令线上发送的数据是“110”时,中央控制模块从数据线上读取从寄存器组中获取的N*M位数据(也即执行步骤960)。当步骤950或步骤960执行完毕,中央控制模块返回空闲态。Please refer to FIG. 9 . FIG. 9 is a schematic diagram of a finite state machine of a central control module provided by an embodiment of the present application. In Fig. 9, the central control module starts in the
综上所述,本申请提供的寄存器的读写方法,应用于芯片中,芯片包括中央控制模块和寄存器组,中央控制模块并行接收中央处理器发送的目标标识信息和对应的目标命令,中央控制模块将上述信息转换为串行的数据,在串行数据中,目标标识信息位于目标命令之前,中央控制模块向所控制的至少两个寄存器组,通过串行的方式广播上述信息,至少两个寄存器组中对应目标标识信息的寄存器组执行目标命令,实现了在不借助总线系统的情况下完成寄存器组与中央处理器之间的信息交互,通过增设中央控制模块,将CPU以并行方式发出的数据转换为串行方式,后续在增加寄存器组时将寄存器组通过信号线连接至中央控制模块即可,在减少寄存器组时相应移除寄存器组和信号线即可,无需像以往那样需重新设计所有寄存器组与总线、CPU的连接方式,降低了芯片设计中新增或者减少寄存器组的设计难度。In summary, the method for reading and writing registers provided by this application is applied to the chip. The chip includes a central control module and a register group. The central control module receives the target identification information and the corresponding target command sent by the central processor in parallel. The central control The module converts the above information into serial data. In the serial data, the target identification information is located before the target command, and the central control module broadcasts the above information to at least two controlled register groups in a serial manner. At least two The register group corresponding to the target identification information in the register group executes the target command, and realizes the information interaction between the register group and the central processing unit without the help of the bus system. By adding a central control module, the CPU sends out in parallel The data is converted into a serial mode, and the register set is connected to the central control module through the signal line when adding the register set, and the register set and the signal line are removed correspondingly when the register set is reduced, without redesigning as in the past The connection mode of all the register groups with the bus and the CPU reduces the design difficulty of adding or reducing the register groups in the chip design.
可选地,由于本申请实施例还能够通过寄存器组的标识对寄存器组进行识别,而并非通过相关技术中通过地址解码的方式识别寄存器组,且寄存器组的标识相较于地址的数据量更小。因此,本申请实施例降低了中央处理器查找到相应的寄存器组的难度,从而提高了从相应的寄存器组中读写数据的效率。Optionally, because the embodiment of the present application can also identify the register set through the identification of the register set, instead of identifying the register set through address decoding in the related art, and the identification of the register set is more important than the data volume of the address. Small. Therefore, the embodiment of the present application reduces the difficulty for the central processing unit to find the corresponding register set, thereby improving the efficiency of reading and writing data from the corresponding register set.
可选地,由于本申请实施例在寄存器组和中央控制模块之间设计了简单的信号线,降低寄存器组的解码工作的逻辑复杂度,使得为芯片新增寄存器组的设计难度大为降低。Optionally, since the embodiment of the present application designs a simple signal line between the register set and the central control module, the logic complexity of the decoding work of the register set is reduced, and the design difficulty of adding a new register set to the chip is greatly reduced.
可选地,由于本申请实施例中中央控制模块对所控制的寄存器组的数据进行统一的读写管理,并进行了数据的并行和串行之间的转换,使得中央处理器读写该体系下中寄存器组的数据更加容易。Optionally, since the central control module in the embodiment of the present application performs unified reading and writing management on the data of the controlled register group, and performs data conversion between parallel and serial, the central processing unit reads and writes the system It is easier to download the data in the register bank.
可选地,由于本申请实施例提供的方案在中央控制模块与寄存器组之间设计了逻辑简单的数据读写标准。因此,本申请实施例还有助于令静态控制的芯片或者总线接口复杂且花费较大的芯片,或者需要统一的中央控制模块控制全部的寄存器组以实现专用功能的芯片实现较高的数据读写效率,以及降低增减寄存器组时的芯片开发难度。Optionally, due to the solution provided by the embodiment of the present application, a logic-simple data read-write standard is designed between the central control module and the register group. Therefore, the embodiment of the present application also helps to make statically controlled chips or chips with complex bus interfaces and expensive chips, or chips that require a unified central control module to control all register groups to achieve special functions to achieve higher data reading. Write efficiency, and reduce the difficulty of chip development when adding or subtracting register groups.
本申请实施例还能够提供一种应用于子系统中的寄存器的读写方法。请参见图10,图10是本申请另一个示例性实施例提供的一种寄存器的读写方法流程图。在图10中,该寄存器的读写方法包括:The embodiment of the present application can also provide a method for reading and writing registers applied in a subsystem. Please refer to FIG. 10 . FIG. 10 is a flowchart of a method for reading and writing a register provided by another exemplary embodiment of the present application. In Figure 10, the read and write methods of this register include:
步骤1001,子系统中的寄存器组通过串行的方式接收目标标识信息。In
其中,目标标识信息是中央控制模块广播的寄存器组的标识,中央控制模块设置于中央处理器和寄存器组之间,且中央控制模块用于控制中央处理器与寄存器之间的数据交互。Wherein, the target identification information is the identification of the register group broadcast by the central control module, the central control module is arranged between the central processing unit and the register group, and the central control module is used to control the data interaction between the central processing unit and the registers.
示意性的,子系统中的每一个寄存器组均通过串行的方式接收目标标识信息。例如,若子系统和中央控制模块以图3所示的方式进行连接,并以子系统2为例。子系统2中的寄存器组_1、寄存器组_2和寄存器组_3均能够通过信号线接收到目标标识信息。Schematically, each register group in the subsystem receives the target identification information in a serial manner. For example, if the subsystem and the central control module are connected in the manner shown in FIG. 3 , take subsystem 2 as an example. Register set_1, register set_2 and register set_3 in subsystem 2 can all receive target identification information through signal lines.
步骤1002,子系统中的寄存器组通过串行的方式接收目标命令。
其中,目标命令用于指示寄存器组写入第一数据,或,用于指示寄存器组输出保存的第二数据,在串行的数据中,目标标识信息位于目标命令之前。Wherein, the target command is used to instruct the register bank to write the first data, or to instruct the register bank to output the stored second data, and in the serial data, the target identification information is located before the target command.
示意性的,寄存器组在接收到目标标识信息之后,将再接收目标命令。子系统中的寄存器组接收串行的数据,在该串行的数据中,目标标识信息位于目标命令之前。Schematically, the register group will receive the target command after receiving the target identification information. The register bank in the subsystem receives serial data in which the target identification information precedes the target command.
步骤1003,子系统中的第一寄存器组执行目标命令,第一寄存器组的标识与目标标识信息匹配。
步骤1004,子系统中的第二寄存器组不响应目标命令,第二寄存器组的标识与目标标识信息不匹配。
可选地,在寄存器组接收目标标识信息和目标命令之后,寄存器组将比较自身的标识和目标标识信息是否匹配。在子系统中,自身的标识和目标标识信息匹配的寄存器组是第一寄存器组。自身的标识和目标标识信息不匹配的寄存器组是第二寄存器组。Optionally, after the register set receives the target identification information and the target command, the register set compares whether its own identification matches the target identification information. In the subsystem, the register group whose own identification matches the target identification information is the first register group. The register set whose own identification does not match the target identification information is the second register set.
进而,在子系统中的第一寄存器组和第二寄存器组将针对目标命令作出不同的反应。其中,子系统中的第一寄存器组将执行目标命令,第二寄存器组不响应目标命令。Furthermore, the first set of registers and the second set of registers in the subsystem will react differently to the target command. Wherein, the first register group in the subsystem will execute the target command, and the second register group will not respond to the target command.
综上所述,本申请实施例公开的由子系统执行的寄存器读写方法,能够令子系统中增加寄存器组时将寄存器组通过信号线连接至中央控制模块即可,在减少寄存器组时相应移除寄存器组和信号线即可,无需像以往重新设计所有寄存器组与总线、CPU的连接方式,降低了芯片设计中为子系统新增或者减少寄存器组的设计难度,并提高了整体新增子系统或者减少子系统的难度。To sum up, the register reading and writing method performed by the subsystem disclosed in the embodiment of the present application can enable the register set to be connected to the central control module through the signal line when adding the register set in the subsystem, and remove the corresponding register set when reducing the register set Register sets and signal lines are all that is needed, and there is no need to redesign the connection methods of all register sets, buses, and CPUs, which reduces the design difficulty of adding or reducing register sets for subsystems in chip design, and improves the overall new subsystem. Or reduce the difficulty of the subsystem.
本申请实施例还能够提供一种寄存器组和中央控制模块同时参与的寄存器的读写方法,介绍如下。The embodiment of the present application can also provide a method for reading and writing registers in which the register group and the central control module participate simultaneously, which is introduced as follows.
请参见图11,图11是本申请另一个示例性实施例提供的寄存器的读写方法流程图。该寄存器的读写方法能够应用在上述图1、图3至图5任一所示芯片中。在图11中,该寄存器的读写方法包括:Please refer to FIG. 11 . FIG. 11 is a flowchart of a method for reading and writing registers provided by another exemplary embodiment of the present application. The method for reading and writing the register can be applied to any of the chips shown in FIG. 1 , FIG. 3 to FIG. 5 . In Figure 11, the read and write methods of this register include:
步骤1011,中央控制模块在第一时段内,向所控制的寄存器组广播目标关键字。Step 1011, the central control module broadcasts the target keyword to the controlled register group within the first time period.
其中,目标关键字用于指示第二时段发送的数据代表指定的寄存器组的标识,也即通过该目标关键字可确定第二时段发送的数据的内容为对应某一寄存器组的标识。Wherein, the target keyword is used to indicate that the data sent in the second period represents the identifier of the designated register bank, that is, the content of the data sent in the second period can be determined to be the identifier corresponding to a certain register bank through the target keyword.
相应的,寄存器组在第一时段内,指示译码模块接收目标关键字,目标关键字用于指示第二时段接收的数据所代表的含义。例如,在一种可能的方式中,目标关键字为“001”,用于指示第二时段接收的数据代表标识数据,也即第二时段接收的数据代表寄存器组的ID。Correspondingly, the register group instructs the decoding module to receive the target keyword in the first period, and the target keyword is used to indicate the meaning represented by the data received in the second period. For example, in one possible manner, the target keyword is "001", which is used to indicate that the data received in the second period represents identification data, that is, the data received in the second period represents the ID of the register bank.
步骤1012,中央控制模块在第二时段内,向所控制的寄存器组广播标识数据。Step 1012, the central control module broadcasts the identification data to the controlled register groups within the second time period.
其中,目标关键字和标识数据属于目标标识信息。Among them, the target keyword and identification data belong to the target identification information.
相应的,寄存器组在第二时段内接收标识数据,目标关键字和标识数据属于目标标识信息。示意性的,第一时段的结束时刻早于或等于第二时段的开始时刻。Correspondingly, the register set receives the identification data within the second period, and the target keyword and the identification data belong to the target identification information. Schematically, the end moment of the first period is earlier than or equal to the start moment of the second period.
步骤1013,中央控制模块在第三时段内,向所控制的寄存器组广播命令关键字。Step 1013, the central control module broadcasts the command keyword to the controlled register group within the third time period.
其中,命令关键字用于指示目标命令的类型,目标命令的类型包括读取类型或写入类型中的一种。Wherein, the command keyword is used to indicate the type of the target command, and the type of the target command includes one of a read type or a write type.
相应的,寄存器组在第三时段内,当标识数据与寄存器组的标识匹配时,指示译码模块接收命令关键字,命令关键字用于指示目标命令的类型,目标命令的类型包括读取类型或写入类型中的一种。Correspondingly, in the third period of time, when the identification data of the register group matches the identification of the register group, the decoding module is instructed to receive the command keyword, the command keyword is used to indicate the type of the target command, and the type of the target command includes the read type or one of the write types.
在一种可能的实施例中,当标识数据与寄存器组的标识不匹配时,译码模块将不再接收后续的命令关键字。或者,译码模块不再对后续接收到的操作关键进行译码识别。In a possible embodiment, when the identification data does not match the identification of the register set, the decoding module will no longer receive subsequent command keywords. Or, the decoding module no longer decodes and recognizes the subsequently received operation keys.
步骤1014,中央控制模块在第四时段内,根据目标命令的类型,广播或读取对应的数据。Step 1014, the central control module broadcasts or reads corresponding data according to the type of the target command within the fourth time period.
相应的,寄存器组在第四时段内,根据目标命令的类型,向中央控制模块传输数据或者接收并读取中央控制模块发送的数据。Correspondingly, in the fourth time period, the register group transmits data to the central control module or receives and reads data sent by the central control module according to the type of the target command.
示意性的,第一时段的结束时刻早于或等于第二时段的开始时刻,第二时段的结束时刻早于或等于第三时段的开始时刻,第三时段的结束时刻早于或等于第四时段的开始时刻。Schematically, the end moment of the first period is earlier than or equal to the start moment of the second period, the end moment of the second period is earlier than or equal to the start moment of the third period, and the end moment of the third period is earlier than or equal to the fourth period The start moment of the period.
在本申请实施例中,中央控制模块还可以通过执行步骤(1)或步骤(2)来实现数据的写入或者读取功能。In the embodiment of the present application, the central control module may also implement the function of writing or reading data by performing step (1) or step (2).
步骤(1),在第四时段,当目标命令的类型是写入类型时,中央控制模块向所控制的寄存器组广播第一数据。Step (1), in the fourth period, when the type of the target command is write type, the central control module broadcasts the first data to the controlled register group.
相应的,在第四时段,当目标命令的类型是写入类型时,寄存器组保存第一数据。Correspondingly, in the fourth period, when the type of the target command is a write type, the register bank stores the first data.
步骤(2),在第四时段,当目标命令的类型是读取类型时,中央控制模块从目标标识信息对应的寄存器组中读取第二数据。Step (2), in the fourth period, when the type of the target command is the read type, the central control module reads the second data from the register set corresponding to the target identification information.
相应的,在第四时段,当目标命令的类型是读取类型时,将第二数据向中央控制模块输出。Correspondingly, in the fourth period, when the type of the target command is a read type, the second data is output to the central control module.
在一种可能的实现方式中,以图4所示架构为例。中央控制模块与寄存器组之间通过命令线和数据线交互。请参见图12,图12是基于图4示出的一种寄存器组写入串行信号时序的示意图。命令线410在第一时段11A串行传输目标关键字“111”。数据线420在第二时段11B串行传输标识数据“10100001”。命令线410在第三时段11C串行传输写入关键字“101”,该关键字表示向寄存器组中写入数据。数据线420在第四时段11D串行传输128位数据。In a possible implementation manner, the architecture shown in FIG. 4 is taken as an example. The central control module interacts with the register group through command lines and data lines. Please refer to FIG. 12 . FIG. 12 is a schematic diagram of a sequence of serial signals for register group writing based on FIG. 4 . The
在另一种可能的实现方式中,以图4所示架构为例。中央控制模块与寄存器组之间通过命令线和数据线交互。请参见图13,图13是基于图4示出的一种从寄存器组中串行读取数据的时序的示意图。命令线410在第一时段11E串行传输目标关键字“111”。数据线420在第二时段11F串行传输标识数据“10100001”。命令线410在第三时段11G串行传输读取关键字“110”,该关键字表示从寄存器组中串行读取128位数据。数据线420在第四时段11H串行传输128位数据。In another possible implementation manner, the architecture shown in FIG. 4 is taken as an example. The central control module interacts with the register group through command lines and data lines. Please refer to FIG. 13 . FIG. 13 is a schematic diagram of a sequence of serially reading data from a register set based on FIG. 4 . The
综上所述,本实施例能够应用于芯片中,芯片包括中央控制模块和寄存器组,中央控制模块并行接收中央处理器发送的目标标识信息和对应的目标命令,中央控制模块将上述信息转换为串行的数据,在串行数据中,目标标识信息位于目标命令之前,中央控制模块向所控制的至少两个寄存器组,通过串行的方式广播上述信息,至少两个寄存器组中对应目标标识信息的寄存器组执行目标命令,实现了在不借助总线系统的情况下完成寄存器组与中央处理器之间的信息交互,通过增设中央控制模块,将CPU以并行方式发出的数据转换为串行方式,后续在增加寄存器组时将寄存器组通过信号线连接至中央控制模块即可,在减少寄存器组时相应移除寄存器组和信号线即可,无需像以往那样需重新设计所有寄存器组与总线、CPU的连接方式,降低了芯片设计中新增或者减少寄存器组的设计难度To sum up, this embodiment can be applied to a chip. The chip includes a central control module and a register group. The central control module receives the target identification information and the corresponding target command sent by the central processor in parallel. The central control module converts the above information into For serial data, in the serial data, the target identification information is located before the target command, and the central control module broadcasts the above information in a serial manner to at least two controlled register groups, and the corresponding target identification in at least two register groups The information register group executes the target command, realizes the information interaction between the register group and the central processing unit without the help of the bus system, and converts the data sent by the CPU in parallel to serial mode by adding a central control module , when increasing the register group, the register group can be connected to the central control module through the signal line, and the register group and the signal line can be removed correspondingly when the register group is reduced, without the need to redesign all the register groups and buses, The CPU connection method reduces the design difficulty of adding or reducing register groups in chip design
本申请实施例还提供了一种计算机可读介质,该计算机可读介质存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如上各个实施例所述的寄存器的读写方法。The embodiment of the present application also provides a computer-readable medium, the computer-readable medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to realize the reading of the register as described in each of the above embodiments. write method.
本申请实施例还提供了一种计算机程序产品,该计算机程序产品存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现如本申请实施例提供的寄存器的读写方法。The embodiment of the present application also provides a computer program product, the computer program product stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the register reading and writing method provided by the embodiment of the present application.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.
本领域普通技术人员能够理解实现上述实施例的全部或部分步骤能够通过硬件来完成,也能够通过程序来指令相关的硬件完成,所述的程序能够存储于一种计算机可读存储介质中,上述提到的存储介质能够是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned can be a read-only memory, a magnetic disk or an optical disk, and the like.
以上所述仅为本申请的能够实现的示例性的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only exemplary embodiments of the present application that can be realized, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the Within the protection scope of this application.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010508128.4A CN111651384B (en) | 2020-06-05 | 2020-06-05 | Register reading and writing method, chip, subsystem, register set and terminal |
PCT/CN2021/090614 WO2021244194A1 (en) | 2020-06-05 | 2021-04-28 | Register reading/writing method, chip, subsystem, register group, and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010508128.4A CN111651384B (en) | 2020-06-05 | 2020-06-05 | Register reading and writing method, chip, subsystem, register set and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111651384A CN111651384A (en) | 2020-09-11 |
CN111651384B true CN111651384B (en) | 2023-06-16 |
Family
ID=72351255
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010508128.4A Active CN111651384B (en) | 2020-06-05 | 2020-06-05 | Register reading and writing method, chip, subsystem, register set and terminal |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111651384B (en) |
WO (1) | WO2021244194A1 (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111651384B (en) * | 2020-06-05 | 2023-06-16 | Oppo广东移动通信有限公司 | Register reading and writing method, chip, subsystem, register set and terminal |
CN112181493B (en) * | 2020-09-24 | 2022-09-13 | 成都海光集成电路设计有限公司 | Register network architecture and register access method |
CN114625681A (en) * | 2020-12-09 | 2022-06-14 | Oppo广东移动通信有限公司 | Inter-chip communication method, multimedia chip and electronic equipment |
CN115495408B (en) * | 2022-11-16 | 2023-09-01 | 无锡沐创集成电路设计有限公司 | Data processing method, chip module, sealing chip and electronic equipment |
CN115994115B (en) * | 2023-03-22 | 2023-10-20 | 成都登临科技有限公司 | Chip control method, chip set and electronic equipment |
CN116126401B (en) * | 2023-04-12 | 2023-07-25 | 此芯科技(上海)有限公司 | A register configuration circuit, method and electronic device |
CN116991764B (en) * | 2023-08-03 | 2024-04-05 | 广州安凯微电子股份有限公司 | A high performance Flash controller and embedded system |
CN116820867B (en) * | 2023-08-29 | 2023-12-15 | 腾讯科技(深圳)有限公司 | Chip debugging method and device and chip |
CN117744570B (en) * | 2023-12-15 | 2024-08-09 | 沐曦集成电路(南京)有限公司 | Batch configuration method of registers, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101030192A (en) * | 2006-03-02 | 2007-09-05 | 国际商业机器公司 | Method and system for management of register |
CN103744009A (en) * | 2013-12-17 | 2014-04-23 | 记忆科技(深圳)有限公司 | Serial transmission chip test method, serial transmission chip test system and integrated chip |
CN108037965A (en) * | 2017-12-29 | 2018-05-15 | 飞天诚信科技股份有限公司 | A kind of method and device for reading and writing objective chip |
US10649923B1 (en) * | 2015-12-29 | 2020-05-12 | Amazon Technologies, Inc. | Broadcasting writes to multiple modules |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050195975A1 (en) * | 2003-01-21 | 2005-09-08 | Kevin Kawakita | Digital media distribution cryptography using media ticket smart cards |
CN101303850B (en) * | 2008-06-30 | 2010-06-23 | 北京中星微电子有限公司 | Method for implementing screen refresh and system thereof |
CN111209231B (en) * | 2018-11-21 | 2021-05-11 | 上海寒武纪信息科技有限公司 | Data processing method and device and related products |
CN111651384B (en) * | 2020-06-05 | 2023-06-16 | Oppo广东移动通信有限公司 | Register reading and writing method, chip, subsystem, register set and terminal |
-
2020
- 2020-06-05 CN CN202010508128.4A patent/CN111651384B/en active Active
-
2021
- 2021-04-28 WO PCT/CN2021/090614 patent/WO2021244194A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101030192A (en) * | 2006-03-02 | 2007-09-05 | 国际商业机器公司 | Method and system for management of register |
CN103744009A (en) * | 2013-12-17 | 2014-04-23 | 记忆科技(深圳)有限公司 | Serial transmission chip test method, serial transmission chip test system and integrated chip |
US10649923B1 (en) * | 2015-12-29 | 2020-05-12 | Amazon Technologies, Inc. | Broadcasting writes to multiple modules |
CN108037965A (en) * | 2017-12-29 | 2018-05-15 | 飞天诚信科技股份有限公司 | A kind of method and device for reading and writing objective chip |
Also Published As
Publication number | Publication date |
---|---|
WO2021244194A1 (en) | 2021-12-09 |
CN111651384A (en) | 2020-09-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111651384B (en) | Register reading and writing method, chip, subsystem, register set and terminal | |
KR100352224B1 (en) | Direct memory access(dma) transactions on a low pin count bus | |
US6954806B2 (en) | Data transfer apparatus and method | |
KR101043842B1 (en) | Physical device(phy) support of the usb2.0 link power management addendum using a ulpi phy interface standard | |
US8610732B2 (en) | System and method for video memory usage for general system application | |
US5564114A (en) | Method and an arrangement for handshaking on a bus to transfer information between devices in a computer system | |
CN101452430B (en) | Communication method between multi-processors and communication device comprising multi-processors | |
US20090022158A1 (en) | Method For Increasing Network Transmission Efficiency By Increasing A Data Updating Rate Of A Memory | |
KR100579203B1 (en) | Streamlined AT device initialization method and device | |
US7469304B2 (en) | Data transfer control device, electronic equipment, and method for a data transfer through a bus, the data transfer control device including a register and a packet buffer that are commonly used during a host operation and a peripheral operation | |
US10176133B2 (en) | Smart device with no AP | |
US20090138673A1 (en) | Internal memory mapped external memory interface | |
CN114327975A (en) | System on chip | |
CN114168503A (en) | Interface IP core control method, interface IP core, device and medium | |
US20070079015A1 (en) | Methods and arrangements to interface a data storage device | |
CN118709190A (en) | A TPM chip interface controller and TPM chip | |
CN116561036B (en) | Data access control method, device, equipment and storage medium | |
CN118409712A (en) | A RAID card management system, method, device, product and medium | |
JP3477306B2 (en) | Extended input / output interface | |
CN116610601A (en) | Data transmission device, control method and device thereof, and medium | |
US20040186949A1 (en) | XIP system and method for serial memory | |
US7694004B2 (en) | Bit-granular writes of control registers | |
US6442643B1 (en) | System and method for resolving data transfer incompatibilities between PCI and Non-PCI buses | |
CN118363901B (en) | PCIe device, electronic component and electronic device | |
EP4398084B1 (en) | Storage device and operating method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |