Embodiment
The embodiment of the invention provides a kind of management method of read-write memory, based on the memory of supporting variable access time leaf length, the total length of one group of data that can send according to peripheral components and the length that at every turn reads and writes data of setting, dynamic-configuration access time leaf length when needed, avoided reading and writing of invalid data, save the time of reading and writing data, improved the read or write speed of memory, thereby promoted data transmission bauds.It is pointed out that the described memory of the embodiment of the invention all is meant the memory of supporting variable access time leaf length, follow-up repeating no more.
As shown in Figure 1, the management method of read-write memory comprises:
S101, will receive one group of writing data into memory the time, according to the total length of these group data and each write data length of setting, need to judge whether dynamic-configuration to write timeslice length, if, then each timeslice length of writing according to dynamic-configuration writes data in memory, if not, the fixing timeslice length of writing of then each basis writes data in memory;
S102, in the time of should organizing data and from memory, read, according to the total length of these group data and each read data length of setting, need to judge whether dynamic-configuration read time leaf length, if, then each read time leaf length sense data from memory according to dynamic-configuration, if not, then each according to fixing read time leaf length sense data from memory.
The management method of the read-write memory that the embodiment of the invention is provided below in conjunction with Figure of description is described in detail.Because the management method basically identical of memory write and memory read, the embodiment of the invention will be that example describes with the management method of memory write.
Suppose that one group of data that transmitting terminal sends need write memory, owing to be subjected to the restriction of memory span, in the process that in memory, writes data, these group data can not be once whole write memories, but in the needs write memory in batches, the total length of these group data in the whole write data process is made as N.For the memory of selected model, can rationally set each write data length M an of the best in advance.Selection to each write data length M of the best, should consider to satisfy the bandwidth availability ratio of certain memory, consider the clock cycle scope of writing timeslice length range and work of the memory support of this model again, will consider also that simultaneously the reasonable distribution of bus resource avoids long-time write data to take bus resource.As shown in Figure 2, the management process of the memory write that the embodiment of the invention provides comprises the steps:
One group of data that S200, receiving end/sending end send;
S201, judge whether according to each write data length M of the total length N of these group data and setting that needs dynamically arrange and write timeslice length, a kind of preferable determination methods is: will organize the total length N of data and each write data length M of setting and be divided by, it should be noted that N and the unit of M should be consistent, if N/M obtains remainder, then judging needs dynamic-configuration to write timeslice length, carry out S202, if N/M does not obtain remainder (being that remainder is 0), then judging does not need dynamic-configuration to write timeslice length, carries out S206;
S202, to establish the integer quotient that N/M obtains be L, the remainder that N/M obtains be K (K<M), then determine to organize data in batches the total degree of write memory be L+1;
S203, in will organizing the whole process of writing data into memory, the timeslice length of writing according to dynamic-configuration writes data in memory at every turn, the scheme that a kind of preferable dynamic-configuration is write timeslice length is: preceding L the fixing timeslice length of writing of basis writes data in memory, write data according to the timeslice length of adjusting of writing in memory for the last time; The wherein fixing timeslice length of writing is amassed with the clock cycle T of memory operation is for the write data length M of setting, can improve the bandwidth availability ratio of memory like this, the timeslice length of adjusting of writing is that the remainder K that N/M obtains amasss with the clock cycle T of memory operation is, can avoid writing of invalid data like this; It will be organized in the whole process of writing data into memory really, as long as guarantee wherein once to write data according to the timeslice length of adjusting of writing in storage arbitrarily, all the other each times write data and get final product according to the timeslice length of writing of fixing in memory.
According to this preferable dynamic-configuration scheme, in will organizing the whole process of writing data into memory, need organize the number of times that data have write in batches in memory to this counts, receive the memory write request need in memory, write data the time at every turn, judge whether the number of times that these group data have write in batches reaches total degree L+1 in memory, if then carry out S204, if not, then carry out S205;
S204, this timeslice length of writing according to adjustment write data in memory;
S205, the fixing timeslice length of writing of this basis write data in memory;
S206, in will organizing the whole process of writing data into memory, receive the memory write request need in memory, write data the time at every turn, write data according to the fixing timeslice length of writing in memory, what this was fixing writes timeslice length meeting continuously effective in the whole write memories of these group data.
In like manner, in the process of from memory, reading these group data, at first need to judge whether needs dynamic-configuration read time leaf length according to the total length of these group data and each read data length of setting, concrete determination methods and consistent with the process that will organize writing data into memory according to the follow-up implementation of judged result repeats no more.Wherein, each write data length of setting can be consistent with each read data length, like this according to this group data configuration fix to write timeslice length also consistent with the read time leaf length of writing timeslice length and adjustment of read time leaf length of fixing and adjustment.Certainly, if be subjected to the speed of receiving terminal consumption data, and the influence of other factors, each read data length of setting also can be inconsistent with each write data length of setting.For example the receiving terminal consumption data is limited in one's ability, then can consider suitably to reduce each read data length.If the speed of transmitting terminal transmission data is suitable, preferable with the speed of receiving terminal consumption data, each read data length of setting is identical with each write data length of setting, to guarantee the continuity of transfer of data.
If this memory is the monobus memory, for example Synchronous Dynamic Random Access Memory (SDRAM) is the memory that read-write operation can not carry out simultaneously, need arbitrate read-write operation when simultaneously read memory request and memory write request being arranged.When receiving read memory request and memory write request simultaneously, by a last operation to memory of flag bit inquiry is that read data operation or data writing operation are arbitrated, the data message of this flag bit is called the indication information of action type, and action type comprises read operation and write operation certainly.The flag bit that can set the read operation correspondence is 0, and the flag bit of write operation correspondence is 1.After this read operation or write operation are finished, can be 0 or 1 according to this operation corresponding setting flag bit, prepare for arbitrate the read-write memory request next time.If last what memory was carried out is read operation, then arbitration result is carried out write operation for this, on the contrary, if last what memory was carried out is write operation, then arbitration result is carried out read operation for this, has avoided continuous like this and has write data or sense data and take bus resource from memory in memory.If memory write request and read memory request are not to send simultaneously, then the problems referred to above needn't be considered.As shown in Figure 3, concrete arbitration process flow process comprises the steps:
S300, receive read memory request and memory write request simultaneously;
S301, inquiry flag bit, the i.e. indication information of action type;
Whether S302, flag bit are 0, if, then carry out S303, if not, then carry out S304;
S303, confirm that according to flag bit action type is read operation, then control this and carry out write operation, promptly respond the memory write request, in memory, write data, continue to carry out S305 according to writing timeslice length;
S304, confirm that according to flag bit action type is a write operation, then control this and carry out read operation, promptly respond read memory request,, continue to carry out S305 according to read time leaf length sense data from memory;
S305, according to this operation setting flag bit, if this is operating as read operation, then flag bit is made as 0, if this is operating as write operation, then flag bit is made as 1.
Certainly, also can adopt other arbitration process mechanism according to different situations, will be if transmitting terminal sends the speed of data faster than the speed of receiving terminal consumption data, when then receiving read memory request and memory write request simultaneously, should preferentially satisfy read memory request, the assurance read right is preferential, can guarantee the continuity of receiving terminal data streams read like this.
Also have a kind of more special situation to be, when write permission takies bus resource and carries out write operation, if receive the read memory request of high priority this moment, then need to interrupt ongoing write operation, abdicate the read memory request that bus resource responds this high priority, memory is carried out read operation, that is:
When receiving the read memory request of high priority in timeslice length writes data in memory the process according to writing of this, the response time that clock cycle long-pending of judging the length of this written data and memory operation increases configuration more whether less than this write timeslice length, wherein the response time be rule of thumb be worth pre-configured;
If, then with this write timeslice length change to the length of this written data and memory operation clock cycle long-pending again with this response time sum, and according to writing after timeslice length executes this write operation the read memory request of response high priority after the change;
If not, then writing after timeslice length executes this write operation the read memory request of response high priority according to this.
So just can guarantee to finish this write operation as early as possible and memory is carried out read operation.In like manner, when read right takies bus resource and carries out read operation,, need to interrupt ongoing read operation this moment if receive the memory write request of high priority, abdicate the memory write request that bus resource responds this high priority, memory is carried out write operation.Handling process when concrete handling process takies bus resource with write permission is consistent, repeats no more.Change the access time leaf length according to the actual requirements, having satisfied can rational distribution bus resource when emergency takes place.
Be that example describes with management read-write monobus memory storage SDRAM below.The length that at every turn reads and writes data of SDRAM can be set at 2,4,8 (unit is the data numbers), perhaps takes the full-page pattern, and each realization random length reads and writes data in admissible scope.SDRAM according to selected model in this example is the length setting that reads and writes data at every turn 512 (unit is the data numbers), can determine corresponding access time leaf length according to the clock cycle of SDRAM work thus.In this example the access time leaf length being made as identically, is that example describes with the write operation process.After the one group of data that receives the transmitting terminal transmission, judge according to the total length of these group data whether the needs dynamic-configuration is write timeslice length to the process that will organize writing data into memory, the total length of supposing these group data is M bit, because the data bandwidth of SDRAM is 32bit, the length N that then at every turn reads and writes data is (512 * 32) bit, if M/ (512 * 32) does not have remainder (being that remainder is 0), then do not need dynamic-configuration to write timeslice length, write timeslice length at every turn and all be set to 512 * T of fixing, wherein T is the clock cycle of this SDRAM work; If M/ (512 * 32) has remainder, and the remainder that obtains is K, and integer quotient is L, then determine to organize data in batches the total degree of write memory be L+1, wherein once write timeslice length arbitrarily and be configured to K * T, write timeslice length and be configured to 512 * T for all the other L time.
According to prior art, when read-write SDRAM, if adopt fixing access time leaf length, for example be 8 * T, for last write operation, if the length of remaining data is less than 8 (they for example being 2), according to writing timeslice length 8 * T, and can 6 invalid datas of random writing after writing valid data.Increase to 512 * T if will write timeslice length, data that may last random writing can be more, and maximum possible can reach 511, will waste the plenty of time, so that the length of read/write slot generally can not adopt is too big.And the scheme of utilizing the embodiment of the invention to provide, after the length setting that will at every turn read and write data is 512, it for total degree L+1 time write operation, having at least, the timeslice length of writing of L is set to 512 * T, improved the bandwidth availability ratio of memory greatly, for last write operation, if the length of remaining data is much smaller than 512, then can avoid writing of invalid data according to the length configurable write timeslice length of remaining data.Can find out that thus the management method of the read-write memory that the employing embodiment of the invention provides has improved the bandwidth availability ratio and the read or write speed of memory, thereby data transmission bauds is provided.
The embodiment of the invention is based on the memory of supporting variable access time leaf length, a kind of management method of read-write memory has been proposed, according to the total length of one group of data and the length that reads and writes data of setting at every turn, need to judge whether dynamic-configuration access time leaf length, if, then according to the access time leaf length of dynamic-configuration memory is carried out read-write operation at every turn, taken into full account the uncertainty of the total length of every group of data, as required can dynamic-configuration access time leaf length, avoided in memory, writing and from memory, reading invalid data, saved the data write time, improved the read or write speed of memory, thereby effectively promoted data transmission bauds, on the basis of reasonable distribution read-write bus resource, select bigger access time leaf length as far as possible, to improve the bandwidth availability ratio of memory, the bandwidth availability ratio of memory and the optimum balance of read or write speed have been reached.
Based on same inventive concept, the embodiment of the invention provides a kind of management devices of read-write memory, as shown in Figure 4, comprising:
Receiving element 401: be used to receive one group of data;
Judging unit 402: be used for according to the total length of these group data and each write data length of setting, need to judge whether dynamic-configuration to write timeslice length, and judged result is write in output, according to the total length of these group data and each read data length of setting, need to judge whether dynamic-configuration read time leaf length, and judged result is read in output;
Dispensing unit 403: be used to receive and describedly write judged result and read judged result, if the described judged result of writing is for being, then dynamic-configuration is write timeslice length, if the described judged result of writing is for denying, then configuration is fixing writes timeslice length, if the described judged result of reading is for being, and dynamic-configuration read time leaf length then, if the described judged result of reading then disposes fixing read time leaf length for not;
Read-write cell 404: be used for when at every turn receiving the memory write request, the timeslice length of writing according to dispensing unit output writes data in memory, when receiving read memory request, according to read time leaf length sense data from memory of dispensing unit output at every turn.
Preferable, this device also comprises:
Memory cell 405: the indication information that is used for the storage operation type;
Arbitration unit 406: being used at described memory is the monobus memory, and when read-write cell 404 receives read memory request and memory write request simultaneously, from described memory cell, obtain the indication information of action type, when confirming that according to described indication information action type is write operation, control read-write cell 404 these sense datas from memory, when confirming that action type is read operation, this writes data control read-write cell 404 in memory, and according to the indication information of action type in this operation updated stored unit 405.
Preferable, this device also comprises:
First processing unit 407: be used at read-write cell 404 during according to this write timeslice length receive the read memory request of high priority in memory writes the process of data, whether the response time that clock cycle long-pending of judging the length of this written data and memory operation increases configuration again writes timeslice length less than this; If, then with this write timeslice length change to the length of this written data and memory operation clock cycle long-pending again with this response time sum, and control read-write cell 404 is according to writing after timeslice length executes this write operation the read memory request of response high priority after the change; If not, then control read-write cell 404 and writing after timeslice length executes this write operation the read memory request of response high priority according to this;
Second processing unit 408: be used for when read-write cell 404 receives the memory write request of high priority according to this read time leaf length from the process of memory sense data, judge this clock cycle long-pending of the length of sense data and memory operation increase configuration again response time whether less than this read time leaf length; If, then control read-write cell 404 with this read time leaf length change to this length of sense data and described memory operation clock cycle long-pending again with this response time sum, and after executing this read operation according to the read time leaf length after the change, the memory write request of response high priority; If not, then control read-write cell 404 after the read time leaf length according to this executes this read operation, the memory write request of response high priority.
The management method of the read-write memory that the embodiment of the invention provides and device can be applied in digital printing technology field, by improving the bandwidth availability ratio and the read or write speed of memory, improve data transmission bauds, to satisfy the demand of high speed printing.Based on same technical conceive, the embodiment of the invention provides a kind of digital printing equipment, comprise host side 500, control system 501, memory 502 and image-forming block 503, between control system 501 and memory 502, also comprise the management devices 504 of this read-write memory, wherein:
The management devices 504 of read-write memory: when being used for one group of writing data into memory 502 receiving from control system 501, according to the total length of these group data and each write data length of setting, need to judge whether dynamic-configuration to write timeslice length, if, then each timeslice length of writing according to dynamic-configuration writes data in memory 502, if not, the fixing timeslice length of writing of then each basis writes data in memory 502; And
In the time of should organizing data and from memory 502, read into control system 501, according to the total length of these group data and each read data length of setting, need to judge whether dynamic-configuration read time leaf length, if, then each read time leaf length sense data from memory 502 according to dynamic-configuration, if not, then each according to fixing read time leaf length sense data from memory 502.
Preferable, the management devices 504 of read-write memory also is used for being the monobus memory at memory 502, and when receiving read memory request that control system 501 sends and memory write request simultaneously, obtains the indication information of the action type of storage; When confirming that according to indication information action type is write operation, control this sense data from memory 502, when confirming that action type is read operation, control this and in memory 502, write data, and operate the indication information of the action type of updated stored according to this.
The management devices 504 of read-write memory, also be used for according to this write timeslice length receive the read memory request of high priority in memory 502 writes the process of data the time, whether the response time that clock cycle long-pending of judging the length of this written data and memory 502 work increases configuration again writes timeslice length less than this; If, then with this write timeslice length change to the length of this written data and memory 502 work clock cycle long-pending again with this response time sum, and according to writing after timeslice length executes this write operation the read memory request of response high priority after the change; If not, then writing after timeslice length executes this write operation the read memory request of response high priority according to this;
Perhaps, when in the process of read time leaf length sense data from memory 502, receiving the memory write request of high priority according to this, judge this clock cycle long-pending of the length of sense data and memory 502 work increase configuration again response time whether less than this read time leaf length; If, then this read time leaf length is changed to this length of sense data and memory 502 work clock cycle long-pending again with this response time sum, and after executing this read operation according to the read time leaf length after the change, the memory write request of response high priority; If not, then after the read time leaf length according to this executes this read operation, respond the memory write request of high priority.
Because in the digital printing process, every group of data all are made up of the data of C, M, Y, four look faces of K, control system will be organized data send to correspondence according to the order of look face look surface imaging parts usually, so usually memory is divided into equal-sized four zones, the data of one of them look face in each regional corresponding stored C, M, four look faces of Y, K, four shared memories of look face.In the process with one group of writing data into memory, because control system is according to four predefined orderings of look face, order sends of all kinds data, does not therefore exist face of all kinds to fight for the problem of bus write permission in the process of writing data into memory.But in control system is read the data of corresponding look face from memory process, can exist a plurality of look faces to fight for the problem of bus read right.Can take read right poll arbitration mechanism, at first each look face is sorted in advance, when a plurality of look faces need from memory sense data simultaneously, definite ordering look face at first obtains read right, after control system is finished a read operation at the look face that obtains read right, because corresponding look surface imaging parts need the time to go to handle the data of reading, in order to make full use of bus resource, this look face can be abdicated the memory bus resource.After it should be noted that the look face that obtains read right is abdicated read right, the ordering of this look face is the most last by original becoming at first, and other ordering of of all kinds is pushed ahead successively, guarantees that like this each look face has equal chance to obtain the read right of memory.
In digital printing equipment, control system generally comprises the Multistage Control subsystem, dot array data is processed into to send to after can the imaging data of direct imaging through control subsystem at different levels successively and carries out imaging in the image-forming block, the management devices of the read-write memory that the embodiment of the invention provides all can be set between control subsystem wherein at different levels and the corresponding memory, to promote the overall data transmission speed of digital printing equipment, satisfy the demand of high speed printing.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.