Search

CN-122019417-A - Cache space lock allocation method and device and electronic equipment

CN122019417ACN 122019417 ACN122019417 ACN 122019417ACN-122019417-A

Abstract

The application discloses a cache space lock allocation method, a device and an electronic device, wherein the access request of a target main device is obtained and is used for accessing target data cached in a system cache, the lock type of the target main device is determined in response to the fact that the target data is not cached in the system cache, the lock type at least comprises a first lock type and a second lock type, the first lock type is the type of the main device which has a lock relation with a cache way in the system cache, the second lock type is the type of the main device which does not have a lock relation with the cache way in the system cache, and the target cache space in the corresponding target cache way is allocated for the target main device based on the lock type of the target main device.

Inventors

  • XU JUN

Assignees

  • 鼎道智芯(上海)半导体有限公司

Dates

Publication Date
20260512
Application Date
20260202

Claims (10)

  1. 1. A cache space lock allocation method comprises the following steps: obtaining an access request of a target main device, wherein the access request is used for accessing target data cached in a system cache; Determining a locking type of the target main device in response to the fact that the target data is not cached in the system cache, wherein the locking type at least comprises a first locking type and a second locking type, the first locking type is a type of the main device which has a locking relation with a cache way in the system cache, and the second locking type is a type of the main device which does not have a locking relation with the cache way in the system cache; And distributing a target cache space in a corresponding target cache way for the target master device based on the locking type of the target master device.
  2. 2. The method of claim 1, the allocating, for the target master device, a target cache space in a corresponding target cache way based on a lock type of the target master device, comprising: determining a target cache way with a locking relation with the target master device in the system cache in response to the target master device being of a first locking type; and determining a target cache space from the target cache way.
  3. 3. The method of claim 1, the allocating, for the target master device, a target cache space in a corresponding target cache way based on a lock type of the target master device, comprising: determining at least one non-locking cache way which does not have a locking relation with any master device from cache ways of the system cache in response to the target master device being of a second locking type, wherein each master device in the any master device is a master device capable of accessing data cached in the system cache; determining a target cache way from the at least one non-locked cache way; and determining a target cache space from the target cache way.
  4. 4. A method according to any one of claims 2 or 3, the determining a target cache space from the target cache way comprising: and determining a cache space of the unbuffered data from a plurality of cache spaces in the target cache way, and determining the determined cache space of the unbuffered data as a target cache space.
  5. 5. The method of claim 4, wherein determining a cache space for uncached data from among the plurality of cache spaces in the target cache way comprises: determining a target cache space for caching first data from the target cache way based on a target rule in response to all cache spaces in the target cache way having cached the cache data; And storing the first data cached in the target cache space into a dynamic random access memory, and deleting the first data cached in the target cache space.
  6. 6. The method of claim 1, further comprising: Reading and outputting the target data from a target cache space in which the target data is cached in response to the target data being cached in the cache system; and updating the buffer status parameters of the corresponding target buffer space.
  7. 7. The method of claim 1, the determining the type of lock of the target master device comprising: acquiring locking configuration information; and determining the locking type of the target main device based on the locking configuration information, wherein the locking configuration information comprises a locking relation between the main device capable of accessing the system cache and a cache way in the system cache.
  8. 8. A cache space lock allocation apparatus comprising: The acquisition module is used for acquiring an access request of the target main equipment, wherein the access request is used for accessing target data cached in the system cache; The system comprises a lock path configuration module, a lock path configuration module and a lock module, wherein the lock path configuration module is used for storing lock configuration information, and the lock configuration information comprises a locking relation between a main device capable of accessing the system cache and a cache path in the system cache; The determining module is used for determining the locking type of the target main device based on the locking configuration information in response to that the target data is not cached in the system cache, wherein the locking type at least comprises a first locking type and a second locking type, the first locking type is the type of the main device which has a locking relation with a cache way in the system cache, and the second locking type is the type of the main device which does not have a locking relation with the cache way in the system cache; and the allocation module is used for allocating the target cache space in the corresponding target cache way for the target master device based on the locking type of the target master device and the locking configuration information.
  9. 9. The apparatus of claim 8, the lock configuration module comprising: The system comprises a lock path register, a first lock configuration information and a second lock configuration information, wherein the lock path register is used for storing first lock configuration information, the first lock configuration information comprises lock information of each cache path in the system cache, and the lock information comprises information with a lock relation or information without the lock relation; And the mask register is used for determining second locking configuration information according to the locking information stored in the lock register, wherein the second locking configuration information comprises information of locking relation between each locked cache way and a main device for locking the locked cache way.
  10. 10. An electronic device, comprising: The system comprises a processor, a locking type determining device, a processor, a target host device and a target host device, wherein the access request is used for accessing target data cached in a system cache, the locking type determining device is used for determining the locking type of the target host device in response to the fact that the target data is not cached in the system cache, and the locking type at least comprises a first locking type and a second locking type, the first locking type is the type of the host device which has a locking relation with a cache way in the system cache, and the second locking type is the type of the host device which does not have a locking relation with the cache way in the system cache; and the memory is used for storing programs required by the processor to execute the processing procedure.

Description

Cache space lock allocation method and device and electronic equipment Technical Field The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for allocating a cache space lock path, and an electronic device. Background The system cache SYSTEM LEVEL CACHE is a component of the system on chip SOC and is used to provide a cache function for each host device of the SOC system to reduce access to the DRAM, thereby achieving the purpose of reducing latency and power consumption. Because the system cache can provide a cache function for a plurality of main devices, in order to avoid the situation of possible resource conflict, for example, the same cache space is contended by a plurality of main devices, a static lock scheme is generally adopted, namely, different cache ways are allocated to different main devices before the system is started, the main devices and the cache ways are locked so as to realize access isolation among different main devices, but when the locked main devices are idle, the cache ways allocated to the locked main devices cannot be used by other main devices, so that the waste of cache resources is caused; In order to solve the problem of the static way locking scheme, a dynamic way locking mode can be adopted, namely, after the system is started, the cache way is allocated, if data which does not belong to the locked main equipment exist in the locked cache way, the stored data in the cache way needs to be emptied, and when a large amount of data is migrated, normal cache access can be interfered, and access delay is caused. Disclosure of Invention In view of this, the application provides a cache space lock allocation method, a device and an electronic device, which have the following specific schemes: A cache space lock allocation method comprises the following steps: obtaining an access request of a target main device, wherein the access request is used for accessing target data cached in a system cache; Determining a locking type of the target main device in response to the fact that the target data is not cached in the system cache, wherein the locking type at least comprises a first locking type and a second locking type, the first locking type is a type of the main device which has a locking relation with a cache way in the system cache, and the second locking type is a type of the main device which does not have a locking relation with the cache way in the system cache; And distributing a target cache space in a corresponding target cache way for the target master device based on the locking type of the target master device. Further, the allocating, for the target master device, a target cache space in a corresponding target cache way based on the locking type of the target master device includes: determining a target cache way with a locking relation with the target master device in the system cache in response to the target master device being of a first locking type; and determining a target cache space from the target cache way. Further, the allocating, for the target master device, a target cache space in a corresponding target cache way based on the locking type of the target master device includes: determining at least one non-locking cache way which does not have a locking relation with any master device from cache ways of the system cache in response to the target master device being of a second locking type, wherein each master device in the any master device is a master device capable of accessing data cached in the system cache; determining a target cache way from the at least one non-locked cache way; and determining a target cache space from the target cache way. Further, the determining the target cache space from the target cache way includes: and determining a cache space of the unbuffered data from a plurality of cache spaces in the target cache way, and determining the determined cache space of the unbuffered data as a target cache space. Further, the determining a cache space of the uncached data from the plurality of cache spaces in the target cache way includes: determining a target cache space for caching first data from the target cache way based on a target rule in response to all cache spaces in the target cache way having cached the cache data; And storing the first data cached in the target cache space into a dynamic random access memory, and deleting the first data cached in the target cache space. Further, the method further comprises the following steps: Reading and outputting the target data from a target cache space in which the target data is cached in response to the target data being cached in the cache system; and updating the buffer status parameters of the corresponding target buffer space. Further, the determining the locking type of the target master device includes: acquiring locking configuration information; and determining the locking type of the target main device bas