WO2014169690A1 - Method and device for processing address mapping - Google Patents

Method and device for processing address mapping Download PDF

Info

Publication number
WO2014169690A1
WO2014169690A1 PCT/CN2013/090967 CN2013090967W WO2014169690A1 WO 2014169690 A1 WO2014169690 A1 WO 2014169690A1 CN 2013090967 W CN2013090967 W CN 2013090967W WO 2014169690 A1 WO2014169690 A1 WO 2014169690A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
physical
segment
logical
addresses
Prior art date
Application number
PCT/CN2013/090967
Other languages
French (fr)
Chinese (zh)
Inventor
黄苏
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2014169690A1 publication Critical patent/WO2014169690A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Definitions

  • the present invention relates to address mapping technology in the field of data communication, and in particular, to a method and apparatus for address mapping processing. Background technique
  • Double Data Rate Synchronous Random Access Memory is a new generation of memory technology standards issued by the Joint Commission on Electronic Equipment (JEDEC) and 2004. Due to its low price, high bandwidth data throughput and low power consumption, DDR SDRAM is widely used in the field of data communication where storage is demanding. However, in the field of data communication chips, the chip's key performance index is the number of packets per second (PPS), which determines that the DDR SDRAM used for packet buffering must achieve the lowest read and write efficiency to meet the processing power of the chip. At the same time, because of cost factors, it is not possible to increase the data throughput of the entire chip simply by increasing the number of physical slices of DDR SDRAM.
  • PPS packets per second
  • DDR SDRAM is widely used in the field of data communication chips. It is used to buffer packet data during message processing. It is currently the third generation of DDR, namely DDR3 SDRAM. This article is referred to as DDR3.
  • the general processing mode of the data communication chip is as follows: After the data packet is processed by the MAC layer, the packet is first buffered into the off-chip DDR3 chip, and the DDR3 physical address of the buffered data packet is generated, and is continued as part of the packet characteristic information. Protocol and handling of QoS functions. For Ethernet data packets, the minimum length of the packet is 64B. At the same time, the current DDR3 burst address width is 16B. You can see that at least 4 burst addresses are required for a data packet. If the DDR3 physical address of the data packet is directly used as its The feature information needs to carry at least 4 physical addresses, resulting in an increase in resources.
  • a logical address represents a number of DDR3 physical addresses. This scheme requires a mapping relationship between the logical address and the physical address of DDR3.
  • the solution wastes RAM resources and does not enable efficient management of physical addresses.
  • the main purpose of the embodiments of the present invention is to provide a method and an apparatus for address mapping processing, which not only saves RAM resources, but also implements efficient management of physical addresses.
  • a method for address mapping processing comprising:
  • mapping between the logical address and the physical address is performed according to the logical addresses of the interval segments after the partition.
  • the partitioning the logical address according to the currently configured number of DDRs specifically includes: obtaining a total physical bank number according to the number of DDRs and the number of physical bank banks included in each DDR;
  • the total logical address is divided into a plurality of logical address segments, and the number of segments is a maximum value of 2n among all the common divisors of the total physical bank number, and the n refers to the number of linked lists in the segment.
  • mapping between the logical address and the physical address according to the logical addresses of the interval segments after the partitioning includes:
  • each logical address segment corresponds to a physical bank, and is a one-to-one mapping between a logical address and a physical address;
  • each logical address segment corresponds to multiple physical banks, which is a one-to-many mapping between logical addresses and physical addresses.
  • the method further includes: configuring, in the one-to-many mapping, each segment of the physical bank Offset base address, the number of offset base addresses in the segment is nl.
  • the method further includes: obtaining, according to the offset base address and the intra-segment offset address in the segment, an intra-segment offset physical bank address corresponding to the intra-segment offset address.
  • the method further includes: obtaining a corresponding physical row address and a physical column address according to the offset physical bank address in the segment.
  • An apparatus for address mapping processing comprising: a partition processing unit and a mapping processing unit; wherein
  • the partition processing unit is configured to partition the logical address according to the currently configured DDR number; the mapping processing unit is configured to perform mapping processing between the logical address and the physical address according to the logical addresses of the interval segments after the partition.
  • the partition processing unit and the mapping processing unit use a central processing unit (CPU) and a digital signal processor (DSP, Digital Singnal) when performing processing.
  • CPU central processing unit
  • DSP digital signal processor
  • the partition processing unit is further configured to obtain a total physical bank number according to the number of DDRs and the number of physical bank banks included in each DDR, and divide the total logical address into multiple logical address segments, and segment the segments.
  • the number is the maximum value of 2n among all the common divisors of the total physical bank number, and the n refers to the number of linked lists in the segment.
  • mapping processing unit is further configured to have a value of 2n, and if each logical address segment corresponds to one physical bank, the one-to-one mapping between the logical address and the physical address; when the value is not 2n, Making each logical address segment correspond to multiple physical banks is a one-to-many mapping between logical addresses and physical addresses.
  • the mapping processing unit is further configured to configure an intra-segment offset base address for each physical bank when the one-to-many mapping is performed, and the number of the offset base addresses in the segment is n-1; Offset base address and intra-segment offset address, get the intra-segment offset physical bank location corresponding to the offset address within the segment Address: obtaining a corresponding physical row address and a physical column address according to the offset physical bank address in the segment.
  • the solution of the embodiment of the present invention partitions the logical address according to the currently configured DDR number; and performs mapping processing between the logical address and the physical address according to the logical address of each interval segment after the partition.
  • the embodiment of the present invention does not directly map the logical address to the physical address for the total logical address, but performs the mapping processing after the total logical address is partitioned, thereby reducing the occupation of the logical address, thereby saving RAM resources. Fewer logical addresses make address addressing easier, and efficient management of physical addresses.
  • FIG. 3 is a schematic structural diagram of a mapping device of an application example 2 of the present invention.
  • FIG. 4 is a schematic diagram showing the structure of a decoding apparatus based on a mapping implementation decoding process according to the third application example of the present invention. detailed description
  • the solution of the embodiment of the present invention is a one-to-many mapping processing scheme between the logical address and the physical address of the DDR3, and uses the least logical address resource to meet the system design requirement, and divides the logical address into interval segments according to the number of DDR3s configured by the current system. Then, the mapping between the logical address and the physical address is performed separately by the interval segment.
  • the logical address is simply referred to as PMAU description when it is represented in the form of a linked list, and the bank of the full text refers to the physical bank instead of the logical physical bank.
  • n refers to the number of linked lists in the segment.
  • FIG. 1 is a schematic flowchart of a method according to an embodiment of the present invention, where the process includes the following steps: Step 101: Partition the logical address according to the currently configured number of DDRs.
  • Step 102 Perform one-to-many mapping processing between the logical address and the physical address according to the logical addresses of the interval segments after the partitioning.
  • mapping process of the embodiment of the present invention is specifically described by taking the total number of logical addresses as 128k and the number of variable groups of off-chip DDR3 being 1 ⁇ 5.
  • Step 201 Perform the segmentation processing on the total logical address, and adopt the equalization mode.
  • step 201 the specific process of step 201 is as follows: According to the current system configuration DDR3 group number, the total logical address idle node interval is equally divided into n segments (each segment is represented by a segment number of a logical address), wherein the number of segments is the total number of physical banks The median value of all the common divisors is 2n, so that PMAU[16:15-n] represents the segmentation address.
  • the total number of physical banks is 40, and the common divisor of 4 is 2n, which is 8, which means that when the number of DDR3 is At 5 o'clock, 40 physical banks are divided into 8 segments.
  • Step 202 For each segment, according to the intra-segment offset address and the intra-segment offset base address configured by the system, the logical address is offset from the physical bank address in the segment corresponding to the segment, that is, the intra-segment offset corresponding to the logical address. Move the physical bank number.
  • the logical address and the physical address are mapped one-to-one, according to the prior art; in the case of non- 2n, the logical address and the physical address are one-to-many mapping.
  • each segment includes only one physical bank, and the segment in the table of FIG. No. Represents the physical bank number to which the logical address belongs.
  • the segmentation interval of each logical address includes a plurality of physical banks.
  • the number of DD3s is 5 when each segment contains physics. The largest number of banks, each segment includes 5 physical banks.
  • the embodiment of the present invention sets an offset base address for each physical bank, and assumes that the number of linked lists in the segment is n, then the required physical bank
  • the number of offset base addresses is nl. Therefore, in the current example, when the number of DDR3s is 5, the required intra-segment offset base address is the most, and the number is 4.
  • the number of DDR3s is 3, under the above-mentioned segmentation rule, because each segment contains only 3 physics. Bank, so only 2 offset base addresses are needed.
  • the purpose of the partition is to obtain partition partitioning with the system-configured offset base address, such as partitions (0-1) and (1-2) identified by offset base addresses 0, 1, and 2, offset.
  • the relationship between the address and the offset base address is: continue to divide in any partition of each partition (0-1) and (1-2), and identify with an offset base address, such as partition (0-1) It is further refined by 0.1, 0.2, 0.3 0.9. It should be pointed out here that "0.1” and so on are for convenience of explanation and are described in digital form. In practical applications, the form of address representation is used, similar to the description of PMAU[13:0], which is not mentioned here.
  • the first 9 on the left represents all physical banks with a segment address of 3.
  • the physical bank base address (each segment contains 3 physical banks), and 1 indicates the offset physical bank address within the segment.
  • the intra-segment offset physical bank address corresponding to the logical address in various configurations can be obtained, which can also be referred to as the physical bank number of the logical address.
  • Step 203 Obtain the base address of the specific row and column of the offset physical bank address in the segment according to the offset physical bank address in the segment.
  • the row and column addresses can be obtained according to the current logical address and the length of each row of DDR3. For example, if the logical address and the length of each row of DDR3 are 2 KB, since each row has only one logical address, then PMAU[13:0] is Row address, the base address of the column is all 0s.
  • the calculation method of the row and column base address under various other configurations is similar.
  • the third embodiment DDR that is, DDR3, is used as an example to describe the mapping of logical addresses to physical addresses in the data chip domain, thereby implementing external cache management, but the partial cache is managed, thereby quickly and efficiently managing Implement decoding.
  • a fixed number of logical addresses is generally required for implementation.
  • a simple mapping relationship between a logical address bit field and a DDR3 physical address bit field is generally adopted.
  • the corresponding physical bank address, row address, and burst column address width are 3bit, 14bit, and 7bit, respectively, if each logical address Fixed to 2KB and the number of logical addresses is fixed at 128K, because DDR3 is 2KB per line, so the logical address is the base address of each row, and the decoding method of logical address to physical base address is simpler.
  • the highest 3bit corresponds to the physical bank.
  • the address, the middle 14bit corresponds to the row address, and the lowest bit low bit is 0, which is the column base address method to complete the decoding.
  • the number of DDR3s required for actual use is often not an integer power of two, such as three groups. If such a simple decoding method is still required, a 19-bit representation is required for the number of 128K logical addresses.
  • the system solution requirements of the shared cache generally require the use of a table to manage the logical address, and the logical address needs to be the addressing pointer of the RAM, which will result in a waste of four times the required RAM resources.
  • the mapping between the logical address and the physical address is performed separately in the segment, and the system design requirement can be satisfied by using the minimum logical address resource, for example, the number of logical addresses of 128K, and the 17-bit representation is fixedly used, thereby adopting the embodiment of the present invention.
  • the system RAM resources are saved to the greatest extent, and the efficient management of physical addresses can be realized, mainly by address mapping to implement address addressing.
  • Application Example 2 A mapping device based on a mapping scheme that implements an embodiment of the present invention.
  • the mapping device is located on the cache side, and includes: a partition processing unit and a mapping processing unit; wherein, the partition processing unit is configured to partition the logical address according to the currently configured DDR number; and the mapping processing unit is configured to The logical address of the interval segment performs mapping processing between the logical address and the physical address.
  • the partition processing unit is further configured to obtain the total physical bank number according to the number of DDRs and the number of physical bank banks included in each DDR, and divide the total logical address into a plurality of logical address segments, and the number of segments is The value of all the common divisors of the total physical bank number is 2n A large value, the n refers to the number of linked lists in the segment.
  • each logical address segment corresponds to one physical bank, and is a one-to-one mapping between the logical address and the physical address; if the value is not 2n, each is made
  • a logical address segment corresponding to multiple physical banks is a one-to-many mapping between a logical address and a physical address.
  • mapping processing unit in the one-to-many mapping is: the mapping processing unit is configured to configure an intra-segment offset base address for each physical bank, and the number of offset base addresses in the segment is n- 1; according to the offset base address and the intra-segment offset address in the segment, obtain an intra-segment offset physical bank address corresponding to the intra-segment offset address; and obtain a corresponding physical row address according to the offset physical bank address in the segment And the physical column address.
  • Application Example 3 A decoding process implemented by a mapping scheme according to an embodiment of the present invention.
  • App_pmau_vld a valid indication of the logical address to be decoded
  • App_pmau the logical address to be decoded
  • DFF D trigger
  • Pmau fld the segment number of the logical address to be decoded parsed according to the number of DDR groups
  • pmau-fld_offset the intra-segment offset address of the logical address to be decoded
  • Pmau farld—physical bank: offset the physical bank number according to the intra-segment offset address and the intra-segment base address comparison;
  • Ddr physical bank— addr: the resolved physical bank address
  • Ddr row addr the resolved physical row address
  • Ddr col addr the resolved physical column address
  • Pmau physical bank—offset: the physical bank internal offset address of the ddr logical address to be parsed
  • Cfg physical bank—addr[i]: the user-configured intra-segment base address for comparison, the total number is i;
  • Cfg ddrc num Number of configured DDR groups.
  • the decoding process (decoding from logical address to physical address) implemented by the above decoding apparatus includes the following contents:
  • the intra-segment offset address belongs to the first physical bank in the segment, that is, the segment Internal offset physical bank number ( pmau - fld - physical bank [2:0] ) and offset physical address ( pmau - physical bank - offset ) in the corresponding physical bank.
  • the row number and the column number of the physical address are obtained according to the offset physical address in the physical bank (the specific row address and column address of the physical address are obtained);
  • the solution of the embodiment of the present invention partitions the logical address according to the currently configured DDR number; and performs mapping processing between the logical address and the physical address according to the logical address of each interval segment after the partition.
  • the embodiment of the present invention does not directly map the logical address to the physical address for the total logical address, but performs the mapping processing after the total logical address is partitioned, thereby reducing the occupation of the logical address, thereby saving RAM resources. Fewer logical addresses make address addressing easier, and efficient management of physical addresses.

Landscapes

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

Abstract

Disclosed are a method and device for processing address mapping. The method comprises: according to the number of double data rate synchronous dynamic random access memories (DDRs) which are configured currently, partitioning a logical address; and according to the logical address of each partitioned range segment, performing mapping processing between the logical address and a physical address respectively. A mapping processing unit of the device is configured to perform mapping processing between a logical address and a physical address respectively according to the logical address of each partitioned range segment. By means of the present invention, RAM resources are saved, and a physical address can also be managed efficiently.

Description

一种地址映射处理的方法、 装置 技术领域  Method and device for address mapping processing
本发明涉及数据通信领域的地址映射技术, 尤其涉及一种地址映射处 理的方法及装置。 背景技术  The present invention relates to address mapping technology in the field of data communication, and in particular, to a method and apparatus for address mapping processing. Background technique
双倍数据速率同步随机存储器, 简称 DDR SDRAM是电子设备工程联 合委员会(JEDEC )与 2004年发布的新生代内存技术标准, 因其低廉的价 格, 高带宽的数据吞吐率以及功耗低的优势, DDR SDRAM被广泛用于存 储需求高的数据通信领域。 然而在数据通信芯片领域, 芯片的关键性能指 数为每秒处理包数( PPS ), 由它决定了用于数据包緩存的 DDR SDRAM必 须达到最低的读写效率以满足芯片的处理能力。 同时, 因为成本因素, 又 不能单纯的以增加 DDR SDRAM物理片数的方法来提高整个芯片的数据吞 吐率。  Double Data Rate Synchronous Random Access Memory (DDRSDRAM) is a new generation of memory technology standards issued by the Joint Commission on Electronic Equipment (JEDEC) and 2004. Due to its low price, high bandwidth data throughput and low power consumption, DDR SDRAM is widely used in the field of data communication where storage is demanding. However, in the field of data communication chips, the chip's key performance index is the number of packets per second (PPS), which determines that the DDR SDRAM used for packet buffering must achieve the lowest read and write efficiency to meet the processing power of the chip. At the same time, because of cost factors, it is not possible to increase the data throughput of the entire chip simply by increasing the number of physical slices of DDR SDRAM.
DDR SDRAM广泛应用于数据通信芯片领域, 用于报文处理过程中緩 存包数据, 目前普遍是 DDR的第三代产品, 即 DDR3 SDRAM , 本文后续 简称 DDR3。 数据通信芯片的一般处理模式为: 数据包经过 MAC层的处理 后首先将包緩存入片外 DDR3芯片, 同时生成緩存数据包的 DDR3物理地 址, 并将其作为数据包特征信息的一部分继续其他如协议以及 QoS功能的 处理。 对以太网数据报文, 包的最小长度为 64B, 同时目前主流 DDR3的 burst地址位宽为 16B, 可以看到一个数据包至少需要 4个 burst地址, 如果 直接将数据包的 DDR3物理地址作为其特征信息, 则至少需要携带 4个物 理地址, 导致资源增加。  DDR SDRAM is widely used in the field of data communication chips. It is used to buffer packet data during message processing. It is currently the third generation of DDR, namely DDR3 SDRAM. This article is referred to as DDR3. The general processing mode of the data communication chip is as follows: After the data packet is processed by the MAC layer, the packet is first buffered into the off-chip DDR3 chip, and the DDR3 physical address of the buffered data packet is generated, and is continued as part of the packet characteristic information. Protocol and handling of QoS functions. For Ethernet data packets, the minimum length of the packet is 64B. At the same time, the current DDR3 burst address width is 16B. You can see that at least 4 burst addresses are required for a data packet. If the DDR3 physical address of the data packet is directly used as its The feature information needs to carry at least 4 physical addresses, resulting in an increase in resources.
为降低开销, 现有技术一般采用逻辑地址作为数据包緩存地址的特征 信息, 一个逻辑地址代表若干个 DDR3物理地址, 此种方案需要 DDR3的 逻辑地址和物理地址之间做——对应的映射关系, 但是, 采用现有技术存 在的问题是: 这种地址映射的处理方案既浪费 RAM资源, 又无法实现对物 理地址的高效管理。 发明内容 In order to reduce overhead, the prior art generally adopts a logical address as a feature of a packet cache address. Information, a logical address represents a number of DDR3 physical addresses. This scheme requires a mapping relationship between the logical address and the physical address of DDR3. However, the problem with the prior art is: The solution wastes RAM resources and does not enable efficient management of physical addresses. Summary of the invention
有鉴于此, 本发明实施例的主要目的在于提供一种地址映射处理的方 法及装置, 既节约 RAM资源, 又能实现对物理地址的高效管理。  In view of this, the main purpose of the embodiments of the present invention is to provide a method and an apparatus for address mapping processing, which not only saves RAM resources, but also implements efficient management of physical addresses.
为达到上述目的, 本发明实施例的技术方案是这样实现的:  To achieve the above objective, the technical solution of the embodiment of the present invention is implemented as follows:
一种地址映射处理的方法, 该方法包括:  A method for address mapping processing, the method comprising:
根据当前配置的双倍数据速率同步随机存储器 DDR数量对逻辑地址分 区;  Synchronous random access memory DDR number to logical address partition according to the currently configured double data rate;
根据分区后各区间段的逻辑地址分别进行逻辑地址和物理地址间的映 射处理。  The mapping between the logical address and the physical address is performed according to the logical addresses of the interval segments after the partition.
其中, 所述根据当前配置的 DDR数量对逻辑地址分区具体包括: 根据 DDR数量及每个 DDR所包含的物理存储体 bank数量得到总的物 理 bank数;  The partitioning the logical address according to the currently configured number of DDRs specifically includes: obtaining a total physical bank number according to the number of DDRs and the number of physical bank banks included in each DDR;
将总的逻辑地址均分为多个逻辑地址段, 且分段数为所述总的物理 bank数的所有公约数中数值为 2n的最大值, 所述 n指段内链表数量。  The total logical address is divided into a plurality of logical address segments, and the number of segments is a maximum value of 2n among all the common divisors of the total physical bank number, and the n refers to the number of linked lists in the segment.
其中, 所述根据分区后各区间段的逻辑地址分别进行逻辑地址和物理 地址间的映射处理具体包括:  The mapping between the logical address and the physical address according to the logical addresses of the interval segments after the partitioning includes:
数值为 2n的情况下, 每个逻辑地址段对应一个物理 bank, 则为逻辑地 址与物理地址的一^一映射;  In the case of a value of 2n, each logical address segment corresponds to a physical bank, and is a one-to-one mapping between a logical address and a physical address;
数值为非 2n的情况下, 每个逻辑地址段对应多个物理 bank, 则为逻辑 地址与物理地址的一对多映射。  When the value is not 2n, each logical address segment corresponds to multiple physical banks, which is a one-to-many mapping between logical addresses and physical addresses.
其中, 该方法还包括: 所述一对多映射时, 为每个物理 bank配置段内 偏移基地址, 所述段内偏移基地址的数量为 n-l。 The method further includes: configuring, in the one-to-many mapping, each segment of the physical bank Offset base address, the number of offset base addresses in the segment is nl.
其中, 该方法还包括: 根据所述段内偏移基地址和段内偏移地址, 得 到段内偏移地址对应的段内偏移物理 bank地址。  The method further includes: obtaining, according to the offset base address and the intra-segment offset address in the segment, an intra-segment offset physical bank address corresponding to the intra-segment offset address.
其中, 该方法还包括: 根据所述段内偏移物理 bank地址得到对应的物 理行地址和物理列地址。  The method further includes: obtaining a corresponding physical row address and a physical column address according to the offset physical bank address in the segment.
一种地址映射处理的装置, 该装置包括: 分区处理单元和映射处理单 元; 其中,  An apparatus for address mapping processing, the apparatus comprising: a partition processing unit and a mapping processing unit; wherein
所述分区处理单元,配置为根据当前配置的 DDR数量对逻辑地址分区; 所述映射处理单元, 配置为根据分区后各区间段的逻辑地址分别进行 逻辑地址和物理地址间的映射处理。  The partition processing unit is configured to partition the logical address according to the currently configured DDR number; the mapping processing unit is configured to perform mapping processing between the logical address and the physical address according to the logical addresses of the interval segments after the partition.
所述分区处理单元和所述映射处理单元, 在执行处理时, 采用中央处 理器( CPU, Central Processing Unit )、数字信号处理器( DSP, Digital Singnal The partition processing unit and the mapping processing unit use a central processing unit (CPU) and a digital signal processor (DSP, Digital Singnal) when performing processing.
Processor )或可编程逻辑阵歹1 J ( FPGA, Field - Programmable Gate Array ) 实现。 Processor ) or Programmable Array 1 J (FPGA, Field - Programmable Gate Array) implementation.
其中, 所述分区处理单元, 还配置为根据 DDR数量及每个 DDR所包 含的物理存储体 bank数量得到总的物理 bank数,将总的逻辑地址均分为多 个逻辑地址段,且分段数为所述总的物理 bank数的所有公约数中数值为 2n 的最大值, 所述 n指段内链表数量。  The partition processing unit is further configured to obtain a total physical bank number according to the number of DDRs and the number of physical bank banks included in each DDR, and divide the total logical address into multiple logical address segments, and segment the segments. The number is the maximum value of 2n among all the common divisors of the total physical bank number, and the n refers to the number of linked lists in the segment.
其中, 所述映射处理单元, 还配置为数值为 2n的情况下, 使每个逻辑 地址段对应一个物理 bank, 则为逻辑地址与物理地址的一对一映射; 数值 为非 2n的情况下, 使每个逻辑地址段对应多个物理 bank, 则为逻辑地址与 物理地址的一对多映射。  Wherein, the mapping processing unit is further configured to have a value of 2n, and if each logical address segment corresponds to one physical bank, the one-to-one mapping between the logical address and the physical address; when the value is not 2n, Making each logical address segment correspond to multiple physical banks is a one-to-many mapping between logical addresses and physical addresses.
其中, 所述映射处理单元, 还配置为一对多映射时, 为每个物理 bank 配置段内偏移基地址, 所述段内偏移基地址的数量为 n-1 ; 根据所述段内偏 移基地址和段内偏移地址, 得到段内偏移地址对应的段内偏移物理 bank地 址;根据所述段内偏移物理 bank地址得到对应的物理行地址和物理列地址。 本发明实施例的方案根据当前配置的 DDR数量对逻辑地址分区;根据 分区后各区间段的逻辑地址分别进行逻辑地址和物理地址间的映射处理。 由于采用本发明实施例不是直接针对总逻辑地址进行逻辑地址到物理地址 的映射, 而是对总的逻辑地址分区处理后再进行映射处理, 从而减少了逻 辑地址的占用,既节约 RAM资源,而更少的逻辑地址更容易地址寻址实现, 又能实现对物理地址的高效管理。 附图说明 Wherein, the mapping processing unit is further configured to configure an intra-segment offset base address for each physical bank when the one-to-many mapping is performed, and the number of the offset base addresses in the segment is n-1; Offset base address and intra-segment offset address, get the intra-segment offset physical bank location corresponding to the offset address within the segment Address: obtaining a corresponding physical row address and a physical column address according to the offset physical bank address in the segment. The solution of the embodiment of the present invention partitions the logical address according to the currently configured DDR number; and performs mapping processing between the logical address and the physical address according to the logical address of each interval segment after the partition. The embodiment of the present invention does not directly map the logical address to the physical address for the total logical address, but performs the mapping processing after the total logical address is partitioned, thereby reducing the occupation of the logical address, thereby saving RAM resources. Fewer logical addresses make address addressing easier, and efficient management of physical addresses. DRAWINGS
图 1为本发明实施例的方法流程图;  1 is a flowchart of a method according to an embodiment of the present invention;
图 2为本发明应用实例一的不同 DDR3数量时逻辑地址的分段表示意 图;  2 is a fragmented representation of a logical address when the number of DDR3s is different according to the first application example of the present invention;
图 3为本发明应用实例二的映射装置组成结构示意图;  3 is a schematic structural diagram of a mapping device of an application example 2 of the present invention;
图 4为本发明应用实例三的基于映射实现译码过程的译码装置组成结 构示意图。 具体实施方式  4 is a schematic diagram showing the structure of a decoding apparatus based on a mapping implementation decoding process according to the third application example of the present invention. detailed description
本发明实施例的方案是 DDR3 的逻辑地址和物理地址之间一对多的映 射处理方案, 使用最少的逻辑地址资源满足系统设计需求, 根据当前系统 配置的 DDR3数量, 将逻辑地址均分成区间段, 然后按区间段单独进行逻 辑地址和物理地址之间的映射。  The solution of the embodiment of the present invention is a one-to-many mapping processing scheme between the logical address and the physical address of the DDR3, and uses the least logical address resource to meet the system design requirement, and divides the logical address into interval segments according to the number of DDR3s configured by the current system. Then, the mapping between the logical address and the physical address is performed separately by the interval segment.
为简化描述, 后续在链表数组形式表示时, 将逻辑地址简称为 PMAU 描述, 全文的存储体(bank )都是指物理 bank, 而不是逻辑物理 bank。 本 文的 n指段内链表数量。  To simplify the description, the logical address is simply referred to as PMAU description when it is represented in the form of a linked list, and the bank of the full text refers to the physical bank instead of the logical physical bank. In this paper, n refers to the number of linked lists in the segment.
下面结合附图对技术方案的实施作进一步的详细描述。  The implementation of the technical solution will be further described in detail below with reference to the accompanying drawings.
如图 1所示为本发明实施例方法流程示意图, 该流程包括以下步驟: 步驟 101、 根据当前配置的 DDR数量对逻辑地址分区。 FIG. 1 is a schematic flowchart of a method according to an embodiment of the present invention, where the process includes the following steps: Step 101: Partition the logical address according to the currently configured number of DDRs.
步驟 102、根据分区后各区间段的逻辑地址分别进行逻辑地址和物理地 址间一对多的映射处理。  Step 102: Perform one-to-many mapping processing between the logical address and the physical address according to the logical addresses of the interval segments after the partitioning.
应用实例一: 本实例以逻辑地址总数为 128k, 片外 DDR3的可变组数 为 1~5组为例具体阐述本发明实施例的映射处理过程。  Application Example 1: In this example, the mapping process of the embodiment of the present invention is specifically described by taking the total number of logical addresses as 128k and the number of variable groups of off-chip DDR3 being 1~5.
步驟 201 : 将总的逻辑地址做分区段处理, 且采用均分方式。  Step 201: Perform the segmentation processing on the total logical address, and adopt the equalization mode.
这里, 步驟 201的具体过程为: 根据当前系统配置的 DDR3组数, 将 总的逻辑地址空闲节点区间均分成 n段(每段用逻辑地址的分段号表示), 其中分区段数为物理 bank 总数所有公约数中值为 2n 的最大值, 这样, PMAU[16:15-n]即代表分段地址。  Here, the specific process of step 201 is as follows: According to the current system configuration DDR3 group number, the total logical address idle node interval is equally divided into n segments (each segment is represented by a segment number of a logical address), wherein the number of segments is the total number of physical banks The median value of all the common divisors is 2n, so that PMAU[16:15-n] represents the segmentation address.
举例来说, 例如, 当 DDR3数量为 5, 每片 DDR3包含 8个物理 bank 时, 总的物理 bank数量为 40, 40的公约数为 2n的最大值即为 8, 也就是 说当 DDR3数量为 5时, 将 40个物理 bank均分成 8段。  For example, when the number of DDR3s is 5 and each DDR3 contains 8 physical banks, the total number of physical banks is 40, and the common divisor of 4 is 2n, which is 8, which means that when the number of DDR3 is At 5 o'clock, 40 physical banks are divided into 8 segments.
上述分段采用的规则, 是为了使逻辑地址每段的段内偏移地址可以用 PMAU[16:15-n]来快速表征, 且每段包含最少的物理 bank 数量, 剩余 PMAU[14-n:0]即为逻辑地址在每段内的偏移地址, 后续译码会比较简单。 不同 DDR3数量配置下逻辑地址的分段情况如图 2的表中内容所示。  The above-mentioned segmentation rules are adopted so that the intra-segment offset address of each segment of the logical address can be quickly characterized by PMAU[16:15-n], and each segment contains the minimum number of physical banks, and the remaining PMAU [14-n] :0] is the offset address of the logical address in each segment, and subsequent decoding will be simpler. The segmentation of logical addresses under different DDR3 number configurations is shown in the table in Figure 2.
步驟 202: 对每段而言,根据段内偏移地址和系统配置的段内偏移基地 址, 获得逻辑地址在该段对应的段内偏移物理 bank地址, 即逻辑地址对应 的段内偏移物理 bank号。  Step 202: For each segment, according to the intra-segment offset address and the intra-segment offset base address configured by the system, the logical address is offset from the physical bank address in the segment corresponding to the segment, that is, the intra-segment offset corresponding to the logical address. Move the physical bank number.
分 2n的情况和非 2n的情况, 2n的情况下是逻辑地址和物理地址一对 一映射, 照现有技术处理; 非 2n的情况下是逻辑地址和物理地址一对多映 射。  In the case of 2n and 2n, in the case of 2n, the logical address and the physical address are mapped one-to-one, according to the prior art; in the case of non- 2n, the logical address and the physical address are one-to-many mapping.
举例来说,由图 2的表中内容可见,系统配置下,如果 DDR3组数为 1 , 2 , 4等 2n的情况, 则每段只包括 1个物理 bank, 图 1的表中的分段号即 代表逻辑地址所属的物理 bank号。 For example, it can be seen from the table in FIG. 2 that, in the system configuration, if the number of DDR3 groups is 1, 2, 4, etc., 2n, each segment includes only one physical bank, and the segment in the table of FIG. No. Represents the physical bank number to which the logical address belongs.
对 DDR3组数不是 2n的情况, 如 DDR3组数为 3和 5的情况,每个逻 辑地址的分段区间内包括多个物理 bank, 当前实例中, DD3数量为 5的时 候每段包含的物理 bank数量最多, 每段包括 5个物理 bank。  In the case where the number of DDR3 groups is not 2n, such as the case where the number of DDR3 groups is 3 and 5, the segmentation interval of each logical address includes a plurality of physical banks. In the current example, the number of DD3s is 5 when each segment contains physics. The largest number of banks, each segment includes 5 physical banks.
为了区分逻辑地址对应的在该段内的段内偏移物理 bank地址, 本发明 实施例分别给每个物理 bank设定一个偏移基地址,假定段内链表数量为 n, 则所需物理 bank的偏移基地址个数为 n-l。 所以当前实例下, 当 DDR3数 量为 5时, 需要的段内偏移基地址最多, 个数为 4, 当 DDR3数量为 3的时 候, 在上述分段规则下, 因为每段只包含 3个物理 bank, 故只需 2个偏移 基地址。以 DDR3数量等于 3为例 ,假定上述 2个偏移地址分别为 a0和 al , PMAU[13:0]为 PMAU在段内的偏移地址, 因为每段包含 3个物理 bank, 所以当 PMAU[13:0]<a0时, 该 PMAU在段内的偏移物理 bank地址即为 0, 当 a0 <= PMAU[13:0] <al时, 该 PMAU在段内的偏移物理 bank地址即为 1 , 当 PMAU[13:0] >=al时, 该 PMAU在段内的偏移物理 bank地址即为 2。 也就是说, 分区的目的就是得到以系统配置的偏移基地址进行分区划分, 如以偏移基地址 0, 1 , 2来标识的分区 (0-1 )和(1-2 ), 偏移地址与该偏 移基地址的关系是: 在每个分区(0-1 )和(1-2 )的任意一个分区中继续划 分, 以偏移基地址来标识, 比如分区 (0-1 ) 中又以 0.1 , 0.2, 0.3 0.9 来细化。 这里需要指出的是, "0.1"等是为了方便解释说明, 以数字形式来 描述, 实际应用中是采用地址表示的形式, 类似 PMAU[13:0]这种描述, 此 处不做赞述。  In order to distinguish the physical bank address in the segment within the segment corresponding to the logical address, the embodiment of the present invention sets an offset base address for each physical bank, and assumes that the number of linked lists in the segment is n, then the required physical bank The number of offset base addresses is nl. Therefore, in the current example, when the number of DDR3s is 5, the required intra-segment offset base address is the most, and the number is 4. When the number of DDR3s is 3, under the above-mentioned segmentation rule, because each segment contains only 3 physics. Bank, so only 2 offset base addresses are needed. Taking the number of DDR3 equal to 3 as an example, assume that the above two offset addresses are a0 and a1 respectively, and PMAU[13:0] is the offset address of the PMAU in the segment, because each segment contains 3 physical banks, so when PMAU[ 13:0]<a0, the offset physical bank address of the PMAU in the segment is 0. When a0 <= PMAU[13:0] <al, the offset physical bank address of the PMAU in the segment is 1. When PMAU[13:0] >=al, the offset physical bank address of the PMAU in the segment is 2. That is to say, the purpose of the partition is to obtain partition partitioning with the system-configured offset base address, such as partitions (0-1) and (1-2) identified by offset base addresses 0, 1, and 2, offset. The relationship between the address and the offset base address is: continue to divide in any partition of each partition (0-1) and (1-2), and identify with an offset base address, such as partition (0-1) It is further refined by 0.1, 0.2, 0.3 0.9. It should be pointed out here that "0.1" and so on are for convenience of explanation and are described in digital form. In practical applications, the form of address representation is used, similar to the description of PMAU[13:0], which is not mentioned here.
总之, 当 DDR3数量为 3 ,如果当 a0 <= PMAU[13:0] <al ,且该 PMAU 所属的段地址为 3的话, 那么该 PMAU在 24个物理 bank里的物理 bank 号即为: 9+1=10。  In summary, when the number of DDR3 is 3, if a0 <= PMAU[13:0] <al and the segment address to which the PMAU belongs is 3, then the physical bank number of the PMAU in 24 physical banks is: 9 +1=10.
其中, 9+1=10的等式中,左边第一个 9表示段地址为 3的所有物理 bank 的物理 bank基地址(每段包含 3个物理 bank ), 1表示段内的偏移物理 bank 地址。 由此可得各种配置下逻辑地址对应的段内偏移物理 bank地址, 也可 以称为逻辑地址的所属物理 bank号。 Where, in the equation of 9+1=10, the first 9 on the left represents all physical banks with a segment address of 3. The physical bank base address (each segment contains 3 physical banks), and 1 indicates the offset physical bank address within the segment. Thus, the intra-segment offset physical bank address corresponding to the logical address in various configurations can be obtained, which can also be referred to as the physical bank number of the logical address.
步驟 203:根据段内偏移物理 bank地址获得该段内偏移物理 bank地址 具体的行、 列的基地址。  Step 203: Obtain the base address of the specific row and column of the offset physical bank address in the segment according to the offset physical bank address in the segment.
物理 bank地址的表现形式相当于二维矩阵, 找到段内偏移物理 bank 地址, 还需要找到该物理 bank地址具体的行、 列基地址。 在计算完逻辑地 址的所属物理 bank号之后, 根据段内的偏移基地址与 PMAU[14-n: 0]的比 较结果很容易就能获取该逻辑地址在所属物理 bank内的偏移地址。 仍以上 述 DDR3 数量等于 3 为例, 假定该逻辑地址的段地址为 3 , 即 PMAU[16:14]=3 , 且 a0<= PMAU[13:0]<al , 那么 ( PMAU[13:0]-a0 ) 即为 该逻辑地址所属物理 bank 内的偏移地址。 最后根据当前逻辑地址以及 DDR3每行的长度即可获得行、 列地址, 譬如逻辑地址和 DDR3每行的长 度都为 2KB的话, 因为每行只有一个逻辑地址, 那么 PMAU[13:0]即为行 地址, 列的基地址为全 0。 其他各种配置下的行列基地址计算方法类同。  The representation of the physical bank address is equivalent to a two-dimensional matrix. To find the offset physical bank address within the segment, you need to find the specific row and column base address of the physical bank address. After calculating the physical bank number of the logical address, it is easy to obtain the offset address of the logical address in the physical bank according to the comparison between the offset base address in the segment and PMAU[14-n: 0]. Still taking the above DDR3 number equal to 3 as an example, assuming that the segment address of the logical address is 3, that is, PMAU[16:14]=3, and a0<= PMAU[13:0]<al , then (PMAU[13:0 ]-a0 ) is the offset address in the physical bank to which the logical address belongs. Finally, the row and column addresses can be obtained according to the current logical address and the length of each row of DDR3. For example, if the logical address and the length of each row of DDR3 are 2 KB, since each row has only one logical address, then PMAU[13:0] is Row address, the base address of the column is all 0s. The calculation method of the row and column base address under various other configurations is similar.
需要指出的是, 本发明实施例仅以第三代 DDR, 即 DDR3为例说明数 据芯片领域内逻辑地址到物理地址的映射, 从而实现外部緩存的管理, 但 部緩存进行管理, 从而快捷高效地实现译码。  It should be noted that the third embodiment DDR, that is, DDR3, is used as an example to describe the mapping of logical addresses to physical addresses in the data chip domain, thereby implementing external cache management, but the partial cache is managed, thereby quickly and efficiently managing Implement decoding.
对比现有技术和本发明实施例, 以 DDR3 为例, 现有技术逻辑地址和 物理地址一对一映射, 存在以下问题:  Comparing the prior art and the embodiment of the present invention, taking the DDR3 as an example, the prior art logical address and the physical address are mapped one-to-one, and the following problems exist:
为保证一定的緩存性能, 实现时一般要求固定的逻辑地址数量, 现有 技术实现时, 一般采用逻辑地址 bit域和 DDR3物理地址 bit域之间的简单 映射关系。 例如, 针对一个 2G, 16bit位宽的 DDR3 , 对应的物理 bank地 址, 行地址和 burst列地址位宽分别 3bit, 14bit和 7bit, 如果每个逻辑地址 固定为 2KB且逻辑地址数量固定为 128K, 因为 DDR3每行即为 2KB, 所 以逻辑地址即为每行的基地址, 逻辑地址到物理基地址的译码方式也较为 简单, 采用最高 3bit对应物理 bank地址, 中间 14bit对应行地址, 最低 bit 低位补 0 即为列基地址的方法即可完成译码。 然而实际使用时所需要的 DDR3的数量往往不是 2的整数幂,如 3组。如果仍然需要采用此种简单的 译码方法, 对 128K的逻辑地址数量, 则需要 19bit表征。 同时, 共享緩存 的系统方案需求一般要求采用琏表的方式管理逻辑地址, 需要将逻辑地址 作为 RAM的寻址指针, 这样将会导致所需 RAM资源浪费 4倍之多。 根据 芯片的不同应用场景, 可能要求外挂的 DDR3数量可变的同时要求具备相 同的可用逻辑地址数量。 To ensure a certain cache performance, a fixed number of logical addresses is generally required for implementation. In the prior art, a simple mapping relationship between a logical address bit field and a DDR3 physical address bit field is generally adopted. For example, for a 2G, 16-bit wide DDR3, the corresponding physical bank address, row address, and burst column address width are 3bit, 14bit, and 7bit, respectively, if each logical address Fixed to 2KB and the number of logical addresses is fixed at 128K, because DDR3 is 2KB per line, so the logical address is the base address of each row, and the decoding method of logical address to physical base address is simpler. The highest 3bit corresponds to the physical bank. The address, the middle 14bit corresponds to the row address, and the lowest bit low bit is 0, which is the column base address method to complete the decoding. However, the number of DDR3s required for actual use is often not an integer power of two, such as three groups. If such a simple decoding method is still required, a 19-bit representation is required for the number of 128K logical addresses. At the same time, the system solution requirements of the shared cache generally require the use of a table to manage the logical address, and the logical address needs to be the addressing pointer of the RAM, which will result in a waste of four times the required RAM resources. Depending on the application scenario of the chip, it may be required to have a variable number of external DDR3s while requiring the same number of available logical addresses.
若如现有技术一样, 将总的逻辑地址直接用于与物理地址的一对一映 射, 会浪费过多的逻辑地址, 而采用本发明实施例, 由于先对总的逻辑地 址分段, 再按照逻辑地址段单独在段内进行逻辑地址与物理地址的映射处 理, 能使用最少的逻辑地址资源满足系统设计需求, 如 128K的逻辑地址数 量, 则固定使用 17bit表征, 从而采用本发明实施例, 最大程度的节约了系 统 RAM资源, 而且能实现对物理地址的高效管理,主要是通过地址映射来 实现地址寻址功能。  If the total logical address is directly used for one-to-one mapping with the physical address as in the prior art, excessive logical addresses are wasted, and in the embodiment of the present invention, since the total logical address is segmented first, According to the logical address segment, the mapping between the logical address and the physical address is performed separately in the segment, and the system design requirement can be satisfied by using the minimum logical address resource, for example, the number of logical addresses of 128K, and the 17-bit representation is fixedly used, thereby adopting the embodiment of the present invention. The system RAM resources are saved to the greatest extent, and the efficient management of physical addresses can be realized, mainly by address mapping to implement address addressing.
应用实例二: 基于实现本发明实施例映射方案的映射装置。  Application Example 2: A mapping device based on a mapping scheme that implements an embodiment of the present invention.
如图 3 所示, 该映射装置位于緩存侧, 包括: 分区处理单元和映射处 理单元; 其中, 分区处理单元用于根据当前配置的 DDR数量对逻辑地址分 区; 映射处理单元用于根据分区后各区间段的逻辑地址分别进行逻辑地址 和物理地址间的映射处理。  As shown in FIG. 3, the mapping device is located on the cache side, and includes: a partition processing unit and a mapping processing unit; wherein, the partition processing unit is configured to partition the logical address according to the currently configured DDR number; and the mapping processing unit is configured to The logical address of the interval segment performs mapping processing between the logical address and the physical address.
这里, 分区处理单元还配置为根据 DDR数量及每个 DDR所包含的物 理存储体 bank数量得到总的物理 bank数,将总的逻辑地址均分为多个逻辑 地址段, 且分段数为所述总的物理 bank数的所有公约数中数值为 2n的最 大值, 所述 n指段内链表数量。 Here, the partition processing unit is further configured to obtain the total physical bank number according to the number of DDRs and the number of physical bank banks included in each DDR, and divide the total logical address into a plurality of logical address segments, and the number of segments is The value of all the common divisors of the total physical bank number is 2n A large value, the n refers to the number of linked lists in the segment.
这里, 映射处理单元还配置为数值为 2n的情况下, 使每个逻辑地址段 对应一个物理 bank, 则为逻辑地址与物理地址的一对一映射; 数值为非 2n 的情况下, 使每个逻辑地址段对应多个物理 bank, 则为逻辑地址与物理地 址的一对多映射。  Here, when the mapping processing unit is further configured to have a value of 2n, each logical address segment corresponds to one physical bank, and is a one-to-one mapping between the logical address and the physical address; if the value is not 2n, each is made A logical address segment corresponding to multiple physical banks is a one-to-many mapping between a logical address and a physical address.
这里, 映射处理单元在一对多映射时的一个最佳实施例为: 映射处理 单元用于为每个物理 bank配置段内偏移基地址, 所述段内偏移基地址的数 量为 n-1 ; 根据所述段内偏移基地址和段内偏移地址, 得到段内偏移地址对 应的段内偏移物理 bank地址;根据所述段内偏移物理 bank地址得到对应的 物理行地址和物理列地址。  Here, a preferred embodiment of the mapping processing unit in the one-to-many mapping is: the mapping processing unit is configured to configure an intra-segment offset base address for each physical bank, and the number of offset base addresses in the segment is n- 1; according to the offset base address and the intra-segment offset address in the segment, obtain an intra-segment offset physical bank address corresponding to the intra-segment offset address; and obtain a corresponding physical row address according to the offset physical bank address in the segment And the physical column address.
应用实例三: 基于本发明实施例的映射方案实现的译码过程。  Application Example 3: A decoding process implemented by a mapping scheme according to an embodiment of the present invention.
如图 4所示为实现译码过程所采用的译码装置, 图 4中名词的中英文 对照如下:  As shown in Figure 4, the decoding device used to implement the decoding process, the Chinese and English comparisons of the nouns in Figure 4 are as follows:
app_pmau_vld: 待译码的逻辑地址有效指示;  App_pmau_vld: a valid indication of the logical address to be decoded;
app_pmau: 待译码的逻辑地址;  App_pmau: the logical address to be decoded;
DFF: D触发器;  DFF: D trigger;
compare: 比较器;  Compare: comparator
pmau fld: 根据 DDR组数解析出的待译码逻辑地址的分段号; pmau—fld— offset: 待译码的逻辑地址的段内偏移地址;  Pmau fld: the segment number of the logical address to be decoded parsed according to the number of DDR groups; pmau-fld_offset: the intra-segment offset address of the logical address to be decoded;
pmau fld dlyl : 译码后的分段后寄存;  Pmau fld dlyl : post-decoding post-segment registration;
pmau—fld—物理 bank: 根据段内偏移地址以及段内基地址比较后的段内 偏移物理 bank号;  Pmau—fld—physical bank: offset the physical bank number according to the intra-segment offset address and the intra-segment base address comparison;
ddr—物理 bank— addr: 解析出的物理 bank地址;  Ddr—physical bank— addr: the resolved physical bank address;
ddr row addr: 解析出的物理行地址;  Ddr row addr: the resolved physical row address;
ddr col addr: 解析出的物理列地址; pmau—物理 bank— offset: 待解析 ddr逻辑地址的物理 bank内部偏移地 址; Ddr col addr: the resolved physical column address; Pmau—physical bank—offset: the physical bank internal offset address of the ddr logical address to be parsed;
cfg—物理 bank— addr[i]: 用户配置的用于比较的段内基地址, 总个数为 i个;  Cfg—physical bank—addr[i]: the user-configured intra-segment base address for comparison, the total number is i;
cfg_pmau— width: 配置的 PMAU长度  Cfg_pmau— width: configured PMAU length
cfg ddrc num: 配置的 DDR组数。  Cfg ddrc num: Number of configured DDR groups.
这里, 需要指出的是, 图 4中梯形的部件都表示运算器。  Here, it should be noted that the components of the trapezoid in Fig. 4 all represent the arithmetic unit.
采用上述译码装置实现的译码过程(从逻辑地址到物理地址的译码 ) 包括以下内容:  The decoding process (decoding from logical address to physical address) implemented by the above decoding apparatus includes the following contents:
1、 首先根据用户配置的 DDR组数( cfg— ddrc— num ) 决定输入的待译 码逻辑地址的段号 (pmau— fld ) 以及该逻辑地址所在段内的偏移地址 ( pmau— fld— offset )。  1. First, according to the number of DDR groups configured by the user ( cfg — ddrc — num ), the segment number of the logical address to be decoded ( pmau — fld ) and the offset address in the segment where the logical address is located ( pmau — fld — offset ).
2、将段内的偏移地址与用户配置的段内基地址( cfg—物理 bank— addr[i] ) 比较得出段内偏移地址在该段内具体属于第几个物理 bank, 即段内偏移物 理 bank号 ( pmau— fld—物理 bank[2:0] ) 以及在对应物理 bank内的偏移物理 地址 ( pmau—物理 bank— offset )。  2. Comparing the offset address in the segment with the user-configured intra-segment base address ( cfg - physical bank - addr[i] ), the intra-segment offset address belongs to the first physical bank in the segment, that is, the segment Internal offset physical bank number ( pmau - fld - physical bank [2:0] ) and offset physical address ( pmau - physical bank - offset ) in the corresponding physical bank.
3、 根据逻辑地址的段号以及段内的偏移物理 bank号计算得知逻辑地 址的物理物理 bank号。  3. Calculate the physical physical bank number of the logical address based on the segment number of the logical address and the offset physical bank number in the segment.
4、 根据物理 bank 内的偏移物理地址译码得到该物理地址的行号和列 号 (从而得到该物理地址的具体行地址和列地址;)。  4. The row number and the column number of the physical address are obtained according to the offset physical address in the physical bank (the specific row address and column address of the physical address are obtained);
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。 工业实用性  The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Industrial applicability
本发明实施例的方案根据当前配置的 DDR数量对逻辑地址分区;根据 分区后各区间段的逻辑地址分别进行逻辑地址和物理地址间的映射处理。 由于采用本发明实施例不是直接针对总逻辑地址进行逻辑地址到物理地址 的映射, 而是对总的逻辑地址分区处理后再进行映射处理, 从而减少了逻 辑地址的占用,既节约 RAM资源,而更少的逻辑地址更容易地址寻址实现, 又能实现对物理地址的高效管理。 The solution of the embodiment of the present invention partitions the logical address according to the currently configured DDR number; and performs mapping processing between the logical address and the physical address according to the logical address of each interval segment after the partition. The embodiment of the present invention does not directly map the logical address to the physical address for the total logical address, but performs the mapping processing after the total logical address is partitioned, thereby reducing the occupation of the logical address, thereby saving RAM resources. Fewer logical addresses make address addressing easier, and efficient management of physical addresses.

Claims

权利要求书 claims
1、 一种地址映射处理的方法, 该方法包括: 1. A method of address mapping processing, which method includes:
根据当前配置的双倍数据速率同步随机存储器 DDR数量对逻辑地址分 区; Partition the logical address according to the currently configured Double Data Rate synchronous random access memory DDR number;
根据分区后各区间段的逻辑地址分别进行逻辑地址和物理地址间的映 射处理。 Mapping between logical addresses and physical addresses is performed based on the logical addresses of each interval segment after partitioning.
2、 根据权利要求 1所述的方法, 其中, 所述根据当前配置的 DDR数 量对逻辑地址分区具体包括: 2. The method according to claim 1, wherein the partitioning of logical addresses according to the currently configured number of DDRs specifically includes:
根据 DDR数量及每个 DDR所包含的物理存储体 bank数量得到总的物 理 bank数; The total number of physical banks is obtained based on the number of DDRs and the number of physical memory banks included in each DDR;
将总的逻辑地址均分为多个逻辑地址段, 且分段数为所述总的物理 bank数的所有公约数中数值为 2n的最大值, 所述 n指段内链表数量。 The total logical address is divided into multiple logical address segments, and the number of segments is the maximum value of 2n among all common denominators of the total number of physical banks, where n refers to the number of linked lists in the segment.
3、 根据权利要求 2所述的方法, 其中, 所述根据分区后各区间段的逻 辑地址分别进行逻辑地址和物理地址间的映射处理具体包括: 3. The method according to claim 2, wherein the mapping between logical addresses and physical addresses according to the logical addresses of each interval segment after partitioning specifically includes:
数值为 2n的情况下, 每个逻辑地址段对应一个物理 bank, 则为逻辑地 址与物理地址的一^一映射; When the value is 2n, each logical address segment corresponds to a physical bank, which is a one-to-one mapping between logical addresses and physical addresses;
数值为非 2n的情况下, 每个逻辑地址段对应多个物理 bank, 则为逻辑 地址与物理地址的一对多映射。 When the value is other than 2n, each logical address segment corresponds to multiple physical banks, which is a one-to-many mapping of logical addresses and physical addresses.
4、 根据权利要求 3所述的方法, 其中, 该方法还包括: 所述一对多映 射时, 为每个物理 bank配置段内偏移基地址, 所述段内偏移基地址的数量 为 n-l。 4. The method according to claim 3, wherein the method further includes: during the one-to-many mapping, configuring an intra-segment offset base address for each physical bank, and the number of intra-segment offset base addresses is n-l.
5、 根据权利要求 4所述的方法, 其中, 该方法还包括: 根据所述段内 偏移基地址和段内偏移地址, 得到段内偏移地址对应的段内偏移物理 bank 地址。 5. The method according to claim 4, wherein the method further includes: obtaining an intra-segment offset physical bank address corresponding to the intra-segment offset address according to the intra-segment offset base address and the intra-segment offset address.
6、 根据权利要求 5所述的方法, 其中, 该方法还包括: 根据所述段内 偏移物理 bank地址得到对应的物理行地址和物理列地址。 6. The method according to claim 5, wherein the method further comprises: according to the Offset the physical bank address to obtain the corresponding physical row address and physical column address.
7、 一种地址映射处理的装置, 该装置包括: 分区处理单元和映射处理 单元; 其中, 7. An address mapping processing device, which includes: a partition processing unit and a mapping processing unit; wherein,
所述分区处理单元,配置为根据当前配置的 DDR数量对逻辑地址分区; 所述映射处理单元, 配置为根据分区后各区间段的逻辑地址分别进行 逻辑地址和物理地址间的映射处理。 The partition processing unit is configured to partition the logical address according to the currently configured number of DDRs; the mapping processing unit is configured to perform mapping processing between logical addresses and physical addresses according to the logical addresses of each interval segment after partitioning.
8、 根据权利要求 7所述的装置, 其中, 所述分区处理单元, 还配置为 根据 DDR数量及每个 DDR所包含的物理存储体 bank数量得到总的物理 bank数, 将总的逻辑地址均分为多个逻辑地址段, 且分段数为所述总的物 理 bank数的所有公约数中数值为 2n的最大值, 所述 n指段内链表数量。 8. The device according to claim 7, wherein the partition processing unit is further configured to obtain the total number of physical banks based on the number of DDRs and the number of physical memory banks included in each DDR, and average the total logical addresses. It is divided into multiple logical address segments, and the number of segments is the maximum value of 2n among all common denominators of the total number of physical banks, where n refers to the number of linked lists in the segment.
9、 根据权利要求 8所述的装置, 其中, 所述映射处理单元, 还配置为 数值为 2n的情况下, 使每个逻辑地址段对应一个物理 bank, 则为逻辑地址 与物理地址的一对一映射; 数值为非 2n的情况下, 使每个逻辑地址段对应 多个物理 bank, 则为逻辑地址与物理地址的一对多映射。 9. The device according to claim 8, wherein the mapping processing unit is further configured to make each logical address segment correspond to a physical bank when the value is 2n, which is a pair of logical addresses and physical addresses. One mapping; when the value is non-2n, each logical address segment corresponds to multiple physical banks, which is a one-to-many mapping of logical addresses and physical addresses.
10、 根据权利要求 9所述的装置, 其中, 所述映射处理单元, 还配置 为一对多映射时, 为每个物理 bank配置段内偏移基地址, 所述段内偏移基 地址的数量为 n-1 ; 根据所述段内偏移基地址和段内偏移地址, 得到段内偏 移地址对应的段内偏移物理 bank地址;根据所述段内偏移物理 bank地址得 到对应的物理行地址和物理列地址。 10. The device according to claim 9, wherein the mapping processing unit is also configured for one-to-many mapping, configuring an intra-segment offset base address for each physical bank, and the intra-segment offset base address is The number is n-1; According to the intra-segment offset base address and the intra-segment offset address, the intra-segment offset physical bank address corresponding to the intra-segment offset address is obtained; The corresponding intra-segment offset physical bank address is obtained physical row address and physical column address.
PCT/CN2013/090967 2013-04-15 2013-12-30 Method and device for processing address mapping WO2014169690A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310130486.6A CN104102586B (en) 2013-04-15 2013-04-15 A kind of method, apparatus of address of cache processing
CN201310130486.6 2013-04-15

Publications (1)

Publication Number Publication Date
WO2014169690A1 true WO2014169690A1 (en) 2014-10-23

Family

ID=51670755

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/090967 WO2014169690A1 (en) 2013-04-15 2013-12-30 Method and device for processing address mapping

Country Status (2)

Country Link
CN (1) CN104102586B (en)
WO (1) WO2014169690A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108550102A (en) * 2018-04-25 2018-09-18 珠海全志科技股份有限公司 A kind of hardware accelerator

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547702B (en) * 2016-09-27 2019-09-10 中国电子科技集团公司第三十八研究所 A kind of 8 memory access address calculation method of bimodulus
CN107870870B (en) * 2016-09-28 2021-12-14 北京忆芯科技有限公司 Accessing memory space beyond address bus width
CN107870867B (en) * 2016-09-28 2021-12-14 北京忆芯科技有限公司 Method and device for 32-bit CPU to access memory space larger than 4GB
CN110851372B (en) * 2018-08-20 2023-10-31 慧荣科技股份有限公司 Storage device and cache area addressing method
CN111367461B (en) * 2018-12-25 2024-02-20 兆易创新科技集团股份有限公司 Storage space management method and device
CN110781101A (en) * 2019-10-25 2020-02-11 苏州浪潮智能科技有限公司 One-to-many mapping relation storage method and device, electronic equipment and medium
CN114328286B (en) * 2022-03-14 2022-07-15 南京芯驰半导体科技有限公司 Method for improving system access performance
CN114707478B (en) * 2022-06-06 2022-09-02 飞腾信息技术有限公司 Mapping table generation method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7932912B1 (en) * 2006-10-04 2011-04-26 Nvidia Corporation Frame buffer tag addressing for partitioned graphics memory supporting non-power of two number of memory elements
CN102156619A (en) * 2010-02-12 2011-08-17 群联电子股份有限公司 Flash memory, flash memory controller and data writing method
CN102622189A (en) * 2011-12-31 2012-08-01 成都市华为赛门铁克科技有限公司 Storage virtualization device, data storage method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7932912B1 (en) * 2006-10-04 2011-04-26 Nvidia Corporation Frame buffer tag addressing for partitioned graphics memory supporting non-power of two number of memory elements
CN102156619A (en) * 2010-02-12 2011-08-17 群联电子股份有限公司 Flash memory, flash memory controller and data writing method
CN102622189A (en) * 2011-12-31 2012-08-01 成都市华为赛门铁克科技有限公司 Storage virtualization device, data storage method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108550102A (en) * 2018-04-25 2018-09-18 珠海全志科技股份有限公司 A kind of hardware accelerator

Also Published As

Publication number Publication date
CN104102586B (en) 2019-02-22
CN104102586A (en) 2014-10-15

Similar Documents

Publication Publication Date Title
WO2014169690A1 (en) Method and device for processing address mapping
CN107220187B (en) Cache management method and device and field programmable gate array
JP6190754B2 (en) Apparatus and method for table lookup using centralized memory pool in network switch
EP3475831B1 (en) System and method for odd modulus memory channel interleaving
Bando et al. FlashTrie: beyond 100-Gb/s IP route lookup using hash-based prefix-compressed trie
WO2016011811A1 (en) Memory management method and apparatus, and storage medium
US9063860B2 (en) Method and system for optimizing prefetching of cache memory lines
CN114556881B (en) Address translation method and device
CN112506823B (en) FPGA data reading and writing method, device, equipment and readable storage medium
US20230409198A1 (en) Memory sharing control method and device, computer device, and system
CN104572498A (en) Cache management method for message and device
WO2021062982A1 (en) Method and apparatus for managing hmb memory, and computer device and storage medium
EP3316543B1 (en) Device and method of enhancing item access bandwidth and atomic operation
TWI744111B (en) Method for establishing look-up table and inquiring memory address, method for establishing host memory address look-up table, and method for inquiring host memory address
WO2024001310A1 (en) Data processing device and method
CN106919516B (en) DDR address mapping system and method
US10067868B2 (en) Memory architecture determining the number of replicas stored in memory banks or devices according to a packet size
US9767051B2 (en) Scalable, parameterizable, and script-generatable buffer manager architecture
WO2017219749A1 (en) Cache management method and device, and computer storage medium
CN111133422A (en) Transaction scheduler for memory management unit
US10078601B2 (en) Approach for interfacing a pipeline with two or more interfaces in a processor
CN104751879B (en) The method for realizing CAM function based on FPGA
CN113722244B (en) Cache structure, access method and electronic equipment
Shi et al. Optimization of shared memory controller for multi-core system
CN115878863A (en) Data searching method and data searching device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13882494

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13882494

Country of ref document: EP

Kind code of ref document: A1