WO2015085891A1 - Method, device and system for establishing processor cache checkpoint - Google Patents

Method, device and system for establishing processor cache checkpoint Download PDF

Info

Publication number
WO2015085891A1
WO2015085891A1 PCT/CN2014/093230 CN2014093230W WO2015085891A1 WO 2015085891 A1 WO2015085891 A1 WO 2015085891A1 CN 2014093230 W CN2014093230 W CN 2014093230W WO 2015085891 A1 WO2015085891 A1 WO 2015085891A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
address
processor
cache line
exported
Prior art date
Application number
PCT/CN2014/093230
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 WO2015085891A1 publication Critical patent/WO2015085891A1/en

Links

Images

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

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method, device and system for establishing a processor Cache checkpoint.
  • the processor cache (CPU Cache) is the component used to reduce the average time required for the processor to access memory. Its capacity is much smaller than the memory, but the speed can be close to the processor's frequency.
  • a process periodically saves the state of the execution program to the stable memory. After the system fails, the system can recover according to the information.
  • Each saved program state is called a checkpoint.
  • the Cache checkpoint is a checkpoint established for the Cache. It saves the entire Cache state at a certain time. In the fault migration and state recovery, if the Cache checkpoint can be used to restore the Cache state, the processor does not need to initialize the Cache. A large number of Cache rebuild times speed up system recovery and state migration.
  • the method for establishing a Cache checkpoint is to use the idle time of the Cache to derive the Cache state of the start time of the process into the compressor during the operation of the processor, thereby establishing a Cache checkpoint.
  • the Cache checkpoint establishment process if there is no update operation to the Cache, all Cache contents are sequentially exported to the compressor in the order of the Cache address.
  • the processor operation needs to be suspended, and the original content of the Cache line is first exported to the compressor, and then started.
  • the processor updates the cache line, that is, when the data of the unexported area needs to be updated, the original data needs to be saved first, and the operation of updating the data by the processor is delayed, the pipeline is suspended, or the memory access operation is suspended. Therefore, the prior art method of establishing a processor Cache checkpoint affects the running of the processor and affects the normal operation of the system.
  • the main purpose of the embodiments of the present invention is to provide a method, an apparatus, and a system for establishing a processor Cache checkpoint, so as to solve the problem that the method for establishing a processor Cache checkpoint in the prior art affects the operation of the processor.
  • the present invention provides a method for establishing a processor Cache checkpoint, the method comprising:
  • the processor When receiving the processor read Cache signal, the processor reads the Cache operation and pauses the export of the content in the Cache.
  • the method further includes:
  • the received processor reads the Cache signal, it is determined that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, and then the processor reads the Cache operation, and simultaneously performs the Cache corresponding to the read Cache operation.
  • the contents of the line are exported.
  • the method further includes:
  • the control address generator generates a first address starting from one end of the Cache line address range.
  • the process of exporting the content in the Cache row by row is specifically: the Cache line corresponding to the first address is The content is exported to the compressor for storage. After each cache line is exported, the address generator is controlled to change the first address to the next cache line address.
  • the determining, by the cache line, that the cache line corresponding to the write operation is an exported cache line includes:
  • the detecting determines that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, and includes:
  • the comparator is configured to compare a cache line address corresponding to the processor write Cache operation with a current first address size
  • the comparison result is that the cache cache address corresponding to the processor write Cache operation is smaller than the current first address, and the processor write Cache operation is determined to be corresponding.
  • the Cache line is in the exported portion of the Cache;
  • the comparison result is that the Cache line address corresponding to the processor write Cache operation is greater than the current first address, and the processor write Cache operation is determined to be corresponding.
  • the Cache line is in the exported portion of the Cache.
  • the detecting determines that the cache line corresponding to the processor write Cache operation is in an unexported portion of the Cache, and includes:
  • the comparator is configured to compare a cache line address corresponding to the processor write Cache operation with a current first address size
  • the comparison result is that the Cache line address corresponding to the processor write Cache operation is greater than or equal to the current first address, and the processor write Cache is determined.
  • the corresponding Cache line of the operation is in the unexported part of the Cache;
  • the comparison result is that the cache cache address corresponding to the processor write cache operation is less than or equal to the current first address, and the processor write cache is determined.
  • the corresponding Cache line is operated in the unexported part of the Cache.
  • the detecting determines that the cache line corresponding to the processor read Cache operation is the next exported cache line, including:
  • the comparator is further configured to compare a cache line address corresponding to the processor read Cache operation with a current first address size
  • the comparison result is that the cache line address corresponding to the processor read Cache operation is equal to the current first address, and the cache line corresponding to the processor read Cache operation is determined to be the next exported cache line.
  • the present invention provides an apparatus for establishing a processor Cache checkpoint, the apparatus comprising:
  • a receiving unit configured to receive a processor write Cache signal or receive a processor read Cache signal during the process of exporting the content in the Cache row by row;
  • a first determining unit configured to: when the receiving unit receives the processor write Cache signal, detect that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache;
  • a first processing unit configured to: when the first determining unit detects that the Cache line corresponding to the processor write Cache operation is in the exported part of the Cache, perform a processor write Cache operation;
  • a first deriving unit configured to: when the first determining unit detects that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, and writes the content of the write Cache operation into the cache line to be exported;
  • a second determining unit configured to: when the receiving unit receives the processor write Cache signal, detect that the cache line corresponding to the processor write Cache operation is in an unexported portion of the Cache;
  • a second processing unit configured to: when the second determining unit detects that the Cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, perform a processor write Cache operation, and pause to export the content in the Cache;
  • a third processing unit configured to: when the receiving unit receives the processor read Cache signal, perform a processor read Cache operation, and suspend exporting the content in the Cache.
  • the device further includes:
  • a third determining unit configured to: when the receiving unit receives the processor read Cache signal, detect that the cache line corresponding to the processor read Cache operation is the next exported Cache line;
  • a fourth processing unit configured to perform a processor read Cache operation when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line;
  • a second deriving unit configured to: when the third determining unit detects that the cache line corresponding to the processor read Cache operation is the next exported Cache line, export the content in the Cache line corresponding to the read Cache operation .
  • the apparatus further includes:
  • the control unit is configured to control the address generator to generate the first address by using one end of the Cache line address range.
  • the process of exporting the content in the Cache row by row is specifically: the control unit controls the address generator to generate the first The content in the cache line corresponding to an address is exported to the compressor for storage. After each cache line is exported, the control unit controls the address generator to change the first address to the next cache line address.
  • the first determining unit includes:
  • a receiving subunit configured to receive a comparison result of the comparator, where the comparator is configured to compare a cache row address corresponding to the processor write Cache operation with a current first address size;
  • a first determining subunit configured to: when the address generator starts generating the first address by the low address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is smaller than the current first address, and the processor is determined to write the Cache operation.
  • the Cache line is in the exported part of the Cache;
  • a second determining subunit configured to: when the address generator starts generating the first address by the high address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is greater than the current first address, and it is determined that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache.
  • the second determining unit includes:
  • a receiving subunit configured to receive a comparison result of the comparator, where the comparator is configured to compare a cache row address corresponding to the processor write Cache operation with a current first address size;
  • a third determining subunit configured to: when the address generator starts to generate the first address by the low address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is greater than or equal to the current first address, and the cache line corresponding to the processor write Cache operation is determined to be in the unexported portion of the Cache;
  • a fourth determining subunit configured to: when the address generator starts generating the first address by the high address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is less than or equal to the current first address, and the cache line corresponding to the processor write Cache operation is determined to be in the unexported portion of the Cache.
  • the third determining unit includes:
  • a receiving subunit configured to receive a comparison result of the comparator, where the comparator is further configured to compare a cache line address corresponding to the processor read Cache operation with a current first address size;
  • a fifth determining subunit wherein the comparison result received by the receiving subunit is that the cache line address corresponding to the processor read Cache operation is equal to the current first address, and determining that the cache line corresponding to the processor read Cache operation is the next exported Cache line.
  • the present invention provides a system for establishing a processor Cache checkpoint, the system comprising:
  • the export controller is the device for establishing a processor Cache checkpoint according to the second aspect of the present invention.
  • An address generator configured to generate a first address according to the control of the export controller
  • a comparator configured to compare a cache row address corresponding to the processor write cache operation with a current first address, compare a cache row address corresponding to the processor read cache operation with a current first address, and send the comparison result Giving the derived controller;
  • a compressor that stores the contents of the Cache line A compressor that stores the contents of the Cache line.
  • the processor write Cache operation is performed, and at the same time
  • the write cache operation is written to the content in the cache line for export; if the detection determines that the processor needs to write the cache and the cache line corresponding to the write cache operation is in the unexported portion of the cache, the processor write cache operation is performed, and the pause is performed.
  • the content in the Cache is exported; when it is detected that the processor needs to read the Cache, the processor reads the Cache operation, and pauses the content in the Cache to be exported.
  • the Cache export process is suspended.
  • the Cache update operation occurs, and the update operation occurs in the exported part of the Cache, and the update is performed.
  • the data needs to be stored in the compressor at the same time, so that the data exported to the compressor is the latest data in each cache line, and the established Cache checkpoint is the Cache state at the end of the establishment process.
  • the processor is always in the normal working state, there is no interruption of the establishment of the Cache checkpoint or any operation of the processor is delayed.
  • the process of establishing the Cache checkpoint does not affect the operation of the processor. The normal operation of the system is guaranteed.
  • FIG. 1 is a schematic diagram of a method for establishing a processor Cache checkpoint in the prior art
  • Embodiment 1 is a flowchart of Embodiment 1 of a method for establishing a processor Cache checkpoint according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an embodiment of a method for establishing a processor Cache checkpoint according to an embodiment of the present invention
  • Embodiment 4 is a flowchart of Embodiment 2 of a method for establishing a processor Cache checkpoint according to an embodiment of the present invention
  • FIG. 5 is a flowchart of Embodiment 3 of a method for establishing a processor Cache checkpoint according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of Embodiment 1 of an apparatus for establishing a processor Cache checkpoint according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of Embodiment 2 of an apparatus for establishing a processor Cache checkpoint according to an embodiment of the present invention
  • FIG. 8 is a schematic diagram of Embodiment 1 of a system for establishing a processor Cache checkpoint according to an embodiment of the present invention
  • FIG. 9 is a structural diagram of Embodiment 2 of a system for establishing a processor Cache checkpoint according to an embodiment of the present invention.
  • the data processing method provided by the embodiment of the present invention is applied to a data processing system, where the data processing system includes an operating system, and a hardware thread resource pool for executing a task code, where the operating system manages the hardware thread pool.
  • the hardware thread is a physical execution unit for executing a task code, and the specific physical form thereof may be a chip or a processor, and the hardware thread pool includes a plurality of hardware threads.
  • CPU Cache is a component used to reduce the average time required for the processor to access memory.
  • Each Cache consists of several cache lines, and each cache line can be It includes an index (Index), a tag (Tag), and a number of flag bits, such as a valid bit, a dirty bit, a use bit, and the like.
  • Index index
  • Tag tag
  • flag bits such as a valid bit, a dirty bit, a use bit, and the like.
  • Cache can be considered as a transparent component, usually can not directly interfere with the operation of the cache, and can not directly read the contents of the Cache through the software method.
  • Cache checkpoint can be used to restore the Cache state, the processor does not need to initialize the Cache, which saves a lot of Cache rebuild time and speeds up system fault recovery and state transition.
  • Cache checkpoints can also be used for system error detection, error correction and fault diagnosis, and auxiliary system debugging.
  • the prior art affects the operation of the processor, that is, when the data of the unexported area needs to be updated, the original data needs to be saved first, and the operation of updating the data by the processor is delayed, the pipeline is suspended, or the access is suspended.
  • the operation of the memory makes the execution of the processor at the time of data export different from the normal mode, and some operations are delayed, which affects the normal operation of the system.
  • the method for establishing a Cache checkpoint in the prior art affects the normal operation of the processor. For this reason, the embodiment of the present invention provides the following method, device, and system for establishing a processor Cache checkpoint.
  • the first embodiment of the method for establishing a processor cache checkpoint in the embodiment of the present invention may include the following steps:
  • Step 201 In the process of exporting the content in the Cache row by row, when receiving the processor write Cache signal, detecting that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, executing the processor write Cache The operation is performed, and at the same time, the write cache operation is written to the content in the cache line for export.
  • the method for establishing a processor Cache checkpoint in the embodiment of the present invention may be performed by a new export controller combined with the processor Cache architecture.
  • the Cache data content of each row can be exported from low to high or high to low according to the Cache address sequence when the Cache is in the idle state without the Cache read and write operation.
  • each row of the output may be returned to continue to determine whether there is a read or write operation to the Cache. If the Cache continues to be idle, the content of the next cache line of the previous exported cache line is exported, that is, the Cache is idle. In the state, the contents of the Cache are exported line by line.
  • the entire Cache In the process of exporting the contents of the Cache line by line, the entire Cache can be divided into two parts: the exported part and the unexported part.
  • the data exported each time includes all data of the cache line, that is, Tag, Valid, Dirty, and Data information.
  • the tag information is identification information, and the Cache row address and the offset address are combined to determine the segment address offset of the saved data in the Cache line;
  • the Valid bit is a valid bit information indicating the number According to whether it is valid;
  • the Dirty bit is dirty bit information, in the writeback strategy, it is determined whether the data has been updated;
  • the Data information is the data content of the corresponding address saved in the Cache line.
  • the compressor can use the lossless compression method to compress according to the correlation between the tag and data information, and store the content in the cache line.
  • the representative processor When receiving the processor write Cache signal, the representative processor needs to perform a write Cache operation, and the write operation is an update operation, and the data that needs to be updated is written into the Cache.
  • the processor write Cache signal further detecting the location where the write operation occurs is determined, and determining that the write operation occurs in the exported portion of the Cache, the data written to the Cache needs to be simultaneously performed in addition to being written into the Cache. Export the storage to the compressor,
  • Step 202 When receiving the processor write Cache signal, detecting that the cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, performing a processor write Cache operation, and suspending exporting the content in the Cache.
  • the processor write Cache operation may be performed normally, and the content in the Cache is suspended.
  • Step 203 When receiving the processor read Cache signal, perform a processor read Cache operation, and pause to export the content in the Cache.
  • the processor When the processor reads the Cache signal, that is, the processor needs to perform the read Cache operation, the processor reads the Cache operation normally, and pauses the content in the Cache to be exported. The process of exporting the contents of the Cache line by line after the processor reads the Cache operation.
  • the Cache is divided into an exported part and an unexported part.
  • the updated data is simultaneously saved in the compressor.
  • the Cache checkpoint is the Cache state at the time of the export end time B.
  • the method for establishing a processor cache checkpoint in the embodiment of the present invention may further include:
  • the received processor reads the Cache signal, it is determined that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, and then the processor reads the Cache operation, and simultaneously performs the Cache corresponding to the read Cache operation.
  • the contents of the line are exported.
  • the read/write operation to the Cache is a read operation on the Cache
  • the content in the Cache line is also exported. That is, the Cache read operation originally needs to pause the Cache export, but when the Cache line corresponding to the read operation is the next Cache line to be exported, the content of the line is directly exported.
  • the read operation The Cache is also exported, which speeds up the speed and avoids repeated reading of the Cache content.
  • the second embodiment of the method for establishing a processor cache checkpoint in the embodiment of the present invention may include the following steps:
  • Step 401 When receiving the external input enable signal, proceed to step 403.
  • Step 402 Determine whether all the cache lines have been exported. If yes, the processor Cache checkpoint is established. If no, go to step 403.
  • Step 403 Determine whether there is a read/write operation on the Cache. If yes, go to step 405 or step 408. If no, go to step 404.
  • Step 404 Export the content in the next cache line of the last exported cache line to the storage in the compressor, and return to step 402.
  • Step 405 When a write operation to the Cache is received when the processor writes the Cache signal, it is detected whether the cache line corresponding to the Cache operation of the processor is in the exported part of the Cache. If yes, go to step 406. If no, go to step 407.
  • Step 406 Perform a processor write Cache operation, write the content of the processor write Cache operation into the cache line and store it in the compressor, and return to step 402.
  • Step 407 Perform a processor write Cache operation, suspend the content in the Cache, and return to step 402.
  • Step 408 When the processor reads the Cache signal, that is, when there is a read operation on the Cache, the detection processor reads whether the cache line corresponding to the Cache operation is the next cache line of the previous export cache line, and if yes, proceeds to step 404. If no, go to step 409.
  • Step 409 Perform a processor read Cache operation, suspend the content in the Cache, and return to step 402.
  • the method of the method includes a complete process of establishing a Cache checkpoint.
  • the Cache checkpoint is started, and the current state of the Cache is determined in real time after the operation of any Cache row. What happens to the Cache in the future, until the contents of all the cache lines are exported, the export step is stopped, and a Cache checkpoint establishment process is completed.
  • the export controller allows the data to be saved to the compressor:
  • the processor does not read or write the Cache, that is, the Cache is in an idle state, and the content in the next cache line of the previous exported cache line is exported to the compressor for storage;
  • the processor is in the read Cache operation, and the cache line read at the same time is the same as the next exported Cache line, then the next exported Cache line is the next one of the previous Cache line.
  • the content in the Cache line is exported to the compressor for storage;
  • the processor updates the Cache data, and the updated Cache line is the exported Cache line, and the updated data is simultaneously stored in the compressor for storage.
  • the method for establishing a processor Cache checkpoint in the embodiment of the present invention enables the Cache checkpoint to be established when the processor is in a normal working state.
  • the method for establishing a processor Cache checkpoint in order to implement the embodiment of the present invention may further include an address generator and a comparator in combination with the processor Cache architecture.
  • the address generator may be configured to generate a first address according to the control of the export controller, where the first address may be regarded as a cache line address that is to be exported, and the comparator may be used for a cache address corresponding to the cache write operation of the processor. Comparing the size of the current first address, comparing the size of the cache line address corresponding to the processor read Cache operation with the current first address, and sending the comparison result to the export controller to determine whether the update operation occurs in the exported part. Or whether the address for the read operation is the cache line address to be exported, and further, the export controller determines whether to save the data to the compressor according to the comparison result of the comparator, whether the cache is in an idle state, or the like.
  • the method for establishing a processor cache checkpoint in the embodiment of the present invention may further include:
  • the control address generator generates a first address starting from one end of the Cache line address range.
  • the export controller control address generator starts to generate the first address by the low address end or the high address end of the Cache, where the first address corresponds to The current Cache row address that needs to be exported.
  • the control address generator changes the current first address to the address of the next Cache row address, for example, generates a first address from the lower address end, and after each content of the Cache is exported, the first address The self-increase to the next Cache row address, so that the implementation of exporting the contents of the Cache line to the storage in the compressor may be the Cache line content corresponding to the first address after the change is derived.
  • the process of exporting the content in the Cache row by row may specifically: export the content in the cache line corresponding to the first address to the compressor, and each After exporting a cache line, the address generator is controlled to change the first address to the next cache line address.
  • the specific implementation of detecting that the Cache line corresponding to the processor write Cache operation is in the exported part of the Cache may include:
  • the comparator is configured to compare the size of the cache line address corresponding to the processor write Cache operation with the current first address
  • the comparison result is that the cache line address corresponding to the processor write Cache operation is smaller than the current first address, and the cache line corresponding to the processor write Cache operation is determined to be The exported part of the Cache;
  • the comparison result is that the cache line address corresponding to the processor write cache operation is greater than the current first address, and the cache line corresponding to the processor write cache operation is determined to be The exported portion of the Cache.
  • the address generator from the lower address end of the Cache line address range as an example, if the content of the cache line is exported, the first address is increased to the next one after the Cache line corresponding to the first address is exported. Cache row address, repeat this process, so that the Cache range from the low address of the Cache to the current first address (excluding the current first address) is the exported part, then the Cache row address corresponding to the write operation and the current first address can be determined.
  • the size of the Cache line corresponding to the write operation is smaller than the current first address.
  • the Cache line corresponding to the write operation is in the exported part, and the content written by the write playground to the Cache line needs to be saved to the compressor at the same time.
  • the address generator starts to generate the first address by the high address end of the Cache line address range, if the Cache line address corresponding to the write operation is greater than the current first address, the Cache line corresponding to the write operation is in the exported part.
  • the specific implementation of detecting that the Cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache may include:
  • the comparator is configured to compare the size of the cache line address corresponding to the processor write Cache operation with the current first address
  • the address generator starts generating the first address from the low address end of the Cache line address range, The result is that the cache cache address corresponding to the processor write cache operation is greater than or equal to the current first address, and the cache line corresponding to the processor write cache operation is determined to be in the unexported portion of the cache;
  • the comparison result is that the cache cache address corresponding to the processor write cache operation is less than or equal to the current first address, and the cache corresponding to the processor write cache operation is determined.
  • the line is in the unexported portion of the Cache.
  • the specific implementation that detects that the cache line corresponding to the processor read Cache operation is the next exported Cache line may include:
  • the comparator is further configured to compare the cache line address corresponding to the processor read Cache operation with the current first address size
  • the result of the comparison is that the cache cache address corresponding to the processor read cache operation is equal to the current first address, and the cache line corresponding to the processor read cache operation is determined to be the next exported cache line.
  • the third embodiment of the method for establishing a processor cache checkpoint in the embodiment of the present invention may include the following steps:
  • Step 501 When receiving the external input enable signal, the control address generator starts generating the first address from the low address end of the Cache, and proceeds to step 503.
  • Step 502 Determine whether all cache lines have been exported. If yes, the processor Cache checkpoint is established. If no, go to step 503.
  • Step 503 Determine whether there is a read/write operation on the Cache. If yes, go to step 504. If no, go to step 505.
  • Step 504 Detect the type of the processor read and write Cache operation. If there is a write operation to the Cache, go to step 506. If there is a read operation on the Cache, go to step 507.
  • Step 505 Export the content in the cache line corresponding to the first address to the storage in the compressor, and control the address generator to increase the first address to the next cache line address, and return to step 502.
  • Step 506 Receive a comparison result of the comparator, determine whether the comparison result is that the cache line address corresponding to the processor write Cache operation is smaller than the current first address, and if yes, go to step 508, if no, go to step 509.
  • Step 507 Receive a comparison result of the comparator, determine whether the comparison result is that the cache line address corresponding to the processor read Cache operation is equal to the current first address, and if yes, go to step 505, if no, go to step 510.
  • Step 508 Perform a processor write Cache operation, and write the write operation to the content of the cache line and store it in the compressor for storage, and return to step 502.
  • Step 509 Perform a processor write Cache operation, and suspend the export of the Cache line, and return to step 502.
  • Step 510 Perform a processor read Cache operation, and suspend the export of the Cache line, and return to step 502.
  • the address generator generates the first address from the low address end of the Cache as an example, and describes the specific conditions under which the Cache content is exported and the judgment condition. Further, there is no read/write operation on the Cache. That is, when the Cache is idle, the content in the Cache line corresponding to the first address is exported to the compressor for storage; when the comparison result of the comparator is that the Cache row address corresponding to the read operation is equal to the current first address, the first address corresponds to The content in the Cache line is exported to the compressor for storage; when the comparison result of the comparator is that the Cache row address corresponding to the write operation is smaller than the current first address, the write operation is written to the cache line and stored in the compressor. To achieve the establishment of Cache checkpoints.
  • the address generator starts to generate the first address by the high address end of the Cache, and then the content in the cache line corresponding to the first address is exported to the compressor for storage when there is no read/write operation to the Cache, that is, the Cache is idle.
  • the comparison result of the comparator is that the Cache row address corresponding to the read operation is equal to the current first address
  • the content in the Cache line corresponding to the first address is exported to the compressor for storage;
  • the comparison result of the comparator is the write operation.
  • the write operation is written to the cache line and stored in the compressor for storage to implement the Cache checkpoint.
  • the Cache idle state of the Cache when the Cache idle state of the Cache is read and written, the Cache content is exported to the compressor in a cache.
  • the Cache export process is suspended, but when the Cache update operation occurs when the Cache is written, and the update operation occurs in the exported part of the Cache, the updated data needs to be simultaneously stored in the compressor, thus being exported to the compressor.
  • the data in the cache is the latest data in each cache line, and the established Cache checkpoint is the Cache state at the end of the setup process.
  • the entire Cache checkpoint establishment process when the processor is always in the normal working state, there is no interruption of the establishment of the Cache checkpoint or any operation of the processor is delayed. The process of establishing the Cache checkpoint does not affect the operation of the processor. The normal operation of the system is guaranteed.
  • the embodiment 1 of the device for establishing a processor Cache checkpoint may include:
  • the receiving unit 601 is configured to receive a processor write Cache signal or receive a processor read Cache signal during the process of deriving content in the Cache row by row.
  • the first determining unit 602 is configured to: when the receiving unit receives the processor write Cache signal, detect that the cache line corresponding to the processor write Cache operation is in the exported portion of the Cache.
  • the first processing unit 603 is configured to perform a processor write Cache operation when the first determining unit detects that the Cache line corresponding to the processor write Cache operation is in the exported portion of the Cache.
  • the first deriving unit 604 is configured to: when the first determining unit detects that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, write the content of the write Cache operation into the cache line for export.
  • the second determining unit 605 is configured to: when the receiving unit receives the processor write Cache signal, detect that the cache line corresponding to the processor write Cache operation is in an unexported portion of the Cache.
  • the second processing unit 606 is configured to: when the second determining unit detects that the Cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, perform a processor write Cache operation, and pause to export the content in the Cache.
  • the third processing unit 607 is configured to: when the receiving unit receives the processor read Cache signal, perform a processor read Cache operation, and suspend exporting the content in the Cache.
  • the embodiment of the present invention establishes a processor cache checkpoint
  • the return can include:
  • a third determining unit configured to: when the receiving unit receives the processor read Cache signal, detect that the cache line corresponding to the processor read Cache operation is the next exported Cache line;
  • a fourth processing unit configured to: when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, perform a processor read Cache operation;
  • the second deriving unit is configured to: when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, export the content in the Cache line corresponding to the read Cache operation.
  • the embodiment 2 of the device for establishing a processor Cache checkpoint in the embodiment of the present invention may include:
  • the receiving unit 701 is configured to receive a processor write Cache signal or receive a processor read Cache signal.
  • the first determining unit 702 is configured to determine whether all the Cache lines have been exported. If the judgment result of the first determining unit is that all the Cache lines have been exported, the processor Cache checkpoint is established, if the judgment result of the first determining unit is If the Cache line is not all exported, the second judgment unit is entered to determine whether there is a read/write operation on the Cache.
  • the second determining unit 703 is configured to determine whether there is a read/write operation on the Cache according to whether the processor writes the Cache signal received by the receiving unit or the receiving processor reads the Cache signal.
  • the third deriving unit 704 is configured to: if the judgment result of the second judging unit is that there is no read/write operation on the Cache, export the content in the next cache line of the last exported cache line to the compressor, and enter The first judgment unit.
  • the first determining unit 705 when the receiving unit receives the processor write Cache signal to make the determination result of the second determining unit that there is a write operation to the Cache, detecting that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache .
  • the first processing unit 706 is configured to perform a processor write Cache operation when the first determining unit detects that the Cache line corresponding to the processor write Cache operation is in the exported portion of the Cache.
  • the first deriving unit 707 is configured to: when the first determining unit detects that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, write the content of the write Cache operation into the cache line, and enter the first Judging unit
  • the second determining unit 708 is configured to: when the receiving unit receives the processor write Cache signal, and the determination result of the second determining unit is that there is a write operation to the Cache, detecting that the Cache line corresponding to the processor write Cache operation is in the Cache Export part;
  • the second processing unit 709 is configured to: when the second determining unit detects that the Cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, perform a processor write Cache operation, and pause to export the content in the Cache, and Entering the first judgment unit;
  • the third determining unit 710 is configured to: when the receiving unit receives the processor read Cache signal, and the judgment result of the second determining unit is that there is a read operation on the Cache, detecting that the Cache line corresponding to the processor read Cache operation is the next Exported Cache line;
  • the fourth processing unit 711 is configured to: when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, perform a processor read Cache operation;
  • the second deriving unit 712 is configured to: when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, export the content in the Cache line corresponding to the read Cache operation, and enter The first judgment unit.
  • the fourth determining unit 713 is configured to: when the receiving unit receives the processor read Cache signal to make the determination result of the second determining unit that there is a read operation on the Cache, detecting that the Cache line corresponding to the processor read Cache operation is not the next Exported Cache line;
  • the third processing unit 714 is configured to detect, by the fourth determining unit, that the Cache line corresponding to the processor read Cache operation is not the next exported Cache line, perform a processor read Cache operation, and pause to export the content in the Cache.
  • the apparatus for establishing a processor Cache checkpoint may further include:
  • control unit for controlling the address generator to be generated by one end of the Cache line address range An address.
  • the process of exporting the content in the Cache row by row is specifically: the content in the cache line corresponding to the first address generated by the control unit control address generator is exported to the compressor for storage, and each After exporting a Cache line, the control unit controls the address generator to change the first address to the next Cache line address.
  • the first determining unit may include:
  • a receiving subunit configured to receive a comparison result of the comparator, where the comparator is configured to compare a cache line address corresponding to the processor write Cache operation with a current first address size;
  • a first determining sub-unit configured to: when the address generator starts to generate the first address by the low address end of the Cache line address range, the comparison result received by the receiving sub-unit is that the Cache line address corresponding to the processor write Cache operation is smaller than the current An address, determining that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache;
  • a second determining sub-unit configured to: when the address generator starts generating the first address by the high address end of the Cache line address range, the comparison result received by the receiving sub-unit is that the Cache line address corresponding to the processor write Cache operation is greater than the current An address determines that the cache line corresponding to the processor write Cache operation is in the exported portion of the Cache.
  • the second determining unit may include:
  • a receiving subunit configured to receive a comparison result of the comparator, where the comparator is configured to compare a cache line address corresponding to the processor write Cache operation with a current first address size;
  • a third determining sub-unit configured to: when the address generator starts generating the first address by the low address end of the Cache line address range, the comparison result received by the receiving sub-unit is that the Cache line address corresponding to the processor write Cache operation is greater than or equal to The current first address determines that the cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache;
  • a fourth determining sub-unit configured to: when the address generator starts generating the first address by the high address end of the Cache line address range, the comparison result received by the receiving sub-unit is that the Cache line address corresponding to the processor write Cache operation is less than or equal to The current first address determines the processor write Cache operation corresponding to The Cache line is in the unexported portion of the Cache.
  • the third determining unit may include:
  • a receiving subunit configured to receive a comparison result of the comparator, where the comparator is further configured to compare a cache line address corresponding to the processor read Cache operation with a current first address size;
  • the fifth determining subunit, the comparison result received by the receiving subunit is that the cache line address corresponding to the processor read Cache operation is equal to the current first address, and determining that the cache line corresponding to the processor read Cache operation is the next exported Cache line .
  • the Cache content is exported to the compressor for storage, and the Cache is suspended when the Cache is not idle.
  • the latest data in the line, the established Cache checkpoint is the Cache state at the end of the establishment process.
  • the processor is always in the normal working state, there is no interruption of the establishment of the Cache checkpoint or any operation of the processor is delayed.
  • the process of establishing the Cache checkpoint does not affect the operation of the processor. The normal operation of the system is guaranteed.
  • the embodiment 1 of the system for establishing a processor Cache checkpoint in the embodiment of the present invention may include:
  • the export controller 801 may be an apparatus embodiment for establishing a processor Cache checkpoint as described above.
  • An address generator 802 configured to generate a first address according to control of the export controller
  • the comparator 803 is configured to compare the size of the cache line address corresponding to the processor write cache operation with the current first address, compare the size of the cache line address corresponding to the processor read cache operation with the current first address, and send the comparison result to the Export controller
  • the compressor 804 is configured to store the content of the cache line.
  • the control address generator is controlled by the Cache line.
  • One end of the address range starts to generate a first address, and determines whether there is a read/write operation on the Cache;
  • the content in the cache line corresponding to the first address is exported to the compressor for storage, and the address generator is controlled to change the first address to the next cache line address, and all caches are determined. Whether the line has been exported; if all the Cache lines have been exported, the processor Cache checkpoint is established. If the Cache line is not all exported, continue to determine whether there is a read or write operation to the Cache; Determine the type of read and write operations;
  • the comparison result of the comparator is received, and the comparison result is determined whether the cache line corresponding to the write operation is the exported cache line; if the read and write operation to the Cache is the Cache The read operation receives the comparison result of the comparator, and determines whether the comparison result of the comparator is the cache address corresponding to the read operation equal to the current first address;
  • the comparison result of the comparator is that the cache line corresponding to the write operation is the exported cache line
  • the write operation writes the content of the cache line to the storage in the compressor, and returns to determine whether all the cache lines have been exported;
  • the comparison result of the device is that the cache line corresponding to the write operation is not the exported cache line, suspends the export of the cache line, and returns to determine whether all the cache lines have been exported;
  • the control address generator changes the first address to the next cache line address, it returns to determine whether all the cache lines have been exported; if the comparator The comparison result is that the cache line address corresponding to the read operation is not equal to the current first address, the export of the cache line is suspended, and it is returned to determine whether all the cache lines have been exported.
  • detecting determines that the processor writes the Cache operation correspondingly If the Cache line is in the unexported part of the Cache, the processor writes the Cache operation and pauses the export of the contents of the Cache.
  • the received processor reads the Cache signal, it is determined that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, and then the processor reads the Cache operation, and simultaneously reads the Cache line corresponding to the Cache operation.
  • the content is exported.
  • the detection determines that the Cache line corresponding to the processor read Cache operation is not the next exported Cache line, performs a processor read Cache operation, and suspends exporting the content in the Cache.
  • the system embodiment 2 of the present invention is used to establish a processor Cache checkpoint.
  • the hardware module added in the embodiment of the present invention includes an address generator, a comparator, and Export controllers, compressors, and several selectors.
  • the system when the Dump_enable enable signal is valid, the system enables the Cache checkpoint establishment, starts to establish the Cache checkpoint, and the export controller controls the address generator to start generating the first address (to generate the first address from the low address end as example);
  • the export controller receives the Valid signal sent by the processor access unit (LSQ) to determine whether there is a read/write operation on the Cache;
  • the export controller sends an enable Dump signal to the compressor, and the first address generated by the address generator is selected by the Addr_sel signal as the Cache read/write address, and the first address generated by the address generator is corresponding.
  • the Cache line content is exported to the compressor, and the exported data includes all data such as Tag, Valid, and Data in the Cache line, and then controls the address generator to increase to the next Cache address. If the Cache is still idle, repeat the above process;
  • the export controller When the Valid signal is valid, it means that the Cache is not idle, the export controller invalid Dump signal, and the export process is suspended. However, when the following two conditions are detected, the export controller enables the Dump signal and derives the corresponding data:
  • the comparator Cpr_res signal is received, and when the read/write address Address of the Cache is equal to the first address, the content of the Cache line corresponding to the first address is exported to the compressor for storage;
  • the export controller sends a Dsel signal, selects a data source of the compressor, and when the updated data is stored in the compressor, uses the Dsel signal to control the selection of the ND data stream; when the Cache data is exported to the compressor, Controlling the data stream of the Cache by using the Dsel signal;
  • the function of the LSQ (load store queue) is to cache the memory access operation of the Cache, and the memory access operation is sent to the Cache.
  • the role of the LSQ is to send and receive to the Cache.
  • the command is to enable the corresponding Wr or Rw signal, and when the Wr write enable signal is valid, the write data is sent, and when the Rw read enable signal is valid, the data is read.
  • FSM Finite State Machine
  • LSQ and memory Mem The Full signal is used to indicate whether the compressor storage space is full. If the storage space is full, the new data cannot be stored.
  • the embodiment of the present invention starts from the checkpoint establishment time, when the processor does not have the Cache idle state of the Cache, that is, the Cache idle state, the content in the Cache is exported to the compressor in a row-by-row manner, and is suspended when the Cache is not idle.
  • the Cache export process but when the Cache update operation occurs when the Cache is written, and the update operation occurs in the exported part of the Cache, the updated data needs to be simultaneously stored in the compressor, so that the data exported to the compressor is The latest data in a Cache line, the Cache checkpoint established is the Cache state at the end of the establishment process.
  • the saved Cache checkpoint can quickly restore the state of the Cache, so that the system can recover to the normal operation as soon as possible, avoiding a large number of Cache misses and improving the efficiency of memory access.
  • state migration the state of one processor is migrated to another processor, and the recovery of the Cache state can also enable the processor to quickly restore locality, and can directly obtain the required data from the Cache, thereby improving the efficiency of migration.
  • the Cache checkpoint stores the most recently used data of the processor, which is important for understanding the running of the program and the state of the system, so it can be used for system error detection, error correction, fault recovery and fault diagnosis.
  • RAM random memory Memory
  • ROM read only memory
  • EEPROM electrically programmable ROM
  • EEPly erasable programmable ROM registers
  • hard disk hard disk
  • removable disk CD-ROM

Landscapes

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

Abstract

Disclosed in an embodiment of the present invention are a method, device and system for establishing a processor cache checkpoint to ensure that establishing a cache checkpoint does not affect the operation of the processor, the method comprising: in the process of exporting content line by line, when a signal is received for the processor to write to the cache, determining that a cache line corresponding to the cache write operation belongs to the already exported portion of the cache, executing the cache write operation by the processor, and exporting the content written to the cache line through the cache write operation; when a signal is received for the processor to write to the cache, determining that the cache line corresponding to the cache write operation belongs to the unexported portion of the cache, executing the cache write operation by the processor, and suspending the export of the content from the cache; and when a signal is received for the processor to read from the cache, executing the cache read operation by the processor, and suspending the export of the content from the cache.

Description

一种建立处理器Cache检查点的方法、装置及系统Method, device and system for establishing processor Cache checkpoint
本申请要求于2013年12月9日提交中国专利局、申请号为201310662178.8、发明名称为“一种建立处理器Cache检查点的方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 201310662178.8, entitled "A Method, Apparatus and System for Establishing Processor Cache Checkpoints", filed on December 9, 2013, the entire contents of which is hereby incorporated by reference. This is incorporated herein by reference.
技术领域Technical field
本发明涉及计算机技术领域,具体涉及一种建立处理器Cache检查点的方法、装置及系统。The present invention relates to the field of computer technologies, and in particular, to a method, device and system for establishing a processor Cache checkpoint.
背景技术Background technique
在计算机系统中,处理器高速缓冲存储器(CPU Cache)是用于减少处理器访问内存所需平均时间的部件,其容量远小于内存,但速度却可以接近处理器的频率。同时,某个进程周期性地保存执行程序的状态至稳定存储器,系统在失效后能够根据这些信息得以恢复,每一个被保存的程序状态称为检查点,目前检查点技术广泛用于系统的容错设计中。则Cache检查点就是针对Cache建立的检查点,它保存了某一时刻的整个Cache状态,在故障迁移和状态恢复中,如果可以使用Cache检查点恢复Cache状态,那么处理器就不用初始化Cache,节约了大量的Cache重建时间,加快了系统故障恢复和状态迁移的速度。In computer systems, the processor cache (CPU Cache) is the component used to reduce the average time required for the processor to access memory. Its capacity is much smaller than the memory, but the speed can be close to the processor's frequency. At the same time, a process periodically saves the state of the execution program to the stable memory. After the system fails, the system can recover according to the information. Each saved program state is called a checkpoint. Currently, the checkpoint technology is widely used for fault tolerance of the system. designing. The Cache checkpoint is a checkpoint established for the Cache. It saves the entire Cache state at a certain time. In the fault migration and state recovery, if the Cache checkpoint can be used to restore the Cache state, the processor does not need to initialize the Cache. A large number of Cache rebuild times speed up system recovery and state migration.
在现有技术中,建立Cache检查点的方法,是在处理器工作的过程中,利用Cache的空闲时间导出建立过程开始时刻的Cache状态到压缩器中,从而建立Cache检查点。在Cache检查点建立过程中,如果没有对Cache的更新操作,所有的Cache内容会按照Cache地址顺序依次导出到压缩器中。但是如果有对Cache的更新操作,并且更新操作对应的Cache行中的原有内容尚未导出,就需要暂停处理器操作,将此Cache行原有的内容先导出到压缩器,然后再启动 处理器更新该Cache行,即在需要更新未导出区域的数据时,需要首先保存原有数据,也就需要延迟处理器更新数据的操作,暂停流水线或者暂停访存操作。因此,现有技术建立处理器Cache检查点的方法存在影响处理器运行的情况,影响系统的正常运行。In the prior art, the method for establishing a Cache checkpoint is to use the idle time of the Cache to derive the Cache state of the start time of the process into the compressor during the operation of the processor, thereby establishing a Cache checkpoint. During the Cache checkpoint establishment process, if there is no update operation to the Cache, all Cache contents are sequentially exported to the compressor in the order of the Cache address. However, if there is an update operation on the Cache, and the original content in the Cache line corresponding to the update operation has not been exported, the processor operation needs to be suspended, and the original content of the Cache line is first exported to the compressor, and then started. The processor updates the cache line, that is, when the data of the unexported area needs to be updated, the original data needs to be saved first, and the operation of updating the data by the processor is delayed, the pipeline is suspended, or the memory access operation is suspended. Therefore, the prior art method of establishing a processor Cache checkpoint affects the running of the processor and affects the normal operation of the system.
发明内容Summary of the invention
有鉴于此,本发明实施例的主要目的是提供一种建立处理器Cache检查点的方法、装置及系统,以解决现有技术中建立处理器Cache检查点的方法存在影响处理器运行的情况,影响系统的正常运行的问题。In view of this, the main purpose of the embodiments of the present invention is to provide a method, an apparatus, and a system for establishing a processor Cache checkpoint, so as to solve the problem that the method for establishing a processor Cache checkpoint in the prior art affects the operation of the processor. A problem that affects the normal operation of the system.
为解决上述问题,本发明提供的技术方案如下:In order to solve the above problems, the technical solution provided by the present invention is as follows:
第一方面,本发明提供了一种建立处理器Cache检查点的方法,所述方法包括:In a first aspect, the present invention provides a method for establishing a processor Cache checkpoint, the method comprising:
在将Cache中的内容逐行导出的过程中,当接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分,则执行处理器写Cache操作,并同时将所述写Cache操作写入Cache行中的内容进行导出;In the process of exporting the contents of the Cache row by row, when receiving the processor write Cache signal, detecting that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, performing a processor write Cache operation, and At the same time, the write Cache operation is written into the cache line to be exported;
当接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分,则执行处理器写Cache操作,并暂停将Cache中的内容进行导出;When receiving the processor write Cache signal, detecting that the cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, performing a processor write Cache operation, and suspending the content in the Cache;
当接收到处理器读Cache信号时,执行处理器读Cache操作,并暂停将Cache中的内容进行导出。When receiving the processor read Cache signal, the processor reads the Cache operation and pauses the export of the content in the Cache.
在第一方面的第一种可能的实现方式中,所述方法还包括:In a first possible implementation manner of the first aspect, the method further includes:
当接收到的处理器读Cache信号时,检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行,则执行处理器读Cache操作,并同时将所述读Cache操作对应的Cache行中的内容进行导出。When the received processor reads the Cache signal, it is determined that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, and then the processor reads the Cache operation, and simultaneously performs the Cache corresponding to the read Cache operation. The contents of the line are exported.
结合第一方面或者第一方面的第一种可能的实现方式,在第一方面的第 二种可能的实现方式中,所述方法还包括:In combination with the first aspect or the first possible implementation of the first aspect, in the first aspect In two possible implementation manners, the method further includes:
控制地址生成器由Cache行地址范围的一端开始生成第一地址。The control address generator generates a first address starting from one end of the Cache line address range.
结合第一方面的第二种可能的实现方式,在第三种可能的实现方式中,所述将Cache中的内容逐行导出的过程具体为:将所述第一地址所对应的Cache行中的内容导出到压缩器内存储,每导出一Cache行后则控制所述地址生成器将第一地址变化为下一Cache行地址。With reference to the second possible implementation of the first aspect, in a third possible implementation, the process of exporting the content in the Cache row by row is specifically: the Cache line corresponding to the first address is The content is exported to the compressor for storage. After each cache line is exported, the address generator is controlled to change the first address to the next cache line address.
结合第一方面的第三种可能的实现方式,在第四种可能的实现方式中,所述判断所述写操作对应的Cache行是否是已导出的Cache行,包括:With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner, the determining, by the cache line, that the cache line corresponding to the write operation is an exported cache line includes:
所述检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分,包括:The detecting determines that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, and includes:
接收比较器的比较结果,所述比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;Receiving a comparison result of the comparator, the comparator is configured to compare a cache line address corresponding to the processor write Cache operation with a current first address size;
当所述地址生成器由Cache行地址范围的低地址端开始生成第一地址时,所述比较结果为处理器写Cache操作对应的Cache行地址小于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分;When the address generator starts to generate the first address by the low address end of the Cache line address range, the comparison result is that the cache cache address corresponding to the processor write Cache operation is smaller than the current first address, and the processor write Cache operation is determined to be corresponding. The Cache line is in the exported portion of the Cache;
当所述地址生成器由Cache行地址范围的高地址端开始生成第一地址时,所述比较结果为处理器写Cache操作对应的Cache行地址大于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分。When the address generator starts to generate the first address by the high address end of the Cache line address range, the comparison result is that the Cache line address corresponding to the processor write Cache operation is greater than the current first address, and the processor write Cache operation is determined to be corresponding. The Cache line is in the exported portion of the Cache.
结合第一方面的第三种可能的实现方式,在第五种可能的实现方式中,所述检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分,包括:In conjunction with the third possible implementation of the first aspect, in a fifth possible implementation, the detecting determines that the cache line corresponding to the processor write Cache operation is in an unexported portion of the Cache, and includes:
接收比较器的比较结果,所述比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;Receiving a comparison result of the comparator, the comparator is configured to compare a cache line address corresponding to the processor write Cache operation with a current first address size;
当所述地址生成器由Cache行地址范围的低地址端开始生成第一地址时,所述比较结果为处理器写Cache操作对应的Cache行地址大于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分; When the address generator starts to generate the first address by the low address end of the Cache line address range, the comparison result is that the Cache line address corresponding to the processor write Cache operation is greater than or equal to the current first address, and the processor write Cache is determined. The corresponding Cache line of the operation is in the unexported part of the Cache;
当所述地址生成器由Cache行地址范围的高地址端开始生成第一地址时,所述比较结果为处理器写Cache操作对应的Cache行地址小于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分。When the address generator starts to generate the first address by the high address end of the cache line address range, the comparison result is that the cache cache address corresponding to the processor write cache operation is less than or equal to the current first address, and the processor write cache is determined. The corresponding Cache line is operated in the unexported part of the Cache.
结合第一方面的第三种可能的实现方式,在第六种可能的实现方式中,所述检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行,包括:With reference to the third possible implementation of the first aspect, in a sixth possible implementation, the detecting determines that the cache line corresponding to the processor read Cache operation is the next exported cache line, including:
接收比较器的比较结果,所述比较器还用于比较所述处理器读Cache操作对应的Cache行地址与当前第一地址的大小;Receiving a comparison result of the comparator, the comparator is further configured to compare a cache line address corresponding to the processor read Cache operation with a current first address size;
所述比较结果为处理器读Cache操作对应的Cache行地址等于当前第一地址,确定处理器读Cache操作对应的Cache行是下一被导出的Cache行。The comparison result is that the cache line address corresponding to the processor read Cache operation is equal to the current first address, and the cache line corresponding to the processor read Cache operation is determined to be the next exported cache line.
第二方面,本发明提供了一种建立处理器Cache检查点的装置,所述装置包括:In a second aspect, the present invention provides an apparatus for establishing a processor Cache checkpoint, the apparatus comprising:
接收单元,用于在将Cache中的内容逐行导出的过程中,接收处理器写Cache信号或者接收处理器读Cache信号;a receiving unit, configured to receive a processor write Cache signal or receive a processor read Cache signal during the process of exporting the content in the Cache row by row;
第一确定单元,用于在所述接收单元接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分;a first determining unit, configured to: when the receiving unit receives the processor write Cache signal, detect that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache;
第一处理单元,用于在所述第一确定单元检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分时,执行处理器写Cache操作;a first processing unit, configured to: when the first determining unit detects that the Cache line corresponding to the processor write Cache operation is in the exported part of the Cache, perform a processor write Cache operation;
第一导出单元,用于在所述第一确定单元检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分时,将所述写Cache操作写入Cache行中的内容进行导出;a first deriving unit, configured to: when the first determining unit detects that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, and writes the content of the write Cache operation into the cache line to be exported;
第二确定单元,用于在所述接收单元接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分;a second determining unit, configured to: when the receiving unit receives the processor write Cache signal, detect that the cache line corresponding to the processor write Cache operation is in an unexported portion of the Cache;
第二处理单元,用于在所述第二确定单元检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分时,执行处理器写Cache操作,并暂停将Cache中的内容进行导出; a second processing unit, configured to: when the second determining unit detects that the Cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, perform a processor write Cache operation, and pause to export the content in the Cache;
第三处理单元,用于在所述接收单元接收到处理器读Cache信号时,执行处理器读Cache操作,并暂停将Cache中的内容进行导出。And a third processing unit, configured to: when the receiving unit receives the processor read Cache signal, perform a processor read Cache operation, and suspend exporting the content in the Cache.
在第二方面的第一种可能的实现方式中,所述装置还包括:In a first possible implementation manner of the second aspect, the device further includes:
第三确定单元,用于在所述接收单元接收到处理器读Cache信号时,检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行;a third determining unit, configured to: when the receiving unit receives the processor read Cache signal, detect that the cache line corresponding to the processor read Cache operation is the next exported Cache line;
第四处理单元,用于在所述第三确定单元检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行时,执行处理器读Cache操作;a fourth processing unit, configured to perform a processor read Cache operation when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line;
第二导出单元,用于在所述第三确定单元检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行时,将所述读Cache操作对应的Cache行中的内容进行导出。a second deriving unit, configured to: when the third determining unit detects that the cache line corresponding to the processor read Cache operation is the next exported Cache line, export the content in the Cache line corresponding to the read Cache operation .
结合第二方面或者第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述装置还包括:With reference to the second aspect, or the first possible implementation of the second aspect, in a second possible implementation, the apparatus further includes:
控制单元,用于控制地址生成器由Cache行地址范围的一端开始生成第一地址。The control unit is configured to control the address generator to generate the first address by using one end of the Cache line address range.
结合第二方面的第二种可能的实现方式,在第三种可能的实现方式中,所述将Cache中的内容逐行导出的过程具体为:将所述控制单元控制地址生成器生成的第一地址所对应的Cache行中的内容导出到压缩器内存储,每导出一Cache行后则所述控制单元控制所述地址生成器将第一地址变化为下一Cache行地址。With reference to the second possible implementation of the second aspect, in a third possible implementation, the process of exporting the content in the Cache row by row is specifically: the control unit controls the address generator to generate the first The content in the cache line corresponding to an address is exported to the compressor for storage. After each cache line is exported, the control unit controls the address generator to change the first address to the next cache line address.
结合第二方面的第三种可能的实现方式,在第四种可能的实现方式中,所述第一确定单元包括:In conjunction with the third possible implementation of the second aspect, in a fourth possible implementation, the first determining unit includes:
接收子单元,用于接收比较器的比较结果,所述比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;a receiving subunit, configured to receive a comparison result of the comparator, where the comparator is configured to compare a cache row address corresponding to the processor write Cache operation with a current first address size;
第一确定子单元,用于当所述地址生成器由Cache行地址范围的低地址端开始生成第一地址时,所述接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址小于当前第一地址,确定处理器写Cache操作对应的 Cache行在Cache的已导出部分;a first determining subunit, configured to: when the address generator starts generating the first address by the low address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is smaller than the current first address, and the processor is determined to write the Cache operation. The Cache line is in the exported part of the Cache;
第二确定子单元,用于当所述地址生成器由Cache行地址范围的高地址端开始生成第一地址时,所述接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址大于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分。a second determining subunit, configured to: when the address generator starts generating the first address by the high address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is greater than the current first address, and it is determined that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache.
结合第二方面的第三种可能的实现方式,在第五种可能的实现方式中,所述第二确定单元包括:In conjunction with the third possible implementation of the second aspect, in a fifth possible implementation, the second determining unit includes:
接收子单元,用于接收比较器的比较结果,所述比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;a receiving subunit, configured to receive a comparison result of the comparator, where the comparator is configured to compare a cache row address corresponding to the processor write Cache operation with a current first address size;
第三确定子单元,用于当所述地址生成器由Cache行地址范围的低地址端开始生成第一地址时,所述接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址大于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分;a third determining subunit, configured to: when the address generator starts to generate the first address by the low address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is greater than or equal to the current first address, and the cache line corresponding to the processor write Cache operation is determined to be in the unexported portion of the Cache;
第四确定子单元,用于当所述地址生成器由Cache行地址范围的高地址端开始生成第一地址时,所述接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址小于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分。a fourth determining subunit, configured to: when the address generator starts generating the first address by the high address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is less than or equal to the current first address, and the cache line corresponding to the processor write Cache operation is determined to be in the unexported portion of the Cache.
结合第二方面的第三种可能的实现方式,在第六种可能的实现方式中,所述第三确定单元包括:In conjunction with the third possible implementation of the second aspect, in a sixth possible implementation, the third determining unit includes:
接收子单元,用于接收比较器的比较结果,所述比较器还用于比较所述处理器读Cache操作对应的Cache行地址与当前第一地址的大小;a receiving subunit, configured to receive a comparison result of the comparator, where the comparator is further configured to compare a cache line address corresponding to the processor read Cache operation with a current first address size;
第五确定子单元,用于所述接收子单元接收的比较结果为处理器读Cache操作对应的Cache行地址等于当前第一地址,确定处理器读Cache操作对应的Cache行是下一被导出的Cache行。a fifth determining subunit, wherein the comparison result received by the receiving subunit is that the cache line address corresponding to the processor read Cache operation is equal to the current first address, and determining that the cache line corresponding to the processor read Cache operation is the next exported Cache line.
第三方面,本发明提供了一种建立处理器Cache检查点的系统,所述系统包括: In a third aspect, the present invention provides a system for establishing a processor Cache checkpoint, the system comprising:
导出控制器,是本发明第二方面所述的建立处理器Cache检查点的装置;The export controller is the device for establishing a processor Cache checkpoint according to the second aspect of the present invention;
地址生成器,用于根据所述导出控制器的控制生成第一地址;An address generator, configured to generate a first address according to the control of the export controller;
比较器,用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小,比较所述处理器读Cache操作对应的Cache行地址与当前第一地址的大小,并将比较结果发送给所述导出控制器;a comparator, configured to compare a cache row address corresponding to the processor write cache operation with a current first address, compare a cache row address corresponding to the processor read cache operation with a current first address, and send the comparison result Giving the derived controller;
压缩器,用于存储Cache行的内容。A compressor that stores the contents of the Cache line.
由此可见,本发明实施例具有如下有益效果:It can be seen that the embodiments of the present invention have the following beneficial effects:
本发明实施例在将Cache中的内容逐行导出的过程中,如果检测确定处理器需要写Cache且写Cache操作对应的Cache行在Cache的已导出部分,则执行处理器写Cache操作,并同时将所述写Cache操作写入Cache行中的内容进行导出;如果检测确定处理器需要写Cache且写Cache操作对应的Cache行在Cache的未导出部分,则执行处理器写Cache操作,并暂停将Cache中的内容进行导出;而检测到处理器需要读Cache则执行处理器读Cache操作,并暂停将Cache中的内容进行导出。这样在逐行导出Cache中内容的过程中,在Cache不空闲时,暂停Cache导出过程,当对Cache进行写操作即发生对Cache的更新操作时,且更新操作发生在Cache的已导出部分,更新的数据需要同时存储到压缩器内,这样导出到压缩器中的数据是每一Cache行内的最新数据,建立的Cache检查点是建立过程结束时刻的Cache状态。在整个Cache检查点建立过程中,在处理器一直处于正常工作的状态时,没有因为建立Cache检查点中断或推迟处理器的任何操作,建立Cache检查点的过程不存在影响处理器运行的情况,保证了系统的正常运行。In the process of exporting the content in the Cache row by row, if the detection determines that the processor needs to write the Cache and the Cache line corresponding to the write Cache operation is in the exported part of the Cache, the processor write Cache operation is performed, and at the same time The write cache operation is written to the content in the cache line for export; if the detection determines that the processor needs to write the cache and the cache line corresponding to the write cache operation is in the unexported portion of the cache, the processor write cache operation is performed, and the pause is performed. The content in the Cache is exported; when it is detected that the processor needs to read the Cache, the processor reads the Cache operation, and pauses the content in the Cache to be exported. In the process of exporting the contents of the Cache line by line, when the Cache is not idle, the Cache export process is suspended. When the Cache is updated, the Cache update operation occurs, and the update operation occurs in the exported part of the Cache, and the update is performed. The data needs to be stored in the compressor at the same time, so that the data exported to the compressor is the latest data in each cache line, and the established Cache checkpoint is the Cache state at the end of the establishment process. During the entire Cache checkpoint establishment process, when the processor is always in the normal working state, there is no interruption of the establishment of the Cache checkpoint or any operation of the processor is delayed. The process of establishing the Cache checkpoint does not affect the operation of the processor. The normal operation of the system is guaranteed.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下 面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below, obviously, The drawings in the above description are some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive labor.
图1为现有技术建立处理器Cache检查点的方法的示意图;1 is a schematic diagram of a method for establishing a processor Cache checkpoint in the prior art;
图2为本发明实施例建立处理器Cache检查点的方法实施例一的流程图;2 is a flowchart of Embodiment 1 of a method for establishing a processor Cache checkpoint according to an embodiment of the present invention;
图3为本发明实施例建立处理器Cache检查点的方法实施例的示意图;3 is a schematic diagram of an embodiment of a method for establishing a processor Cache checkpoint according to an embodiment of the present invention;
图4为本发明实施例建立处理器Cache检查点的方法实施例二的流程图;4 is a flowchart of Embodiment 2 of a method for establishing a processor Cache checkpoint according to an embodiment of the present invention;
图5为本发明实施例建立处理器Cache检查点的方法实施例三的流程图;FIG. 5 is a flowchart of Embodiment 3 of a method for establishing a processor Cache checkpoint according to an embodiment of the present invention;
图6为本发明实施例建立处理器Cache检查点的装置实施例一的示意图;FIG. 6 is a schematic diagram of Embodiment 1 of an apparatus for establishing a processor Cache checkpoint according to an embodiment of the present invention;
图7为本发明实施例建立处理器Cache检查点的装置实施例二的示意图;FIG. 7 is a schematic diagram of Embodiment 2 of an apparatus for establishing a processor Cache checkpoint according to an embodiment of the present invention;
图8为本发明实施例建立处理器Cache检查点的系统实施例一的示意图;FIG. 8 is a schematic diagram of Embodiment 1 of a system for establishing a processor Cache checkpoint according to an embodiment of the present invention; FIG.
图9为本发明实施例建立处理器Cache检查点的系统实施例二的结构图。FIG. 9 is a structural diagram of Embodiment 2 of a system for establishing a processor Cache checkpoint according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例所提供的数据处理方法,应用于数据处理系统中,所述数据处理系统中包括操作系统,以及用于执行任务代码的硬件线程资源池,所述操作系统对硬件线程池进行管理;所述硬件线程为用于执行任务代码的物理执行单元,其具体的物理形态可以是芯片或处理器,所述硬件线程池中包括多个硬件线程。The data processing method provided by the embodiment of the present invention is applied to a data processing system, where the data processing system includes an operating system, and a hardware thread resource pool for executing a task code, where the operating system manages the hardware thread pool. The hardware thread is a physical execution unit for executing a task code, and the specific physical form thereof may be a chip or a processor, and the hardware thread pool includes a plurality of hardware threads.
本发明实施例的建立处理器Cache检查点的方法、装置及系统可以适用于CPU Cache的检查点建立。CPU Cache是用于减少处理器访问内存所需平均时间的部件,每个Cache由若干Cache行组成,每个Cache行中又可 以包括索引(Index)、标签(Tag)、若干标志位,如有效位(valid bit)、脏位(dirty bit)、使用位(use bit)等。在处理器看来,Cache可以认为是一个透明部件,通常无法直接干预对缓存的操作,也无法通过软件的方法直接读取Cache的内容。The method, device and system for establishing a processor Cache checkpoint in the embodiment of the present invention can be applied to the checkpoint establishment of the CPU Cache. CPU Cache is a component used to reduce the average time required for the processor to access memory. Each Cache consists of several cache lines, and each cache line can be It includes an index (Index), a tag (Tag), and a number of flag bits, such as a valid bit, a dirty bit, a use bit, and the like. From the processor's point of view, Cache can be considered as a transparent component, usually can not directly interfere with the operation of the cache, and can not directly read the contents of the Cache through the software method.
在大规模系统中,设计越来越复杂,规模越来越大,一些部件出现故障会影响整个系统的运行,甚至整个系统的瘫痪,可靠性问题越来越严峻。为了保障系统的可靠性,可以使用故障恢复技术和状态迁移技术。在故障迁移和状态恢复中,如果可以使用Cache检查点恢复Cache状态,那么处理器就不用初始化Cache,节约了大量的Cache重建时间,加快了系统故障恢复和状态迁移的速度。Cache检查点也可以用于系统的检错,纠错和故障诊断中,辅助系统调试等。In large-scale systems, the design is more and more complex, and the scale is getting bigger and bigger. The failure of some components will affect the operation of the whole system, and even the whole system will be more and more serious. To ensure system reliability, you can use fault recovery technology and state transition technology. In fault migration and state recovery, if the Cache checkpoint can be used to restore the Cache state, the processor does not need to initialize the Cache, which saves a lot of Cache rebuild time and speeds up system fault recovery and state transition. Cache checkpoints can also be used for system error detection, error correction and fault diagnosis, and auxiliary system debugging.
在现有技术中,有一种离线建立Cache检查点的方法,当系统需要建立检查点时,首先暂停处理器的运行,停止流水线,在所有Cache数据都存储到压缩器后,再启动处理器。但是这种方法,需要暂停处理器的正常工作状态,停止流水线,影响了系统的运行,在建立Cache检查点阶段处理器不能执行任何操作,所需时间长,成本高。同时此技术破坏了系统的实时性,对于一些实时系统,暂停以后处理器可能无法再继续正常运行。In the prior art, there is a method for establishing a Cache checkpoint offline. When the system needs to establish a checkpoint, it first suspends the operation of the processor, stops the pipeline, and starts the processor after all the cache data is stored in the compressor. However, this method needs to suspend the normal working state of the processor, stop the pipeline, and affect the operation of the system. The processor cannot perform any operations during the establishment of the Cache checkpoint stage, which takes a long time and is costly. At the same time, this technology destroys the real-time performance of the system. For some real-time systems, the processor may not continue to operate normally after the pause.
因此,在现有技术中,有另一种建立Cache检查点的方法,其主要思想是将导出建立过程开始时刻的Cache状态到压缩器中。参见图1所示,系统从A时刻开始导出Cache的内容到压缩器中,直到B时刻结束,导出的Cache内容为A时刻的Cache状态。在此建立过程中,如果Cache没有数据更新操作,所有的Cache行会按照Cache地址顺序依次导出到压缩器中。但是如果有更新操作,并且更新的Cache行的内容尚未导出,就需要暂停流水线,将此Cache行原有的内容先导出到压缩器,然后再启动流水线,更新该Cache行。否则,更新操作覆盖了原有数据,原有数据无法获得,也就无法导出A时刻的Cache数据。 Therefore, in the prior art, there is another method for establishing a Cache checkpoint, the main idea of which is to derive the Cache state at the start of the setup process into the compressor. As shown in Figure 1, the system derives the contents of the Cache from the time A to the compressor until the end of time B, and the exported Cache content is the Cache state at time A. During this setup process, if the Cache does not have a data update operation, all cache lines are sequentially exported to the compressor in the order of the Cache address. However, if there is an update operation and the content of the updated cache line has not been exported, the pipeline needs to be suspended, the original content of the cache line is first exported to the compressor, and then the pipeline is started, and the cache line is updated. Otherwise, the update operation overwrites the original data, the original data cannot be obtained, and the Cache data at time A cannot be exported.
由此可见,这种现有技术会影响处理器的运行,即在需要更新未导出区域的数据时,需要首先保存原有数据,也就需要延迟处理器更新数据的操作,暂停流水线或者暂停访存操作,使得数据导出时的处理器执行与正常模式不一样,一些操作被推迟,影响了系统的正常运行。It can be seen that the prior art affects the operation of the processor, that is, when the data of the unexported area needs to be updated, the original data needs to be saved first, and the operation of updating the data by the processor is delayed, the pipeline is suspended, or the access is suspended. The operation of the memory makes the execution of the processor at the time of data export different from the normal mode, and some operations are delayed, which affects the normal operation of the system.
因此,在现有技术中建立Cache检查点的方式均会影响处理器的正常运行,为此本发明实施例提供了如下的建立处理器Cache检查点的方法、装置及系统。Therefore, the method for establishing a Cache checkpoint in the prior art affects the normal operation of the processor. For this reason, the embodiment of the present invention provides the following method, device, and system for establishing a processor Cache checkpoint.
参见图2所示,本发明实施例建立处理器Cache检查点的方法实施例一,可以包括以下步骤:As shown in FIG. 2, the first embodiment of the method for establishing a processor cache checkpoint in the embodiment of the present invention may include the following steps:
步骤201:在将Cache中的内容逐行导出的过程中,当接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分,则执行处理器写Cache操作,并同时将所述写Cache操作写入Cache行中的内容进行导出。Step 201: In the process of exporting the content in the Cache row by row, when receiving the processor write Cache signal, detecting that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, executing the processor write Cache The operation is performed, and at the same time, the write cache operation is written to the content in the cache line for export.
本发明实施例建立处理器Cache检查点的方法可以由结合处理器Cache架构新增的导出控制器执行。The method for establishing a processor Cache checkpoint in the embodiment of the present invention may be performed by a new export controller combined with the processor Cache architecture.
在接收到外部输入的使能信号时,可以在不存在对Cache的读写操作即Cache处于空闲状态时,开始按照Cache地址顺序由低至高或者由高至低导出每一行的Cache数据内容到压缩器中,在具体实现中,可以每导出一行返回继续判断是否存在对Cache的读写操作,如果Cache继续空闲,则导出上一导出Cache行的下一Cache行中的内容,即在Cache空闲的状态下逐行导出Cache的内容。When receiving the external input enable signal, the Cache data content of each row can be exported from low to high or high to low according to the Cache address sequence when the Cache is in the idle state without the Cache read and write operation. In the specific implementation, each row of the output may be returned to continue to determine whether there is a read or write operation to the Cache. If the Cache continues to be idle, the content of the next cache line of the previous exported cache line is exported, that is, the Cache is idle. In the state, the contents of the Cache are exported line by line.
在将Cache中的内容逐行导出的过程中,整个Cache就可以被分为两个部分:已导出部分和未导出部分。In the process of exporting the contents of the Cache line by line, the entire Cache can be divided into two parts: the exported part and the unexported part.
其中,每次导出的数据包括该Cache行的所有数据,即Tag、Valid、Dirty、Data信息。Tag信息为标识信息,与Cache行地址,偏移地址结合可以确定该Cache行中的保存的数据的段地址偏移;Valid位是有效位信息,表示该数 据是否有效;Dirty位是脏位信息,在写回策略中,确定该数据是否被更新过;Data信息则为Cache行保存的对应地址的数据内容。The data exported each time includes all data of the cache line, that is, Tag, Valid, Dirty, and Data information. The tag information is identification information, and the Cache row address and the offset address are combined to determine the segment address offset of the saved data in the Cache line; the Valid bit is a valid bit information indicating the number According to whether it is valid; the Dirty bit is dirty bit information, in the writeback strategy, it is determined whether the data has been updated; the Data information is the data content of the corresponding address saved in the Cache line.
压缩器可以使用无损压缩的方法,根据Tag,data信息之间的相关性进行压缩,在Cache行的内容进行存储。The compressor can use the lossless compression method to compress according to the correlation between the tag and data information, and store the content in the cache line.
当接收到处理器写Cache信号时,代表处理器需要执行写Cache操作,写操作即更新操作,是向Cache内写入需要更新的数据。当接收到处理器写Cache信号时,进一步检测确定写操作发生的位置,在确定写操作发生在Cache的已导出部分,写入Cache的数据除了要写入到Cache中之外,还需要同时进行导出存储到压缩器中,When receiving the processor write Cache signal, the representative processor needs to perform a write Cache operation, and the write operation is an update operation, and the data that needs to be updated is written into the Cache. When receiving the processor write Cache signal, further detecting the location where the write operation occurs is determined, and determining that the write operation occurs in the exported portion of the Cache, the data written to the Cache needs to be simultaneously performed in addition to being written into the Cache. Export the storage to the compressor,
步骤202:当接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分,则执行处理器写Cache操作,并暂停将Cache中的内容进行导出。Step 202: When receiving the processor write Cache signal, detecting that the cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, performing a processor write Cache operation, and suspending exporting the content in the Cache.
当检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分,则可以正常执行处理器写Cache操作,并暂停将Cache中的内容进行导出。可以在处理器写Cache操作后继续将Cache中的内容逐行导出的过程。When it is determined that the Cache line corresponding to the processor write Cache operation is in the unexported part of the Cache, the processor write Cache operation may be performed normally, and the content in the Cache is suspended. The process of exporting the contents of the Cache line by line after the processor writes the Cache operation.
步骤203:当接收到处理器读Cache信号时,执行处理器读Cache操作,并暂停将Cache中的内容进行导出。Step 203: When receiving the processor read Cache signal, perform a processor read Cache operation, and pause to export the content in the Cache.
当接收到处理器读Cache信号时,也即处理器需要进行读读Cache操作,则正常执行处理器读Cache操作,并暂停将Cache中的内容进行导出。可以在处理器读Cache操作后继续将Cache中的内容逐行导出的过程。When the processor reads the Cache signal, that is, the processor needs to perform the read Cache operation, the processor reads the Cache operation normally, and pauses the content in the Cache to be exported. The process of exporting the contents of the Cache line by line after the processor reads the Cache operation.
如果全部Cache行已经被导出,则一个处理器Cache检查点建立完成,此时保存在压缩器中的Cache内容是导出结束时刻的Cache中的内容。If all the Cache lines have been exported, a processor Cache checkpoint is established, and the Cache content saved in the compressor is the content in the Cache at the end of the export.
参见图3所示,本发明实施例在建立Cache检查点的过程中Cache会被分为已导出部分和未导出部分,当更新操作发生在已导出部分时,更新的数据同时保存到压缩器中,对处理器更新Cache操作本身没有任何影响,这样本发明实施例中所导出的Cache数据始终为Cache的最新内容,即建立的 Cache检查点为导出结束时刻B时刻的Cache状态,在整个Cache检查点建立过程中,在处理器一直处于正常工作的状态时,没有因为建立Cache检查点中断或推迟处理器的任何操作,建立Cache检查点的过程不存在影响处理器运行的情况,保证了系统的正常运行。As shown in FIG. 3, in the process of establishing a Cache checkpoint, the Cache is divided into an exported part and an unexported part. When an update operation occurs in the exported part, the updated data is simultaneously saved in the compressor. Having no effect on the processor update Cache operation itself, so that the Cache data derived in the embodiment of the present invention is always the latest content of the Cache, that is, the established The Cache checkpoint is the Cache state at the time of the export end time B. During the entire Cache checkpoint establishment process, when the processor is always in the normal working state, no Cache is established because the Cache checkpoint is interrupted or any operation of the processor is delayed. The process of checking points does not affect the operation of the processor, which ensures the normal operation of the system.
在发明的一些实施例中,本发明实施例建立处理器Cache检查点的方法还可以包括:In some embodiments of the present invention, the method for establishing a processor cache checkpoint in the embodiment of the present invention may further include:
当接收到的处理器读Cache信号时,检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行,则执行处理器读Cache操作,并同时将所述读Cache操作对应的Cache行中的内容进行导出。When the received processor reads the Cache signal, it is determined that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, and then the processor reads the Cache operation, and simultaneously performs the Cache corresponding to the read Cache operation. The contents of the line are exported.
也就是说,在对Cache的读写操作为对Cache的读操作时,为了加快导出Cache的速度,在读操作对应的Cache行正好是下一Cache行时,同样对该Cache行中的内容进行导出,也即Cache读操作时原本是需要对Cache导出进行暂停的,但当读操作所对应的Cache行是在下一次即将导出的Cache行时,直接将该行内容导出,在特殊情况下,读操作时也进行了Cache的导出,加快了速度,避免了对Cache内容的重复读取。That is to say, when the read/write operation to the Cache is a read operation on the Cache, in order to speed up the export of the Cache, when the Cache line corresponding to the read operation is exactly the next Cache line, the content in the Cache line is also exported. That is, the Cache read operation originally needs to pause the Cache export, but when the Cache line corresponding to the read operation is the next Cache line to be exported, the content of the line is directly exported. In a special case, the read operation The Cache is also exported, which speeds up the speed and avoids repeated reading of the Cache content.
参见图4所示,本发明实施例建立处理器Cache检查点的方法实施例二,可以包括以下步骤:As shown in FIG. 4, the second embodiment of the method for establishing a processor cache checkpoint in the embodiment of the present invention may include the following steps:
步骤401:在接收外部输入的使能信号时,进入步骤403。Step 401: When receiving the external input enable signal, proceed to step 403.
在接收到外部输入的使能信号时,开始判断是否存在对Cache的读写操作。也即在接收到外部的使能信号时,开始建立处理器Cache检查点的过程。When receiving the enable signal of the external input, it starts to determine whether there is a read or write operation to the Cache. That is, when an external enable signal is received, the process of establishing a processor Cache checkpoint is started.
步骤402:判断全部Cache行是否已经被导出,如果是,建立处理器Cache检查点结束,如果否,进入步骤403。Step 402: Determine whether all the cache lines have been exported. If yes, the processor Cache checkpoint is established. If no, go to step 403.
步骤403:判断是否存在对Cache的读写操作,如果是,进入步骤405或步骤408,如果否,进入步骤404。Step 403: Determine whether there is a read/write operation on the Cache. If yes, go to step 405 or step 408. If no, go to step 404.
步骤404:将上一导出Cache行的下一Cache行中的内容导出到压缩器内存储,并返回步骤402。 Step 404: Export the content in the next cache line of the last exported cache line to the storage in the compressor, and return to step 402.
需要注意的是,在开始判断是否存在对Cache的读写操作后,首次获得不存在对Cache的读写操作的判断结果时,由于还不存在上一导出Cache行,故上一导出Cache行的下一Cache行可以认为就是第一行Cache行。It should be noted that, after starting to determine whether there is a read/write operation to the Cache, the first time to obtain the judgment result of the read/write operation of the Cache, since there is no previous export cache line, the previous cache line is derived. The next Cache line can be thought of as the first line of Cache lines.
步骤405:当接收到处理器写Cache信号即存在对Cache的写操作时,检测处理器写Cache操作对应的Cache行是否在Cache的已导出部分,如果是,进入步骤406,如果否,进入步骤407。Step 405: When a write operation to the Cache is received when the processor writes the Cache signal, it is detected whether the cache line corresponding to the Cache operation of the processor is in the exported part of the Cache. If yes, go to step 406. If no, go to step 407.
步骤406:执行处理器写Cache操作,将处理器写Cache操作写入该Cache行中的内容同时存储到压缩器内存储,并返回步骤402。Step 406: Perform a processor write Cache operation, write the content of the processor write Cache operation into the cache line and store it in the compressor, and return to step 402.
步骤407:执行处理器写Cache操作,暂停将Cache中的内容进行导出,并返回步骤402。Step 407: Perform a processor write Cache operation, suspend the content in the Cache, and return to step 402.
步骤408:当接收到处理器读Cache信号即存在对Cache的读操作时,检测处理器读Cache操作对应的Cache行是否是上一导出Cache行的下一Cache行,如果是,进入步骤404,如果否,进入步骤409。Step 408: When the processor reads the Cache signal, that is, when there is a read operation on the Cache, the detection processor reads whether the cache line corresponding to the Cache operation is the next cache line of the previous export cache line, and if yes, proceeds to step 404. If no, go to step 409.
步骤409:执行处理器读Cache操作,暂停将Cache中的内容进行导出,并返回步骤402。Step 409: Perform a processor read Cache operation, suspend the content in the Cache, and return to step 402.
本方法实施例包括了建立Cache检查点的完整过程,当接收到外部输入的使能信号时,开始Cache检查点的建立,在对任一Cache行进行操作后实时判断Cache的当前状态,以决定后续对Cache进行怎样的操作,直到全部Cache行的内容均被导出后,停止导出步骤,一个Cache检查点建立过程完成。The method of the method includes a complete process of establishing a Cache checkpoint. When receiving an enable signal of an external input, the Cache checkpoint is started, and the current state of the Cache is determined in real time after the operation of any Cache row. What happens to the Cache in the future, until the contents of all the cache lines are exported, the export step is stopped, and a Cache checkpoint establishment process is completed.
具体的,从本方法实施例中可以看出,当开始建立检查点后,如果处理器处于以下三种情况时,则导出控制器允许保存数据至压缩器中:Specifically, it can be seen from the embodiment of the method that after starting to establish the checkpoint, if the processor is in the following three cases, the export controller allows the data to be saved to the compressor:
第一,处理器不读写Cache,即Cache处于空闲状态,将上一导出Cache行的下一Cache行中的内容导出到压缩器内存储;First, the processor does not read or write the Cache, that is, the Cache is in an idle state, and the content in the next cache line of the previous exported cache line is exported to the compressor for storage;
第二,处理器处于读Cache操作,同时读取的Cache行与下一被导出的Cache行相同,则将该下一被导出的Cache行即上一导出Cache行的下一 Cache行中的内容导出到压缩器内存储;Second, the processor is in the read Cache operation, and the cache line read at the same time is the same as the next exported Cache line, then the next exported Cache line is the next one of the previous Cache line. The content in the Cache line is exported to the compressor for storage;
第三,处理器更新Cache数据,同时更新的Cache行是已导出的Cache行,则将更新的数据同时存储到压缩器内存储。Third, the processor updates the Cache data, and the updated Cache line is the exported Cache line, and the updated data is simultaneously stored in the compressor for storage.
这样,本发明实施例建立处理器Cache检查点的方法使处理器在正常工作状态时,依然可以实现Cache检查点的建立。In this way, the method for establishing a processor Cache checkpoint in the embodiment of the present invention enables the Cache checkpoint to be established when the processor is in a normal working state.
在具体应用中,为了实现本发明实施例建立处理器Cache检查点的方法可以结合处理器Cache架构还可以增加地址生成器、比较器。地址生成器可以用于根据所述导出控制器的控制生成第一地址,第一地址可以认为是当前即将需要导出的Cache行地址;比较器可以用于处理器写Cache操作对应的Cache行地址与当前第一地址的大小,比较所述处理器读Cache操作对应的Cache行地址与当前第一地址的大小,,并将比较结果发送给导出控制器,以判断更新操作是否发生在已导出部分,或者读操作对于的地址是否是即将需要导出的Cache行地址,进一步使导出控制器根据比较器的比较结果、Cache是否处于空闲状态等信息决定是否将数据保存到压缩器中。In a specific application, the method for establishing a processor Cache checkpoint in order to implement the embodiment of the present invention may further include an address generator and a comparator in combination with the processor Cache architecture. The address generator may be configured to generate a first address according to the control of the export controller, where the first address may be regarded as a cache line address that is to be exported, and the comparator may be used for a cache address corresponding to the cache write operation of the processor. Comparing the size of the current first address, comparing the size of the cache line address corresponding to the processor read Cache operation with the current first address, and sending the comparison result to the export controller to determine whether the update operation occurs in the exported part. Or whether the address for the read operation is the cache line address to be exported, and further, the export controller determines whether to save the data to the compressor according to the comparison result of the comparator, whether the cache is in an idle state, or the like.
具体的,在发明的一些实施例中,本发明实施例建立处理器Cache检查点的方法还可以包括:Specifically, in some embodiments of the present invention, the method for establishing a processor cache checkpoint in the embodiment of the present invention may further include:
控制地址生成器由Cache行地址范围的一端开始生成第一地址。The control address generator generates a first address starting from one end of the Cache line address range.
即在接收到外部输入的使能信号时,建立处理器Cache检测点开始,导出控制器控制地址生成器由Cache的低地址端或高地址端开始生成第一地址,第一地址对应的即为当前需要导出的Cache行地址。每导出一行Cache的内容,则控制地址生成器将当前第一地址变化为下一Cache行地址的地址,例如从低地址端开始生成第一地址,在每导出一行Cache的内容后,第一地址自增至下一Cache行地址,这样将Cache行中的内容导出到压缩器内存储的实现就可以是导出变化后的第一地址对应的Cache行内容。That is, when the external input enable signal is received, the processor cache detection point is established, and the export controller control address generator starts to generate the first address by the low address end or the high address end of the Cache, where the first address corresponds to The current Cache row address that needs to be exported. Each time the content of the Cache is exported, the control address generator changes the current first address to the address of the next Cache row address, for example, generates a first address from the lower address end, and after each content of the Cache is exported, the first address The self-increase to the next Cache row address, so that the implementation of exporting the contents of the Cache line to the storage in the compressor may be the Cache line content corresponding to the first address after the change is derived.
这样,在本发明的一些实施例中,将Cache中的内容逐行导出的过程具体可以为:将第一地址所对应的Cache行中的内容导出到压缩器内存储,每 导出一Cache行后则控制所述地址生成器将第一地址变化为下一Cache行地址。In this way, in some embodiments of the present invention, the process of exporting the content in the Cache row by row may specifically: export the content in the cache line corresponding to the first address to the compressor, and each After exporting a cache line, the address generator is controlled to change the first address to the next cache line address.
在本发明的一些实施例中,检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分的具体实现可以包括:In some embodiments of the present invention, the specific implementation of detecting that the Cache line corresponding to the processor write Cache operation is in the exported part of the Cache may include:
接收比较器的比较结果,比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;Receiving a comparison result of the comparator, the comparator is configured to compare the size of the cache line address corresponding to the processor write Cache operation with the current first address;
当地址生成器由Cache行地址范围的低地址端开始生成第一地址时,比较结果为处理器写Cache操作对应的Cache行地址小于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分;When the address generator starts to generate the first address by the low address end of the Cache line address range, the comparison result is that the cache line address corresponding to the processor write Cache operation is smaller than the current first address, and the cache line corresponding to the processor write Cache operation is determined to be The exported part of the Cache;
当地址生成器由Cache行地址范围的高地址端开始生成第一地址时,比较结果为处理器写Cache操作对应的Cache行地址大于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分。When the address generator starts to generate the first address by the high address end of the cache line address range, the comparison result is that the cache line address corresponding to the processor write cache operation is greater than the current first address, and the cache line corresponding to the processor write cache operation is determined to be The exported portion of the Cache.
以地址生成器由Cache行地址范围的低地址端开始生成第一地址为例,在符合导出Cache行内容的情况下,将第一地址对应的Cache行导出后,第一地址自增至下一Cache行地址,重复此过程,这样,Cache的低地址到当前第一地址(不包括当前第一地址)的Cache范围就是已导出部分,则可以判断写操作对应的Cache行地址与当前第一地址的大小,写操作对应的Cache行地址小于当前第一地址时,写操作对应的Cache行在已导出部分,该写操场写入该Cache行的内容需要同时保存到压缩器中。当地址生成器由Cache行地址范围的高地址端开始生成第一地址时,则写操作对应的Cache行地址大于当前第一地址时,代表写操作对应的Cache行在已导出部分。Taking the address generator from the lower address end of the Cache line address range as an example, if the content of the cache line is exported, the first address is increased to the next one after the Cache line corresponding to the first address is exported. Cache row address, repeat this process, so that the Cache range from the low address of the Cache to the current first address (excluding the current first address) is the exported part, then the Cache row address corresponding to the write operation and the current first address can be determined. The size of the Cache line corresponding to the write operation is smaller than the current first address. The Cache line corresponding to the write operation is in the exported part, and the content written by the write playground to the Cache line needs to be saved to the compressor at the same time. When the address generator starts to generate the first address by the high address end of the Cache line address range, if the Cache line address corresponding to the write operation is greater than the current first address, the Cache line corresponding to the write operation is in the exported part.
类似的,在本发明的一些实施例中,检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分的具体实现可以包括:Similarly, in some embodiments of the present invention, the specific implementation of detecting that the Cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache may include:
接收比较器的比较结果,比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;Receiving a comparison result of the comparator, the comparator is configured to compare the size of the cache line address corresponding to the processor write Cache operation with the current first address;
当地址生成器由Cache行地址范围的低地址端开始生成第一地址时,比 较结果为处理器写Cache操作对应的Cache行地址大于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分;When the address generator starts generating the first address from the low address end of the Cache line address range, The result is that the cache cache address corresponding to the processor write cache operation is greater than or equal to the current first address, and the cache line corresponding to the processor write cache operation is determined to be in the unexported portion of the cache;
当地址生成器由Cache行地址范围的高地址端开始生成第一地址时,比较结果为处理器写Cache操作对应的Cache行地址小于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分。When the address generator starts to generate the first address by the high address end of the cache line address range, the comparison result is that the cache cache address corresponding to the processor write cache operation is less than or equal to the current first address, and the cache corresponding to the processor write cache operation is determined. The line is in the unexported portion of the Cache.
类似的,在本发明的一些实施例中,检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行的具体实现可以包括:Similarly, in some embodiments of the present invention, the specific implementation that detects that the cache line corresponding to the processor read Cache operation is the next exported Cache line may include:
接收比较器的比较结果,比较器还用于比较处理器读Cache操作对应的Cache行地址与当前第一地址的大小;Receiving the comparison result of the comparator, the comparator is further configured to compare the cache line address corresponding to the processor read Cache operation with the current first address size;
比较结果为处理器读Cache操作对应的Cache行地址等于当前第一地址,确定处理器读Cache操作对应的Cache行是下一被导出的Cache行。The result of the comparison is that the cache cache address corresponding to the processor read cache operation is equal to the current first address, and the cache line corresponding to the processor read cache operation is determined to be the next exported cache line.
参见图5所示,本发明实施例建立处理器Cache检查点的方法实施例三,可以包括以下步骤:As shown in FIG. 5, the third embodiment of the method for establishing a processor cache checkpoint in the embodiment of the present invention may include the following steps:
步骤501:在接收外部输入的使能信号时,控制地址生成器由Cache的低地址端开始生成第一地址,并进入步骤503。Step 501: When receiving the external input enable signal, the control address generator starts generating the first address from the low address end of the Cache, and proceeds to step 503.
步骤502:判断全部Cache行是否已经被导出,如果是,建立处理器Cache检查点结束,如果否,进入步骤503。Step 502: Determine whether all cache lines have been exported. If yes, the processor Cache checkpoint is established. If no, go to step 503.
步骤503:判断是否存在对Cache的读写操作,如果是,进入步骤504,如果否,进入步骤505。Step 503: Determine whether there is a read/write operation on the Cache. If yes, go to step 504. If no, go to step 505.
步骤504:检测处理器读写Cache操作的类型,如果存在对Cache的写操作时,进入步骤506,如果存在对Cache的读操作时,进入步骤507。Step 504: Detect the type of the processor read and write Cache operation. If there is a write operation to the Cache, go to step 506. If there is a read operation on the Cache, go to step 507.
步骤505:将第一地址所对应的Cache行中的内容导出到压缩器内存储,并控制地址生成器将第一地址增加到下一Cache行地址,返回步骤502。Step 505: Export the content in the cache line corresponding to the first address to the storage in the compressor, and control the address generator to increase the first address to the next cache line address, and return to step 502.
步骤506:接收比较器的比较结果,判断比较结果是否为处理器写Cache操作对应的Cache行地址小于当前第一地址,如果是,进入步骤508,如果否,进入步骤509。 Step 506: Receive a comparison result of the comparator, determine whether the comparison result is that the cache line address corresponding to the processor write Cache operation is smaller than the current first address, and if yes, go to step 508, if no, go to step 509.
步骤507:接收比较器的比较结果,判断比较结果是否为处理器读Cache操作对应的Cache行地址等于当前第一地址,如果是,进入步骤505,如果否,进入步骤510。Step 507: Receive a comparison result of the comparator, determine whether the comparison result is that the cache line address corresponding to the processor read Cache operation is equal to the current first address, and if yes, go to step 505, if no, go to step 510.
步骤508:执行处理器写Cache操作,并将写操作写入该Cache行的内容同时存储到压缩器内存储,并返回步骤502。Step 508: Perform a processor write Cache operation, and write the write operation to the content of the cache line and store it in the compressor for storage, and return to step 502.
步骤509:执行处理器写Cache操作,并暂停对Cache行的导出,并返回步骤502。Step 509: Perform a processor write Cache operation, and suspend the export of the Cache line, and return to step 502.
步骤510:执行处理器读Cache操作,并暂停对Cache行的导出,并返回步骤502。Step 510: Perform a processor read Cache operation, and suspend the export of the Cache line, and return to step 502.
本方法实施例以地址生成器由Cache的低地址端开始生成第一地址为例,说明了具体在哪些情况下进行Cache内容的导出以及判断条件,进一步的,在不存在对Cache的读写操作即Cache空闲时将第一地址所对应的Cache行中的内容导出到压缩器内存储;在比较器的比较结果为读操作对应的Cache行地址等于当前第一地址时将第一地址所对应的Cache行中的内容导出到压缩器内存储;在比较器的比较结果为写操作对应的Cache行地址小于当前第一地址时,将写操作写入该Cache行的内容同时存储到压缩器内存储,以实现Cache检查点的建立。In the embodiment of the method, the address generator generates the first address from the low address end of the Cache as an example, and describes the specific conditions under which the Cache content is exported and the judgment condition. Further, there is no read/write operation on the Cache. That is, when the Cache is idle, the content in the Cache line corresponding to the first address is exported to the compressor for storage; when the comparison result of the comparator is that the Cache row address corresponding to the read operation is equal to the current first address, the first address corresponds to The content in the Cache line is exported to the compressor for storage; when the comparison result of the comparator is that the Cache row address corresponding to the write operation is smaller than the current first address, the write operation is written to the cache line and stored in the compressor. To achieve the establishment of Cache checkpoints.
类似的,地址生成器由Cache的高地址端开始生成第一地址,则在不存在对Cache的读写操作即Cache空闲时将第一地址所对应的Cache行中的内容导出到压缩器内存储;在比较器的比较结果为读操作对应的Cache行地址等于当前第一地址时将第一地址所对应的Cache行中的内容导出到压缩器内存储;在比较器的比较结果为写操作对应的Cache行地址大于当前第一地址时,将写操作写入该Cache行的内容同时存储到压缩器内存储,以实现Cache检查点的建立。Similarly, the address generator starts to generate the first address by the high address end of the Cache, and then the content in the cache line corresponding to the first address is exported to the compressor for storage when there is no read/write operation to the Cache, that is, the Cache is idle. When the comparison result of the comparator is that the Cache row address corresponding to the read operation is equal to the current first address, the content in the Cache line corresponding to the first address is exported to the compressor for storage; the comparison result of the comparator is the write operation. When the Cache row address is greater than the current first address, the write operation is written to the cache line and stored in the compressor for storage to implement the Cache checkpoint.
这样,本发明实施例从检查点建立时刻起,在不存在对Cache的读写操作即Cache空闲状态时,逐行导出Cache中的内容到压缩器内存储,在Cache 不空闲时,暂停Cache导出过程,但当对Cache进行写操作即发生Cache更新操作时,且更新操作发生在Cache的已导出部分,更新的数据需要同时存储到压缩器内,这样导出到压缩器中的数据是每一Cache行内的最新数据,建立的Cache检查点是建立过程结束时刻的Cache状态。在整个Cache检查点建立过程中,在处理器一直处于正常工作的状态时,没有因为建立Cache检查点中断或推迟处理器的任何操作,建立Cache检查点的过程不存在影响处理器运行的情况,保证了系统的正常运行。In this way, in the embodiment of the present invention, when the Cache idle state of the Cache is read and written, the Cache content is exported to the compressor in a cache. When not idle, the Cache export process is suspended, but when the Cache update operation occurs when the Cache is written, and the update operation occurs in the exported part of the Cache, the updated data needs to be simultaneously stored in the compressor, thus being exported to the compressor. The data in the cache is the latest data in each cache line, and the established Cache checkpoint is the Cache state at the end of the setup process. During the entire Cache checkpoint establishment process, when the processor is always in the normal working state, there is no interruption of the establishment of the Cache checkpoint or any operation of the processor is delayed. The process of establishing the Cache checkpoint does not affect the operation of the processor. The normal operation of the system is guaranteed.
相应的,参见图6所示,本发明实施例建立处理器Cache检查点的装置实施例一,可以包括:Correspondingly, referring to FIG. 6, the embodiment 1 of the device for establishing a processor Cache checkpoint according to an embodiment of the present invention may include:
接收单元601,用于在将Cache中的内容逐行导出的过程中,接收处理器写Cache信号或者接收处理器读Cache信号。The receiving unit 601 is configured to receive a processor write Cache signal or receive a processor read Cache signal during the process of deriving content in the Cache row by row.
第一确定单元602,用于在接收单元接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分。The first determining unit 602 is configured to: when the receiving unit receives the processor write Cache signal, detect that the cache line corresponding to the processor write Cache operation is in the exported portion of the Cache.
第一处理单元603,用于在第一确定单元检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分时,执行处理器写Cache操作。The first processing unit 603 is configured to perform a processor write Cache operation when the first determining unit detects that the Cache line corresponding to the processor write Cache operation is in the exported portion of the Cache.
第一导出单元604,用于在第一确定单元检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分时,将写Cache操作写入Cache行中的内容进行导出。The first deriving unit 604 is configured to: when the first determining unit detects that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, write the content of the write Cache operation into the cache line for export.
第二确定单元605,用于在接收单元接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分。The second determining unit 605 is configured to: when the receiving unit receives the processor write Cache signal, detect that the cache line corresponding to the processor write Cache operation is in an unexported portion of the Cache.
第二处理单元606,用于在第二确定单元检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分时,执行处理器写Cache操作,并暂停将Cache中的内容进行导出。The second processing unit 606 is configured to: when the second determining unit detects that the Cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, perform a processor write Cache operation, and pause to export the content in the Cache.
第三处理单元607,用于在接收单元接收到处理器读Cache信号时,执行处理器读Cache操作,并暂停将Cache中的内容进行导出。The third processing unit 607 is configured to: when the receiving unit receives the processor read Cache signal, perform a processor read Cache operation, and suspend exporting the content in the Cache.
在本发明的一些实施例中,本发明实施例建立处理器Cache检查点的装 置还可以包括:In some embodiments of the present invention, the embodiment of the present invention establishes a processor cache checkpoint The return can include:
第三确定单元,用于在接收单元接收到处理器读Cache信号时,检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行;a third determining unit, configured to: when the receiving unit receives the processor read Cache signal, detect that the cache line corresponding to the processor read Cache operation is the next exported Cache line;
第四处理单元,用于在第三确定单元检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行时,执行处理器读Cache操作;a fourth processing unit, configured to: when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, perform a processor read Cache operation;
第二导出单元,用于在第三确定单元检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行时,将读Cache操作对应的Cache行中的内容进行导出。The second deriving unit is configured to: when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, export the content in the Cache line corresponding to the read Cache operation.
参见图7所示,本发明实施例建立处理器Cache检查点的装置实施例二,可以包括:As shown in FIG. 7, the embodiment 2 of the device for establishing a processor Cache checkpoint in the embodiment of the present invention may include:
接收单元701,用于接收处理器写Cache信号或者接收处理器读Cache信号。The receiving unit 701 is configured to receive a processor write Cache signal or receive a processor read Cache signal.
第一判断单元702,用于判断是否全部Cache行已经被导出,如果第一判断单元的判断结果为全部Cache行已经被导出,则建立处理器Cache检查点结束,如果第一判断单元的判断结果为Cache行没有被全部导出,则进入第二判断单元判断是否存在对Cache的读写操作。The first determining unit 702 is configured to determine whether all the Cache lines have been exported. If the judgment result of the first determining unit is that all the Cache lines have been exported, the processor Cache checkpoint is established, if the judgment result of the first determining unit is If the Cache line is not all exported, the second judgment unit is entered to determine whether there is a read/write operation on the Cache.
第二判断单元703,用于根据是否接收单元接收到的处理器写Cache信号或者接收处理器读Cache信号判断是否存在对Cache的读写操作。The second determining unit 703 is configured to determine whether there is a read/write operation on the Cache according to whether the processor writes the Cache signal received by the receiving unit or the receiving processor reads the Cache signal.
第三导出单元704,用于如果第二判断单元的判断结果为不存在对Cache的读写操作时,将上一导出Cache行的下一Cache行中的内容导出到压缩器内存储,并进入第一判断单元。The third deriving unit 704 is configured to: if the judgment result of the second judging unit is that there is no read/write operation on the Cache, export the content in the next cache line of the last exported cache line to the compressor, and enter The first judgment unit.
第一确定单元705,在接收单元接收到处理器写Cache信号使第二判断单元的判断结果为存在对Cache的写操作时,检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分。The first determining unit 705, when the receiving unit receives the processor write Cache signal to make the determination result of the second determining unit that there is a write operation to the Cache, detecting that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache .
第一处理单元706,用于在第一确定单元检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分时,执行处理器写Cache操作。 The first processing unit 706 is configured to perform a processor write Cache operation when the first determining unit detects that the Cache line corresponding to the processor write Cache operation is in the exported portion of the Cache.
第一导出单元707,用于在第一确定单元检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分时,将写Cache操作写入Cache行中的内容进行导出,并进入第一判断单元;The first deriving unit 707 is configured to: when the first determining unit detects that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, write the content of the write Cache operation into the cache line, and enter the first Judging unit
第二确定单元708,用于在接收单元接收到处理器写Cache信号使第二判断单元的判断结果为存在对Cache的写操作时,检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分;The second determining unit 708 is configured to: when the receiving unit receives the processor write Cache signal, and the determination result of the second determining unit is that there is a write operation to the Cache, detecting that the Cache line corresponding to the processor write Cache operation is in the Cache Export part;
第二处理单元709,用于在第二确定单元检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分时,执行处理器写Cache操作,并暂停将Cache中的内容进行导出,并进入第一判断单元;The second processing unit 709 is configured to: when the second determining unit detects that the Cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, perform a processor write Cache operation, and pause to export the content in the Cache, and Entering the first judgment unit;
第三确定单元710,用于在接收单元接收到处理器读Cache信号使第二判断单元的判断结果为存在对Cache的读操作时,检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行;The third determining unit 710 is configured to: when the receiving unit receives the processor read Cache signal, and the judgment result of the second determining unit is that there is a read operation on the Cache, detecting that the Cache line corresponding to the processor read Cache operation is the next Exported Cache line;
第四处理单元711,用于在第三确定单元检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行时,执行处理器读Cache操作;The fourth processing unit 711 is configured to: when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, perform a processor read Cache operation;
第二导出单元712,用于在第三确定单元检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行时,将读Cache操作对应的Cache行中的内容进行导出,并进入第一判断单元。The second deriving unit 712 is configured to: when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, export the content in the Cache line corresponding to the read Cache operation, and enter The first judgment unit.
第四确定单元713,用于在接收单元接收到处理器读Cache信号使第二判断单元的判断结果为存在对Cache的读操作时,检测确定处理器读Cache操作对应的Cache行不是下一被导出的Cache行;The fourth determining unit 713 is configured to: when the receiving unit receives the processor read Cache signal to make the determination result of the second determining unit that there is a read operation on the Cache, detecting that the Cache line corresponding to the processor read Cache operation is not the next Exported Cache line;
第三处理单元714,用于第四确定单元检测确定处理器读Cache操作对应的Cache行不是下一被导出的Cache行,执行处理器读Cache操作,暂停将Cache中的内容进行导出。The third processing unit 714 is configured to detect, by the fourth determining unit, that the Cache line corresponding to the processor read Cache operation is not the next exported Cache line, perform a processor read Cache operation, and pause to export the content in the Cache.
在本发明的一些实施例中,本发明实施例建立处理器Cache检查点的装置还可以包括:In some embodiments of the present invention, the apparatus for establishing a processor Cache checkpoint may further include:
控制单元,用于控制地址生成器由Cache行地址范围的一端开始生成第 一地址。a control unit for controlling the address generator to be generated by one end of the Cache line address range An address.
在本发明的一些实施例中,将Cache中的内容逐行导出的过程具体为:将控制单元控制地址生成器生成的第一地址所对应的Cache行中的内容导出到压缩器内存储,每导出一Cache行后则控制单元控制地址生成器将第一地址变化为下一Cache行地址。In some embodiments of the present invention, the process of exporting the content in the Cache row by row is specifically: the content in the cache line corresponding to the first address generated by the control unit control address generator is exported to the compressor for storage, and each After exporting a Cache line, the control unit controls the address generator to change the first address to the next Cache line address.
在本发明的一些实施例中,第一确定单元可以包括:In some embodiments of the present invention, the first determining unit may include:
接收子单元,用于接收比较器的比较结果,比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;a receiving subunit, configured to receive a comparison result of the comparator, where the comparator is configured to compare a cache line address corresponding to the processor write Cache operation with a current first address size;
第一确定子单元,用于当地址生成器由Cache行地址范围的低地址端开始生成第一地址时,接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址小于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分;a first determining sub-unit, configured to: when the address generator starts to generate the first address by the low address end of the Cache line address range, the comparison result received by the receiving sub-unit is that the Cache line address corresponding to the processor write Cache operation is smaller than the current An address, determining that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache;
第二确定子单元,用于当地址生成器由Cache行地址范围的高地址端开始生成第一地址时,接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址大于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分。a second determining sub-unit, configured to: when the address generator starts generating the first address by the high address end of the Cache line address range, the comparison result received by the receiving sub-unit is that the Cache line address corresponding to the processor write Cache operation is greater than the current An address determines that the cache line corresponding to the processor write Cache operation is in the exported portion of the Cache.
在本发明的一些实施例中,第二确定单元可以包括:In some embodiments of the present invention, the second determining unit may include:
接收子单元,用于接收比较器的比较结果,比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;a receiving subunit, configured to receive a comparison result of the comparator, where the comparator is configured to compare a cache line address corresponding to the processor write Cache operation with a current first address size;
第三确定子单元,用于当地址生成器由Cache行地址范围的低地址端开始生成第一地址时,接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址大于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分;a third determining sub-unit, configured to: when the address generator starts generating the first address by the low address end of the Cache line address range, the comparison result received by the receiving sub-unit is that the Cache line address corresponding to the processor write Cache operation is greater than or equal to The current first address determines that the cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache;
第四确定子单元,用于当地址生成器由Cache行地址范围的高地址端开始生成第一地址时,接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址小于或等于当前第一地址,确定处理器写Cache操作对应 的Cache行在Cache的未导出部分。a fourth determining sub-unit, configured to: when the address generator starts generating the first address by the high address end of the Cache line address range, the comparison result received by the receiving sub-unit is that the Cache line address corresponding to the processor write Cache operation is less than or equal to The current first address determines the processor write Cache operation corresponding to The Cache line is in the unexported portion of the Cache.
在本发明的一些实施例中,第三确定单元可以包括:In some embodiments of the present invention, the third determining unit may include:
接收子单元,用于接收比较器的比较结果,比较器还用于比较处理器读Cache操作对应的Cache行地址与当前第一地址的大小;a receiving subunit, configured to receive a comparison result of the comparator, where the comparator is further configured to compare a cache line address corresponding to the processor read Cache operation with a current first address size;
第五确定子单元,用于接收子单元接收的比较结果为处理器读Cache操作对应的Cache行地址等于当前第一地址,确定处理器读Cache操作对应的Cache行是下一被导出的Cache行。The fifth determining subunit, the comparison result received by the receiving subunit is that the cache line address corresponding to the processor read Cache operation is equal to the current first address, and determining that the cache line corresponding to the processor read Cache operation is the next exported Cache line .
这样,本发明实施例从检查点建立时刻起,在不存在对Cache的读写操作即Cache空闲状态时,逐行导出Cache中的内容到压缩器内存储,在Cache不空闲时,暂停Cache导出过程,但当对Cache进行写操作即发生Cache更新操作时,且更新操作发生在Cache的已导出部分,更新的数据需要同时存储到压缩器内,这样导出到压缩器中的数据是每一Cache行内的最新数据,建立的Cache检查点是建立过程结束时刻的Cache状态。在整个Cache检查点建立过程中,在处理器一直处于正常工作的状态时,没有因为建立Cache检查点中断或推迟处理器的任何操作,建立Cache检查点的过程不存在影响处理器运行的情况,保证了系统的正常运行。In this way, in the embodiment of the present invention, when there is no Cache idle state for the Cache read/write operation, the Cache content is exported to the compressor for storage, and the Cache is suspended when the Cache is not idle. The process, but when the Cache is written, the Cache update operation occurs, and the update operation occurs in the exported part of the Cache, and the updated data needs to be stored in the compressor at the same time, so that the data exported to the compressor is each Cache. The latest data in the line, the established Cache checkpoint is the Cache state at the end of the establishment process. During the entire Cache checkpoint establishment process, when the processor is always in the normal working state, there is no interruption of the establishment of the Cache checkpoint or any operation of the processor is delayed. The process of establishing the Cache checkpoint does not affect the operation of the processor. The normal operation of the system is guaranteed.
相应的,参见图8所示,本发明实施例建立处理器Cache检查点的系统实施例一,可以包括:Correspondingly, referring to FIG. 8, the embodiment 1 of the system for establishing a processor Cache checkpoint in the embodiment of the present invention may include:
导出控制器801,可以是上述的建立处理器Cache检查点的装置实施例。The export controller 801 may be an apparatus embodiment for establishing a processor Cache checkpoint as described above.
地址生成器802,用于根据导出控制器的控制生成第一地址;An address generator 802, configured to generate a first address according to control of the export controller;
比较器803,用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小,比较处理器读Cache操作对应的Cache行地址与当前第一地址的大小,并将比较结果发送给导出控制器;The comparator 803 is configured to compare the size of the cache line address corresponding to the processor write cache operation with the current first address, compare the size of the cache line address corresponding to the processor read cache operation with the current first address, and send the comparison result to the Export controller
压缩器804,用于存储Cache行的内容。The compressor 804 is configured to store the content of the cache line.
本系统实施例的工作原理是:The working principle of the embodiment of the system is:
导出控制器在接收外部输入的使能信号时,控制地址生成器由Cache行 地址范围的一端开始生成第一地址,并判断是否存在对Cache的读写操作;When the export controller receives the enable signal of the external input, the control address generator is controlled by the Cache line. One end of the address range starts to generate a first address, and determines whether there is a read/write operation on the Cache;
如果不存在对Cache的读写操作时,将第一地址所对应的Cache行中的内容导出到压缩器内存储,并控制地址生成器将第一地址变化为下一Cache行地址,判断全部Cache行是否已经被导出;如果全部Cache行已经被导出,则建立处理器Cache检查点结束,如果Cache行没有被全部导出,继续判断是否存在对Cache的读写操作;如果存在对Cache的读写操作时,判断读写操作的类型;If there is no read or write operation to the Cache, the content in the cache line corresponding to the first address is exported to the compressor for storage, and the address generator is controlled to change the first address to the next cache line address, and all caches are determined. Whether the line has been exported; if all the Cache lines have been exported, the processor Cache checkpoint is established. If the Cache line is not all exported, continue to determine whether there is a read or write operation to the Cache; Determine the type of read and write operations;
如果对Cache的读写操作为对Cache的写操作,接收比较器的比较结果,判断比较结果是否为写操作对应的Cache行是已导出的Cache行;如果对Cache的读写操作为对Cache的读操作,接收比较器的比较结果,判断比较器的比较结果是否为读操作对应的Cache行地址等于当前第一地址;If the read/write operation on the Cache is a write operation to the Cache, the comparison result of the comparator is received, and the comparison result is determined whether the cache line corresponding to the write operation is the exported cache line; if the read and write operation to the Cache is the Cache The read operation receives the comparison result of the comparator, and determines whether the comparison result of the comparator is the cache address corresponding to the read operation equal to the current first address;
如果比较器的比较结果为写操作对应的Cache行是已导出的Cache行,将写操作写入该Cache行的内容同时存储到压缩器内存储,返回判断全部Cache行是否已经被导出;如果比较器的比较结果为写操作对应的Cache行不是已导出的Cache行,暂停对Cache行的导出,返回判断全部Cache行是否已经被导出;If the comparison result of the comparator is that the cache line corresponding to the write operation is the exported cache line, the write operation writes the content of the cache line to the storage in the compressor, and returns to determine whether all the cache lines have been exported; The comparison result of the device is that the cache line corresponding to the write operation is not the exported cache line, suspends the export of the cache line, and returns to determine whether all the cache lines have been exported;
如果比较器的比较结果为读操作对应的Cache行地址等于当前第一地址,并控制地址生成器将第一地址变化为下一Cache行地址,返回判断全部Cache行是否已经被导出;如果比较器的比较结果为读操作对应的Cache行地址不等于当前第一地址,暂停对Cache行的导出,返回判断全部Cache行是否已经被导出。If the comparison result of the comparator is that the cache line address corresponding to the read operation is equal to the current first address, and the control address generator changes the first address to the next cache line address, it returns to determine whether all the cache lines have been exported; if the comparator The comparison result is that the cache line address corresponding to the read operation is not equal to the current first address, the export of the cache line is suspended, and it is returned to determine whether all the cache lines have been exported.
也就是说,在将Cache中的内容逐行导出的过程中,当接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分,则执行处理器写Cache操作,并同时将写Cache操作写入Cache行中的内容进行导出。That is, in the process of exporting the content in the Cache row by row, when receiving the processor write Cache signal, detecting that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, performing processor write Cache operation, and at the same time write the write Cache operation to the contents of the Cache line for export.
当接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的 Cache行在Cache的未导出部分,则执行处理器写Cache操作,并暂停将Cache中的内容进行导出。When receiving the processor write Cache signal, detecting determines that the processor writes the Cache operation correspondingly If the Cache line is in the unexported part of the Cache, the processor writes the Cache operation and pauses the export of the contents of the Cache.
当接收到的处理器读Cache信号时,检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行,则执行处理器读Cache操作,并同时将读Cache操作对应的Cache行中的内容进行导出。When the received processor reads the Cache signal, it is determined that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, and then the processor reads the Cache operation, and simultaneously reads the Cache line corresponding to the Cache operation. The content is exported.
当接收到处理器读Cache信号时,检测确定处理器读Cache操作对应的Cache行不是下一被导出的Cache行,执行处理器读Cache操作,并暂停将Cache中的内容进行导出。When receiving the processor read Cache signal, the detection determines that the Cache line corresponding to the processor read Cache operation is not the next exported Cache line, performs a processor read Cache operation, and suspends exporting the content in the Cache.
这样,可以实现将导出结束时刻的Cache状态导出到压缩器中存储。In this way, the Cache state at the end of the export can be exported to the compressor for storage.
参见图9所示,是本发明实施例建立处理器Cache检查点的系统实施例二,在实际应用中,结合具体的Cache结构,本发明实施例增加的硬件模块包括地址生成器、比较器、导出控制器、压缩器以及若干个选择器。As shown in FIG. 9 , the system embodiment 2 of the present invention is used to establish a processor Cache checkpoint. In an actual application, in combination with a specific Cache structure, the hardware module added in the embodiment of the present invention includes an address generator, a comparator, and Export controllers, compressors, and several selectors.
在实际应用中,当Dump_enable使能信号有效,系统使能了Cache检查点建立,开始建立Cache检查点,导出控制器控制地址生成器开始生成第一地址(以从低地址端生成第一地址为例);In the actual application, when the Dump_enable enable signal is valid, the system enables the Cache checkpoint establishment, starts to establish the Cache checkpoint, and the export controller controls the address generator to start generating the first address (to generate the first address from the low address end as example);
导出控制器接收处理器访存单元(LSQ)发出的Valid信号,判断是否存在对Cache的读写操作;The export controller receives the Valid signal sent by the processor access unit (LSQ) to determine whether there is a read/write operation on the Cache;
当Valid信号无效时,代表Cache空闲,导出控制器向压缩器发送使能Dump信号,通过Addr_sel信号选择地址生成器生成的第一地址作为Cache读写地址,将地址生成器生成的第一地址对应的Cache行内容导出到压缩器,导出数据包括该Cache行内的Tag、Valid、Data等全部数据,然后控制地址生成器自增到下一Cache地址。如果Cache仍空闲,重复上述过程;When the Valid signal is invalid, the Cache is idle, the export controller sends an enable Dump signal to the compressor, and the first address generated by the address generator is selected by the Addr_sel signal as the Cache read/write address, and the first address generated by the address generator is corresponding. The Cache line content is exported to the compressor, and the exported data includes all data such as Tag, Valid, and Data in the Cache line, and then controls the address generator to increase to the next Cache address. If the Cache is still idle, repeat the above process;
当Valid信号有效时,代表Cache不空闲,导出控制器无效Dump信号,暂停导出过程。但当检测到以下两种情况发生时,导出控制器使能Dump信号,导出相应数据:When the Valid signal is valid, it means that the Cache is not idle, the export controller invalid Dump signal, and the export process is suspended. However, when the following two conditions are detected, the export controller enables the Dump signal and derives the corresponding data:
第一,接收LSQ发送的写信号Wr或者读信号Rw,以判断读写操作的 类型,当为处理器更新已导出部分的Cache时,即Wr信号有效,同时接收比较器Cpr_res信号,当第一地址小于Cache的读写地址Address时,同时将更新的数据导出到压缩器中;First, receiving the write signal Wr or the read signal Rw sent by the LSQ to determine the read/write operation Type, when the Cache of the exported part is updated for the processor, that is, the Wr signal is valid, and the comparator Cpr_res signal is received, and when the first address is smaller than the read/write address Address of the Cache, the updated data is simultaneously exported to the compressor;
第二,当为读操作时,接收比较器Cpr_res信号,当Cache的读写地址Address等于第一地址时,将第一地址对应的Cache行内容导出到压缩器内存储;Secondly, when it is a read operation, the comparator Cpr_res signal is received, and when the read/write address Address of the Cache is equal to the first address, the content of the Cache line corresponding to the first address is exported to the compressor for storage;
具体的,导出控制器发出Dsel信号,选择压缩器的数据来源,当将更新的数据存储到压缩器中时,利用Dsel信号控制选择ND数据流;当将Cache的数据导出到压缩器中时,利用Dsel信号控制选择Cache的数据流;Specifically, the export controller sends a Dsel signal, selects a data source of the compressor, and when the updated data is stored in the compressor, uses the Dsel signal to control the selection of the ND data stream; when the Cache data is exported to the compressor, Controlling the data stream of the Cache by using the Dsel signal;
当地址生成器达到地址最大值时,导出结束,Cache此时刻的状态全部存储在压缩器中,一个Cache检查点建立过程完成。When the address generator reaches the address maximum value, the export ends, and the state of the Cache at this time is all stored in the compressor, and a Cache checkpoint establishment process is completed.
其中,LSQ(load store queue,访存队列)其作用就是缓存处理器对于Cache的访存操作,并将访存操作发送到Cache,在本发明实施例中,LSQ的作用是向Cache发送读写命令,以使能相应的Wr或Rw信号,在Wr写使能信号有效时,送入写数据,在Rw读使能信号有效时,读出数据。The function of the LSQ (load store queue) is to cache the memory access operation of the Cache, and the memory access operation is sent to the Cache. In the embodiment of the present invention, the role of the LSQ is to send and receive to the Cache. The command is to enable the corresponding Wr or Rw signal, and when the Wr write enable signal is valid, the write data is sent, and when the Rw read enable signal is valid, the data is read.
另外,FSM(Finite State Machine,有限状态机),其相当于Cache的控制器模块,用于生成各种Cache控制信号,并与其它模块(LSQ和内存Mem)进行交互。Full信号用于标示压缩器存储空间是否已满,如果存储空间已满,则不能继续存储新数据。In addition, FSM (Finite State Machine), which is equivalent to the controller module of the Cache, is used to generate various Cache control signals and interact with other modules (LSQ and memory Mem). The Full signal is used to indicate whether the compressor storage space is full. If the storage space is full, the new data cannot be stored.
这样,本发明实施例从检查点建立时刻起,在处理器不存在对Cache的读写操作即Cache空闲状态时,逐行导出Cache中的内容到压缩器内存储,在Cache不空闲时,暂停Cache导出过程,但当对Cache进行写操作即发生Cache更新操作时,且更新操作发生在Cache的已导出部分,更新的数据需要同时存储到压缩器内,这样导出到压缩器中的数据是每一Cache行内的最新数据,建立的Cache检查点是建立过程结束时刻的Cache状态。在整个Cache检查点建立过程中,在处理器一直处于正常工作的状态时,没有因为 建立Cache检查点中断或推迟处理器的任何操作,建立Cache检查点的过程不存在影响处理器运行的情况,保证了系统的正常运行。In this way, the embodiment of the present invention starts from the checkpoint establishment time, when the processor does not have the Cache idle state of the Cache, that is, the Cache idle state, the content in the Cache is exported to the compressor in a row-by-row manner, and is suspended when the Cache is not idle. The Cache export process, but when the Cache update operation occurs when the Cache is written, and the update operation occurs in the exported part of the Cache, the updated data needs to be simultaneously stored in the compressor, so that the data exported to the compressor is The latest data in a Cache line, the Cache checkpoint established is the Cache state at the end of the establishment process. During the entire Cache checkpoint establishment process, when the processor is always in a working state, there is no reason Establishing a Cache checkpoint interrupt or deferring any operation of the processor, the process of establishing a Cache checkpoint does not affect the operation of the processor, ensuring the normal operation of the system.
同时,当系统发生故障(例如软错误)后,需要进行故障恢复,回滚到上一个无故障的检查点。保存的Cache检查点可以快速的恢复Cache的状态,使得系统能够最快的恢复到正常运行,避免发生大量的Cache miss,提高访存效率。同样在状态迁移,即将一个处理器的状态迁移到另一个处理器,Cache状态的恢复也可以使处理器快速的恢复局部性,能够直接从Cache中获得所需数据,提高了迁移的效率。At the same time, after a system failure (such as a soft error), it is necessary to recover from the failure and roll back to the last trouble-free checkpoint. The saved Cache checkpoint can quickly restore the state of the Cache, so that the system can recover to the normal operation as soon as possible, avoiding a large number of Cache misses and improving the efficiency of memory access. Also in state migration, the state of one processor is migrated to another processor, and the recovery of the Cache state can also enable the processor to quickly restore locality, and can directly obtain the required data from the Cache, thereby improving the efficiency of migration.
Cache检查点中保存了处理器最近使用的数据,这些数据对于了解程序的运行和系统的状态都很重要,因此可用于系统的检错,纠错,故障恢复和故障诊断。The Cache checkpoint stores the most recently used data of the processor, which is important for understanding the running of the program and the state of the system, so it can be used for system error detection, error correction, fault recovery and fault diagnosis.
需要说明的是,本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统或装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。It should be noted that the various embodiments in the present specification are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same similar parts between the various embodiments may be referred to each other. For the system or 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 context, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying such entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存 储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented directly in hardware, a software module executed by a processor, or a combination of both. Software modules can be placed in random memory Memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form known in the art In the storage medium.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。 The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments are obvious 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 invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but the scope of the invention is to be accorded

Claims (15)

  1. 一种建立处理器Cache检查点的方法,其特征在于,所述方法包括:A method for establishing a processor Cache checkpoint, the method comprising:
    在将Cache中的内容逐行导出的过程中,当接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分,则执行处理器写Cache操作,并同时将所述写Cache操作写入Cache行中的内容进行导出;In the process of exporting the contents of the Cache row by row, when receiving the processor write Cache signal, detecting that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, performing a processor write Cache operation, and At the same time, the write Cache operation is written into the cache line to be exported;
    当接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分,则执行处理器写Cache操作,并暂停将Cache中的内容进行导出;When receiving the processor write Cache signal, detecting that the cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, performing a processor write Cache operation, and suspending the content in the Cache;
    当接收到处理器读Cache信号时,执行处理器读Cache操作,并暂停将Cache中的内容进行导出。When receiving the processor read Cache signal, the processor reads the Cache operation and pauses the export of the content in the Cache.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    当接收到的处理器读Cache信号时,检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行,则执行处理器读Cache操作,并同时将所述读Cache操作对应的Cache行中的内容进行导出。When the received processor reads the Cache signal, it is determined that the Cache line corresponding to the processor read Cache operation is the next exported Cache line, and then the processor reads the Cache operation, and simultaneously performs the Cache corresponding to the read Cache operation. The contents of the line are exported.
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, wherein the method further comprises:
    控制地址生成器由Cache行地址范围的一端开始生成第一地址。The control address generator generates a first address starting from one end of the Cache line address range.
  4. 根据权利要求3所述的方法,其特征在于,所述将Cache中的内容逐行导出的过程具体为:将所述第一地址所对应的Cache行中的内容导出到压缩器内存储,每导出一Cache行后则控制所述地址生成器将第一地址变化为下一Cache行地址。The method according to claim 3, wherein the process of exporting the content in the Cache row by row is specifically: exporting the content in the cache line corresponding to the first address to the compressor for storage, each After exporting a cache line, the address generator is controlled to change the first address to the next cache line address.
  5. 根据权利要求4所述的方法,其特征在于,所述检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分,包括:The method according to claim 4, wherein the detecting determines that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, and includes:
    接收比较器的比较结果,所述比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;Receiving a comparison result of the comparator, the comparator is configured to compare a cache line address corresponding to the processor write Cache operation with a current first address size;
    当所述地址生成器由Cache行地址范围的低地址端开始生成第一地址 时,所述比较结果为处理器写Cache操作对应的Cache行地址小于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分;Generating the first address when the address generator starts from the lower address end of the Cache line address range The comparison result is that the cache line address corresponding to the processor write cache operation is smaller than the current first address, and the cache line corresponding to the processor write cache operation is determined to be in the exported part of the cache;
    当所述地址生成器由Cache行地址范围的高地址端开始生成第一地址时,所述比较结果为处理器写Cache操作对应的Cache行地址大于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分。When the address generator starts to generate the first address by the high address end of the Cache line address range, the comparison result is that the Cache line address corresponding to the processor write Cache operation is greater than the current first address, and the processor write Cache operation is determined to be corresponding. The Cache line is in the exported portion of the Cache.
  6. 根据权利要求4所述的方法,其特征在于,所述检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分,包括:The method according to claim 4, wherein the detecting determines that the cache line corresponding to the processor write Cache operation is in an unexported portion of the Cache, and includes:
    接收比较器的比较结果,所述比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;Receiving a comparison result of the comparator, the comparator is configured to compare a cache line address corresponding to the processor write Cache operation with a current first address size;
    当所述地址生成器由Cache行地址范围的低地址端开始生成第一地址时,所述比较结果为处理器写Cache操作对应的Cache行地址大于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分;When the address generator starts to generate the first address by the low address end of the Cache line address range, the comparison result is that the Cache line address corresponding to the processor write Cache operation is greater than or equal to the current first address, and the processor write Cache is determined. The corresponding Cache line of the operation is in the unexported part of the Cache;
    当所述地址生成器由Cache行地址范围的高地址端开始生成第一地址时,所述比较结果为处理器写Cache操作对应的Cache行地址小于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分。When the address generator starts to generate the first address by the high address end of the cache line address range, the comparison result is that the cache cache address corresponding to the processor write cache operation is less than or equal to the current first address, and the processor write cache is determined. The corresponding Cache line is operated in the unexported part of the Cache.
  7. 根据权利要求4所述的方法,其特征在于,所述检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行,包括:The method according to claim 4, wherein the detecting determines that the cache line corresponding to the processor read Cache operation is the next exported Cache line, and includes:
    接收比较器的比较结果,所述比较器还用于比较所述处理器读Cache操作对应的Cache行地址与当前第一地址的大小;Receiving a comparison result of the comparator, the comparator is further configured to compare a cache line address corresponding to the processor read Cache operation with a current first address size;
    所述比较结果为处理器读Cache操作对应的Cache行地址等于当前第一地址,确定处理器读Cache操作对应的Cache行是下一被导出的Cache行。The comparison result is that the cache line address corresponding to the processor read Cache operation is equal to the current first address, and the cache line corresponding to the processor read Cache operation is determined to be the next exported cache line.
  8. 一种建立处理器Cache检查点的装置,其特征在于,所述装置包括:An apparatus for establishing a processor Cache checkpoint, the apparatus comprising:
    接收单元,用于在将Cache中的内容逐行导出的过程中,接收处理器 写Cache信号或者接收处理器读Cache信号;a receiving unit, configured to receive a processor during the process of exporting content in the Cache line by line Write a Cache signal or receive a processor read Cache signal;
    第一确定单元,用于在所述接收单元接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分;a first determining unit, configured to: when the receiving unit receives the processor write Cache signal, detect that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache;
    第一处理单元,用于在所述第一确定单元检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分时,执行处理器写Cache操作;a first processing unit, configured to: when the first determining unit detects that the Cache line corresponding to the processor write Cache operation is in the exported part of the Cache, perform a processor write Cache operation;
    第一导出单元,用于在所述第一确定单元检测确定处理器写Cache操作对应的Cache行在Cache的已导出部分时,将所述写Cache操作写入Cache行中的内容进行导出;a first deriving unit, configured to: when the first determining unit detects that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache, and writes the content of the write Cache operation into the cache line to be exported;
    第二确定单元,用于在所述接收单元接收到处理器写Cache信号时,检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分;a second determining unit, configured to: when the receiving unit receives the processor write Cache signal, detect that the cache line corresponding to the processor write Cache operation is in an unexported portion of the Cache;
    第二处理单元,用于在所述第二确定单元检测确定处理器写Cache操作对应的Cache行在Cache的未导出部分时,执行处理器写Cache操作,并暂停将Cache中的内容进行导出;a second processing unit, configured to: when the second determining unit detects that the Cache line corresponding to the processor write Cache operation is in the unexported portion of the Cache, perform a processor write Cache operation, and pause to export the content in the Cache;
    第三处理单元,用于在所述接收单元接收到处理器读Cache信号时,执行处理器读Cache操作,并暂停将Cache中的内容进行导出。And a third processing unit, configured to: when the receiving unit receives the processor read Cache signal, perform a processor read Cache operation, and suspend exporting the content in the Cache.
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    第三确定单元,用于在所述接收单元接收到处理器读Cache信号时,检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行;a third determining unit, configured to: when the receiving unit receives the processor read Cache signal, detect that the cache line corresponding to the processor read Cache operation is the next exported Cache line;
    第四处理单元,用于在所述第三确定单元检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行时,执行处理器读Cache操作;a fourth processing unit, configured to perform a processor read Cache operation when the third determining unit detects that the Cache line corresponding to the processor read Cache operation is the next exported Cache line;
    第二导出单元,用于在所述第三确定单元检测确定处理器读Cache操作对应的Cache行是下一被导出的Cache行时,将所述读Cache操作对应的Cache行中的内容进行导出。a second deriving unit, configured to: when the third determining unit detects that the cache line corresponding to the processor read Cache operation is the next exported Cache line, export the content in the Cache line corresponding to the read Cache operation .
  10. 根据权利要求8或9所述的装置,其特征在于,所述装置还包括:The device according to claim 8 or 9, wherein the device further comprises:
    控制单元,用于控制地址生成器由Cache行地址范围的一端开始生成第一地址。 The control unit is configured to control the address generator to generate the first address by using one end of the Cache line address range.
  11. 根据权利要求10所述的装置,其特征在于,所述将Cache中的内容逐行导出的过程具体为:将所述控制单元控制地址生成器生成的第一地址所对应的Cache行中的内容导出到压缩器内存储,每导出一Cache行后则所述控制单元控制所述地址生成器将第一地址变化为下一Cache行地址。The device according to claim 10, wherein the process of deriving the content in the Cache row by row is specifically: controlling the content in the Cache line corresponding to the first address generated by the address generator by the control unit Exported to the internal storage of the compressor, the control unit controls the address generator to change the first address to the next cache line address after each cache line is exported.
  12. 根据权利要求11所述的装置,其特征在于,所述第一确定单元包括:The apparatus according to claim 11, wherein the first determining unit comprises:
    接收子单元,用于接收比较器的比较结果,所述比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;a receiving subunit, configured to receive a comparison result of the comparator, where the comparator is configured to compare a cache row address corresponding to the processor write Cache operation with a current first address size;
    第一确定子单元,用于当所述地址生成器由Cache行地址范围的低地址端开始生成第一地址时,所述接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址小于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分;a first determining subunit, configured to: when the address generator starts generating the first address by the low address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is smaller than the current first address, and the cache line corresponding to the processor write Cache operation is determined to be in the exported part of the Cache;
    第二确定子单元,用于当所述地址生成器由Cache行地址范围的高地址端开始生成第一地址时,所述接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址大于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的已导出部分。a second determining subunit, configured to: when the address generator starts generating the first address by the high address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is greater than the current first address, and it is determined that the cache line corresponding to the processor write Cache operation is in the exported part of the Cache.
  13. 根据权利要求11所述的装置,其特征在于,所述第二确定单元包括:The apparatus according to claim 11, wherein the second determining unit comprises:
    接收子单元,用于接收比较器的比较结果,所述比较器用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小;a receiving subunit, configured to receive a comparison result of the comparator, where the comparator is configured to compare a cache row address corresponding to the processor write Cache operation with a current first address size;
    第三确定子单元,用于当所述地址生成器由Cache行地址范围的低地址端开始生成第一地址时,所述接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址大于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分;a third determining subunit, configured to: when the address generator starts to generate the first address by the low address end of the Cache line address range, the comparison result received by the receiving subunit is a Cache line corresponding to the processor write Cache operation The address is greater than or equal to the current first address, and the cache line corresponding to the processor write Cache operation is determined to be in the unexported portion of the Cache;
    第四确定子单元,用于当所述地址生成器由Cache行地址范围的高地 址端开始生成第一地址时,所述接收子单元接收到的比较结果为处理器写Cache操作对应的Cache行地址小于或等于当前第一地址,确定处理器写Cache操作对应的Cache行在Cache的未导出部分。a fourth determining subunit, configured to be used by the address generator by the Cache line address range of the highlands When the address starts to generate the first address, the comparison result received by the receiving subunit is that the cache line address corresponding to the processor write Cache operation is less than or equal to the current first address, and the cache line corresponding to the processor write Cache operation is determined to be in the Cache. Unexported part.
  14. 根据权利要求11所述的装置,其特征在于,所述第三确定单元包括:The apparatus according to claim 11, wherein the third determining unit comprises:
    接收子单元,用于接收比较器的比较结果,所述比较器还用于比较所述处理器读Cache操作对应的Cache行地址与当前第一地址的大小;a receiving subunit, configured to receive a comparison result of the comparator, where the comparator is further configured to compare a cache line address corresponding to the processor read Cache operation with a current first address size;
    第五确定子单元,用于所述接收子单元接收的比较结果为处理器读Cache操作对应的Cache行地址等于当前第一地址,确定处理器读Cache操作对应的Cache行是下一被导出的Cache行。a fifth determining subunit, wherein the comparison result received by the receiving subunit is that the cache line address corresponding to the processor read Cache operation is equal to the current first address, and determining that the cache line corresponding to the processor read Cache operation is the next exported Cache line.
  15. 一种建立处理器Cache检查点的系统,其特征在于,所述系统包括:A system for establishing a processor Cache checkpoint, the system comprising:
    导出控制器,是权利要求8-14任一项所述的建立处理器Cache检查点的装置;An export controller, which is the apparatus for establishing a processor Cache checkpoint according to any one of claims 8-14;
    地址生成器,用于根据所述导出控制器的控制生成第一地址;An address generator, configured to generate a first address according to the control of the export controller;
    比较器,用于比较处理器写Cache操作对应的Cache行地址与当前第一地址的大小,比较所述处理器读Cache操作对应的Cache行地址与当前第一地址的大小,并将比较结果发送给所述导出控制器;a comparator, configured to compare a cache row address corresponding to the processor write cache operation with a current first address, compare a cache row address corresponding to the processor read cache operation with a current first address, and send the comparison result Giving the derived controller;
    压缩器,用于存储Cache行的内容。 A compressor that stores the contents of the Cache line.
PCT/CN2014/093230 2013-12-09 2014-12-08 Method, device and system for establishing processor cache checkpoint WO2015085891A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310662178.8A CN104699574B (en) 2013-12-09 2013-12-09 A kind of method, apparatus and system for establishing processor Cache checkpoints
CN201310662178.8 2013-12-09

Publications (1)

Publication Number Publication Date
WO2015085891A1 true WO2015085891A1 (en) 2015-06-18

Family

ID=53346734

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/093230 WO2015085891A1 (en) 2013-12-09 2014-12-08 Method, device and system for establishing processor cache checkpoint

Country Status (2)

Country Link
CN (1) CN104699574B (en)
WO (1) WO2015085891A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527697A (en) * 2020-05-11 2021-03-19 大唐半导体科技有限公司 Data exchange controller of Cache RAM and Retention RAM and implementation method

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107066707B (en) * 2017-03-27 2019-07-30 中国科学院计算技术研究所 A kind of adjustable design method for tracing and device using snapshot
CN107103116B (en) * 2017-03-27 2019-07-30 中国科学院计算技术研究所 A kind of trigger device and design method being multiplexed trace cache

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5748985A (en) * 1993-06-15 1998-05-05 Hitachi, Ltd. Cache control method and cache controller
JP2000330729A (en) * 1999-05-18 2000-11-30 Toshiba Corp Disk array system having on-line backup function
US6584581B1 (en) * 1999-12-06 2003-06-24 Ab Initio Software Corporation Continuous flow checkpointing data processing

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2916420B2 (en) * 1996-09-04 1999-07-05 株式会社東芝 Checkpoint processing acceleration device and data processing method
CN100359476C (en) * 2004-06-03 2008-01-02 华为技术有限公司 Snapshot backup method
CN100428200C (en) * 2006-12-28 2008-10-22 北京时代民芯科技有限公司 Method for implementing on-chip command cache
CN100492323C (en) * 2007-09-10 2009-05-27 杭州华三通信技术有限公司 Method and apparatus for protecting caching content and caching controller thereof
US8521961B2 (en) * 2009-08-20 2013-08-27 International Business Machines Corporation Checkpointing in speculative versioning caches

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5748985A (en) * 1993-06-15 1998-05-05 Hitachi, Ltd. Cache control method and cache controller
JP2000330729A (en) * 1999-05-18 2000-11-30 Toshiba Corp Disk array system having on-line backup function
US6584581B1 (en) * 1999-12-06 2003-06-24 Ab Initio Software Corporation Continuous flow checkpointing data processing

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527697A (en) * 2020-05-11 2021-03-19 大唐半导体科技有限公司 Data exchange controller of Cache RAM and Retention RAM and implementation method

Also Published As

Publication number Publication date
CN104699574A (en) 2015-06-10
CN104699574B (en) 2018-04-20

Similar Documents

Publication Publication Date Title
US10521375B2 (en) Controller for a memory system
US8990617B2 (en) Fault-tolerant computer system, fault-tolerant computer system control method and recording medium storing control program for fault-tolerant computer system
US10162873B2 (en) Synchronization of physical disks
US8850262B2 (en) Inter-processor failure detection and recovery
US8725953B2 (en) Local cache power control within a multiprocessor system
US11768768B2 (en) Memory mapping for hibernation
WO2003021439A1 (en) Methods and apparatus for improving throughput of cache-based embedded processors by switching tasks in response to a cache miss
TWI510912B (en) Fault tolerance in a multi-core circuit
EP3332306B1 (en) System and method for cache aware low power mode control in a portable computing device
WO2021223468A1 (en) Ssd-based log data storage method and apparatus, device and medium
KR20170042593A (en) Flushing in file system
CN104407880A (en) RISC (reduced instruction-set computer) processor loading/storage unit supporting non-aligned hardware storage accessing
WO2015085891A1 (en) Method, device and system for establishing processor cache checkpoint
US8181063B2 (en) Computer device, continuing operation method for computer device, and program
US10642684B1 (en) Memory command interleaving
CN115576734B (en) Multi-core heterogeneous log storage method and system
US10599530B2 (en) Method and apparatus for recovering in-memory data processing system
JP2022050757A (en) Memory system
CN105786758A (en) Processor device with data caching function and data read-write method of processor device
KR102441992B1 (en) Method and apparatus for managing disaggregated memory
JP5549627B2 (en) Microcomputer
CN103116484B (en) Command processing method and equipment
JP2006260393A (en) Cpu system
CN105224412A (en) The accurate trap control structure of a kind of storer based on SPARCV8 processor and method
KR101629411B1 (en) Apparatus and method for controlling level 0 cache

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: 14868813

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: 14868813

Country of ref document: EP

Kind code of ref document: A1