Patent ID: 8392621

Claim:
A method of managing a memory, the method comprising: receiving a request from a processing unit to transfer data from a source location to a destination location, the data transfer request associated with an operation to be performed on an intermediate memory configured to temporarily hold data that is being transferred from the source location to the destination location, the operation selected from an input into the intermediate memory and an output from the intermediate memory; checking, by a controller unit, a two-state indicator associated with the intermediate memory, the two-state indicator having a first state indicating that an immediately preceding operation on the intermediate memory was an input to the intermediate memory and a second state indicating that the immediately preceding operation was an output from the intermediate memory; determining, by the controller unit, whether the operation is received in a correct order relative to the immediately preceding operation, the operation being in the correct order based on one of: the operation being an input operation and the two-state indicator being in the second state, indicating that the immediately preceding operation was an output; and the operation being an output operation and the two-state indicator being in the first state, indicating that the immediately preceding operation was an input; and performing, by the controller unit, the operation based on a determination that the operation is received in the correct order, wherein performing includes any one of: setting the two-state indicator to the first state based on the operation being an input operation; and setting the two-state indicator to the second state based on the operation being an output operation.