[go: up one dir, main page]

CN118331919B - Data communication method, address conversion device and electronic equipment - Google Patents

Data communication method, address conversion device and electronic equipment Download PDF

Info

Publication number
CN118331919B
CN118331919B CN202410749395.9A CN202410749395A CN118331919B CN 118331919 B CN118331919 B CN 118331919B CN 202410749395 A CN202410749395 A CN 202410749395A CN 118331919 B CN118331919 B CN 118331919B
Authority
CN
China
Prior art keywords
address conversion
address
unit
conversion data
level cache
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
Application number
CN202410749395.9A
Other languages
Chinese (zh)
Other versions
CN118331919A (en
Inventor
周恩松
敖子安
郑继荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dingdao Zhixin Shanghai Semiconductor Co ltd
Original Assignee
Dingdao Zhixin Shanghai Semiconductor Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Dingdao Zhixin Shanghai Semiconductor Co ltd filed Critical Dingdao Zhixin Shanghai Semiconductor Co ltd
Priority to CN202410749395.9A priority Critical patent/CN118331919B/en
Priority to CN202411426653.6A priority patent/CN119336692A/en
Publication of CN118331919A publication Critical patent/CN118331919A/en
Application granted granted Critical
Publication of CN118331919B publication Critical patent/CN118331919B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1027Address translation using associative or pseudo-associative address translation means, e.g. translation look-aside buffer [TLB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The application discloses a data communication method, an address conversion device and electronic equipment, which relate to the memory processing technology, wherein the data communication method is applied to the address conversion device, the address conversion device comprises a translation buffer unit, and the method comprises the following steps: receiving an address conversion request sent by a first node, wherein the address conversion request comprises a virtual address; querying address conversion data corresponding to the virtual address from the translation buffer unit, wherein the address conversion data comprises a corresponding relation between the virtual address and a physical address, the translation buffer unit comprises a first-level buffer unit and a second-level buffer unit, the first-level buffer unit is only associated with the first node, the second-level buffer unit is associated with at least two control nodes including the first node, and a buffer space for the address conversion data can be provided for the at least two control nodes; and converting the virtual address into a corresponding target physical address to be accessed based on the searched address conversion data.

Description

数据通信方法、地址转换装置及电子设备Data communication method, address conversion device and electronic equipment

技术领域Technical Field

本申请涉及内存处理技术,更具体的说,是涉及一种数据通信方法、地址转换装置及电子设备。The present application relates to memory processing technology, and more specifically, to a data communication method, an address conversion device and an electronic device.

背景技术Background Art

SMMU(system memory manage unit 系统内存管理单元)是系统级内存管理单元,实现虚拟地址到物理地址的转换。SMMU (system memory manage unit) is a system-level memory management unit that implements the conversion of virtual addresses to physical addresses.

图1为SMMU的进行地址转换的原理示意图。结合图1所示,在传统的SMMU方案中,其地址转换功能主要由TBU(Translation Buffer Unit,翻译缓冲单元)和TCU(TranslationControl Unit,翻译控制单元)实现。当处理器Master发出某虚拟地址时,SMMU中的TBU获得该虚拟地址,并从自身TLB(Translation Lookaside Buffer,转换检测缓冲区)中查找是否存在与该虚拟地址对应的地址转换表,若存在则直接取用,若不存在则通过切换开关switch将虚拟地址的转换表的查询请求发送至TCU,由TCU从内存中查询对应的地址转换表。整体而言,上述方案的地址转换延迟比较大,存在很大的优化空间。Figure 1 is a schematic diagram of the principle of address conversion of SMMU. As shown in Figure 1, in the traditional SMMU solution, its address conversion function is mainly implemented by TBU (Translation Buffer Unit) and TCU (Translation Control Unit). When the processor Master issues a virtual address, the TBU in the SMMU obtains the virtual address and searches its own TLB (Translation Lookaside Buffer) to see whether there is an address conversion table corresponding to the virtual address. If it exists, it is directly used. If not, the query request for the virtual address conversion table is sent to the TCU through the switch switch, and the TCU queries the corresponding address conversion table from the memory. Overall, the address conversion delay of the above solution is relatively large, and there is a lot of room for optimization.

发明内容Summary of the invention

有鉴于此,本申请提供如下技术方案:In view of this, this application provides the following technical solutions:

本申请第一方面提供了一种数据通信方法,应用于地址转换装置,所述地址转换装置包括翻译缓冲单元,所述方法包括:A first aspect of the present application provides a data communication method, which is applied to an address conversion device, wherein the address conversion device includes a translation buffer unit, and the method includes:

接收第一节点发送的地址转换请求,所述地址转换请求包括虚拟地址;receiving an address translation request sent by the first node, wherein the address translation request includes a virtual address;

从所述翻译缓冲单元查询与所述虚拟地址对应的地址转换数据,所述地址转换数据包括虚拟地址与物理地址的对应关系,所述翻译缓冲单元包括第一级缓存单元和第二级缓存单元,所述第一级缓存单元仅关联所述第一节点,所述第二级缓存单元关联包括所述第一节点在内的至少两个控制节点,能够为所述至少两个控制节点提供地址转换数据的缓存空间;Querying address conversion data corresponding to the virtual address from the translation buffer unit, the address conversion data including a correspondence between a virtual address and a physical address, the translation buffer unit including a first-level cache unit and a second-level cache unit, the first-level cache unit is associated only with the first node, and the second-level cache unit is associated with at least two control nodes including the first node, and can provide a cache space for address conversion data for the at least two control nodes;

基于查找到的地址转换数据,将所述虚拟地址转换为对应的待访问的目标物理地址。Based on the found address conversion data, the virtual address is converted into a corresponding target physical address to be accessed.

在一种可能的实现中,方法还包括:In one possible implementation, the method further includes:

若未从所述翻译缓冲单元中查询到所述地址转换数据,基于翻译控制单元获得与所述虚拟地址对应的地址转换数据,其中,所述翻译控制单元关联所有的控制节点;If the address conversion data is not found from the translation buffer unit, obtaining the address conversion data corresponding to the virtual address based on a translation control unit, wherein the translation control unit is associated with all control nodes;

其中,基于翻译控制单元获得与所述虚拟地址对应的地址转换数据,包括:从翻译控制单元获得与所述虚拟地址对应的地址转换数据,或基于翻译控制单元从内存中获得与所述虚拟地址对应的地址转换数据。Wherein, obtaining the address conversion data corresponding to the virtual address based on the translation control unit includes: obtaining the address conversion data corresponding to the virtual address from the translation control unit, or obtaining the address conversion data corresponding to the virtual address from the memory based on the translation control unit.

在一种可能的实现中,还包括:In a possible implementation, the method further includes:

在各个第二级缓存单元内部动态的对当前第二级缓存单元的存储资源进行分配,所述分配表征将存储资源分配给当前第二级缓存单元关联的至少两个控制节点使用。The storage resources of the current second-level cache unit are dynamically allocated inside each second-level cache unit, and the allocation represents allocating the storage resources to at least two control nodes associated with the current second-level cache unit for use.

在一种可能的实现中,所述在各个第二级缓存单元内部动态的对当前第二级缓存单元的存储资源进行分配,包括:In a possible implementation, dynamically allocating storage resources of the current second-level cache unit within each second-level cache unit includes:

基于当前第二级缓存单元关联的至少两个控制节点的特征参数确定所述至少两个控制节点的优先级;Determining priorities of the at least two control nodes based on characteristic parameters of the at least two control nodes associated with the current second-level cache unit;

基于所述至少两个控制节点的优先级为各个控制节点分配第二级缓存单元的存储资源。The storage resources of the second-level cache unit are allocated to each control node based on the priority of the at least two control nodes.

在一种可能的实现中,在所述基于翻译控制单元获得与所述虚拟地址对应的地址转换数据后,还包括:In a possible implementation, after obtaining the address conversion data corresponding to the virtual address based on the translation control unit, the method further includes:

将所述地址转换数据缓存在所述第二级缓存单元,包括以下至少之一:Caching the address translation data in the second-level cache unit includes at least one of the following:

直接将所述地址转换数据缓存在所述第二级缓存单元;directly caching the address conversion data in the second-level cache unit;

在所述第一级缓存单元已存满数据的情况下,将所述地址转换数据缓存在所述第二级缓存单元;When the first-level cache unit is full of data, the address conversion data is cached in the second-level cache unit;

在所述虚拟地址为所述第二级缓存单元关联的至少两个控制节点的处理业务均会访问的虚拟地址的情况下,将所述地址转换数据缓存在所述第二级缓存单元;When the virtual address is a virtual address that is accessed by processing services of at least two control nodes associated with the second-level cache unit, cache the address conversion data in the second-level cache unit;

在所述第二级缓存单元已存满数据的情况下,将符合第一要求的缓存数据删除,并将所述地址转换数据缓存在所述第二级缓存单元。When the second-level cache unit is full of data, the cache data that meets the first requirement is deleted, and the address conversion data is cached in the second-level cache unit.

在一种可能的实现中,所述第二级缓存单元关联的至少两个控制节点的确定包括:In a possible implementation, determining the at least two control nodes associated with the second-level cache unit includes:

将业务处理涉及相同虚拟地址的控制节点匹配到同一个第二级缓存单元;Matching the control nodes with the same virtual address involved in the business processing to the same second-level cache unit;

或,or,

将工作状态具有互斥性的控制节点匹配到同一个的第二级缓存单元,其中的互斥性表征不会同时发出数据访问指令。Control nodes with mutually exclusive working states are matched to the same second-level cache unit, wherein the mutual exclusivity indicates that data access instructions will not be issued simultaneously.

本申请第二方面提供了一种地址转换装置,包括:A second aspect of the present application provides an address conversion device, including:

翻译缓冲单元,包括多个地址转换单元、多个第一级缓冲单元和多个第二级缓冲单元;A translation buffer unit, comprising a plurality of address translation units, a plurality of first-level buffer units and a plurality of second-level buffer units;

每一个地址转换单元关联一个控制节点,用于接收对应的控制节点发送的地址转换请求,基于所述地址转换请求中的虚拟地址查询对应的地址转换数据,并基于获得的地址转换数据将所述虚拟地址转换为物理地址;Each address translation unit is associated with a control node, and is used to receive an address translation request sent by the corresponding control node, query corresponding address translation data based on the virtual address in the address translation request, and translate the virtual address into a physical address based on the obtained address translation data;

每一个第一级缓存单元与一个地址转换单元连接,关联对应的控制节点,用于缓存获得的地址转换数据;Each first-level cache unit is connected to an address translation unit, associated with a corresponding control node, and used to cache the obtained address translation data;

每一个第二级缓存单元与多个所述第一级缓存单元连接,关联至少两个对应的控制节点,能够同时为所述至少两个控制节点提供缓存空间,用于缓存获得的地址转换数据。Each second-level cache unit is connected to a plurality of the first-level cache units, and is associated with at least two corresponding control nodes, and can simultaneously provide cache space for the at least two control nodes for caching the obtained address conversion data.

在一种可能的实现中,还包括:In a possible implementation, the method further includes:

翻译控制单元,用于在所述翻译缓冲单元中没有查询到所述虚拟地址对应的地址转换数据时,从自身存储空间查询得到所述虚拟地址对应的地址转换数据,或控制从内存中查询获得所述虚拟地址对应的地址转换数据。The translation control unit is used to query the address translation data corresponding to the virtual address from its own storage space when the address translation data corresponding to the virtual address is not queried in the translation buffer unit, or to control the query from the memory to obtain the address translation data corresponding to the virtual address.

在一种可能的实现中,其中:In one possible implementation, where:

所述第二级缓存单元关联的至少两个控制节点为业务处理涉及相同虚拟地址的控制节点;At least two control nodes associated with the second-level cache unit are control nodes whose service processing involves the same virtual address;

或,所述第二级缓存单元关联的至少两个控制节点为工作状态具有互斥性的控制节点,其中的互斥性表征不会同时发出数据访问指令。Alternatively, at least two control nodes associated with the second-level cache unit are control nodes with mutually exclusive working states, wherein the mutual exclusivity indicates that data access instructions will not be issued at the same time.

本申请第三方面提供了一种电子设备,包括:A third aspect of the present application provides an electronic device, including:

处理器;processor;

存储器,用于存储所述处理器的可执行指令;A memory, configured to store executable instructions of the processor;

其中,所述可执行指令包括:接收第一节点发送的地址转换请求,所述地址转换请求包括虚拟地址;从所述翻译缓冲单元查询与所述虚拟地址对应的地址转换数据,所述地址转换数据包括虚拟地址与物理地址的对应关系,所述翻译缓冲单元包括第一级缓存单元和第二级缓存单元,所述第一级缓存单元仅关联所述第一节点,所述第二级缓存单元关联包括所述第一节点在内的至少两个控制节点,能够为所述至少两个控制节点提供地址转换数据的缓存空间;基于查找到的地址转换数据,将所述虚拟地址转换为对应的待访问的目标物理地址。Among them, the executable instructions include: receiving an address conversion request sent by a first node, the address conversion request including a virtual address; querying address conversion data corresponding to the virtual address from the translation buffer unit, the address conversion data including the correspondence between the virtual address and the physical address, the translation buffer unit including a first-level cache unit and a second-level cache unit, the first-level cache unit is only associated with the first node, and the second-level cache unit is associated with at least two control nodes including the first node, and can provide cache space for address conversion data for the at least two control nodes; based on the found address conversion data, converting the virtual address into a corresponding target physical address to be accessed.

本申请第四方面提供了一种计算机程序产品,包括计算机可读指令,当所述计算机可读指令在电子设备上运行时,使得所述电子设备实现上述第一方面或第一方面任一实现方式的数据通信方法。In a fourth aspect, the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the data communication method of the first aspect or any implementation of the first aspect.

本申请第五方面提供了一种计算机存储介质,所述存储介质承载有一个或多个计算机程序,当所述一个或多个计算机程序被电子设备执行时,能够使所述电子设备上述第一方面或第一方面任一实现方式的数据通信方法。In a fifth aspect, the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the data communication method of the first aspect or any implementation method of the first aspect.

本申请提供的方案中,翻译缓冲单元中用于缓存地址转换数据的不仅包括单独与一个控制节点关联的第一级缓存单元,还包括同时与多个控制节点关联的第二级缓存单元,因此整体上扩大了地址转换数据的缓存空间,能够存储对应多个控制节点的更多的地址转换数据;从而后续在控制节点访问内存数据时,很大概率能够从翻译缓冲单元查找到对应的地址转换数据完成地址转换,而无需再去内存中查找地址转换数据,整体上降低地址转换的延迟,提升了处理效率。In the solution provided by the present application, the translation buffer unit used to cache address conversion data includes not only a first-level cache unit associated with a single control node, but also a second-level cache unit associated with multiple control nodes at the same time. Therefore, the cache space of the address conversion data is expanded as a whole, and more address conversion data corresponding to multiple control nodes can be stored; therefore, when the control node subsequently accesses the memory data, it is very likely that the corresponding address conversion data can be found from the translation buffer unit to complete the address conversion, without having to search for the address conversion data in the memory, thereby reducing the delay of address conversion as a whole and improving processing efficiency.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

图1为SMMU的进行地址转换的原理示意图;FIG1 is a schematic diagram showing the principle of address conversion performed by SMMU;

图2为本申请实施例公开的一种数据通信方法的流程图;FIG2 is a flow chart of a data communication method disclosed in an embodiment of the present application;

图3为本申请实施例公开的地址转换装置的架构原理示意图;FIG3 is a schematic diagram of the architecture principle of the address conversion device disclosed in an embodiment of the present application;

图4为本申请实施例公开的传统方案与本申请方案获得地址转换数据的查询路径示意图;FIG4 is a schematic diagram of query paths for obtaining address conversion data using the conventional solution disclosed in the embodiment of the present application and the solution of the present application;

图5为本申请实施例公开的为第二级缓存单元分配存储资源的流程图;FIG5 is a flow chart of allocating storage resources to a second-level cache unit disclosed in an embodiment of the present application;

图6为本申请实施例公开的缓存共享组别的划分示例图;FIG6 is a diagram showing an example of the division of cache sharing groups disclosed in an embodiment of the present application;

图7为本申请实施例公开的一种地址转换装置的结构示意图;FIG7 is a schematic diagram of the structure of an address conversion device disclosed in an embodiment of the present application;

图8为本申请实施例公开的一种电子设备的结构示意图。FIG8 is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

本申请实施例可以应用于电子设备,本申请对该电子设备的产品形式不做限定,可以包括但并不局限于智能手机、平板电脑、可穿戴设备、个人计算机(personalcomputer, PC)、上网本等,可以依据应用需求选择。The embodiments of the present application can be applied to electronic devices. The present application does not limit the product form of the electronic device, which can include but is not limited to smart phones, tablet computers, wearable devices, personal computers (PCs), netbooks, etc., and can be selected according to application requirements.

图2为本申请实施例公开的一种数据通信方法的流程图。图2所示方法可应用于地址转换装置,所述地址转换装置包括翻译缓冲单元。所述地址转换装置可以是系统内存管理单元SMMU。参加图2所示,数据通信方法可以包括:FIG2 is a flow chart of a data communication method disclosed in an embodiment of the present application. The method shown in FIG2 can be applied to an address translation device, and the address translation device includes a translation buffer unit. The address translation device can be a system memory management unit SMMU. As shown in FIG2, the data communication method can include:

步骤201:接收第一节点发送的地址转换请求,所述地址转换请求包括虚拟地址。Step 201: Receive an address translation request sent by a first node, where the address translation request includes a virtual address.

其中,所述第一节点可以是电子设备内部任何可以访问内存的控制节点,包括但不限于CPU(Central Processing Unit,中央处理器)、GPU(graphics processing unit,图形处理器)、TPU(Tensor Processing Unit,张量处理器)、NPU(Neural networkProcessing Unit,神经网络处理器)、FPGA(Field Programmable Gate Array,现场可编程门阵列)等。Among them, the first node can be any control node inside the electronic device that can access the memory, including but not limited to CPU (Central Processing Unit), GPU (graphics processing unit), TPU (Tensor Processing Unit), NPU (Neural network Processing Unit), FPGA (Field Programmable Gate Array), etc.

第一节点在需要访问内存中的目标数据时,会发出地址转换请求给地址转换装置。地址转换请求中包括其想要访问数据的虚拟地址,该虚拟地址并不是第一节点想要访问的目标数据的真实物理地址,因此需要地址转换装置基于预存的表征虚拟地址到物理地址映射关系的地址转换数据,将虚拟地址转换成为对应所述目标数据的物理地址,进而使得第一节点能够从该真实的物理地址读取需要的目标数据。When the first node needs to access the target data in the memory, it will send an address conversion request to the address conversion device. The address conversion request includes the virtual address of the data it wants to access, which is not the real physical address of the target data that the first node wants to access. Therefore, the address conversion device needs to convert the virtual address into the physical address corresponding to the target data based on the pre-stored address conversion data representing the mapping relationship between the virtual address and the physical address, so that the first node can read the required target data from the real physical address.

步骤202:从所述翻译缓冲单元查询与所述虚拟地址对应的地址转换数据,所述地址转换数据包括虚拟地址与物理地址的对应关系,所述翻译缓冲单元包括第一级缓存单元和第二级缓存单元,所述第一级缓存单元仅关联所述第一节点,所述第二级缓存单元关联包括所述第一节点在内的至少两个控制节点,能够为所述至少两个控制节点提供地址转换数据的缓存空间。Step 202: Query the address conversion data corresponding to the virtual address from the translation buffer unit, the address conversion data including the correspondence between the virtual address and the physical address, the translation buffer unit including a first-level cache unit and a second-level cache unit, the first-level cache unit is only associated with the first node, and the second-level cache unit is associated with at least two control nodes including the first node, and can provide cache space for address conversion data for the at least two control nodes.

其中,所述地址转换数据为历史查询过程中存储在所述翻译缓冲单元中的数据。也即,在之前控制节点查询内存中的某数据时,发出携带虚拟地址的地址转换请求,地址转换装置的翻译缓冲单元从内存中获得了对应该数据的地址转换数据并缓存,若后续有控制节点再次访问相同的虚拟地址,则可以直接从缓存中获得对应的地址转换数据,而无需再从内存中去寻找地址转换数据。需要说明的是,由于翻译缓冲单元的存储空间是有限的,因此其中缓存的地址转换数据也是动态更新的,具体的更新策略可以基于场景需求来设定。Among them, the address conversion data is the data stored in the translation buffer unit during the historical query process. That is, when the control node previously queried certain data in the memory, it issued an address conversion request carrying the virtual address, and the translation buffer unit of the address conversion device obtained the address conversion data corresponding to the data from the memory and cached it. If a control node subsequently accesses the same virtual address again, the corresponding address conversion data can be directly obtained from the cache without having to search for the address conversion data from the memory. It should be noted that since the storage space of the translation buffer unit is limited, the cached address conversion data therein is also dynamically updated, and the specific update strategy can be set based on scenario requirements.

图3为本申请实施例公开的地址转换装置的架构原理示意图。其中,最上方包括多个控制节点Master,TLB为第一级缓存单元, shared TLB为第二级缓存单元,TBU表征翻译缓冲单元,Switch为转换开关,TCU为翻译控制单元。结合图3所示,第一级缓存单元的存储空间较小,其仅能缓存与其关联的第一节点相关的地址转换数据;第二级缓存单元的存储空间较大,能够同时与多个第一级缓存单元连接,其能够关联至少两个控制节点,缓存与其关联的至少两个控制节点相关的地址转换数据。在从所述翻译缓冲单元中查找与所述虚拟地址对应的地址转换数据时,可以逐级的进行查找,即先从所述第一级缓存单元查找是否存在与所述虚拟地址对应的地址转换数据;若没有查找到,继续从所述第二级缓存单元查找与所述虚拟地址对应的地址转换数据。FIG3 is a schematic diagram of the architecture principle of the address conversion device disclosed in the embodiment of the present application. Among them, the top includes multiple control nodes Master, TLB is a first-level cache unit, shared TLB is a second-level cache unit, TBU represents a translation buffer unit, Switch is a conversion switch, and TCU is a translation control unit. As shown in FIG3, the storage space of the first-level cache unit is small, and it can only cache the address conversion data related to the first node associated with it; the storage space of the second-level cache unit is large, and it can be connected to multiple first-level cache units at the same time. It can be associated with at least two control nodes and cache the address conversion data related to at least two control nodes associated with it. When searching for the address conversion data corresponding to the virtual address from the translation buffer unit, it can be searched step by step, that is, first search from the first-level cache unit whether there is address conversion data corresponding to the virtual address; if not found, continue to search for the address conversion data corresponding to the virtual address from the second-level cache unit.

结合图3,从结构上来看,第一级缓存单元TLB和翻译缓冲单元TBU可以集成于同一硬件模块内,该硬件模块直接与控制节点Master连接;各个shared TLB 可以是单独的存储组件。地址转换装置中的TLB都可以采用SRAM (Static Random-Access Memory,静态随机存取存储器),由于SRAM的读写效率很高,因此可以保证地址转换处理工作的高效进行。Combined with Figure 3, from a structural point of view, the first-level cache unit TLB and the translation buffer unit TBU can be integrated into the same hardware module, which is directly connected to the control node Master; each shared TLB can be a separate storage component. The TLB in the address translation device can all use SRAM (Static Random-Access Memory). Since the read and write efficiency of SRAM is very high, it can ensure the efficient processing of address translation.

步骤203:基于查找到的地址转换数据,将所述虚拟地址转换为对应的待访问的目标物理地址。Step 203: Based on the found address conversion data, convert the virtual address into a corresponding target physical address to be accessed.

从所述翻译缓存模块查找到与所述虚拟地址对应的地址转换数据后,可以基于查找到的地址转换数据中记录的映射关系,将述虚拟地址转换为对应的待访问的目标物理地址并返回总线,以使得控制节点的数据访问流程继续进行,实现对目标数据的访问。After finding the address conversion data corresponding to the virtual address from the translation cache module, the virtual address can be converted into the corresponding target physical address to be accessed and returned to the bus based on the mapping relationship recorded in the found address conversion data, so that the data access process of the control node can continue and access to the target data can be achieved.

图4为本申请实施例公开的传统方案与本申请方案获得地址转换数据的查询路径示意图,其中上图带箭头曲线为传统方案查询路径,下图中带箭头曲线为本申请方案查询路径。Figure 4 is a schematic diagram of the query path for obtaining address conversion data using the traditional solution and the solution of the present application disclosed in the embodiment of the present application, wherein the arrowed curve in the upper figure is the query path of the traditional solution, and the arrowed curve in the lower figure is the query path of the solution of the present application.

结合图4中上面的图,在传统方案查询路径中,控制节点发送出地址转换请求,翻译缓冲单元TBU获得该请求,并基于请求中携带的虚拟地址,从自身对应的存储模块TLB中查找对应的地址转换数据;若TLB中未查找到对应的地址转换数据,则需要通过多个转换开关switch将地址转换请求发送至翻译控制单元TCU,由控制单元TCU从自身存储模块或从内存中查询获得对应的地址转换数据,并将查询到的地址转换数据原路返回给翻译控制单元,由翻译控制单元基于地址转换数据进行地址转换处理。该方案实现由翻译缓冲单元TBU和翻译控制单元TCU共同参与完成,地址转换延迟大约50~120个处理周期。Combined with the upper diagram in Figure 4, in the query path of the traditional solution, the control node sends an address conversion request, the translation buffer unit TBU obtains the request, and based on the virtual address carried in the request, searches for the corresponding address conversion data from its corresponding storage module TLB; if the corresponding address conversion data is not found in the TLB, it is necessary to send the address conversion request to the translation control unit TCU through multiple conversion switches, and the control unit TCU obtains the corresponding address conversion data from its own storage module or from the memory, and returns the queried address conversion data to the translation control unit in the original path, and the translation control unit performs address conversion processing based on the address conversion data. This solution is implemented by the translation buffer unit TBU and the translation control unit TCU, and the address conversion delay is about 50~120 processing cycles.

结合图4中下面的图,本申请方案的查询路径中,由于翻译缓冲单元中增加了第二级缓存单元shared TLB,缓存空间大增加,能够缓存的地址转换数据量也会大幅增多,则在接收到地址转换请求后很大概率能够从翻译缓冲单元查询到需要的地址转换数据而无需再去翻译控制单元或内存中查找。由此,翻译缓冲单元TBU在接收到控制节点发送的地址转换请求后,能够从第二级缓存单元shared TLB中查找到对应地址转换请求中虚拟地址的地址转换数据,并基于查询到的地址转换数据进行地址转换处理。该方案实现仅由翻译缓存单参与完成,经过了两级缓存单元,地址转换延迟大约40~60个处理周期,从而相对于传统技术方案能够大幅降低地址转换延迟。Combined with the following figure in FIG4, in the query path of the solution of the present application, since the second-level cache unit shared TLB is added to the translation buffer unit, the cache space is greatly increased, and the amount of address conversion data that can be cached will also be greatly increased. Therefore, after receiving the address conversion request, it is very likely that the required address conversion data can be queried from the translation buffer unit without having to search in the translation control unit or memory. Therefore, after receiving the address conversion request sent by the control node, the translation buffer unit TBU can find the address conversion data of the virtual address in the corresponding address conversion request from the second-level cache unit shared TLB, and perform address conversion processing based on the queried address conversion data. The implementation of this solution is completed only by the translation cache unit, and after two levels of cache units, the address conversion delay is about 40 to 60 processing cycles, thereby significantly reducing the address conversion delay compared to the traditional technical solution.

本实施例所述数据通信方法中,用于缓存地址转换数据的不仅包括单独与一个控制节点关联的第一级缓存单元,还包括同时与多个控制节点关联的第二级缓存单元,因此整体上扩大了地址转换数据的缓存空间,能够存储对应多个控制节点的更多的地址转换数据;从而后续在控制节点访问内存数据时,很大概率能够从翻译缓冲单元查找到对应的地址转换数据完成地址转换,而无需再去内存中查找地址转换数据,整体上降低地址转换的延迟,提升了处理效率。In the data communication method described in this embodiment, the device for caching address conversion data includes not only a first-level cache unit associated with a single control node, but also a second-level cache unit associated with multiple control nodes at the same time. Therefore, the cache space of the address conversion data is expanded as a whole, and more address conversion data corresponding to multiple control nodes can be stored; therefore, when the control node subsequently accesses the memory data, it is very likely that the corresponding address conversion data can be found from the translation buffer unit to complete the address conversion, without having to search for the address conversion data in the memory, thereby reducing the delay of address conversion as a whole and improving processing efficiency.

在前述实施例内容的基础上,所述数据通信方法还可以包括:若未从所述翻译缓冲单元中查询到所述地址转换数据,基于翻译控制单元获得与所述虚拟地址对应的地址转换数据,其中,所述翻译控制单元关联所有的控制节点。Based on the contents of the foregoing embodiments, the data communication method may further include: if the address conversion data is not queried from the translation buffer unit, obtaining the address conversion data corresponding to the virtual address based on the translation control unit, wherein the translation control unit is associated with all control nodes.

若从所述翻译缓冲单元中没有查询到对应所述虚拟地址的地址转换数据,则需要从更深层次的模块或存储空间去查找地址转换数据,应用中在所述翻译缓冲单元中没有对应所述虚拟地址的地址转换数据时,可以从与翻译缓冲单元连接的翻译控制单元中查找地址转换数据;若所述翻译控制单元中仍未找到所述地址转换数据,则可以由翻译控制单元控制从内存中查找所述地址转换数据。If the address conversion data corresponding to the virtual address is not found in the translation buffer unit, it is necessary to search for the address conversion data from a deeper module or storage space. In the application, when there is no address conversion data corresponding to the virtual address in the translation buffer unit, the address conversion data can be searched from the translation control unit connected to the translation buffer unit; if the address conversion data is still not found in the translation control unit, the translation control unit can control the search for the address conversion data from the memory.

以上内容中,无论是从翻译控制单元还是内存中查找所述地址转换数据,均可以由翻译控制单元控制实现,因此基于翻译控制单元获得与所述虚拟地址对应的地址转换数据,包括:从翻译控制单元获得与所述虚拟地址对应的地址转换数据,或基于翻译控制单元从内存中获得与所述虚拟地址对应的地址转换数据。In the above content, whether searching for the address conversion data from the translation control unit or the memory, it can be controlled and implemented by the translation control unit. Therefore, obtaining the address conversion data corresponding to the virtual address based on the translation control unit includes: obtaining the address conversion data corresponding to the virtual address from the translation control unit, or obtaining the address conversion data corresponding to the virtual address from the memory based on the translation control unit.

一个实现中,数据通信方法还可以包括:在各个第二级缓存单元内部动态的对当前第二级缓存单元的存储资源进行分配,所述分配表征将存储资源分配给当前第二级缓存单元关联的至少两个控制节点使用。In one implementation, the data communication method may further include: dynamically allocating storage resources of the current second-level cache unit within each second-level cache unit, wherein the allocation represents allocating storage resources to at least two control nodes associated with the current second-level cache unit for use.

结合图3所示,由于所述第二级缓存单元关联多个控制节点,因此能够为其关联的多个控制节点提供缓存空间。实现中,翻译缓冲单元可以将一个第二级缓存单元中的存储空间动态的分配给该第二级缓存单元关联的多个控制节点,各个控制节点对应的地址转换数据也仅可以存储在第二级缓存单元中相应控制节点分配的存储空间中。如图3中Master0、Master1和Master2为同一个第二级缓存单元关联的控制节点,该第二级缓存单元同时为Master0、Master1和Master2分配缓存空间;如第二级缓存单元的存储空间为10,则为Master0分配的存储空间为4,为Master1分配的存储空间为3,为Master2分配的存储空间为3。当然,上述分配仅为一个示例,相同第二级缓存单元关联的多个控制节点分配的存储空间可以相同,也可以不同,本申请对此并不限制,具体分配方式可结合实际应用需求来确定。As shown in FIG3, since the second-level cache unit is associated with multiple control nodes, it can provide cache space for multiple control nodes associated with it. In implementation, the translation buffer unit can dynamically allocate the storage space in a second-level cache unit to multiple control nodes associated with the second-level cache unit, and the address conversion data corresponding to each control node can only be stored in the storage space allocated to the corresponding control node in the second-level cache unit. As shown in FIG3, Master0, Master1 and Master2 are control nodes associated with the same second-level cache unit, and the second-level cache unit allocates cache space to Master0, Master1 and Master2 at the same time; if the storage space of the second-level cache unit is 10, the storage space allocated to Master0 is 4, the storage space allocated to Master1 is 3, and the storage space allocated to Master2 is 3. Of course, the above allocation is only an example, and the storage space allocated to multiple control nodes associated with the same second-level cache unit can be the same or different. This application does not limit this, and the specific allocation method can be determined in combination with actual application requirements.

图5示出了本申请实施例公开的为第二级缓存单元分配存储资源的流程图。结合图5,所述在各个第二级缓存单元内部动态的对当前第二级缓存单元的存储资源进行分配,可以包括:FIG5 shows a flowchart of allocating storage resources to the second-level cache unit disclosed in an embodiment of the present application. In conjunction with FIG5, the dynamic allocation of storage resources of the current second-level cache unit within each second-level cache unit may include:

步骤501:基于当前第二级缓存单元关联的至少两个控制节点的特征参数确定所述至少两个控制节点的优先级。Step 501: Determine the priorities of at least two control nodes associated with the current second-level cache unit based on characteristic parameters of the at least two control nodes.

其中,所述特征参数至少包括以下任意一项:控制节点类型、实时性要求和数据传输量。本实施例中,与同一第二级缓存单元关联的多个控制节点在第二级缓存单元中的存储空间大小不是固定的,可以动态的调整。一个示例中,不同类型的控制节点的重要度不容,如CPU的重要度高于TPU,则CPU的优先级更高,为了保证CPU的处理性能,需要为其分配更多一点的缓存空间,而为TPU分配相对较少的缓存空间。其他示例中,也可以根据控制节点的实时性要求和数据传输量来确定控制节点的优先级;可以理解的,实时性要求高和数据传输量大的控制节点,分配的缓存空间也会更多。当然,确定控制节点的优先级,也可以同时基于多种因素综合考虑,例如可以同时结合实时性要求和数据传输量,将两者进行加权求和得到综合分值,基于综合分值确定不同控制节点的优先级高低。Among them, the characteristic parameters include at least any one of the following: control node type, real-time requirements and data transmission volume. In this embodiment, the storage space size of multiple control nodes associated with the same second-level cache unit in the second-level cache unit is not fixed and can be adjusted dynamically. In one example, the importance of different types of control nodes is not limited. For example, the importance of CPU is higher than that of TPU, so the priority of CPU is higher. In order to ensure the processing performance of CPU, it is necessary to allocate more cache space to it, and allocate relatively less cache space to TPU. In other examples, the priority of control node can also be determined according to the real-time requirements and data transmission volume of control node; it can be understood that control nodes with high real-time requirements and large data transmission volume will also be allocated more cache space. Of course, the priority of control node can also be determined based on a comprehensive consideration of multiple factors at the same time. For example, real-time requirements and data transmission volume can be combined at the same time, and the two can be weighted and summed to obtain a comprehensive score, and the priority of different control nodes can be determined based on the comprehensive score.

步骤502:基于所述至少两个控制节点的优先级为各个控制节点分配第二级缓存单元的存储资源。Step 502: Allocate storage resources of a second-level cache unit to each control node based on the priority of the at least two control nodes.

在确定了不同控制节点的优先级后,可以按照优先级的高低控制为各控制节点分配第二级缓存单元的存储资源,保证各控制节点在此分配方案上能够流畅运行。After the priorities of different control nodes are determined, the storage resources of the second-level cache unit can be allocated to each control node according to the priority level, so as to ensure that each control node can run smoothly on this allocation scheme.

前文也介绍到动态的对当前第二级缓存单元的存储资源进行分配。应用中,某控制节点在不同的工作状态下的数据传输量不同,如GPU,在设备有视频输出的情况下,其必然需要进行大量的数据传输和处理,因此在有视频输出时,可以在第二级存储单元中为GPU分配更多的存储资源;而在设备没有视频输出内容时,则可以在第二级存储单元中为GPU分配较少的存储资源,满足其不同的资源需求。The previous article also introduced the dynamic allocation of storage resources of the current second-level cache unit. In the application, the data transmission volume of a control node is different in different working states. For example, when the device has video output, the GPU must perform a large amount of data transmission and processing. Therefore, when there is video output, more storage resources can be allocated to the GPU in the second-level storage unit; when the device has no video output content, less storage resources can be allocated to the GPU in the second-level storage unit to meet its different resource requirements.

本实施例所述数据通信方法在实现中可以动态的根据第二级缓存单元关联的多个控制节点的特征参数动态的为各个控制节点分配存储资源,保证合理的存储资源分配,保障各个控制节点相关工作的顺利进行。The data communication method described in this embodiment can dynamically allocate storage resources to each control node according to the characteristic parameters of multiple control nodes associated with the second-level cache unit during implementation, thereby ensuring reasonable storage resource allocation and guaranteeing smooth progress of related work of each control node.

前述实施例中,在所述基于翻译控制单元获得与所述虚拟地址对应的地址转换数据后,还可以包括:将所述地址转换数据缓存在所述第二级缓存单元。将地址转换数据缓存在所述第二级缓存单元,以便于后续有控制节点访问相同虚拟地址的数据时,可以从第二级缓存单元快速查找到对应的地址转换数据进行地址转换处理。In the aforementioned embodiment, after the translation control unit obtains the address conversion data corresponding to the virtual address, the method may further include: caching the address conversion data in the second-level cache unit. The address conversion data is cached in the second-level cache unit so that when a control node subsequently accesses data at the same virtual address, the corresponding address conversion data can be quickly found from the second-level cache unit for address conversion processing.

一个实现中,在获得地址转换数据后,可以直接将该地址转换数据缓存到第二级缓存单元。该实现中不考虑其他情况,也不会考虑第一级缓存单元是否会存储该地址转换数据,只要从翻译控制单元获得地址转换数据后,即会将其存储在第二级缓存单元。In one implementation, after obtaining the address translation data, the address translation data can be directly cached in the second-level cache unit. In this implementation, other situations are not considered, and whether the first-level cache unit will store the address translation data is not considered. As long as the address translation data is obtained from the translation control unit, it will be stored in the second-level cache unit.

另一个实现中,将所述地址转换数据缓存在所述第二级缓存单元,可以在所述第一级缓存单元已存满数据的情况下,将所述地址转换数据缓存在所述第二级缓存单元。In another implementation, the address conversion data is cached in the second-level cache unit. When the first-level cache unit is full of data, the address conversion data can be cached in the second-level cache unit.

在第一级缓存单元存满数据的情况下,为了保证整体缓存的地址转换数据更多,可以将地址转换数据缓存在第二级缓存单元;在第一级缓存单元没有存满数据的情况下,第二级缓存单元可配置的,可以存储所述地址转换数据,也可以不存储地址转换数据。When the first-level cache unit is full of data, the address conversion data may be cached in the second-level cache unit to ensure that the overall cache has more address conversion data; when the first-level cache unit is not full of data, the second-level cache unit may be configured to store the address conversion data or not.

又一个实现中,将所述地址转换数据缓存在所述第二级缓存单元,可以在所述虚拟地址为所述第二级缓存单元关联的至少两个控制节点的处理业务均会访问的虚拟地址的情况下,将所述地址转换数据缓存在所述第二级缓存单元。In another implementation, the address conversion data is cached in the second-level cache unit. When the virtual address is a virtual address that is accessed by processing services of at least two control nodes associated with the second-level cache unit, the address conversion data can be cached in the second-level cache unit.

若获得的地址转换数据对应第二级缓存单元对应的两个甚至更多控制节点,则可以将该地址转换数据缓存在第二级缓存单元,以便于当前访问数据的第一节点之外的其他控制节点在访问相同数据时,能够从其与第一节点共用的第二级缓存单元中查询到对应的地址访问数据。If the obtained address conversion data corresponds to two or more control nodes corresponding to the second-level cache unit, the address conversion data can be cached in the second-level cache unit so that other control nodes other than the first node currently accessing the data can query the corresponding address access data from the second-level cache unit shared with the first node when accessing the same data.

又一个实现中,将所述地址转换数据缓存在所述第二级缓存单元,可以在所述第二级缓存单元已存满数据的情况下,将符合第一要求的缓存数据删除,并将所述地址转换数据缓存在所述第二级缓存单元。In another implementation, the address conversion data is cached in the second-level cache unit. When the second-level cache unit is full of data, the cache data that meets the first requirement can be deleted and the address conversion data can be cached in the second-level cache unit.

其中,所述第一要求可以包括以下至少一项:缓存时间最久、查询频率最低和对应的控制节点的实时性要求最低。在所述第一要求为级缓存时间最久的情况下,若接收到新的地址转换数据,则会将第二级缓存单元中最先存储的地址转换数据删除,以释放存储空间存储最新获得的地址转换数据。在所述第一要求为查询频率最低的情况下,则会将第二级缓存单元中最久没有被查询的地址转换数据删除,释放存储空间存储最新获得的地址转换数据。在所述第一要求为对应的控制节点的实时性要求最低的情况下,则会将第二级缓存单元对应的控制节点中实时性要求最低的控制节点对应的地址转换数据删除,释放存储空间存储最新获得的地址转换数据;可以理解的,由于对应的控制节点的实时性要求最低,则即使第二级缓存单元中没有查询到需要的地址转换数据,从翻译控制单元或内存中查找需要的地址转换数据,也基本能够满足对应控制节点的时延需求,满足其工作需求。Wherein, the first requirement may include at least one of the following: the longest cache time, the lowest query frequency, and the lowest real-time requirement of the corresponding control node. In the case where the first requirement is the longest cache time, if new address conversion data is received, the address conversion data first stored in the second-level cache unit will be deleted to release storage space to store the latest address conversion data. In the case where the first requirement is the lowest query frequency, the address conversion data that has not been queried for the longest time in the second-level cache unit will be deleted to release storage space to store the latest address conversion data. In the case where the first requirement is the lowest real-time requirement of the corresponding control node, the address conversion data corresponding to the control node with the lowest real-time requirement among the control nodes corresponding to the second-level cache unit will be deleted to release storage space to store the latest address conversion data; it can be understood that since the real-time requirement of the corresponding control node is the lowest, even if the required address conversion data is not queried in the second-level cache unit, searching for the required address conversion data from the translation control unit or the memory can basically meet the latency requirements of the corresponding control node and meet its work requirements.

以上内容介绍了将所述地址转换数据缓存在所述第二级缓存单元的多种不同的实现,便于领域内技术人员更好的理解和实施本申请技术方案。需要说明的是,各个不同的实现不具备排他性,实际应用场景中也可以结合多种存储策略控制地址转换数据在第二级存储单元的存储,本申请对此并不固定限制。The above content introduces a variety of different implementations of caching the address conversion data in the second-level cache unit, which is convenient for technicians in the field to better understand and implement the technical solution of this application. It should be noted that the different implementations are not exclusive, and in actual application scenarios, multiple storage strategies can also be combined to control the storage of address conversion data in the second-level storage unit, and this application does not have fixed restrictions on this.

前述实施例内容中,所述第二级缓存单元关联的至少两个控制节点的确定可以包括:将业务处理涉及相同虚拟地址的控制节点匹配到同一个第二级缓存单元。In the aforementioned embodiment, the determination of at least two control nodes associated with the second-level cache unit may include: matching control nodes with the same virtual address involved in service processing to the same second-level cache unit.

也即,基于不同控制节点间的共享关联性(存在共享数据),将会访问相同虚拟地址的控制节点划分到一个缓存共享组别,该组别中的控制节点同时匹配到同一个第二级缓存单元。可以理解的,由于一个缓存共享组别中的控制节点会访问相同的数据,因此当其中一个控制节点访问某数据获得一地址转换数据并将其缓存在第二级缓存单元中,后续该缓存共享组别中的其他控制节点也访问相同数据,则可以在第二级缓存单元中快速查找到之前缓存的地址转换数据。That is, based on the sharing association between different control nodes (there is shared data), the control nodes that access the same virtual address are divided into a cache sharing group, and the control nodes in the group are matched to the same second-level cache unit at the same time. It can be understood that since the control nodes in a cache sharing group will access the same data, when one of the control nodes accesses a certain data to obtain an address conversion data and caches it in the second-level cache unit, and other control nodes in the cache sharing group also access the same data later, the previously cached address conversion data can be quickly found in the second-level cache unit.

另一个实现中,第二级缓存单元关联的至少两个控制节点的确定可以包括:将工作状态具有互斥性的控制节点匹配到同一个的第二级缓存单元,其中的互斥性表征不会同时发出数据访问指令。In another implementation, determining at least two control nodes associated with the second-level cache unit may include: matching control nodes with mutually exclusive working states to the same second-level cache unit, wherein the mutual exclusivity indicates that data access instructions will not be issued simultaneously.

其中,工作状态具有互斥性的控制节点,也即在一个控制节点在工作状态(发出指令)时,另一个控制节点则处于非工作状态(不会发出指令),可分别工作在不同的场景,这样具有互斥性的工作节点不会同时使用第二级缓存单元,则第二级缓存单元的存储空间不必设置的过大,从而节省资源配置。如具有互斥性的两个节点共用一个第二级缓存单元,则该第二级缓存单元的存储空间能够满足一个控制节点使用即可。Among them, the control nodes with mutually exclusive working states, that is, when one control node is in working state (issuing instructions), the other control node is in non-working state (will not issue instructions), and they can work in different scenarios respectively. In this way, the mutually exclusive working nodes will not use the second-level cache unit at the same time, so the storage space of the second-level cache unit does not need to be set too large, thereby saving resource configuration. If two mutually exclusive nodes share a second-level cache unit, the storage space of the second-level cache unit can meet the use of one control node.

本实施例中,采用系统级“共享/互斥”相结合的资源优化组合策略,可对所有的控制节点自动划分缓存共享组别,其可以基于共享关联性划分缓存共享组别,提升在翻译缓冲单元查找到地址转换数据的命中率;基于互斥关联性,实现整体资源的低成本配置。图6为本申请实施例公开的缓存共享组别的划分示例图,其中两个虚线圈出的为两个缓存共享组的配置资源架构。结合图6,左侧虚线圈中包含的Master0、Master1和Master2同属于一个缓存共享组,三个控制节点共用第一个第二级缓存单元;右侧虚线圈中包含的Maste3和Master4同属于一个缓存共享组,两个控制节点共用第二个第二级缓存单元。In this embodiment, a resource optimization combination strategy combining "sharing/mutual exclusion" at the system level is adopted to automatically divide all control nodes into cache sharing groups. The cache sharing groups can be divided based on sharing associations to improve the hit rate of address conversion data found in the translation buffer unit; based on mutual exclusion associations, low-cost configuration of overall resources is achieved. Figure 6 is an example diagram of the division of cache sharing groups disclosed in the embodiment of the present application, in which the two dotted circles indicate the configuration resource architecture of the two cache sharing groups. In conjunction with Figure 6, Master0, Master1 and Master2 contained in the dotted circle on the left belong to the same cache sharing group, and the three control nodes share the first second-level cache unit; Master3 and Master4 contained in the dotted circle on the right belong to the same cache sharing group, and the two control nodes share the second second-level cache unit.

对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some 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 and modules involved are not necessarily required by the present application.

上述本申请公开的实施例中详细描述了方法,对于本申请的方法可采用多种形式的装置实现,因此本申请还公开了一种装置,下面给出具体的实施例进行详细说明。The method is described in detail in the embodiments disclosed in the above-mentioned application. The method of the application can be implemented by various forms of devices. Therefore, the application also discloses a device, and a specific embodiment is given below for detailed description.

图7为本申请实施例公开的一种地址转换装置的结构示意图。参见图7所示,地址转换装置70可以包括:FIG7 is a schematic diagram of the structure of an address conversion device disclosed in an embodiment of the present application. Referring to FIG7 , the address conversion device 70 may include:

翻译缓冲单元701,包括多个地址转换单元7011、多个第一级缓冲单元7012和多个第二级缓冲单元7013(图7中以一个第二级缓冲单元为例示出);The translation buffer unit 701 includes a plurality of address conversion units 7011, a plurality of first-level buffer units 7012, and a plurality of second-level buffer units 7013 (one second-level buffer unit is shown as an example in FIG. 7 );

每一个地址转换单元7011关联一个控制节点,用于接收对应的控制节点发送的地址转换请求,基于所述地址转换请求中的虚拟地址查询对应的地址转换数据,并基于获得的地址转换数据将所述虚拟地址转换为物理地址;Each address conversion unit 7011 is associated with a control node, and is used to receive an address conversion request sent by the corresponding control node, query corresponding address conversion data based on the virtual address in the address conversion request, and convert the virtual address into a physical address based on the obtained address conversion data;

每一个第一级缓存单元7012与一个地址转换单元连接,关联对应的控制节点,用于缓存获得的地址转换数据;Each first-level cache unit 7012 is connected to an address translation unit, associated with a corresponding control node, and is used to cache the obtained address translation data;

每一个第二级缓存单元7013与多个所述第一级缓存单元连接,关联至少两个对应的控制节点,能够同时为所述至少两个控制节点提供缓存空间,用于缓存获得的地址转换数据。Each second-level cache unit 7013 is connected to multiple first-level cache units, associated with at least two corresponding control nodes, and can simultaneously provide cache space for the at least two control nodes for caching the obtained address conversion data.

本实施例所述地址转换装置的翻译缓冲单元,用于缓存地址转换数据的不仅包括单独与一个控制节点关联的第一级缓存单元,还包括同时与多个控制节点关联的第二级缓存单元,因此整体上扩大了地址转换数据的缓存空间,能够存储对应多个控制节点的更多的地址转换数据,从而后续在控制节点访问内存数据时,很大概率能够从翻译缓冲单元查找到对应的地址转换数据完成地址转换,而无需再去内存中查找地址转换数据,整体上降低地址转换的延迟,提升了处理效率。The translation buffer unit of the address conversion device described in this embodiment is used to cache address conversion data. It not only includes a first-level cache unit associated with a control node alone, but also includes a second-level cache unit associated with multiple control nodes at the same time. Therefore, the cache space of the address conversion data is expanded as a whole, and more address conversion data corresponding to multiple control nodes can be stored. Therefore, when the control node accesses the memory data subsequently, it is very likely that the corresponding address conversion data can be found from the translation buffer unit to complete the address conversion without having to search for the address conversion data in the memory. This reduces the delay of address conversion as a whole and improves processing efficiency.

一个实现中,参见图3所示,地址转换装置除了翻译缓冲单元外,还可以包括:翻译控制单元,用于在所述翻译缓冲单元中没有查询到所述虚拟地址对应的地址转换数据时,从自身存储空间查询得到所述虚拟地址对应的地址转换数据,或控制从内存中查询获得所述虚拟地址对应的地址转换数据。In one implementation, referring to FIG. 3 , the address conversion device may further include, in addition to the translation buffer unit: a translation control unit for querying the address conversion data corresponding to the virtual address from its own storage space when the address conversion data corresponding to the virtual address is not found in the translation buffer unit, or for controlling the query from the memory to obtain the address conversion data corresponding to the virtual address.

一个实现中,所述第二级缓存单元关联的至少两个控制节点为业务处理涉及相同虚拟地址的控制节点;或,所述第二级缓存单元关联的至少两个控制节点为工作状态具有互斥性的控制节点,其中的互斥性表征不会同时发出数据访问指令。In one implementation, at least two control nodes associated with the second-level cache unit are control nodes whose business processing involves the same virtual address; or, at least two control nodes associated with the second-level cache unit are control nodes with mutually exclusive working states, wherein the mutual exclusivity indicates that data access instructions will not be issued at the same time.

上述实施例中的所述的任意一种地址转换装置包括处理器和存储器,上述实施例中的翻译缓冲单元、地址转换单元、第一级缓冲单元、多个第二级缓冲单元、翻译控制单元等均作为程序模块存储在存储器中,由处理器执行存储在所述存储器中的上述程序模块来实现相应的功能。Any one of the address conversion devices described in the above embodiments includes a processor and a memory. The translation buffer unit, address conversion unit, first-level buffer unit, multiple second-level buffer units, translation control unit, etc. in the above embodiments are all stored in the memory as program modules, and the processor executes the above program modules stored in the memory to implement corresponding functions.

处理器中包含内核,由内核去存储器中调取相应的程序模块。内核可以设置一个或多个,通过调整内核参数来实现回访数据的处理。The processor includes a kernel, which retrieves the corresponding program module from the memory. One or more kernels can be set, and the processing of the access data can be realized by adjusting the kernel parameters.

存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

在示例性实施例中,还提供了一种计算机可读存储介质,可直接加载到计算机的内部存储器,其中含有软件代码,该计算机程序经由计算机载入并执行后能够实现上述数据通信方法任一实施例所示步骤。In an exemplary embodiment, a computer-readable storage medium is also provided, which can be directly loaded into the internal memory of a computer and contains software code. After being loaded and executed by a computer, the computer program can implement the steps shown in any embodiment of the above-mentioned data communication method.

在示例性实施例中,还提供一种计算机程序产品,可直接加载到计算机的内部存储器,其中含有软件代码,该计算机程序经由计算机载入并执行后能够实现上述所述的数据通信方法任一实施例所示步骤。In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into the internal memory of a computer and contains software codes. After being loaded and executed by a computer, the computer program can implement the steps shown in any embodiment of the data communication method described above.

进一步,本申请实施例提供了一种电子设备。图8为本申请实施例公开的一种电子设备的结构示意图。参见图8所示,电子设备80包括至少一个处理器801、以及与处理器连接的至少一个存储器802、总线803;其中,处理器、存储器通过总线完成相互间的通信;处理器用于调用存储器中的程序指令,以执行上述的数据通信方法。Furthermore, an embodiment of the present application provides an electronic device. FIG8 is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. Referring to FIG8 , the electronic device 80 includes at least one processor 801, and at least one memory 802 and a bus 803 connected to the processor; wherein the processor and the memory communicate with each other through the bus; and the processor is used to call the program instructions in the memory to execute the above-mentioned data communication method.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also 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 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 device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A data communication method applied to an address conversion apparatus including a translation buffer unit, the method comprising:
Receiving an address conversion request sent by a first node, wherein the address conversion request comprises a virtual address;
Querying address conversion data corresponding to the virtual address from the translation buffer unit, wherein the address conversion data comprises a corresponding relation between the virtual address and a physical address, the translation buffer unit comprises a first-level buffer unit and a second-level buffer unit, the first-level buffer unit is only associated with the first node, the second-level buffer unit is associated with at least two control nodes including the first node, and a buffer space for the address conversion data can be provided for the at least two control nodes;
converting the virtual address into a corresponding target physical address to be accessed based on the searched address conversion data;
wherein the determining of the at least two control nodes associated with the second level cache unit includes:
Matching control nodes with the same virtual address in service processing to the same second-level cache unit;
Or alternatively, the first and second heat exchangers may be,
And matching the control nodes with the mutual exclusivity in the working state to a second-level cache unit which is the same, wherein the mutual exclusivity is characterized in that the data access instructions are not sent out at the same time.
2. The data communication method of claim 1, the method further comprising:
If the address conversion data is not queried from the translation buffer unit, obtaining the address conversion data corresponding to the virtual address based on a translation control unit, wherein the translation control unit is associated with all control nodes;
wherein obtaining address conversion data corresponding to the virtual address based on the translation control unit includes: and obtaining address conversion data corresponding to the virtual address from the translation control unit or obtaining the address conversion data corresponding to the virtual address from the memory based on the translation control unit.
3. The data communication method of claim 1, further comprising:
and dynamically allocating storage resources of the current second-level cache unit in each second-level cache unit, wherein the allocation process represents allocation of the storage resources to at least two control nodes associated with the current second-level cache unit.
4. A data communication method according to claim 3, wherein said dynamically allocating storage resources of a current second level cache unit within each second level cache unit comprises:
determining the priority of at least two control nodes based on the characteristic parameters of the at least two control nodes associated with the current second-level cache unit;
And distributing storage resources of a second-level cache unit for each control node based on the priorities of the at least two control nodes.
5. The data communication method according to claim 2, further comprising, after the translation-based control unit obtains address conversion data corresponding to the virtual address:
caching the address translation data in the second level cache unit, including at least one of:
directly caching the address conversion data in the second-level caching unit;
Under the condition that the first-level caching unit is full of data, caching the address conversion data in the second-level caching unit;
Under the condition that the virtual address is a virtual address which is accessed by processing services of at least two control nodes associated with the second-level caching unit, caching the address conversion data in the second-level caching unit;
And deleting the cache data meeting the first requirement under the condition that the second-level cache unit is full of data, and caching the address conversion data in the second-level cache unit.
6. An address translation apparatus comprising:
a translation buffer unit including a plurality of address conversion units, a plurality of first-stage buffer units, and a plurality of second-stage buffer units;
Each address conversion unit is associated with a control node and is used for receiving an address conversion request sent by the corresponding control node, inquiring corresponding address conversion data based on a virtual address in the address conversion request and converting the virtual address into a physical address based on the obtained address conversion data;
Each first-level buffer unit is connected with one address conversion unit, and is associated with a corresponding control node for buffering the obtained address conversion data;
Each second-level cache unit is connected with a plurality of first-level cache units, and is associated with at least two corresponding control nodes, so that cache space can be provided for the at least two control nodes at the same time, and the cache space is used for caching the obtained address conversion data;
wherein, at least two control nodes associated with the second-level cache unit are control nodes with the same virtual address for business processing;
Or at least two control nodes associated with the second-level cache unit are control nodes with mutual exclusivity in a working state, wherein the mutual exclusivity is characterized in that data access instructions are not sent out at the same time.
7. The address translation device of claim 6, further comprising:
And the translation control unit is used for inquiring the address conversion data corresponding to the virtual address from the storage space of the translation buffer unit or controlling the inquiry of the address conversion data corresponding to the virtual address from the memory when the address conversion data corresponding to the virtual address is not inquired in the translation buffer unit.
8. An electronic device, comprising:
A processor;
A memory for storing executable instructions of the processor;
Wherein the executable instructions comprise: receiving an address conversion request sent by a first node, wherein the address conversion request comprises a virtual address; inquiring address conversion data corresponding to the virtual address from a translation buffer unit, wherein the address conversion data comprises a corresponding relation between the virtual address and a physical address, the translation buffer unit comprises a first-level buffer unit and a second-level buffer unit, the first-level buffer unit is only associated with the first node, the second-level buffer unit is associated with at least two control nodes including the first node, and a buffer space for the address conversion data can be provided for the at least two control nodes; converting the virtual address into a corresponding target physical address to be accessed based on the searched address conversion data;
the determining of the at least two control nodes associated with the second-level cache unit includes: matching control nodes with the same virtual address in service processing to the same second-level cache unit; or matching the control nodes with the mutual exclusivity in the working state to the same second-level cache unit, wherein the mutual exclusivity characterization does not send out data access instructions at the same time.
CN202410749395.9A 2024-06-11 2024-06-11 Data communication method, address conversion device and electronic equipment Active CN118331919B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202410749395.9A CN118331919B (en) 2024-06-11 2024-06-11 Data communication method, address conversion device and electronic equipment
CN202411426653.6A CN119336692A (en) 2024-06-11 2024-06-11 Data communication method, address conversion device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410749395.9A CN118331919B (en) 2024-06-11 2024-06-11 Data communication method, address conversion device and electronic equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202411426653.6A Division CN119336692A (en) 2024-06-11 2024-06-11 Data communication method, address conversion device and electronic equipment

Publications (2)

Publication Number Publication Date
CN118331919A CN118331919A (en) 2024-07-12
CN118331919B true CN118331919B (en) 2024-10-18

Family

ID=91766395

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202410749395.9A Active CN118331919B (en) 2024-06-11 2024-06-11 Data communication method, address conversion device and electronic equipment
CN202411426653.6A Pending CN119336692A (en) 2024-06-11 2024-06-11 Data communication method, address conversion device and electronic equipment

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202411426653.6A Pending CN119336692A (en) 2024-06-11 2024-06-11 Data communication method, address conversion device and electronic equipment

Country Status (1)

Country Link
CN (2) CN118331919B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119248423B (en) * 2024-09-23 2025-06-10 奕行智能科技(广州)有限公司 Memory virtualization method, deep learning system and task switching method thereof
CN119226184B (en) * 2024-11-27 2025-02-28 沐曦集成电路(南京)有限公司 A two-way transmission system for address translation

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114546897A (en) * 2020-11-26 2022-05-27 龙芯中科技术股份有限公司 Memory access method and device, electronic equipment and storage medium
CN115827502A (en) * 2022-12-09 2023-03-21 北京奕斯伟计算技术股份有限公司 Memory access system, method and medium
CN116383101A (en) * 2022-12-26 2023-07-04 阿里云计算有限公司 Memory access method, memory management unit, chip, device and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9003163B2 (en) * 2012-06-12 2015-04-07 Oracle International Corporation Combining a remote TLB lookup and a subsequent cache miss into a single coherence operation
CN112631962B (en) * 2019-09-24 2024-11-01 阿里巴巴集团控股有限公司 Memory management device, memory management method, processor and computer system
CN114416632A (en) * 2021-12-28 2022-04-29 北京时代民芯科技有限公司 Two-stage cache interconnection structure based on flexible conversion of multi-bus protocol
CN115794681B (en) * 2022-10-12 2023-05-23 中国人民解放军军事科学院国防科技创新研究院 Multi-stage expandable TLB system suitable for RISC-V and address translation method thereof
CN116594925B (en) * 2023-04-24 2024-09-27 上海天数智芯半导体有限公司 Address translation system, processor, address translation method and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114546897A (en) * 2020-11-26 2022-05-27 龙芯中科技术股份有限公司 Memory access method and device, electronic equipment and storage medium
CN115827502A (en) * 2022-12-09 2023-03-21 北京奕斯伟计算技术股份有限公司 Memory access system, method and medium
CN116383101A (en) * 2022-12-26 2023-07-04 阿里云计算有限公司 Memory access method, memory management unit, chip, device and storage medium

Also Published As

Publication number Publication date
CN119336692A (en) 2025-01-21
CN118331919A (en) 2024-07-12

Similar Documents

Publication Publication Date Title
CN118331919B (en) Data communication method, address conversion device and electronic equipment
Hagersten et al. WildFire: A scalable path for SMPs
US6505286B1 (en) User specifiable allocation of memory for processes in a multiprocessor computer having a non-uniform memory architecture
CN105740164A (en) Multi-core processor supporting cache consistency, reading and writing methods and apparatuses as well as device
CN103544269B (en) Methods and node controllers for storing and enquiring directories
CN108804350A (en) A kind of memory pool access method and computer system
CN116644006B (en) A memory page management method, system, device, equipment and computer medium
CN112506823B (en) FPGA data reading and writing method, device, equipment and readable storage medium
CN116594925B (en) Address translation system, processor, address translation method and electronic equipment
CN116383101A (en) Memory access method, memory management unit, chip, device and storage medium
JP6343722B2 (en) Method and device for accessing a data visitor directory in a multi-core system
CN117093371B (en) Cache resource allocation method, device, electronic device and storage medium
CN116974467A (en) Data caching processing method, device and system
CN117076347A (en) A memory sharing method and device
CN114840445A (en) Memory access method and device
CN107193494A (en) RDD (remote data description) persistence method based on SSD (solid State disk) and HDD (hard disk drive) hybrid storage system
CN114925000B (en) Address conversion method, electronic device and electronic equipment
CN114996023B (en) Target cache device, processing device, network equipment and table item acquisition method
CN117009253A (en) Memory pool management method and system for RDMA (remote direct memory access) network
TW202111541A (en) Intra-device notational data movement system
CN120407201A (en) Memory resource allocation method, device, electronic device, medium and product
CN117806526A (en) Data migration method, device, chip and computer-readable storage medium
CN104166596B (en) A kind of memory allocation method and node
CN118193411A (en) Memory management device, method, chip and electronic equipment
CN114265687B (en) Memory management method, device and system

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