Patent ID: 9563584
Date: 2017-02-07
CPC Classifications: G06F,G11C

Claim:
1. A method for buffer processing in a System on Chip, SOC, comprising: when a first datum of a first user needs to be buffered, reading a current storage start address of a buffer space, which is shared by sub-systems in the SOC; storing the first datum into the buffer space from the current storage start address, wherein the buffer space occupied by the first datum is a first buffer space; for the first datum, saving storage location information comprising a start address and a space length of the first buffer space, to locate the first buffer space according to the start address and the space length of the first buffer space when the first datum needs to be read, and reading the first datum from the first buffer space; and updating the current storage start address with a next address of the first buffer space, to buffer next data needing to be buffered from the updated current storage start address; wherein after storing the first datum into the buffer space from the current storage start address, recording an idle state of the first datum, and determining whether the first datum is released according to the idle state; setting a threshold value, wherein the threshold value is a buffer space size needed for storing a maximum datum; when a remaining buffer space behind the current storage start address is smaller than the threshold value, arranging data in the buffer space by a predefined method, and updating a start address of each datum after the arrangement; wherein the predefined method is selecting from the buffer space an invalid datum stored at the earliest, and consecutively storing, from a start address of the selected invalid datum, valid data behind the selected invalid datum until all the valid data consecutively occupy the buffer space; wherein the invalid datum is a released datum, and the valid data are data not released; and after the arrangement is completed, updating the current storage start address with a next address of a last valid datum in the buffer space.