Movatterモバイル変換


[0]ホーム

URL:


CN108132894B - Positioning device and method for TLB multi-hit exception in CPU - Google Patents

Positioning device and method for TLB multi-hit exception in CPU
Download PDF

Info

Publication number
CN108132894B
CN108132894BCN201711411290.9ACN201711411290ACN108132894BCN 108132894 BCN108132894 BCN 108132894BCN 201711411290 ACN201711411290 ACN 201711411290ACN 108132894 BCN108132894 BCN 108132894B
Authority
CN
China
Prior art keywords
hit
tlb
exception
cpu
registers
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
CN201711411290.9A
Other languages
Chinese (zh)
Other versions
CN108132894A (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.)
C core Technology Co ltd
Original Assignee
C core Technology 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 C core Technology Co ltdfiledCriticalC core Technology Co ltd
Priority to CN201711411290.9ApriorityCriticalpatent/CN108132894B/en
Publication of CN108132894ApublicationCriticalpatent/CN108132894A/en
Application grantedgrantedCritical
Publication of CN108132894BpublicationCriticalpatent/CN108132894B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention provides a positioning device and a method for TLB multi-hit abnormity in a CPU, wherein the method specifically comprises the following steps: the virtual address to be mapped is compared with matching addresses stored in n TLB table entries in a hit comparison module, wherein the matching addresses are configured in advance, and the matching hit numbers in the table entries are obtained; screening out the numbers of the hit table entries with the minimum number and the maximum number by adopting a multiplexer with a priority, and storing the numbers in a register; the exception handler reads the values of the two registers, locating the TLB entry number that caused the TLB multi-hit. The invention assists the TLB multi-hit exception handling program, and can quickly find out the TLB table entry number in which the TLB multi-hit occurs; two sets of multiplexers with priorities and software accessible registers are adopted, so that the time for processing the TLB multi-hit exception is saved, and the exception checking efficiency is improved.

Description

Positioning device and method for TLB multi-hit exception in CPU
Technical Field
The invention belongs to the technical field of embedded processors in integrated circuits, and particularly relates to a positioning device and method for TLB multi-hit exception in a CPU.
Background
As a functional module commonly used in a CPU (central processing unit), a tlb (translation Lookaside buffer) is responsible for mapping a virtual address in a software program executed by the CPU to a real address on a physical bus. Ideally, each virtual address should be mapped by the TLB to a unique real address.
In practice, however, the mapping table stored in the TLB is implemented by a manual pre-writing program, which may cause some non-uniqueness of the virtual address mapping due to human reasons. As shown in the example of fig. 2; for example, the virtual address segments 0x 00001000-0 x00005000 are mapped to the real address segments 0x 10001000-0 x10005000 and stored in the TLB table entry # 1. The virtual address segments 0x 00004000-0 x00008000 are mapped to real address segments 0x 20004000-0 x20008000 and stored in TLB table entry # 2. Therefore, the virtual address subsections 0x00004000 to 0x00005000 are mapped to the real address subsections 0x10004000 to 0x10005000 by the table entry #1 and mapped to the real address subsections 0x20004000 to 0x20005000 by the table entry # 2. Such overlapping of virtual address segments in different TLB entries may result in non-unique mapping of overlapping segment addresses.
The address mapping that is not unique in a TLB is commonly referred to in the industry as TLB multi hit. Some CPUs such as PowerPC470 have internal circuitry that automatically selects one mapping and discards another mapping according to some built-in rule when TLB multiple-hit occurs. Other CPUs, such as PowerPC460, when a TLB multi-hit occurs, immediately trigger the CPU to enter a TLB multi-hit exception state. The CPU stops the execution of the normal program and jumps to the exception handling program corresponding to the TLB multi-hit programmed in advance to try to correct the error.
Because there are generally many TLB mapping table entries in the CPU, it is cumbersome to check which mapping of two (or more) table entries overlap one by one. The troubleshooting is completed through an exception handling program, so that the complexity of program writing is brought, and the time overhead of troubleshooting and error correction is influenced.
Disclosure of Invention
In view of the above, the present invention is directed to provide a positioning apparatus for TLB multiple hit exception in a CPU, which can quickly and intuitively feedback which two TLB mapping table entries are overlapped when two table entries are hit.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a positioning device for TLB multi-hit exception in CPU comprises a virtual address input module to be mapped, a hit comparison module and a multiplexer which are connected in sequence, wherein the hit comparison module is also connected with two groups of registers through the multiplexer with priority;
the hit comparison module is used for comparing the virtual address to be mapped with the preset matching addresses stored in the n TLB table entries one by one to obtain the number of matching hits in the table entries;
the multiplexer is used for outputting the mapped real address;
and the two groups of registers are used for storing the table entry numbers with the maximum number and the minimum number screened out by the multiplexer with the priority.
Further, the bit width of each group of registers is the binary width of the TLB table entry number.
Further, the two sets of registers are readable by a software program, and the values of the registers are synchronously reset to 0 when the CPU is reset.
Compared with the prior art, the positioning device for the TLB multi-hit exception in the CPU has the following advantages: the invention assists the TLB multi-hit exception handling program, and can quickly find out the TLB table entry number in which the TLB multi-hit occurs; two sets of multiplexers with priorities and software accessible registers are adopted, so that the time for processing the TLB multi-hit exception is saved, and the exception checking efficiency is improved.
Another objective of the present invention is to provide a method for positioning TLB multiple hit exception in CPU, which can quickly and intuitively feedback which two TLB mapping table entries are overlapped when two table entries are hit.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a method for positioning TLB multi-hit exception in CPU includes following steps:
(1) the virtual address to be mapped is compared with matching addresses stored in n TLB table entries in a hit comparison module, wherein the matching addresses are configured in advance, and the matching hit numbers in the table entries are obtained;
(2) screening out the hit table entry number with the minimum number by adopting a multiplexer with priority, and storing the hit table entry number in a register;
(3) screening out the number of the hit table entry with the largest number by adopting a multiplexer with priority, and storing the number in a register;
(4) the exception handler reads the values of the two registers, locating the TLB entry number that caused the TLB multi-hit.
Furthermore, when two or more TLB table entries are hit at the same time, the hit comparison module sets the multi hit flag signal, and the two groups of registers store the numbers of the two hit table entries by using the multi hit flag signal as an enable signal.
The method for positioning the TLB multi-hit abnormity in the CPU has the same beneficial effect as the positioning device for the TLB multi-hit abnormity in the CPU, and is not repeated herein.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate an embodiment of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a schematic structural diagram of a positioning apparatus for a TLB multi-hit exception in a CPU according to an embodiment of the present invention;
fig. 2 is a diagram illustrating non-uniqueness of virtual address mapping in the prior art.
Detailed Description
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, and are used only for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention. Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first," "second," etc. may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless otherwise specified.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art through specific situations.
The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
As shown in fig. 1, in practical application, the virtual address to be mapped is compared with the matching addresses stored in n TLB entries in advance, and after comparison, when only one of the n TLB entries is matched and hit, the number of the hit entry is used as a routing signal of the multiplexer, and the pre-configured real address information corresponding to the hit entry is screened out and output, thereby completing a normal TLB mapping process;
when more than one TLB table entry is hit, the invention provides a diagnosis positioning device and method, which can quickly and intuitively feedback which two TLB mapping table entries are overlapped.
The positioning device comprises a virtual address input module to be mapped, a hit comparison module and a multiplexer which are sequentially connected, wherein the hit comparison module is also connected with two groups of registers through the multiplexer with priority;
the hit comparison module is used for comparing the virtual address to be mapped with the preset matching addresses stored in the n TLB table entries one by one to obtain the number of matching hits in the table entries;
the multiplexer is used for outputting the mapped real address;
and the two groups of registers are used for storing the table entry numbers with the maximum number and the minimum number screened out by the multiplexer with the priority. The bit width of each group of registers is the binary width of the TLB table entry number. When two or more TLB table entries hit at the same time, the comparison circuit sets a multi hit flag signal, and the 2 groups of registers store two hit table entry numbers by using the multi hit flag signal as an enable signal.
The input of the first group of registers adopts a multiplexer with priority to screen out the hit table entry number with the minimum number. And a second group of registers, the input of which adopts a multiplexer with priority to screen out the hit table entry number with the largest number. The two sets of registers are readable by a software program, and the values of the registers are synchronously reset to 0 when the CPU is reset. When the CPU has TLB multi-hit abnormity, the abnormity processing program can directly read the values of the two groups of registers, thereby directly positioning which two groups of TLB table items have mapping overlap, not only saving the troubleshooting program, but also saving the time overhead of one-by-one troubleshooting.
An example of an implementation on the PowerPC460 is given here. The number of TLB entries of PowerPC460 is 64, and a fully associative structure is adopted, and the entry numbers are from #0 to # 63. Each virtual address generated by the CPU running the software program is compared with the preset addresses in the 64 entries to determine which hit. The bit width of each group of the 2 groups of hit table entry number registers added in the invention is 6 bit. When TLB multi hit occurs, the first set of registers filters out the first hit entry in the order #0 to #63 and stores its number. The second set of registers selects the second hit entry in the order #63 to #0 and stores its number. The two sets of registers are software program accessible registers that access bits 26 to 31 and 18 to 23 addressed to the PowerPC460 exception status register ESR. The TLB multi hit exception handler of PowerPC460 may read the last 2 bytes of the ESR directly to locate the TLB entry number that caused the TLB multi-hit.
When more than two items are hit, the two items can be reduced to 2 items hit to process the items pair by pair.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (5)

CN201711411290.9A2017-12-232017-12-23Positioning device and method for TLB multi-hit exception in CPUActiveCN108132894B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201711411290.9ACN108132894B (en)2017-12-232017-12-23Positioning device and method for TLB multi-hit exception in CPU

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201711411290.9ACN108132894B (en)2017-12-232017-12-23Positioning device and method for TLB multi-hit exception in CPU

Publications (2)

Publication NumberPublication Date
CN108132894A CN108132894A (en)2018-06-08
CN108132894Btrue CN108132894B (en)2021-11-30

Family

ID=62391690

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201711411290.9AActiveCN108132894B (en)2017-12-232017-12-23Positioning device and method for TLB multi-hit exception in CPU

Country Status (1)

CountryLink
CN (1)CN108132894B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109783265B (en)*2018-12-302022-08-12国网北京市电力公司 Abnormal business data processing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104424034A (en)*2013-09-042015-03-18华为技术有限公司Hardware resource access method and hardware resource access device
CN102789429B (en)*2007-06-012016-06-22英特尔公司The virtual address of page attributes is to the conversion of physical address

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1848096A (en)*2005-04-112006-10-18美普思科技有限公司Improved apparatus and method for avoiding repeated matched inputting in switching side-looking buffer
US8601234B2 (en)*2007-11-072013-12-03Qualcomm IncorporatedConfigurable translation lookaside buffer
US9292453B2 (en)*2013-02-012016-03-22International Business Machines CorporationStoring a system-absolute address (SAA) in a first level translation look-aside buffer (TLB)
CN104216833B (en)*2013-05-292017-10-10华为技术有限公司A kind of method and device for determining physical address
CN104239238B (en)*2013-06-212018-01-19格芯公司Method and apparatus for managing translation lookaside buffering

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102789429B (en)*2007-06-012016-06-22英特尔公司The virtual address of page attributes is to the conversion of physical address
CN104424034A (en)*2013-09-042015-03-18华为技术有限公司Hardware resource access method and hardware resource access device

Also Published As

Publication numberPublication date
CN108132894A (en)2018-06-08

Similar Documents

PublicationPublication DateTitle
US10922259B2 (en)System and method for extended peripheral component interconnect express fabrics
US7689806B2 (en)Method and system to indicate an exception-triggering page within a microprocessor
US9372750B2 (en)Method and apparatus for non-volatile RAM error re-mapping
US20200057747A1 (en)Hybrid remote direct memory access
US8751713B2 (en)Executing virtual functions using memory-based data in a PCI express SR-IOV and MR-IOV environment
WO2015117553A1 (en)Per-Function Downstream Port Containment
CN107992376B (en)Active fault tolerance method and device for data storage of DSP (digital Signal processor)
US9734921B2 (en)Memory repair using external tags
US9417952B2 (en)Direct memory access (DMA) unit with error detection
CN105653481A (en)PCIe bus-based data transmission method and device
EP2240856B1 (en)Error detector in a cache memory using configurable way redundancy
CN108132894B (en)Positioning device and method for TLB multi-hit exception in CPU
US20130013849A1 (en)Programmable Patch Architecture for ROM
US7185172B1 (en)CAM-based search engine devices having index translation capability
US11709776B2 (en)Methods and systems for a stripe mode cache pool
US9442819B2 (en)Method and apparatus for storing trace data
US9003158B2 (en)Flexible control mechanism for store gathering in a write buffer
US9459977B2 (en)Data processing system with debug control
US20150323602A1 (en)Monitoring method, monitoring apparatus, and electronic device
US8032687B2 (en)Method, system, and apparatus for supporting limited address mode memory access
US8359528B2 (en)Parity look-ahead scheme for tag cache memory
US8760941B2 (en)Data transfer circuit and data transfer method
EP4275207B1 (en)Logical memory repair with a shared physical memory
CN102236572B (en) A method and device for loading firmware
US20080082781A1 (en)Watchpointing unaligned data accesses

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp