CN105138287A - Storage equipment, interruption control method and power supply time measuring method - Google Patents

Storage equipment, interruption control method and power supply time measuring method Download PDF

Info

Publication number
CN105138287A
CN105138287A CN201510494515.6A CN201510494515A CN105138287A CN 105138287 A CN105138287 A CN 105138287A CN 201510494515 A CN201510494515 A CN 201510494515A CN 105138287 A CN105138287 A CN 105138287A
Authority
CN
China
Prior art keywords
dma
data
memory
memory device
write
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201510494515.6A
Other languages
Chinese (zh)
Other versions
CN105138287B (en
Inventor
王祎磊
殷雪冰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Memblaze Technology Co Ltd
Original Assignee
Beijing Memblaze Technology Co Ltd
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 Beijing Memblaze Technology Co Ltd filed Critical Beijing Memblaze Technology Co Ltd
Priority to CN201510494515.6A priority Critical patent/CN105138287B/en
Publication of CN105138287A publication Critical patent/CN105138287A/en
Application granted granted Critical
Publication of CN105138287B publication Critical patent/CN105138287B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides storage equipment, an interruption control method and a power supply time measuring method. The storage equipment comprises a flash memory and a buffer memory. The interruption control method comprises the following steps of: receiving data to be written into the storage equipment from information processing equipment; writing the received data to be written into the storage equipment into the buffer memory; taking out data in the buffer memory and writing the data into the flash memory; and after the received data to be written into the storage equipment is written into the buffer memory, if the data volume in the buffer memory is smaller than the preset threshold value, sending a message for indicating the writing operation completion to the information processing equipment. The interruption control method also comprises the steps of: when the condition that a power supply of the information processing equipment fails, starting a timer; when the voltage provided by the power supply of the information processing equipment for the storage equipment is lower than the preset threshold value, stopping the timer; and modifying the preset threshold value according to the timing time of the timer.

Description

Memory device, interrupt control method and power-on time measuring method
Technical field
The present invention relates to solid storage device (SolidStorageDevice, SSD), more specifically, the present invention relates to the interruption that memory device sends to main frame.
Background technology
Similar with mechanical type hard disk, solid storage device (SSD) is also Large Copacity, non-volatile memory device for computer system.Solid storage device is generally using flash memory (Flash) as storage medium.Solid storage device is as shown in figure 17 disclosed in Chinese patent literature CN102043689A.As shown in figure 17, be the functional block diagram of solid storage device general at present.Wherein mainly comprise host computer system 1701 and solid storage device 1702.Wherein, solid storage device 1702 comprises interface module 1703, solid-state storage processor 1704, and the Flash array 1706 formed in units of Flash particle 1705.Wherein, interface module 1703 is mainly used in realizing and host computer system accordant interface agreement, such as SATA (SerialAdvancedTechnologyAttachment, Serial Advanced Technology Attachment), USB (UniversalSerialBus, USB (universal serial bus)), PCIE (PeripheralComponentInterconnectExpress, quick peripheral assembly interconnecting), SCSI (SmallComputerSystemInterface, small computer system interface), IDE (IntegratedDriveElectronics, integrated drive electronics) etc.By interface module 1703, what solid storage device presented to host computer system is a standard memory device having certain logical space.Solid-state storage processor 1704 is control cores of whole memory device, the control signal between primary responsibility interface module 1703 and flash array 1706 and the transmission of data, Flash management, host logical address to the conversion of Flash physical address or mapping, wear leveling (logical address is mapped to different physical addresss thus prevent single Flash by too intensively operating premature failure), bad block management etc.Solid-state storage processor 1704 can be realized by software, hardware, firmware or its various ways combined.1705 is single Flash particle, and multiple Flash particle 1705 forms Flash array 1706.
For improving the reading and writing speed of solid storage device, the random access storage device of such as DRAM or SRAM or the storer being suitable for high speed read/write operation of other types can be set in solid storage device, as to flash memory write data or from cache memory during flash reading and writing data.In storage device access process, as an example, computing machine sends SCSI (small computer system interface) order to memory device, and memory device receives and treatment S CSI order, performs corresponding storage medium read-write process according to the operation indicated by scsi command.In this course, scsi command not direct control cache memory.That is, cache memory is " transparent " to computing machine or user.Also some memory devices are had to provide " cleaning " mechanism of cache memory, computing machine or user can use predetermined command forces memory device the data in cache memory to be written in non-volatile memory medium (such as, disk or flash memory).
But, to the work load of controller that the distribution of cache memory and management will become on solid storage device.And after cache memory is otherwise fully engaged, if solid storage device receives the new request of access from host computer system, then also need to perform the replacement operation to cache memory.So both add the complexity of controller, main frame can be allowed again to experience jolting in read/write performance.
DMA (DirectMemoryAccess, direct memory access) transmission can also be carried out between main frame and equipment.The method and apparatus performing DMA transmission is disclosed in Chinese patent literature CN101221544A.A canonical process of DMA transmission is dispersion/collection (Scatter/Gather) operation.Dispersion/collect in operation, multiple data block waiting for transmission is stored in discontinuous multiple address location of system (main frame) storer.The operation that processor does not need each data block for moving to a certain destination from a certain source to programme to dma controller.But processor sets up descriptor table or descriptor chained list in the system memory.Descriptor table or descriptor chained list comprise a group descriptor.Each descriptor all describes data block moving direction, source address, destination-address and the optional byte number transmitted.When not comprising transmission byte number in a descriptor, transmit the data of about measured length by dma mode.
The scheme of loss of data when avoiding memory device accident power-off in memory buffer is disclosed in Chinese patent literature CN101710252B.Wherein, in memory device, provide standby power supply, when meet accident power-off time, provide interim electric energy by standby power supply to memory device, for by the data conversion storage in memory buffer (Cache) in flash memory.Disclose with electric capacity as the scheme of the standby power supply of memory device at american documentation literature US8031551B2, and the performance of operationally Detection capacitance, when detecting that capacitance is too low, electric capacity is charged.
Disclose in Chinese patent literature CN101483480A and detect mainboard voltage when not existing, produce alerting signal to indicate power supply power-fail.And the difference disclosed in Chinese patent literature CN101467212A based on power source, different mode of operations selected by memory device.
Summary of the invention
But the speed of semiconductor technology evolves far exceedes the electric capacity as standby power supply.The size of the memory buffer that can to use in memory device as the energy limited that the electric capacity of standby power supply provides.Further, the power supply of computing machine or similar messaging device or feed circuit after a loss of power, or computing machine peripheral device instruction power loss event after, the electric power that its peripheral device provides not stops at once completely.Due to the existence of the energy-storage travelling wave tube of such as electric capacity in the circuit such as power supply or mainboard, after a power failure, the electric energy in energy-storage travelling wave tube will outwards discharge.But in the prior art, this part energy will be left in the basket.By technical scheme of the present invention, peripherals will be made after computing machine power down being detected, the residual circuit in computing machine or similar messaging device can be made full use of, extend the working time of peripherals.Further, the capacity improving standby power supply is also meaned to the utilization of this part energy, and then, larger memory buffer can be used on a storage device or use the storage space of larger memory buffer.
In the first embodiment of the present invention, provide a kind of interrupt control method of memory device, described memory device comprises flash memories and memory buffer, and described method comprises:
The data wanting write storage device are received from messaging device;
The received data of write storage device of wanting are write described memory buffer;
Data in described memory buffer are taken out and writes described flash memories;
Wherein, by received want the data of write storage device to write described memory buffer after, if the data volume in described memory buffer is less than predetermined threshold, then send to described messaging device the message that instruction write operation completes;
Described method also comprises power supply power-fail that described messaging device detected and starts timer, stop timer when the power supply of described messaging device is less than predetermined voltage threshold to the voltage that described memory device provides, revise described predetermined threshold according to the timing time of described timer.
Method according to a first embodiment of the present invention, also comprise described memory device receives messaging device described in unique identification the first identifier from described messaging device, if described first identifier is identical with the second identifier stored in described memory device, then revise described predetermined threshold according to the timing time of described timer.
Method according to a first embodiment of the present invention, if described first identifier is different from the second identifier stored in described memory device, then uses as default described predetermined threshold; And in described memory device, store described first identifier to replace described second identifier.
Method according to a first embodiment of the present invention, also comprises the timing time storing described timer.
Method according to a first embodiment of the present invention, wherein when described messaging device starts, described memory device receives the first identifier of messaging device described in unique identification from described messaging device, if described first identifier is identical with the second identifier stored in described memory device, then revise described predetermined threshold according to the timing time of stored described timer.
Method according to a first embodiment of the present invention, wherein said memory device receives the instruction used as default by described predetermined threshold, is used as default by described predetermined threshold, and removes the timing time of the described timer stored.
Method according to a first embodiment of the present invention, also comprises the timing time according to described timer and determines described predetermined threshold, and storing described predetermined threshold.
Method according to a first embodiment of the present invention, wherein by received want the data of write storage device to write described memory buffer after, if the data volume in described memory buffer is not less than predetermined threshold, then do not send to described messaging device the message indicating write operation to complete.
Method according to a first embodiment of the present invention, wherein said predetermined threshold is corresponding to utilizing the standby power supply of described memory device reliably to take out from described memory buffer and writing the data volume of described flash memories.
According to a second embodiment of the present invention, provide a kind of interrupt control method of memory device, described memory device comprises flash memories and memory buffer, and described method comprises:
Write request is received from messaging device;
Based on said write request, data are write described memory buffer, and makes counter increment;
Described data in described memory buffer taken out and writes described flash memories, and making described counter decrement;
Wherein, if described counter is less than predetermined threshold, then send the message indicating said write request process to complete to described messaging device;
Described method also comprises the power supply power-fail described messaging device being detected and the first value recording described counter, record the second value of described counter when the power supply of described messaging device is less than predetermined voltage threshold to the voltage that described memory device provides, revise described predetermined threshold according to the difference of described first value and described second value.
According to the third embodiment of the invention, provide a kind of memory device, described memory device comprises memory buffer, flash memories, messaging device interface and control circuit, described control circuit also comprises counter and interruptable controller, described memory device can be connected communicatedly with messaging device, wherein:
Described messaging device interface receives write request from messaging device;
Data, based on said write request, are write described memory buffer by described control circuit, and make described counter increment;
Described data in described memory buffer are taken out and are write described flash memories by described control circuit, and make described counter decrement;
When described counter is less than predetermined threshold, described interruptable controller sends the message indicating said write request process to complete to described messaging device;
When described control circuit determines that the power supply of described messaging device is in power-down state, start timer; When described control circuit determines that the voltage that the power supply of described messaging device provides is less than predetermined voltage threshold, stop described timer, and revise described predetermined threshold according to the timing time of described timer.
According to a fourth embodiment of the invention, provide a kind of memory device, described memory device comprises memory buffer, flash memories, messaging device interface and control circuit, described control circuit also comprises counter and interruptable controller, described memory device can be connected communicatedly with messaging device, wherein:
Described messaging device interface receives the data wanting write storage device from messaging device;
The received data of write storage device of wanting are write described memory buffer by described control circuit;
Data in described memory buffer are taken out and are write described flash memories by described control circuit;
By received want the data of write storage device to write described memory buffer after, if the data volume in described memory buffer is less than predetermined threshold, then described interruptable controller sends to described messaging device the message that instruction write operation completes;
When described control circuit determines that the power supply of described messaging device is in power-down state, start timer; When described control circuit determines that the voltage that the power supply of described messaging device provides is less than predetermined voltage threshold, stop described timer, and revise described predetermined threshold according to the timing time of described timer.
According to a fifth embodiment of the invention, provide a kind of method measuring the power-on time after power supply power-fail, comprising:
Timer is started in response to described power supply power-fail being detected;
Detect the voltage that described power supply provides, when described voltage is less than predetermined voltage threshold, stop timer;
Store the timing time of described timer as the power-on time after described power supply power-fail.
Method according to a fifth embodiment of the invention, also comprises the power-on time after the power supply power-fail storing repetitive measurement, and based on the power-on time after the power supply power-fail of described repetitive measurement, obtains the power-on time after the described power supply power-fail estimated.
Accompanying drawing explanation
When reading together with accompanying drawing, by reference to below to the detailed description of the embodiment of illustrating property, will understand the present invention and preferred using forestland and its further object and advantage best, wherein accompanying drawing comprises:
Fig. 1 is the structured flowchart of the memory device according to the embodiment of the present invention;
Fig. 2 A, 2B are the schematic diagram of the write order according to the embodiment of the present invention;
Fig. 3 is the process flow diagram of the method performing write order according to the memory device of the embodiment of the present invention;
Fig. 4 is the schematic diagram of the main frame according to the embodiment of the present invention;
Fig. 5 is the process flow diagram performing write operation according to the main frame of the embodiment of the present invention;
Fig. 6 is the schematic diagram of the second write order according to the embodiment of the present invention;
Fig. 7 A, 7B are the process flow diagrams performing the second write order according to the memory device of the embodiment of the present invention;
The structured flowchart writing the memory device of order for the execution second implemented in Fig. 7 A, 7B is illustrated in Fig. 7 C;
Fig. 8 is the software block diagram of the main frame according to the embodiment of the present invention;
Fig. 9 A creates according to the main frame of the embodiment of the present invention and performs the process flow diagram of the second write order;
Fig. 9 B is that main frame creates and performs the process flow diagram of the second write order according to another embodiment of the present invention;
Figure 10 A is the process flow diagram creating chained list in the memory buffer of memory device according to one embodiment of the invention;
Figure 10 B is the process flow diagram creating chained list in the memory buffer of memory device according to one embodiment of the invention;
Figure 10 C utilizes the chained list created in memory buffer to perform the process flow diagram of dma descriptor according to the memory device of one embodiment of the invention;
Figure 11 A-11F illustrates the various states of the memory buffer be associated with Figure 10 B, Figure 10 C;
Figure 12 is the structured flowchart of memory device according to still another embodiment of the invention;
Figure 13 is the structured flowchart of the memory device according to further embodiment of this invention;
Figure 14 A is the process flow diagram that memory device execution interruption according to still another embodiment of the invention suppresses;
Figure 14 B is the process flow diagram that memory device execution interruption according to still another embodiment of the invention suppresses;
Figure 15 is the process flow diagram that memory device execution interruption according to still another embodiment of the invention suppresses;
Figure 16 A is the structured flowchart of the memory device that execution interruption according to still another embodiment of the invention suppresses;
Figure 16 B is the structured flowchart of the memory device that execution interruption according to still another embodiment of the invention suppresses;
Figure 16 C is the structured flowchart of the memory device that execution interruption according to still another embodiment of the invention suppresses;
Figure 16 D is the structured flowchart of the memory device that execution interruption according to still another embodiment of the invention suppresses;
Figure 17 is the structured flowchart of the solid storage device according to prior art;
Figure 18 A is the schematic diagram of the feed circuit of peripherals according to an embodiment of the invention;
Figure 18 B is the schematic diagram of the feed circuit of peripherals according to an embodiment of the invention;
Figure 18 C is the schematic diagram of the feed circuit of peripherals according to an embodiment of the invention;
Figure 19 A, 19B, 19C, 19D and 19E respectively illustrate the embodiment of the control circuit in feed circuit of the present invention;
Figure 20 A is the process flow diagram of the method according to embodiments of the invention determination buffer area data volume threshold value;
Figure 20 B is the process flow diagram of the method for buffer set data-quantity threshold really according to another embodiment of the present invention; And
Figure 21 is the process flow diagram of the method arranging buffer area data volume threshold value according to an embodiment of the invention.
Embodiment
Fig. 1 is the structured flowchart of the memory device according to the embodiment of the present invention.The memory device 102 that embodiment as shown in Figure 1 comprises main frame 101 and is coupled with main frame 101.Main frame 101 is coupled by various ways with between memory device 102, and coupling scheme include but not limited to connect main frame 101 and memory device 102 by such as SATA, IDE, USB, PCIE, SCSI, Ethernet, optical-fibre channel, cordless communication network etc.Main frame 101 can be can by the way with the messaging device that memory device communicates, such as, and personal computer, panel computer, server, portable computer, the network switch, router, cell phone, personal digital assistant etc.Memory device 102 comprises host interface 103, control circuit 104, one or more flash chip 105 and memory buffer 106.Host interface 103 can adapt to and exchange data by the modes such as such as SATA, IDE, USB, PCIE, SCSI, Ethernet, optical-fibre channel and main frame 101.Control circuit 104 for control between host interface 103, flash chip 105 and memory buffer 106 data transmission, also for flash memory management, host logical address to flash memory physical address map, erasure balance, bad block management etc.Control circuit 104 is realized by software, hardware, firmware or its various ways combined.Control circuit 104 can be FPGA (Field-programmablegatearray, field programmable gate array), ASIC (ApplicationSpecificIntegratedCircuit, application specific integrated circuit) or its combination form.Control circuit 104 also can comprise processor or controller.
According to one embodiment of present invention, main frame 101 sends read-out command or write order to memory device 102.Control circuit 104 receives this read-out command or write order via host interface 103.Describe the first write order 200 as an example in fig 2 in detail.
Referring to Fig. 2 A, 2B, Fig. 2 A is the schematic diagram of the write order according to the embodiment of the present invention.Write order 200 comprises field 201,202,203 and 204.Field 201 indicates this order for write order, and field 202 is flash memory address, and field 203 is data, and this write order 200 indicates memory device 102 by the data in data field 203 based on the flash memory address write flash chip 105 indicated by field 202.Field 204 is buffer memory address, when memory device 102 receives this write order 200, first by the data in data field 203 based on write indicated by field 204 buffer memory address write buffering memory 106, then by the data in data field 203 based on indicated by field 202 flash memory address write flash chip 105.In one example in which, memory device 102 by the data in data field 203 based on write buffer memory address write buffering memory 106 indicated by field 204 after, from memory buffer 106, read this data again, then these data are written to flash chip 105.Write data into the operation of memory buffer 106, with by another data reading in storer 106 and be written to the operation of flash chip 105 can concurrence performance, thus main frame 101 is got a promotion to the concurrency performance of the write operation of memory device 102, and significantly can not increase the complexity of control circuit 104, because control circuit 104 is without the need to processing the allocation of space task of memory buffer 106.In one embodiment, can be the full address of memory buffer 106 in field 204, and in another embodiment, field 204 be off-set values of relatively a certain base address.In one embodiment, the data that will write flash memory 105 are carried in field 203.And in another embodiment, can carry a pointer in field 203, this pointed wants the data of write storage device 102, and these data can be stored in the storer of main frame 101, in the case, memory device 102 obtains this data by DMA transmitting procedure subsequently from main frame 101.In still another embodiment, field 203 can carry a pointer, and this pointed wants the data of write storage device 102, and these data can be stored in the memory buffer of memory device 102.Field 202 can be physical address or the logical address of the flash chip 105 that data will be write.Field 202 also can be a pointer, points to memory buffer 106, stores the physical address for flash chip 105 or logical address wherein.Logical address, to the transfer process of physical address, can be realized by the mode of searching address mapping table.
One of ordinary skill in the art will easily recognize, write order can have multiple specific coding mode and order of the field.Such as, referring to Fig. 2 B, the type of instruction write order 210 is that the field 214 of write operation can in the write end of order 210 or other positions.And in field 211, carry buffer memory address, in field 212, carry the pointer of the deposit position of data or sensing data.In field 213, deposit flash memory address, or point to the pointer depositing flash memory address, flash memory address can be logical address or physical address.
Fig. 3 is the process flow diagram of the method performing write order according to the memory device of the embodiment of the present invention.In step 301, memory device 102 receives write order 200 from main frame 101.After the control circuit 104 of memory device 102 receives write order 200 by host interface 103, extract be contained in write order 200 in be used to indicate the field 201 that action type is write operation, be used to indicate the field 202 of the address of the flash memory that will write, be used to indicate the field 203 of the data that will write, and be used to indicate the field 204 of address of memory buffer 106.In step 302, in response to this write order 200, control circuit 104 obtains the address for memory buffer 106 based on field 204, and obtains the data that will write based on field 203, and the data that will write are written to the position in memory buffer 106 indicated by field 204.When writing data into after in memory buffer 106, memory device 102 can send message to indicate the complete of write order 200, although data are now not yet written among flash chip 105 by actual to main frame.In this way, at main frame 101, after step 302 is complete, write order 200 is complete, thus improves the performance of the execution write order 200 of memory device 102.The message sent to main frame can be contained among the interrupt request that memory device 102 sends to main frame 101, also can coupling scheme (SATA, IDE, USB, PCIE, SCSI, Ethernet, optical-fibre channel, cordless communication network etc.) between Intrusion Detection based on host 101 and memory device 102 and select other suitable message modes.After the data that will write are written to memory buffer 106, under the control of control circuit 104, by the data that will write indicated by field 203, based on the flash memory address indicated by field 202, be written in flash chip 105 (step 303).When writing data into after in flash chip 105, memory device 102 also can send message to indicate the complete of write order 200 to main frame, especially, now main frame again can be specified and data are write the address that this is used to indicate memory buffer 106 in write order 200, and can not cause error in data because of the rewriting of the data to this address place.In one example in which, if be logical address for flash chip 105 indicated by field 202, then this logical address is converted to the physical address for flash chip 105.Logical address is that one of ordinary skill in the art understood to the conversion regime of physical address.In one example in which, in step 303, from memory buffer 106, again obtain write data, and these data are written to flash chip 105.One of ordinary skill in the art will recognize, under the control of control circuit 104, write data into the operation of memory buffer 106 in step 302, with the operation writing data into flash memories 105 in step 303, and can executed in parallel.Like this, can process multiple write order in memory device 102, wherein, a moment, based on a write order, the first data are written in memory buffer 106 by control circuit 104 simultaneously; And based on another write order, the second data be present in memory buffer 106 are written in flash chip 105 by control circuit 104.Memory buffer 106 can be dual-ported memory, makes, while writing the first data via the first port to memory buffer 106, to read the second data from the second port from memory buffer 106.One of ordinary skill in the art can recognize other embodiments of memory buffer 106, to support to read and/or write operation while many numbers certificate.
By carrying the field 204 of the address being used to indicate memory buffer 106 in write order, will safeguard that the work of memory buffer 106 removes from control circuit 104, and make main frame 101 have the ability of more flexible control store equipment 102.
Fig. 4 is the schematic diagram of the main frame according to the embodiment of the present invention.Fig. 4 shows the block scheme of the software composition of main frame 400.Main frame 400 can be personal computer, server computer or other there is the equipment of computing power.Main frame 400 comprises one or more user application 401,402 and 403, and operating system 404.There is in operating system 404 memory device driver 405.In an embodiment according to the present invention, driver 405 comprises buffer control block 406, in order to the memory buffer 106 of control store equipment 102 in main frame 400.Buffer control block 406 is by multiple storage unit (411,412 ... 41n) form, each storage unit (411,412 in buffer control block 406 ... 41n) corresponding to the storage unit of in memory buffer 106, and the duty of corresponding stored unit in record buffer storer 106.In one embodiment, the storage unit (411,412 in buffer control block 406 ... 41n) each, the corresponding stored unit in record buffer storer 106 is idle or occupied.In a further embodiment, sending in memory device 102 read/write command the multiple storage unit related in memory buffer, such as 2.In the case, in buffer control block 406 2 storage unit (411,412) is associated together, this incidence relation between record storage unit 411 and 412 is gone back in storage unit 411,412, such as, in storage unit 411, record points to one or more pointers of storage unit 412.Still further in embodiment, in storage unit 412, also record points to one or more pointers of storage unit 411.
Fig. 5 is the process flow diagram performing write operation according to the main frame of the embodiment of the present invention.When user application or the execution of other PROGRAMMED REQUESTS write data into the operation of memory device, application program or other programs can send write request.Memory device driver 405 in Fig. 4 receives this write request (step 501), this write request comprises data that will write that application program or other programs provide for the address of memory device, address for memory device can be file path and off-set value, and is converted into the logical address for memory device further.In one example in which, this logical address is the logical address of the flash chip on memory device, and data will be written in flash chip based on this logical address by this write request.In step 502, memory device driver 405 is the memory buffer of this write request distribution free time.Particularly, traversal buffer control block 406, finding is wherein the storage unit of idle condition, such as, storage unit 411.Storage unit 411 is idle condition, represents that the corresponding stored unit in the memory buffer 106 of memory device 102 is idle condition, can receive the data of write.
In step 503, memory device driver 405 sends write order to memory device 102, comprise the data that will write and the address for memory device 102 at write order, in this write order, also comprise the address for memory buffer 106 that same storage unit 411 is corresponding.One of ordinary skill in the art will recognize, have various ways to obtain the corresponding relation of the corresponding stored unit in storage unit 411 and memory buffer 106.Such as, n storage unit (411,412 is had in buffer control block 406 ... 41n), and in memory buffer 106, also comprise n storage unit, storage unit 411 corresponds to first storage unit in memory buffer 106, and storage unit 412 corresponds to second storage unit in memory buffer 106, and similarly, storage unit 41n corresponds to the n-th storage unit in memory buffer 106, makes the address that can calculate the corresponding stored unit in memory buffer 106 based on the position of storage unit 411 in buffer control block 406.Still as an example, can also in storage unit (411,412 ... 412) address of the corresponding stored unit in store buffer memory 106.In still another example, in write order, carry a sequence number, this sequence number had both indicated the position of storage unit 411 in buffer control block 406, indicated again the position of the corresponding stored unit in memory buffer 106.
In step 504, receive the message from memory device 102.In one example in which, this message is interrupt request, and this interrupt request indicates the write order sent in step 503 to be finished.As elucidated before, in one example in which, data in write order are being written to memory buffer 106 (especially by the control circuit 104 in memory device 102, be written to storage unit corresponding with the storage unit 411 of buffer control block 406 in memory buffer 106) after, namely memory device sends interruption, indicates this write order complete.In one example in which, after control circuit 104 writes data into flash chip 105, memory device 102 sends to main frame 101 and interrupts.In one example in which, the information of the storage unit of the buffer control block 406 that the write order also comprising transmission in instruction step 503 in this interrupt request is correlated with.This information can be one or more storage unit (411,412 ... address 41n), one or more storage unit (411,412 ... sequence number 41n).
In step 505, in response to this interrupt request received in step 504, and the information of storage unit based on the buffer control block 406 relevant to this write order indicated in this interrupt request, discharge the storage unit (411,412 of the buffer control block 406 relevant to this write order ... 41n).Release storage unit (411,412 ... can be 41n) specifically in storage unit (411,412 ... the corresponding stored unit arranged 41n) in memory buffer 106 is idle condition.
In one example in which, write order in step 503 relates to two storage unit 411 and 412 of buffer control block 406, further, in storage unit 411 and 412, have recorded sensing pointer each other respectively, to represent that these two storage unit 411,412 are associated with same write order.In the interrupt request received in step 504, storage unit 411 both can be indicated also can to indicate storage unit 412.In step 505, based on the pointer of one of instruction storage unit 411 and 412, two storage unit 411 and 412 can be obtained, and discharged.Similarly, one of ordinary skill in the art can recognize can also associate three or more storage unit (411,412 in this way in write order ... 41n).
Fig. 6 is the schematic diagram of the second write order according to the embodiment of the present invention.Second write order instruction memory device 102 obtains data with dma mode from main frame 101 and is written to flash chip 105.Second write order can be dma descriptor 600.Dma descriptor 600 comprises command dma 610 and one or more DMA data (620,630).Command dma 610 comprises field 611, is used to indicate dma mode, i.e. the operation of this dma descriptor 600 instruction, and it can be flash memory reading and writing, erasing or other operations.Field 612 indicates the logical address of memory device.Field 613 indicates the length of this dma descriptor 600, i.e. the number of these DMA data (620,630) included by dma descriptor 600, and it can be one or more.Field 614 indicates the address of memory buffer 106.DMA data 620,630 comprise field 621,631 respectively, are used to indicate the host address in DMA transmission.DMA data 620,630 also comprise field 622,632 respectively, are used to indicate the address of memory buffer 106.
The logical address of the memory device of the field 612 in command dma 610 can be used for DMA data 620,630.When only comprising DMA data 620 in dma descriptor 600, the host address that memory device 102 indicates according to field 621 and the buffer memory address that field 622 indicates, between main frame 101 and memory device 102, initiate DMA transmission, and the data received the most at last are stored in the flash chip 105 indicated by field 612.When dma descriptor 600 comprises DMA data 620 and 630, memory device 102 transmits the data of gained by performing DMA according to DMA data 620, finally be stored in the flash chip 105 indicated by field 612, and memory device 102 also will perform the data of DMA transmission gained according to DMA data 630, be finally stored in and added in the flash chip 105 indicated by a predetermined offset value by field 612.In other words, dma descriptor 600 can indicate the repeatedly DMA between main frame 101 and memory device 102 to transmit, each DMA transmission is corresponding with in DMA data 620,630, the data (such as 4K byte) of equal number are transmitted in each DMA transmission, and the logical address of the memory device that DMA data 620 are transmitted with the DMA corresponding to DMA data 630 be continuous print (such as, at a distance of predetermined off-set value, this off-set value can be corresponding with the data volume that DMA transmits).Like this, in dma descriptor 600, a memory device logical address (field 612) can only be carried.And two DMA host addresses (field 621,631) that DMA data 620 and the DMA corresponding to DMA data 630 transmit can be discontinuous, the DMA transmission disperseing-collect (Scatter-Gather) mode can be supported like this.
In the DMA transmission corresponding to DMA data 620, by the data from the DMA host address indicated by field 621, be written in the memory buffer 106 indicated by field 622, be then then written in flash chip 105.In the DMA transmission corresponding to DMA data 630, by the data from the DMA host address indicated by field 631, be written in the memory buffer 106 indicated by field 632, be then then written in flash chip 105.
Field 614 is optional.Buffer memory address place corresponding to field 614, as an example, can preserve the length of the dma descriptor 600 indicated by field 613.Thus the DMA transmission can recorded corresponding to DMA many data 620,630 has and how much performed, or have and how much be not yet performed.For dma descriptor 600, after the DMA corresponding to its whole DMA data 620,630 transmits equal executed, such as, corresponding data are all written to after in flash chip 105, memory device 102 sends to main frame 101 and interrupts, complete with what indicate dma descriptor 600.Like this, for dma descriptor 600, although it corresponds to 2 DMA transmitting procedures, only send to main frame 101 and once interrupt.Reduce interrupt request number of times, will the working load reducing main frame 101 be contributed to.
Fig. 7 A, 7B are the process flow diagrams performing the second write order according to the memory device of the embodiment of the present invention.Second write order can be descriptor 600 as shown in Figure 6.Referring to Fig. 7 A, in step 701, memory device 102 receives dma descriptor 600.Dma descriptor 600 comprise for main frame address (such as, DMA host address 621,631), for flash chip 105 address (such as, memory device logical address 612) and for the address (such as, buffer memory address 622,632) of memory buffer 106.Although dma descriptor 600 in figure 6 comprises command dma 610, DMA data 620,630, this is only the object in order to clear expression.Command dma 610, DMA data 620,630 also can be combined.Memory device 102 extracts the address for main frame from dma descriptor 600, for the address of flash chip 105 and the address for memory buffer 106.
In step 702, memory device 102, based on the address for main frame and the address for memory buffer, writes data into memory buffer 106 with DMA transmission mode from main frame 101.In step 703, based on the address for flash memories with for memory buffer, by the data be written in a step 702 in memory buffer, be written to flash chip 105.
In one example in which, in step 702, after writing data into memory buffer 106, to main frame 101 send interrupt, with indicate to DMA transmission complete.If only comprise this time DMA transmission (such as, DMA describes 600 and only comprises command dma 610 and DMA data 620) in dma descriptor 600, then also to represent dma descriptor 600 complete in this interruption.In one example in which, in step 703, after writing data into flash chip 105, to main frame 101 send interrupt, with indicate to DMA transmission complete.
Referring to Fig. 7 B, it illustrates the more detailed processing procedure to the dma descriptor 600 comprising multiple DMA data (620,630).In step 711, memory device 102 receives dma descriptor 600, and dma descriptor 600 comprises command dma 610, DMA data 620 and DMA data 630.
In step 712, based on dma descriptor 600, DMA data 620 are transformed to a DMA micro-order, DMA data 630 are transformed to the 2nd DMA micro-order.One DMA micro-order comprises DMA host address 621 and buffer memory address 622.Based on a DMA micro-order, the logical address 612 of the memory device corresponding with it, dma operation type and dma descriptor length 613 can also be obtained.The logical address 612 of this memory device and dma operation type can be parts for a DMA micro-order, also can be stored in memory buffer 106, and visited by the index in a DMA micro-order, can also by a DMA micro-order being placed in specific operation queue (reading and writing, erasing, other), to identify the action type of a DMA micro-order.
As still another example, for a DMA micro-order, obtain being stored in the pointer in memory buffer 106 according to buffer memory address 622 and a predetermined off-set value, based on this pointer, obtain logical address 612 and/or the dma descriptor length 613 of memory device.By similar mode, for the 2nd DMA micro-order, obtain being stored in the pointer in memory buffer 106 according to buffer memory address 632 and a predetermined offset value, based on this pointer, obtain logical address 612 and/or the dma descriptor length 613 of memory device.
In a preferred embodiment, based on buffer memory address 614, dma descriptor length 613 is stored in memory buffer 106, wherein dma descriptor length is equal to number (or the total number of command dma in dma descriptor 600 and DMA data of the DMA data in dma descriptor 600, therefrom can obtain the number of DMA data), and visit dma descriptor length 613 by the index in a DMA micro-order.Like this, the execution sequence of a DMA micro-order and the 2nd DMA micro-order becomes inessential.Often perform a DMA micro-order, dma descriptor length in memory buffer 106 is successively decreased (such as, subtract 1 or deduct unit length), when the dma descriptor length in memory buffer 106 becomes 0, represent all complete to all dma operations of this dma descriptor 600.
In step 713, for a DMA micro-order, based on DMA host address 621 and buffer memory address 622, write data in corresponding memory buffer 106 with DMA transmission mode.
In step 714, for the 2nd DMA micro-order, based on DMA host address 631 and buffer memory address 632, with DMA transmission mode, corresponding data is written in memory buffer 106.
In step 715, send to main frame and interrupt, to indicate, the operation of dma descriptor 600 is completed.
In one example in which, step 713, also comprises the data be written in memory buffer 106 corresponding for a same DMA micro-order, based on memory device logical address 612, is written in flash chip 105.Step 714 also comprises with the corresponding data be written in memory buffer 106 of the 2nd DMA micro-order, based on memory device logical address 612 add predetermined offset value and, be written in flash chip 105.
In a preferred embodiment, in step 713,714, after corresponding data being written in memory buffer 106, also based on the index in first, second micro-order, access the dma descriptor length 613 be stored in memory buffer, and dma descriptor length 613 is successively decreased (such as, subtract 1 or deduct unit length).Like this, when this dma descriptor length 613 becomes 0, mean and the operation of dma descriptor 600 is completed.In this way, multiple dma descriptor 600 can be processed in memory device 102, and the execution sequence of a DMA micro-order and the 2nd DMA micro-order is also unessential simultaneously.Other modes can also be adopted to identify that the multiple DMA data in dma descriptor 600 are all performed.Such as, each DMA data for each dma descriptor 600 in memory buffer or register provide mark, after DMA data (DMA micro-order) are performed, by corresponding flag set.Order can also perform each DMA data (DMA micro-order) in dma descriptor 600, after last DMA data (DMA micro-order) are performed, what mean this dma descriptor 600 is complete.
In still another embodiment, after each the DMA micro-order in dma descriptor 600 is performed, sends to main frame 101 and interrupt, and analyzed by host driver whether the execution of dma descriptor 600 is completed.The process whether analytical approach is all performed with the multiple DMA data identified in memory device 102 described above in dma descriptor 600 is similar.
The structured flowchart writing the memory device of order for the execution second implemented in Fig. 7 A, 7B is illustrated in Fig. 7 C.In Fig. 7 C, main frame 101 comprises PCIE controller 721 and mainframe memory 722.Mainframe memory 722 can be random access storage device (RAM), and PCIE controller 721 communicates via PCIE bus for same memory device.Memory device 102 comprises PCIE interface 731, DMA instruction analysis device 732, micro-order FIFO (first-in first-out buffer) 733, DMA write operation controller 734, DMA write interface 735, logical address to physical address translations circuit 736, Flash interface controller 737, flash chip 105 and memory buffer 106.
The dma descriptor 600 that PCIE interface 731 Receiving Host 101 is sent by PCIE controller 721.Connection between main frame 101 and memory device 102 is not limited to PCIE mode, can also pass through SATA, IDE, USB, PCIE, SCSI, Ethernet, optical-fibre channel etc. and connect main frame 101 and memory device 102.The dma descriptor 600 that PCIE interface 731 receives by DMA instruction analysis device 732 is transformed to DMA micro-order.For dma descriptor 600 as shown in Figure 6, comprising DMA data 620 and DMA data 630, then DMA instruction analysis device is transformed to the DMA micro-order corresponding to DMA data 620 and the 2nd DMA micro-order corresponding to the 2nd DMA data 630.The structure of the one DMA micro-order and the 2nd DMA micro-order is introduced hereinbefore in detail.DMA instruction analysis device 732 also extracts dma descriptor length from the command dma 610 of dma descriptor 600, and is preserved it, can be kept in memory buffer 106, register or analog.The quantity of the DMA data of dma descriptor Length Indication included by dma descriptor 600, also indicates the number of the DMA micro-order obtained from this dma descriptor 600.One DMA micro-order and the 2nd DMA micro-order are stored in micro-order FIFO733 by DMA instruction analysis device 732.
Micro-order FIFO733 can buffer memory DMA micro-order, and provides DMA micro-order according to the mode of first in first out to DMA write operation controller 734.Although here only for write operation, describe and the DMA micro-order corresponding with DMA write operation be buffered in micro-order FIFO733, one of ordinary skill in the art by recognize can by the DMA micro-order corresponding with DMA read operation with and DMA micro-order hybrid cache corresponding to DMA write operation at micro-order FIFO733.Micro-order FIFO733 can also be configured to two parts or multiple part, wherein a part is exclusively used in and stores the DMA micro-order corresponding with DMA read operation, and another part is exclusively used in the storage DMA micro-order corresponding with DMA write operation.
For the DMA micro-order corresponding with DMA write operation, such as, a DMA micro-order noted earlier and the 2nd DMA micro-order, DMA write operation controller 734 performs DMA write operation based on these DMA micro-orders.As noted earlier, a DMA micro-order comprises, DMA host address 621 and buffer memory address 622.DMA write operation controller 734 utilizes DMA host address 621 and buffer memory address 622, write interface 735 by DMA and initiate DMA write operation between main frame 101 and memory device 102, the data at DMA host address 621 place will be stored in, be transferred to the position indicated by buffer memory address 622, the data transmitted can have predetermined length (such as 4K byte).For the 2nd DMA micro-order, DMA write operation controller 734 performs similar operation, will be stored in the data at DMA host address 631 place, is transferred to the position indicated by buffer memory address 632.
The logical address for respective memory device can be obtained from a DMA micro-order and the 2nd DMA micro-order.In logical address to physical address translations circuit 736, the logical address for the memory device of every bar DMA micro-order is converted to the physical address for flash chip 105.For each DMA micro-order, Flash interface controller 737 will be written to the data of memory buffer 106, and the physical address that logic-based address provides to physical address translations circuit 736 is written in flash chip 105.
Flash interface controller 737 is also based on the index in first, second micro-order, what access was preserved extracts dma descriptor length from the command dma 610 of dma descriptor 600, and dma descriptor is successively decreased (such as, subtract 1 or deduct unit length).Like this, when this dma descriptor length becomes 0, mean and the operation of dma descriptor 600 is completed.Then, can send to main frame and interrupt, to indicate, the operation of dma descriptor 600 be completed.In one example in which, preserved dma descriptor length also accessed by DMA write operation controller, and determine whether all data corresponding with dma descriptor 600 to be all written in memory buffer 106, and send to main frame the interruption that all data of instruction have been written to memory buffer 106.
Fig. 8 is the software block diagram of the main frame according to the embodiment of the present invention.Fig. 8 shows the block scheme of the software of main frame 800, and its software block diagram with the main frame shown in Fig. 4 is similar.Difference is, also comprises I/O request chained list 801 in the buffer control block 406 in Fig. 8.I/O request chained list 801 is the storage unit (411,412 utilized in buffer control block 406 ... chained list 41n) formed.I/O request chained list 801 can be single-track link table, doubly linked list or circular linked list.When generating dma descriptor 600 as shown in Figure 6, for a dma descriptor 600, create an I/O request chained list 801 corresponded, comprising distinguishing corresponding storage unit (811,812,813) with command dma 610, DMA data 620, DMA data 630 respectively.It is pointed out that storage unit (811,812,813) is the storage unit (411,412 of buffer control block 406 ... three storage unit 41n), and by arranging corresponding pointer, form I/O request chained list 801.In fig. 8, by storage unit (811,812,813) and storage unit (411,412 ... 41n) separately show, be only used to the needs clearly described.
Fig. 9 A creates according to the main frame of the embodiment of the present invention and performs the process flow diagram of the second write order.In one embodiment, step 901, receives I/O request by the memory device driver 405 of main frame.Multiple data blocks of the different physical addresss being dispersed in mainframe memory are written in memory device 102 by the instruction of this I/O request, will perform dispersion-collection dma operation between main frame and memory device for this reason.The operating process of main frame to storer write data will be described by way of example below.
In step 902, composition graphs 8, takes out the storage unit of an idle condition, such as storage unit 411 from buffer control block 406.
In step 904, according to the content of I/O request, create the command dma 610 of dma descriptor 600, fill dma mode field 611 (in this example embodiment, being write operation), memory device logical address field 612 (this information can be obtained from I/O request), dma descriptor length field 613 (this information can be obtained from I/O request) and the buffer memory address field 614 (corresponding with the storage unit 411 of distributing in step 902) in command dma 610.Then created command dma 610 is sent to memory device 102.And using storage unit 411 as the start node (such as storage unit 811) of I/O request chained list 801 being used for this I/O request.Create I/O request chained list 801, after executing dma descriptor 600 at memory device 102, shared storage unit is returned to buffer control block 406, and with regard to the complete notice application software of this I/O request or other upper layer software (applications)s.For this purpose, in one example in which, in storage unit 411, also store the pointer corresponding to this I/O request.Based on dma descriptor length, the residue length of DMA data division also can be obtained.Before generation first DMA data, the residue length of DMA data division is the number of the DMA data (620,630) in dma descriptor 600, and as an example, it subtracts 1 for dma descriptor length.
In step 906, from buffer control block 406, take out the storage unit of an idle condition, such as, storage unit 412.According to the content of I/O request, create the DMA data 620 of dma descriptor 600, fill DMA host address field 621 (this information can be obtained from I/O request) in DMA data 620 and buffer memory address 622 (corresponding with distributed storage unit 412, such as, the off-set value of storage unit 412 in buffer control block 406 or sequence number).Then created DMA data 620 are sent to memory device 102.And using storage unit 412 as the node (such as storage unit 812) of I/O request chained list 801 being used for this I/O request.
In step 908, DMA data division residue length is successively decreased, obtain the number of the DMA data not yet sending to memory device in dma descriptor 600.
In step 909, if the residue length of DMA data division is 0, then represent that the generation of dma descriptor 600 completes, and then will wait in step 910 memory device driver 405 interruption that the process of the expression dma descriptor 600 that memory device 102 returns has completed, and find I/O request chained list 801 corresponding with it according to this interruption, and by storage unit (811, the 812) release in I/O request chained list 801.In other words, the state by the storage unit (811,812) in I/O request chained list 801 is set to the free time, thus makes can know that the state of storage unit 411,412 is for idle by buffer control block 406.In one example in which, read operation is indicated at dma descriptor 600, and the CPU of main frame 101 is when comprising cache memory, also notify that the CPU cache memory that the DMA host address (621,631) of same dma descriptor 600 is associated performs consistency treatment, to reflect that the data at DMA host address (621,631) place may change because reading DMA read operation.In one example in which, the interruption that memory device 102 returns comprises the content of one of multiple storage unit (811,812) in instruction I/O request chained list 801 one of (or buffer memory address 622,632), according to this content, by I/O request chained list 801, storage unit (811,812) is discharged.
In step 909, if the residue length of DMA data division is greater than 0, then represent that the generation of dma descriptor 600 not yet completes, and also needs for I/O request generates one or more DMA data, so process will turn back to step 906 and repeated execution of steps 906,908 and 909.
Fig. 9 B is that main frame creates and performs the process flow diagram of the second write order according to another embodiment of the present invention.In this embodiment, the free memory locations in buffer control block 406 is further organized as free memory locations pond, to contribute to the constructive process of dma descriptor 600.By by state in buffer control block 406 being idle storage unit (411,412 ... 41n) be organized into chained list to form free memory locations pond.When needs obtain free memory locations from buffer control block 406, storage unit can be taken out from free memory locations pond, thus eliminate the expense of searching free memory locations in buffer control block 406.
In one embodiment, step 921, receives I/O request by the memory device driver 405 of main frame.Similar with Fig. 9 A, multiple data blocks of the different physical addresss being dispersed in mainframe memory are written in memory device 102 by the instruction of this I/O request, will perform dispersion-collection dma operation between main frame and memory device for this reason.
In step 922, according to the content of I/O request, calculate the length (such as, the number of command dma and DMA data) for the dma descriptor corresponding with this I/O request identical.Noticing in embodiment disclosed in Fig. 9 A, is create in the process of command dma 610 in step 904 to obtain dma descriptor length, and one of ordinary skill in the art will recognize each step and not necessarily performs with order disclosed in the present embodiment.
In step 923, judge in free memory locations pond whether be empty.If free memory locations pond non-NULL, namely there is the storage unit being in idle condition in buffer control block 406, then proceed to step 924, and take out a free memory locations (such as storage unit 411) from free memory locations pond.If free memory locations pond is empty, mean in buffer control block 406 there is no idle storage unit.Then in step 925, wait for that free memory locations pond is updated, there is idle storage unit.When dma descriptor complete after, associated storage unit can be released, thus in free memory locations pond, occur idle storage unit.Behind this will be described in detail.
In step 926, determine currently will generate command dma field for dma descriptor 600 or DMA data field.Generally speaking, dma descriptor 600 comprises a command dma and one or more DMA data.When generating command dma, process turns to step 927, and according to the content of I/O request, creates the command dma 610 of dma descriptor 600, fills each field (611,612,613,614) in command dma 610.In one example in which, also store in storage unit 411 and correspond to the pointer of this I/O request, so as this I/O request complete after, this I/O request of identifiable design also notifies application software or other upper layer software (applications)s.When generating DMA data, process turns to step 928, and according to the content of I/O request, creates the DMA data 620 of dma descriptor 600, fills each field (621,622) of DMA data 620.
Next, in step 929, generated command dma or DMA data are sent to memory device 102.And in step 930, the storage unit 411 obtained in step 924 is arranged in I/O request chained list 801.As an example, first storage unit entering into I/O request chained list 801, using the head node as I/O request chained list 801, but, also will recognize when I/O request chained list 801 is organized as annular chain meter, wherein not exist " head node ".In step 930, also dma descriptor length is successively decreased.
In step 931, if dma descriptor length is 0, mean that the generation of dma descriptor 600 completes, and then will wait in step 932 memory device driver 405 interruption that the process of the expression dma descriptor 600 that memory device 102 returns has completed, and find I/O request chained list 801 corresponding with it according to this interruption, and by storage unit (811, the 812) release in I/O request chained list 801.In other words, state by the storage unit (811,812) in I/O request chained list 801 is set to the free time, thus make can know that the state of storage unit 411,412 is for idle by buffer control block 406, and storage unit 411,412 is put into free memory locations pond.In one example in which, the interruption that memory device 102 returns comprises the content of one of the multiple storage unit (811,812) indicated in I/O request chained list 801, according to this content, by I/O request chained list 801, storage unit (811,812) is discharged.
In step 931, if dma descriptor length is greater than 0, then represent that the generation of dma descriptor 600 not yet completes, and also needs for I/O request generates one or more DMA data, so process will turn back to step 923 and repeated execution of steps 923-931.
Composition graphs 9A, 9B describes the generative process of dma descriptor 600 above.Dma descriptor 600 in dispersion-collect the multiple dma operations describing in DMA and will perform, the plurality of dma operation data from the storage space be stored in continuously or do not contact.One of ordinary skill in the art will easily recognize, the generating mode of dma descriptor 600 includes but not limited to the concrete mode described in Fig. 9 A, 9B above.
Figure 10 A is the process flow diagram creating chained list according to an embodiment of the invention in the memory buffer of memory device.In the process of the storage device processes dma descriptor 600 such as disclosed in Fig. 7 A-7C, dma descriptor 600 is converted to one or more micro-order.In a further embodiment, in order to effectively process incidence relation between one or more micro-order (such as, these micro-orders are all associated with dma descriptor 600), the dma descriptor 600 that memory device 102 transmits in response to main frame 101, also in memory buffer 106, set up chained list, the multiple micro-orders corresponding to same dma descriptor 600 associate by this chained list.
As shown in Figure 10 A, in step 1002, main frame 101 sends dma descriptor 600 to memory device 102.Dma descriptor 600 comprises command dma 610 and DMA data 620,630.Composition graphs 9A and Fig. 9 B and describe main frame 101 sends example from the process of dma descriptor 600 to memory device 102 above.It is to be further appreciated that and create chained list in the memory buffer of memory device, will the execution of memory device to I/O operation be contributed to, particularly to multiple I/O operation concurrent/Out-of-order execution, multiple I/O operation is associated together by accessing respective chained list.Do not possess like this incidence relation I/O operation can in memory device concurrence performance.Thus, IO order or other orders of the other types except command dma can also be responded, to create chained list in memory device.
In step 1004, received by judgement is command dma 610 or DMA data 620,630.
If receive command dma 610, in step 1006, from buffer memory address field 610 wherein, extract the buffer memory address for this command dma 610, and based on this buffer memory address, be this command dma 610 memory allocated space in memory buffer 106.Next, in step 1008, save as the buffer memory address that this command dma 610 distributes, be used for using for during DMA data 620,630 distributing buffer storage address.
If judge that received is DMA data 620 in step 1004, then in step 1010, from the buffer memory address field 622 of DMA data 620 from the buffer memory address extracted for these DMA data 620, and based on this buffer memory address, be these DMA data 620 memory allocated space in memory buffer 106.And in step 1012, in the storage space of the memory buffer of distributing for these DMA data 620, be stored in the buffer memory address of the command dma 610 preserved in step 1008.Like this, in memory buffer 106, the storage space distributed for command dma 610 and DMA data 620 defines chained list, and the storage space wherein distributed for command dma 610 is the head node of chained list, and the storage space distributed for DMA data 620 is connected to the head node of chained list.
When dma descriptor 600 also comprises DMA data 630, by step 1010 and step 1012, be DMA data 630 memory allocated spaces in memory buffer 106 based on the buffer memory address 632 in DMA data 630, and in the storage space of the memory buffer of distributing for DMA data 630, preserve the buffer memory address of command dma 610.One of ordinary skill in the art will recognize, also in the storage space of the memory buffer 106 of distributing for DMA data 630, can preserve the buffer memory address being used for DMA data 620, thus form dissimilar chained list.In other examples, the storage space distributed for command dma 610, DMA data 620,630 in memory buffer 106 is created as circular linked list or doubly linked list.
Composition graphs 7A, 7B, 7C has described memory device 102 and has generated DMA micro-order based on DMA data (620,630) above, and is kept in micro-order FIFO733.After the operation that DMA data (620,630) generate DMA micro-order can betide step 1012, and in DMA micro-order, carry the buffer memory address distributed for DMA data (620,630).
Figure 10 B is the process flow diagram creating chained list in the memory buffer of memory device according to one embodiment of the invention.The embodiment provided with Figure 10 A is compared, in the embodiment of Figure 10 B, also by the process of dma descriptor or perform relevant information and be stored in created chained list.Figure 10 C utilizes the chained list created in memory buffer to perform the process flow diagram of dma descriptor according to the memory device of one embodiment of the invention.Figure 11 A-11F illustrates the various states of the memory buffer be associated with Figure 10 C with Figure 10 B.In Figure 11 A-11F, the storage space in 1100 instruction memory buffer 106.
Particularly, in step 1020, main frame 101 sends dma descriptor 600 to memory device 102.
In step 1022, received by judgement is command dma 610 or DMA data 620,630.
If receive command dma 610, in step 1024, from buffer memory address field 610, extract buffer memory address, and based on this buffer memory address, be this command dma 610 memory allocated space in memory buffer 106.Referring to Figure 11 A, it is command dma 610 memory allocated space 1101.And also from command dma 610, extract dma descriptor length field 613, the length (such as, dma descriptor length subtracts 1) of the DMA data division of this dma descriptor 600 can be obtained from dma descriptor length 613.Next, in step 1026, save as the buffer memory address that this command dma 610 distributes, be used for using for during DMA data 620,630 distributing buffer address.Further, by the length records of DMA data division in the memory buffer of distributing for this command dma 610.Referring to Figure 11 A, in storage space 1101, save the length (in this example, the length of DMA data division is 2) of DMA data division.
If judge that received is DMA data 620 in step 1022, then in step 1028, from the buffer memory address field 622 of DMA data 620 from the buffer memory address extracted for these DMA data 620, and based on this buffer memory address, be these DMA data 620 memory allocated space in memory buffer 106.Referring to Figure 11 B, it is DMA data 620 memory allocated space 1112.And in step 1030, in the storage space 1112 of the memory buffer of distributing for these DMA data 620, be stored in the buffer memory address of the command dma 610 preserved in step 1026.Like this, in memory buffer 106, the storage space (1101 and 1112) distributed for command dma 610 and DMA data 620 defines chained list, the storage space 1101 wherein distributed for command dma 610 is head nodes of chained list, and the storage space 1112 distributed for DMA data 620 is connected to the head node of chained list.In storage space 1112, also store the corresponding DMA host address of same DMA data 620.
When dma descriptor 600 also comprises DMA data 630, by step 1028 and step 1030, be DMA data 630 memory allocated spaces 1123 (referring to Figure 11 C) in memory buffer 106 based on the buffer memory address 632 in DMA data 630, and in storage space 1123, preserve the buffer memory address of command dma 610.And in storage space 1123, also store the corresponding DMA host address of same DMA data 630.
Thus, in memory buffer 106, define the chained list that same dma descriptor 600 is corresponding, wherein storage space 1101 is head nodes of chained list, and storage space 1112 and 1123 is nodes of chained list, and points to the head node of this chained list.One of ordinary skill in the art will recognize, also in the storage space 1123 of the memory buffer 106 of distributing for DMA data 630, can preserve the buffer memory address being used for DMA data 620, thus form dissimilar chained list.In other examples, the storage space distributed for command dma 610, DMA data 620,630 in memory buffer 106 is created as circular linked list or doubly linked list.
Figure 10 C utilizes the chained list created in memory buffer to perform the process flow diagram of dma descriptor according to the memory device of one embodiment of the invention.Composition graphs 7A, 7B, 7C has described memory device 102 and has generated DMA micro-order based on DMA data (620,630) above, and is kept in micro-order FIFO733.In the execution of memory device 102 pairs of DMA micro-orders, in one example in which, the chained list in memory buffer 106 is utilized.In DMA micro-order, comprise buffer memory address, by this buffer memory address, the storage space in the memory buffer 106 of distributing for the DMA data corresponding with this DMA micro-order can be obtained, and then can obtain and the DMA host address corresponding to these DMA data and the number with the DMA data portion length in the dma descriptor corresponding to these DMA data or DMA data.
In the following description, the DMA micro-order corresponding to DMA data 620 is indicated by a DMA micro-order, the DMA micro-order corresponding to DMA data 630 is indicated by the 2nd DMA micro-order.
In step 1040, obtain a DMA micro-order from micro-order FIFO733.
In step 1042, a DMA micro-order comprises the address of the storage space 1112 of the memory buffer 106 of distributing for DMA data 620, and obtains DMA host address from storage space 1112.This DMA host address is provided by the DMA host address field 621 in DMA data 620.Based on DMA host address, between main frame 101 and memory device 102, carry out DMA transmission, by the data of the predetermined length (such as, 4KB) at this DMA host address place of main frame 101, be transferred to dma mode in the memory buffer of memory device 102.For the 2nd DMA micro-order, perform similar operation, by the data of the DMA host address provided by the DMA host address field 632 of DMA data 630 of main frame 101, be transferred to storage space 1123 place distributed for DMA data 632 of the memory buffer of memory device 102 with dma mode.In Figure 11 D, show after executing a DMA micro-order and the 2nd DMA micro-order, store with the storage space 1112 of the data of dma mode transmission and storage space 1123.
In step 1044, continue to be performed a DMA micro-order.By the address of the storage space 1112 in a DMA micro-order, take out the data of predetermined length from storage space, these data are in step 1042, are transferred to the storage space 1112 of memory buffer 106 by dma operation from main frame 101.And by flash interface controller (such as, the Flash interface controller 737 in Fig. 7 C) by these data based on the address being used for flash memories included in a DMA micro-order, be written to flash chip 105.This address being used for flash memories is obtained by the memory device logical address field 612 in command dma 610.2nd DMA micro-order is performed in a similar fashion.The address of the storage space 1123 comprised by the 2nd DMA micro-order, the data of predetermined length are taken out from storage space, and by these data by flash interface controller, based on the address for flash memories included in the 2nd DMA micro-order, be written to flash chip 105.The address for flash memories included in 2nd DMA micro-order, add that predetermined value (such as corresponds to the length of the data of DMA transmission by the memory device logical address field 612 in command dma 610, in this example embodiment, be 4KB) obtain.In one example in which, the memory device logical address in command dma 610 is converted to the physical address of memory device, and writes data in flash chip 105 based on this physical address.Mapping process from the logical address of memory device to physical address is known by one of ordinary skill in the art.
In step 1046, continue to be performed a DMA micro-order.By the address of the storage space 1112 in a DMA micro-order, the address of the storage space 1101 that acquisition distributes for command dma 610, and DMA data portion length is obtained in storage space 1101, and the DMA data portion length stored in storage 1101 is successively decreased (such as, subtract 1 or deduct unit length).Referring to Figure 11 E, for a DMA micro-order, after being successively decreased by the DMA data portion length in storage space 1101, its value becomes 1 from 2.Further, in storage space 1112, no longer preserving the address of storage space 1101, for showing, the execution of DMA data 620 being completed.In step 1048, because the length of DMA data division is not 0, means and the operation of dma descriptor 600 is not yet completed, because it also comprises another DMA data 630, now, be not further processed.
When the 2nd DMA micro-order is performed in step 1046, by the address of the storage space 1123 in the 2nd DMA micro-order, the address of the storage space 1101 that acquisition distributes for command dma 610, and DMA data portion length is obtained in storage space 1101, and the DMA data portion length stored in storage 1101 is successively decreased (such as, subtract 1 or deduct unit length).Referring to Figure 11 F, for the 2nd DMA micro-order, after being successively decreased by the DMA data portion length in storage space 1101, its value becomes 0 from 1.Further, in storage space 1123, no longer preserving the address of storage space 1101, for showing, the execution of DMA data 630 being completed.
Now, when the second dma descriptor is performed in step 1048, because the length of DMA data division is 0, means and the execution of dma descriptor 600 is completed.Next, in step 1050, send to main frame 101 and interrupt, complete to indicate the execution to DMA describes 600.
Again referring to Figure 11 F, storage space 1112 and 1123 all no longer preserves the address of storage space 1101.The value of the DMA data portion length in storage space 1101 is 0.In the case, mean and complete the execution of dma descriptor 600, all can not be used storage space 1101,1112 and 1123, these storage spaces can be released for the execution to other dma descriptors again.In one example in which, control release to respective stored space and recycling by main frame 101, above composition graphs 9A and Fig. 9 B to the release of the storage space in I/O request chained list 801.Due to the storage unit (411,412 in buffer control block 406 ... 41n) corresponding with the storage space in memory buffer 106, thus to the release of the storage space in I/O request chained list 801, the release to the storage space 1101,1112 and 1123 in memory buffer is meaned.
Composition graphs 10B, 10C, 11A-11F and describe the scheme of DMA host address storing in memory buffer 106 and correspond to first and second micro-order above, thus make need not carry DMA host address in DMA micro-order and decrease taking circuit resource, and by scheme that memory buffer 106 will correspond to first, second DMA micro-order of same dma descriptor 600 and is associated together.One of ordinary skill in the art will recognize, the memory device logical address and/or DMA host address that correspond to first and second micro-order can also be stored in memory buffer, thus reduce length and the taking circuit resource thereof of DMA micro-order further.
Figure 12 is the hardware block diagram of memory device according to still another embodiment of the invention.Similar to disclosed in Fig. 7 C, main frame 101 comprises PCIE controller 721 and mainframe memory 722.Memory device 102 comprises PCIE interface 731, DMA instruction analysis device 732, micro-order first-in first-out buffer (FIFO) 733, DMA write operation controller 734, DMA write interface 735, logical address to physical address translations circuit 736 and memory buffer 106.Also comprise DMA in memory device 102 and read and write micro-order decision circuitry 1210, DMA reads interface 1212, flash controller 1221,1222,1223, flash interface 1231,1232,1233, completes control circuit 1242, MUX 1241 and multichannel shared device 1243.Flash interface 1231,1232,1233 is coupled in flash chip 105.
The dma descriptor 600 that PCIE interface 731 Receiving Host 101 is sent by PCIE controller 721.Connection between main frame 101 and memory device 102 is not limited to PCIE mode.The dma descriptor 600 that PCIE interface 731 receives by DMA instruction analysis device 732 is transformed to DMA micro-order.For dma descriptor 600 as shown in Figure 6, then DMA instruction analysis device is transformed to the DMA micro-order corresponding to DMA data 620 and the 2nd DMA micro-order corresponding to DMA data 630.In one example in which, comprise the field of the access unit address in the field of this micro-order type of instruction (read/write/erasing/other), the instruction memory buffer 106 corresponding with it in first and second DMA micro-order respectively, indicate the field of the logical address of memory device.
Referring to Figure 10 B and Figure 11 C, DMA instruction analysis device 732 also for command dma 610, memory allocated unit in memory buffer 106, and the length storing DMA data division wherein.DMA instruction analysis device also for DMA data 620, memory allocated unit in memory buffer 106, and the access unit address being stored as that command dma 610 distributes wherein, and store the DMA host address in DMA data 620.DMA instruction analysis device also for DMA data 630, memory allocated unit in memory buffer 106, and the access unit address being stored as that command dma 610 distributes wherein, and store the DMA host address in DMA data 630.
One DMA micro-order and the 2nd DMA micro-order are stored in micro-order FIFO733 by DMA instruction analysis device 732.
Micro-order FIFO733 can buffer memory DMA micro-order, and reads and writes micro-order decision circuitry 1210 according to the mode of first in first out to DMA and provide DMA micro-order.
Read and write micro-order decision circuitry 1210 at DMA, judge the type of the DMA micro-order obtained.For the DMA micro-order corresponding with DMA write operation, such as, a DMA micro-order noted earlier and the 2nd DMA micro-order, DMA write operation controller 734 performs DMA write operation based on these DMA micro-orders.The field of the access unit address in the memory buffer 106 that DMA write operation controller 734 utilizes the instruction in a DMA micro-order corresponding with it, DMA host address is obtained from memory buffer 106, and write interface 735 by DMA initiate DMA write operation between main frame 101 and memory device 102, data in DMA host address will be stored in, be transferred in the storage unit of the memory buffer 106 corresponding with a DMA micro-order, the data transmitted can have predetermined length (such as 4K byte).For the 2nd DMA micro-order, DMA write operation controller 734 utilizes the field of the access unit address in the memory buffer 106 corresponding with it, DMA host address is obtained from memory buffer 106, and DMA write operation is initiated between main frame 101 and memory device 102, to the data in DMA host address be stored in, be transferred in the storage unit of the memory buffer 106 corresponding with the 2nd DMA micro-order.
The logical address for respective memory device is obtained from the field of the logical address of the instruction memory device of a DMA micro-order and the 2nd DMA micro-order.In logical address to physical address translations circuit 736, the logical address of the memory device of every bar DMA micro-order is converted to the physical address for flash chip 105.For each DMA micro-order, the physical address that Flash controller 1221,1222,1223 logic-based address provides to physical address translations circuit 736, the data of memory buffer 106 will be written to by flash interface 1231,1232,1233, be written in flash chip 105, wherein, Flash controller 1221 is coupled with flash interface 1231, and Flash controller 1222 is coupled with flash interface 1232, and Flash controller 1223 is coupled with flash interface 1233.And flash interface 1231,1232,1233 is coupled to respective flash chip respectively.Thus for the physical address for flash chip 105 that the logical address from the memory device in DMA micro-order is converted to, this physical address indicates specific flash chip, and specific one of this flash chip and flash interface 1231,1232,1233 is coupled.Thus, based on this physical address, can determine to use in flash interface 1231,1232,1233 which data are write flash chip, which in Flash controller 1221,1222,1223 also can determine to use.Flash interface 1231,1232,1233 is also coupled by MUX 1241 and memory buffer.Based on this physical address, data are sent to specific one flash interface 1231,1232,1233 by MUX 1241 from memory buffer 106.
After flash interface 1231,1232,1233 writes data in flash chip 105, complete control circuit 1242 also based on the field of the access unit address in the memory buffer 106 corresponding with it of the instruction in first, second micro-order, accesses buffer 106, and and then be storage unit that command dma 610 distributes in accesses buffer, therefrom obtain the length of DMA data division, and the length of DMA data division is successively decreased (such as, subtract 1 or deduct unit length).Like this, when the length of this DMA data division in the storage unit of distributing for command dma 610 becomes 0, mean and the operation of dma descriptor 600 is completed.Then, can send to main frame and interrupt, to indicate, the operation of dma descriptor 600 be completed.
Although illustrate the embodiment comprising three Flash controllers, 1221,1222,1223 and three flash interfaces 1231,1232,1233 in Figure 12 by way of example, one of ordinary skill in the art will recognize and the Flash controller and flash interface that can use multiple varying number adapt with the quantity of same flash chip.
For the DMA micro-order corresponding with DMA read operation, DMA reads and writes micro-order decision circuitry 1210 and directly sends it to logical address to physical address translations circuit 736, and obtains the physical address for flash chip 105.Flash controller 1221,1222,1223 based on this physical address, by flash interface 1231,1232,1233 will from flash chip 105 sense data.And based on the field of the access unit address in the memory buffer 106 corresponding with it of the instruction in DMA micro-order, the DMA host address corresponding with this DMA micro-order is obtained from memory buffer 106, and read interface 1212 via DMA and between main frame 101 and memory device 102, initiate DMA transmit, sense data is transferred to the position indicated by this DMA host address in the main frame RAM722 of main frame 101.Flash interface 1231,1232,1233 is read interface 1212 via multichannel shared device 1243 with DMA and is coupled, and makes the data obtained from flash interface 1231,1232,1233 all can read interface 1212 by DMA and is transferred to main frame RAM722.When flash interface 1231,1232,1233 is after flash chip 105 sense data, complete control circuit 1242 also based on the field of the access unit address in the memory buffer 106 corresponding with it of the instruction in DMA micro-order, accesses buffer 106, and and then obtain the length of DMA data division, and the length of DMA data division is successively decreased (such as, subtract 1 or deduct unit length).Like this, when the length of this DMA data division becomes 0, mean and the operation of this dma descriptor is completed.Then, can send to main frame and interrupt, to indicate, the operation of this dma descriptor be completed.
In the memory device disclosed in Figure 12, the concurrent operations to multiple dma descriptor 600 can be supported.For each of multiple dma descriptor 600, by the chained list created in memory buffer 106, by the DMA data correlation corresponding with dma descriptor 600 together, make to become inessential to the sequence of operation of multiple DMA micro-order.
Describe the execution that memory device performs data write operation or the dma descriptor relevant to write operation above in detail.Obviously, memory device execution read operation also can benefit from the present invention is open.Such as, can in reading order simultaneously specified flash chip address and buffer memory address, and utilize memory buffer as the buffering of sense data.Also can describe buffer memory address in the dma descriptor relevant to read operation, after data being read from flash chip, memory buffer can be utilized as the buffer memory of sense data.
Figure 13 is the structured flowchart of the memory device according to further embodiment of this invention.Memory device in Figure 13 is similar with the memory device in Fig. 1.Its difference is, also comprises interrupt control circuit 1301 in its control circuit 104.In a further embodiment, memory device also comprises standby power supply 1305.Various ways can be had to provide standby power supply 1305, such as, super capacitor, UPS, rechargeable battery etc.Be described previously the data first write buffering memory 106 of control circuit 104 based on write order 200 from host 101 in future in Fig. 2 A, then write flash chip 105.Further, when based on order 200 by data write buffering memory 106 after, message or interrupt request can be sent to main frame 101, to indicate, the write operation of order 200 be completed.Although now data are not yet written to flash chip 105, memory device 102 can guarantee that these data will be reliably written to flash chip 105.Even if now meet accident power-off, standby power supply 1305 also can provide electric energy that these data in memory buffer 106 are written to flash chip 105.
Because the capacity of standby power supply 1305 may be not enough to support that the total data in memory buffer 106 is written to flash chip 105, thus, interrupt control circuit 1301 also to be monitored in memory buffer 106 and the data volume not yet write in flash chip 105.When this data volume is more than a predetermined threshold, and when making the energy of standby power supply 1305 that this data volume cannot be supported to be written to flash chip 105, interrupt control circuit 1301 will temporarily suppress the activity sending message or interruption to main frame 101.Owing to not receiving message from memory device 102 or interruption, main frame 101 can be appreciated that the execution of memory device 102 to write order 200 not yet completes, this means, if now there is power down, memory device 102 does not ensure will complete the execution of write order 200, and in write order 200, entrained data may be lost.
When do not receive from the instruction write order 200 of memory device 102 complete message or interrupt time, state that main frame 101 can think that memory device 102 is in " do ", and correspondingly temporary transient not sending to memory device 102 further writes order.Main frame 101 also can not wait complete message or the interruption of write order 200 to be instructed, and concurrent or asynchronously to memory device 102 send other write order.But main frame 101 should be recognized, for the write order not receiving the complete message of instruction or interruption, its execution may not complete.It is also to be noted that, when memory buffer 106 of main frame 101 memory allocated equipment 102, the complete message of instruction write order 200 or interruption not mean the release of the corresponding storage unit to memory buffer 106, because the data that the respective memory unit of memory buffer 102 is not yet written in flash chip 105 in addition, these storage unit are still in occupied state.
Thus, the data volume of flash chip 105 to be written in memory buffer 106 is detected by interrupt control circuit 1301, temporarily do not send complete message or the interruption of instruction write order 200 to main frame 101, ensure that the data volume of the flash chip to be written 105 in memory buffer 106 can not exceed the ability of standby power supply 1305.
In one example in which, interrupt control circuit 1301 safeguards a counter.When control circuit 104 is by data write buffering memory 106, counter increment; And when the data in memory buffer 106 are taken out and write flash chip 105 by control circuit 104, counter decrement.Thus when the value of this counter exceedes predetermined threshold, interrupt control circuit 1301 is implemented to interrupt suppressing.And constantly take out the data in memory buffer 106 along with control circuit 104 and write flash chip 105, when making under counter decrement to predetermined threshold, interrupt control circuit 1301 recovers to send to main frame 101 message or interruption that indicate write order 200 to operate.There is multiple similar fashion can the data volume of flash chip 105 to be written in cache memory access 106, as provided buffer queue, and monitoring queue depth.In one example in which, control circuit 104 records the data volume of write buffering memory 106 and the data volume of write flash chip 105, and the difference of both interrupt control circuit 1301 calculating obtains the data volume of the flash chip to be written 105 of buffer memory in memory buffer 106.
The size of predetermined threshold can preset.It is relevant to factors such as the electricity of standby power supply 1305, the power consumptions of memory device 102.For specific standby power supply 1305 and memory device 102, by the predetermined threshold that measuring is suitable.And for the consideration of reliability, preferably when setting threshold value, provide certain nargin.Because the electricity of electric capacity, battery can change along with the time, operationally can also measure the electricity of standby power supply 1305 or indicate the parameter of this electricity, as in american documentation literature US8031551B2 mention.And the corresponding relation setting up this parameter and threshold value is stored in memory device 102, for operationally detecting the parameter of standby power supply 1305, and adjust threshold value.By main frame 101, this threshold value can also be set to memory device 102.Special threshold value setting command can be provided, be sent by main frame 101, be received by memory device 102.The threshold value that will set can be carried in threshold value setting command, also memory device 102 can be caused to detect the parameter of the instruction electricity of standby power supply 1305 based on this threshold value setting command, and and then change threshold value setting.Composition graphs 18-21, also provides the scheme set according to the change threshold value of the embodiment of the present invention.
In one example in which, interrupt control circuit 1301 suppresses the activity sending message or interruption to main frame 101 will be realized to the message of main frame 101 transmission or interruption by buffer memory.Particularly, interrupt control circuit 1301 can be used for the identifier identifying write order 200 to main frame 101 by buffer memory.Alternatively, can buffer memory write order 200 itself.The buffer memory address 204 of all right buffer memory write indicated by order 200, because this buffer memory address 204 can indicate which or which storage unit to be released to main frame 101.Further, the suppression of interrupt control circuit 1301 pairs of message or interruption, and do not rely on the buffer memory address 204 carried in write order 200.Do not comprise buffer memory address in write order, and processed the situation of the distribution of memory buffer 106 by memory device 102, also can implement message or interrupt suppressing.In this case, order itself can be write or writes the identifier of order by buffer memory.
Even if it is pointed out that interrupt control circuit 1301 inhibits the activity sending message or interruption to main frame 101, the data in memory buffer 106 are still written in flash chip 105 by control circuit 104.
When there is power down, be dropped by the message of interrupt control circuit 1301 buffer memorys or interruption, the data being not yet written to flash chip 105 corresponded also are dropped, and indicate the corresponding data of the write order of complete message or interruption to be written in flash chip 105 by having have sent to main frame 101 in memory buffer 106.
Also will it is noted that when memory buffer 106 be empty, main frame 101 can send multiple write order to memory device 102, and receives the message or interruption that indicate and write and ordered very soon.Now, main frame 101 can be experienced memory device 102 and has good write performance.When the free space of memory buffer 106 is depleted, or interrupt suppressing because interrupt control circuit 1301 implements, the write performance that main frame 101 can experience memory device 102 is deteriorated rapidly.Jolting in this performance is disadvantageous, because the time of ablation process consumption becomes unpredictable.
Jolt for reducing, the number of times initiating a message to main frame 101 or interrupt in during interrupt control circuit 1301 also monitors certain hour.If the message sent in during certain hour or interruption times are too much, such as exceeded certain threshold value, then interrupt control circuit 1301 will suppress the activity sending message or interruption to main frame 101.Like this, when the free space of the memory buffer 106 in memory device 102 is more, although memory device 102 can accept more concurrent write order, suppressed by the interruption of interrupt control circuit 1301, and too much message or interruption can not be sent to main frame.Here the time cycle that enforcement monitors can be arranged by user, and can operationally dynamic conditioning, and corresponding threshold value also can be arranged by user, and can operationally dynamic conditioning.
Also by it is noted that jolt and the message implemented or the message interrupted suppressing to adapt with the electricity for same standby power supply and implement or interrupt suppressing for reducing, can implement separately, also can combine enforcement.Be described previously to be embodied as separately to reduce and jolt and the message implemented or interrupt suppresses and the example that suppresses for the message that the electricity of same standby power supply adapts and implement or interrupt.In the example that combination is implemented, interrupt control circuit 1301 to detect in memory buffer 106 and not yet writes the data volume in flash chip 105.When this data volume is more than the first predetermined threshold, interrupt control circuit 1301 produces the first interruption and suppresses signal.And interrupt control circuit 1301 is interior to the actual number of times initiating a message or interrupt of main frame 101 during also monitoring certain hour.If the message sent in during certain hour or interruption times have exceeded certain Second Threshold, interrupt control circuit 1301 has produced the second interruption and has suppressed signal.If the first any one of interrupting in suppression signal or the second interruption suppression signal is effective, then interrupt control circuit 1301 is implemented message or is interrupted suppressing, such as, interrupt control circuit 1301 does not temporarily send message or interruption to main frame 101, but is cached.Further, along with the enforcement interrupting suppressing and be written into flash chip 105 along with the data in memory buffer 106, the data volume not yet write in memory buffer 106 in flash chip 105 will be less than first threshold, thus first interrupt suppress signal will become invalid; And along with the enforcement and as time goes by interrupting suppressing, the message sent in during certain hour or interruption times will be less than Second Threshold, thus second interrupt suppression signal will become invalid.When first interrupt suppressing signal and second interrupts suppressing both all become invalid after, interrupt control circuit 1301 can by buffer memory or the message of newly generation or interruption send to main frame 101.
Figure 14 A and 14B memory device according to still another embodiment of the invention performs the process flow diagram interrupting suppressing.Electricity for same standby power supply adapts and implements message or interrupt suppressing.In step 1402, memory device 102 receives the data wanting write storage device of from host 101.In one example in which, this packet is contained in write order 200.In other examples, these data are transferred to memory device 102 by dma mode from main frame 101.In step 1404, these data are written to memory buffer 106 by control circuit 104, and by counter increment.The value of counter indicates the data volume be not yet written in memory buffer 106 in flash chip 105.For the write order with fixed data amount, can be increase Board Lot, such as 1 to increasing progressively of counter.For the write order with variable data amount, can be increase the numerical value corresponding with data volume to increasing progressively of counter.Disclose above, after writing data into memory buffer 106, interrupt control circuit 1301 can send message or interruption to main frame 101, to indicate writing the complete of order.And be implement to interrupt suppressing, in step 1406, interrupt control circuit 1301 judges whether counter is less than predetermined threshold.If the value of counter is less than predetermined threshold, then perform step 1408, interrupt control circuit 1301 sends instruction write to main frame and orders the message or interruption that have processed.In step 1406, if interrupt control circuit 1301 finds that counter is greater than predetermined threshold, then do not send to main frame 101 message or interruption that indicate write order executed to complete.Interrupt control circuit 1301 is by implementing message or interrupting suppressing to the buffer memory of message or interruption.
Continue referring to Figure 14 B, which show the process flow diagram of the concurrent another part method of the method flow diagram shown with Figure 14 A.When having the data not yet writing flash chip 105 in memory buffer 106, control circuit 104 is sense data from memory buffer 106, step 1410.Further, in step 1412, the data of reading are also written to flash chip 105 by control circuit 104, and by counter decrement.Successively decreasing of counter can be Board Lot or the numerical value corresponding with data volume.Step 1410 with 1412 execution be with step 1402,1404,1406, the execution of 1408 is parallel.Thus, in step 1406, if interrupt control circuit 1301 finds that counter is greater than predetermined threshold, when interruptable controller 1301 is implemented to interrupt suppressing, along with step 1410,1412 execution, the data of buffering are constantly write flash chip 105, thus the value of counter is successively decreased, and the value of counter can be become be less than predetermined threshold.
Figure 15 is the process flow diagram that memory device 102 execution interruption according to still another embodiment of the invention suppresses.For reduce jolt and implement message or interrupt suppress.In step 1502, memory device 102 receives the data wanting write storage device of from host 101.In one example in which, this packet is contained in write order 200.In other examples, these data are transferred to memory device 102 by dma mode from main frame 101.In step 1504, these data are written to memory buffer 106 by control circuit 104, and by counter increment.The value of counter indicates the data volume be not yet written in memory buffer 106 in flash chip 105.Disclose above, after writing data into memory buffer 106, interrupt control circuit 1301 can send message or interruption to main frame 101, to indicate writing the complete of order, and counts the number of times sending message or interruption.And be implement to interrupt suppressing, in step 1506, interrupt control circuit 1301 judges whether the interruption times sent in predetermined time interval is greater than predetermined threshold.In one example in which, the timer producing then signal at regular intervals can be used.And monitor the message or interruption times that then occur between signal for twice.If interruption times is not more than predetermined threshold, then perform step 1510, interrupt control circuit 1301 sends instruction write to main frame and orders the message or interruption that have processed.In step 1506, if interrupt control circuit 1301 finds that counter is greater than predetermined threshold, then do not send to main frame 101 message or interruption that indicate write order executed to complete.Interrupt control circuit 1301 is by implementing message or interrupting suppressing to the buffer memory of message or interruption.In another example, whenever timer then signal is effective time, be counter equal predetermined value, this numeric representation upper once timer then signal effectively before, the message that can send to main frame 101 or the quantity of interruption, and often send a message or interruption, by this counter decrement.If next timer then signal effectively before, counter decrement is 0, then interruptable controller 1301 comes into effect and interrupts suppressing.In one example in which, the fixed time interval of timer and/or predetermined threshold can be upgraded by main frame 101 or control circuit 104.Also it is pointed out that the message that interruptable controller 1301 is implemented or interrupt suppressing, not affecting control circuit 104 and the data in memory buffer 106 are written in flash chip 105.When there are data to be written in memory buffer 106, control circuit 104 just can operate with other and data in memory buffer 106 is written in flash chip 105 concurrently.
In a further embodiment, the message that the electricity for same standby power supply Figure 14 A, 14B can shown adapts and implements or interrupt suppressing, that shows with Figure 15 jolts and the message implemented or interrupt suppression and combine for reducing.Control circuit 104 receives the data wanting write storage device 102, and by data write buffering memory 106.Interrupt control circuit 1301 to detect in memory buffer 106 and not yet writes the data volume in flash chip 105.When this data volume is more than the first predetermined threshold, interrupt control circuit 1301 produces the first interruption and suppresses signal.And interrupt control circuit 1301 is interior to the actual number of times initiating a message or interrupt of main frame 101 during also monitoring certain hour.If the message sent in during certain hour or interruption times have exceeded certain Second Threshold, interrupt control circuit has produced second and has interrupted suppressing signal.If the first any one of interrupting in suppression signal or the second interruption suppression signal is effective, then interrupt control circuit 1301 is implemented message or is interrupted suppressing, such as, interrupt control circuit 1301 does not temporarily send message or interruption to main frame 101, but is cached.Further, along with the enforcement interrupting suppressing and be written into flash chip 105 along with the data in memory buffer 106, in memory buffer 106 and not yet the data volume write in flash chip 105 will be less than first threshold, thus first interrupt suppression signal will become invalid; And along with the enforcement and as time goes by interrupting suppressing, the message sent in during certain hour or interruption times will be less than Second Threshold, thus second interrupt suppression signal will become invalid.When first interrupt suppressing signal and second interrupts suppressing both all become invalid after, interrupt control circuit 1301 can by buffer memory or the message of newly generation or interruption send to main frame 101.
Figure 16 A is the structured flowchart of the memory device that execution interruption according to still another embodiment of the invention suppresses.Memory device in Figure 16 A is similar with the memory device in Fig. 7 C, for performing the dma descriptor 600 shown according to Fig. 6.Its difference is, it also comprises interruptable controller 1601.Interruptable controller 1601 is coupled to DMA writes interface 735 and Flash interface controller 737.As noted earlier, for a DMA micro-order, DMA write operation controller 734 utilizes DMA host address 621 and buffer memory address 622, write interface 735 by DMA and initiate DMA write operation between main frame 101 and memory device 102, the data at DMA host address 621 place will be stored in, be transferred to the position indicated by buffer memory address 622, the data transmitted can have predetermined length (such as 4K byte).Next, interruptable controller 1601 record is written to memory buffer 106 but is not yet written to the data volume in flash chip 105.Due to the data (such as 4K byte) of the corresponding equal number of every bar DMA micro-order, counter can be safeguarded by interruptable controller 1601, and when writing data into memory buffer 106 based on a DMA micro-order (or afterwards), make counter increment unit value (such as 1, corresponding to 4K byte).For the 2nd DMA micro-order, DMA write operation controller 734 performs similar operation, will be stored in the data at DMA host address 631 place, is transferred to the position indicated by buffer memory address 632.When writing data into memory buffer 106 based on the 2nd DMA micro-order (or afterwards), still make counter increment unit value.Disclose above, for each DMA micro-order, Flash interface controller 737 will be written to the data of memory buffer 106, and the physical address that logic-based address provides to physical address translations circuit 736 is written in flash chip 105.Then, interruptable controller 1601 is by counter decrement unit value.
After writing data into memory buffer 106 based on a DMA micro-order or the 2nd DMA micro-order with dma mode, interruptable controller 1601 checks whether counter is greater than predetermined threshold.If counter is greater than predetermined threshold, means in memory buffer 106 and stored too much data to be written.When unexpected power down, the electricity of the standby power supply on memory device 102 is not enough to support these data to be written to be saved in flash chip 105.Thus, interruptable controller 1601 suppresses the instruction sent to main frame 101 to the complete message of a DMA micro-order or the 2nd DMA micro-order or interruption.In one example in which, when the DMA micro-order included by dma descriptor 600 and the 2nd DMA micro-order all complete, namely, after the equal write buffering memory 106 of data transmitted based on a DMA micro-order and the 2nd DMA micro-order, whether flash controller is greater than predetermined threshold based on counter and determines whether send the complete message of instruction dma descriptor 600 or interruption to main frame 101.When the actual generation of unexpected power down, the message suppressed for interruptable controller 1601 or interruption, and be dropped with these message or the DMA micro-order corresponding to interrupting or its dma descriptor.And the data that the message sent to main frame 101 with interruptable controller 1601 or interrupt is transmitted indicated by corresponding DMA micro-order or dma descriptor, be written to utilizing standby power supply in flash chip 105.
In another embodiment, interruptable controller 1601 also utilizes another counter records in a predetermined time interval to the message of main frame 101 reality transmission or the quantity of interruption.By arranging a timer to obtain predetermined time interval.If in predetermined time interval, the message sent to main frame 101 reality or the quantity of interruption are beyond another threshold value, then interruptable controller 1601 suppresses the message that sends to main frame 101 or interruption.
In still another embodiment, the message that the electricity for same standby power supply adapts and implements or interrupt suppressing, jolts and the message implemented or interrupt suppression and combine with for reducing.The data being not yet written to flash chip 105 detected in memory buffer 106 when interruptable controller 1601 exceed predetermined threshold, then produce first and interrupt suppressing signal.When interruptable controller 1601 detects that the message or the quantity of interruption that send to main frame 101 reality in predetermined time interval are beyond another predetermined threshold, then produce second and interrupt suppressing signal.When first interrupts suppressing signal and second to interrupt suppressing any one in signal effective, interruptable controller 1601 implements message or interruption suppression.Along with Flash interface controller 737 by memory buffer 106 data write flash chip 105, first interrupt suppress signal can be changed into invalid, as time goes by and timer is again issued to time signal, second interrupt suppress signal can be changed into invalid.When first interrupts suppressing signal and second to interrupt suppressing signal all to become invalid, interruptable controller 1601 stops implementing to interrupt suppressing, and sends message or the interruption of institute's buffer memory to main frame 101.
The time cycle of timer here can be arranged by user, and can operationally dynamic conditioning, and corresponding threshold value (comprises the threshold value relevant to the data volume of the flash chip to be written 105 in memory buffer 106, and in predetermined time interval to the threshold value that the quantity of main frame 101 message that sends of reality or interruption is relevant) also can be arranged by user, and can operationally dynamic conditioning.
Figure 16 B is the structured flowchart of the memory device that execution interruption according to still another embodiment of the invention suppresses.Memory device in Figure 16 B is similar with the memory device in Figure 16 A, for performing the dma descriptor 600 shown according to Fig. 6.Its difference is, it also comprises interruption memory buffer 1613.Interrupt memory buffer 1613 and be coupled to interruptable controller 1601.When interruptable controller 1601 judges will perform message or interrupt suppressing, message or interruption are buffered in and interrupt in memory buffer 1613 by it.In one example in which, interruptable controller will send to the message of main frame 101 by all or interrupt all being buffered in interruption memory buffer 1613.Further, when without the need to implementing to interrupt controlling, from interruption memory buffer 1613, taking out message or interruption, and send to main frame 101.In one example in which, be identifier for identifying from dma descriptor 600 to main frame 101 what interrupt buffer memory in memory buffer 1613.Alternatively, can buffer memory the one DMA micro-order and the 2nd DMA micro-order.All right buffer memory buffer memory address 622 and buffer memory address 632, because this buffer memory address 622,632 can indicate dma descriptor 600 to main frame 101.In a preferred embodiment, buffer memory buffer memory address 622 and in buffer memory buffer memory address 632 in buffer device is being interrupted.By indicating buffer memory buffer memory address 622 and in buffer memory buffer memory address 632 to main frame 101 in message or interruption, with reference to embodiment disclosed in Fig. 9 A, Fig. 9 B, main frame 101 can obtain I/O request chained list corresponding with it, and thus knows which I/O request is done.
In another embodiment, can not arrange and interrupt memory buffer 1613, and as an alternative, buffer memory to send to message or the interruption of main frame 101 in memory buffer 106.
Figure 16 C is the structured flowchart of the memory device that execution interruption according to still another embodiment of the invention suppresses.Memory device in Figure 16 C is similar with the memory device in Figure 16 A, for performing the dma descriptor 600 shown according to Fig. 6.Its difference is, interruptable controller 1602 is not be coupled to DMA write interface 735 but be coupled to DMA write operation controller 734 and Flash interface controller 737.As noted earlier, for a DMA micro-order, DMA write operation controller 734 utilizes DMA host address 621 and buffer memory address 622, write interface 735 by DMA and initiate DMA write operation between main frame 101 and memory device 102, the data at DMA host address 621 place will be stored in, be transferred to the position indicated by buffer memory address 622, the data transmitted can have predetermined length (such as 4K byte).Next, interruptable controller 1602 record is written to memory buffer 106 but is not yet written to the data volume in flash chip 105.Due to the data (such as 4K byte) of the corresponding equal number of every bar DMA micro-order, counter can be safeguarded by interruptable controller 1602, and when writing data into memory buffer 106 based on a DMA micro-order (or afterwards), make counter increment unit value (such as 1, corresponding to 4K byte).For the 2nd DMA micro-order, DMA write operation controller 734 performs similar operation, will be stored in the data at DMA host address 631 place, is transferred to the position indicated by buffer memory address 632.When writing data into memory buffer 106 based on the 2nd DMA micro-order (or afterwards), still make counter increment unit value.Disclose above, for each DMA micro-order, Flash interface controller 737 will be written to the data of memory buffer 106, and the physical address that logic-based address provides to physical address translations circuit 736 is written in flash chip 105.Then, interruptable controller 1602 is by counter decrement unit value.
When interruptable controller 1602 judges will perform message or interrupt suppressing, interruptable controller 1602 indicates DMA write operation controller 734 to suspend the operation obtaining DMA micro-order from micro-order FIFO733.In this way, the DMA micro-order be not yet performed is buffered in FIFO733.And correspondence is by the DMA micro-order that DMA write operation controller 734 and DMA are write interface 735 and be performed, interruptable controller 1602 sends the message or interruption that indicate these DMA micro-orders to be performed to main frame 101.Or, in one example in which, when the whole DMA micro-orders corresponding to a dma descriptor have all write interface 735 by DMA write operation controller 734 and DMA and after being performed, interruptable controller 1602 sends to main frame 101 message or interruption that these DMA micro-orders of instruction or this dma descriptor be performed.When being written to flash chip 105 along with the data in memory buffer 106, when interruptable controller 1602 judges without the need to implementing to interrupt suppressing again, its instruction DMA write operation controller obtains DMA micro-order and performs from micro-order FIFO733.
When the actual generation of power down, micro-order in micro-order FIFO733 is dropped, and the data that the message sent to main frame 101 with interruptable controller 1602 or interrupt is transmitted indicated by corresponding DMA micro-order or dma descriptor, be written to utilizing standby power supply in flash chip 105.
In another embodiment, interruptable controller 1602 also safeguards that timer is to monitor in certain hour interval to the message of main frame 101 transmission or the quantity of interruption.When exceeding threshold value to the message of main frame 101 transmission or the quantity of interruption in certain hour interval, interruptable controller 1602 suppresses the activity sending message or interruption to main frame 101, namely indicates DMA write operation controller 734 to suspend and obtain DMA micro-order from micro-order FIFO733.
In still another embodiment, in interruptable controller 1602, the message that the electricity for same standby power supply adapts and implements or interrupt suppressing, jolts and the message implemented or interrupt suppression and combine with for reducing.
Figure 16 D is the structured flowchart of the memory device that execution interruption according to still another embodiment of the invention suppresses.Memory device in Figure 16 D is similar with the memory device in Figure 12, for performing the dma descriptor 600 shown according to Fig. 6.Its difference is, also comprises interruptable controller 1603.Interruptable controller 1603 is coupled to DMA write operation controller 734 and Flash interface 1231, Flash interface 1232 (not shown), Flash interface 1233 (not shown).Interruptable controller 1603 is that the flash chip be coupled with Flash interface 1231 arranges the first counter, and the flash chip be coupled for same Flash interface 1232 arranges the second counter, and the flash chip be coupled for same Flash interface 1233 arranges the 3rd counter.When each of Flash interface 1231,1232,1233 has been coupled multiple flash chip or flash memory die respectively, each the multiple flash chip be coupled or the flash memory die that can be same Flash interface 1231,1232,1233 have arranged counter corresponding with it respectively.When the electricity for same standby power supply adapts and implements message or interrupt suppressing, the multiple flash chip be preferably coupled for same Flash interface 1231,1232,1233 or tube core monitor its data volume to be written respectively.
As an example, in one embodiment, each all same flash chip of Flash interface 1231,1232,1233 is coupled, and each flash chip comprising a flash memory die, the first counter, the second counter and the 3rd counter correspond respectively to the flash chip that is coupled with Flash interface 1231 or tube core, the flash chip that is coupled with Flash interface 1232 or tube core and the flash chip be coupled with Flash interface 1233 or tube core.Each of Flash interface 1231,1232,1233 is all coupled to the situation of multiple flash chip or tube core, similar mode can be adopted to implement.When under the control at DMA writing controller 734, perform DMA micro-order, and write interface 735 by DMA initiate dma operation between main frame 101 and memory device 102, by data with after dma mode write buffering memory 106, interruptable controller 1603 obtains the logical address for flash chip 105 corresponding to this DMA micro-order by DMA write operation controller 734, and and then obtain physical address for flash chip 105 corresponding with this logical address, thus determine that the data of this DMA micro-order are by the flash chip of write or tube core, and by with the counter arranged for this flash chip or tube core (such as, second counter) increase progressively.Interruptable controller 1603 also can adopt other modes to obtain the physical address for flash chip 105 corresponding with DMA micro-order.When one of Flash interface 1231,1232,1233 (such as Flash interface 1232) writes data into the flash chip 105 be coupled with it, instruction interruptable controller 1603 writes the flash chip of data by corresponding to or the counter (in this example embodiment, the second counter) of tube core successively decreases.
When any one in the first counter, the second counter and the 3rd counter exceedes predetermined threshold, interruptable controller 1603 is implemented to interrupt suppressing.When the first counter, the second counter and the 3rd counter all do not exceed predetermined threshold, interruptable controller 1603 is removed and is interrupted suppressing.Also will recognize, the predetermined threshold corresponding to the first counter, the second counter and the 3rd counter can be different from each other, to adapt with each flash chip corresponding thereto or tube core.
In another embodiment, interruptable controller 1603 also safeguards that timer is to monitor in certain hour interval to the message of main frame 101 transmission or the quantity of interruption.When exceeding threshold value to the message of main frame 101 transmission or the quantity of interruption in certain hour interval, interruptable controller 1603 suppresses the activity sending message or interruption to main frame 101, namely indicates DMA write operation controller 734 to suspend and obtain DMA micro-order from micro-order FIFO733.
In still another embodiment, in interruptable controller 1603, the message that the electricity for same standby power supply adapts and implements or interrupt suppressing, jolts and the message implemented or interrupt suppression and combine with for reducing.
Mention above, memory device 102 can support the concurrent operations to multiple dma descriptor 600.For each of multiple dma descriptor 600, by the chained list created in memory buffer 106, by the DMA data correlation corresponding with dma descriptor 600 together, make to become inessential to the sequence of operation of multiple DMA micro-order.The message sent to main frame 101 at interruptable controller 1603 or interruption, what can indicate DMA micro-order is complete, and what also can indicate the dma descriptor be associated with DMA micro-order is complete.
Feed circuit, method of supplying power to and host supplying power ability measurement
The power supply of main frame or feed circuit after a loss of power, or computing machine peripheral device instruction power loss event after, the electric power that its peripheral device provides not stops at once completely.Due to the existence of the energy-storage travelling wave tube of such as electric capacity in the circuit such as power supply or mainboard, after a power failure, the electric energy in energy-storage travelling wave tube will outwards discharge.In Figure 18 A-18C, provide the feed circuit be arranged in memory device, and in Figure 19 A-19E, provide the multiple layout of the control circuit in feed circuit.
Figure 18 A is the schematic diagram of the feed circuit of peripherals according to an embodiment of the invention.The memory device 1810 that embodiment as shown in Figure 18 A comprises main frame 1800 and is coupled with main frame 1800.Main frame 1800 is coupled by various ways with between memory device 1810, and coupling scheme include but not limited to connect main frame 1800 and memory device 1810 by such as SATA, IDE, USB, PCIE, SCSI, Ethernet, optical-fibre channel, cordless communication network etc.Main frame 1800 can be can by the way with the messaging device that memory device communicates, such as, and personal computer, panel computer, server, portable computer, the network switch, router, cell phone, personal digital assistant etc.One of ordinary skill in the art will recognize, the peripherals of other types, and such as network adapter, graphics adapter etc. also can adopt feed circuit provided by the present invention.
Main frame 1800 comprises power supply 1802, for providing electric power to each electronic unit in main frame and the memory device 1810 that is connected to main frame 1800.In the electronic unit such as power supply, mainboard of main frame 1800, also comprise the energy-storage travelling wave tube of such as electric capacity 1804.Can have one or more at the energy-storage travelling wave tube of main frame 1800, here in order to clearly object, and be shown as electric capacity 1804.Between the output terminal that electric capacity 1804 is coupling in power supply 1802 and ground.
The feed circuit of memory device 1810 receive electric power from main frame, and supply load 1880.In memory device 1810, load 1880 can be flash memories and memorizer control circuit.The feed circuit of memory device 1810 comprise diode 1814, N-channel MOS FET (mos field effect transistor) 1816 and control circuit 1818.The anode of diode 1814 is coupled to the output terminal of power supply 1802, and the negative electrode of diode 1814 is coupled to load 1880.Diode 1814 defines the supply access 1823 of powering to load 1880.The source-coupled of N-channel MOS FET1816 to the output terminal of power supply 1802, the drain coupled of N-channel MOS FET1816 to load 1880, for providing electric power to load 1880.Control circuit 1818 is coupled to the grid of N-channel MOS FET1816, for controlling the closed of N-channel MOS FET1816 or disconnecting.N-channel MOS FET1816 works as a switch, and defines the supply access 1821 of powering to load 1880.Such as, the source electrode of N-channel MOS FET1816 is as the input end of switch, and the drain electrode of N-channel MOS FET1816 is as the output terminal of switch, and the grid of N-channel MOS FET1816 is used for the closed of gauge tap as control end and disconnects.
One of ordinary skill in the art will recognize, other forms of switch can be adopted to form supply access 1821, and other forms of switch includes but not limited to the switch of the PN junction form of such as triode, also can the mechanical switch of such as relay.Control circuit 1818 based on power supply 1802 output voltage or carry out other signals of from host 1800, and the closed of N-channel MOS FET1816 or disconnect to be controlled.When power supply 1802 normally works, its output voltage is more than or equal to predetermined voltage.Control circuit 1818 detects the output voltage of power supply 1802, and when detected output voltage is more than or equal to predetermined voltage, control circuit 1818 exports control signal to N-channel MOS FET1816, closes to make N-channel MOS FET1816.In the case, the electric power carrying out the power supply 1802 of from host 1800 is applied to load 1880 by N-channel MOS FET1816.In a preferred embodiment, choose diode 1814, make its conducting resistance be greater than the conducting resistance of N-channel MOS FET1816, thus when power supply 1802 normally works, electric power is provided to load 1880 by supply access 1821, instead of is provided to load 1880 by supply access 1823.Obviously, also can select N-channel MOS FET1816, make its conducting resistance be greater than the conducting resistance of diode 1814; Or collaborative consider the choosing, with the conducting resistance making the conducting resistance of N-channel MOS FET1816 be less than diode 1814 of diode 1814 and N-channel MOS FET1816.One of ordinary skill in the art also will recognize, diode 1814 and N-channel MOS FET1816 can conductings simultaneously, thus provide electric power by supply access 1821,1823 to load 1880 simultaneously.
When power down, due to the existence of electric capacity 1804, the voltage that power supply 1802 exports declines gradually.When the output voltage of power supply 1802 drops under predetermined voltage, it means main frame 1800 power down, and power supply 1802 cannot provide electric power for memory device 1810 with remaining valid.Control circuit 1818, based on the detection output voltage of power supply 1802 being less than to predetermined voltage, exports control signal, to disconnect N-channel MOS FET1816 to N-channel MOS FET1816.Although now the output voltage of power supply 1802 is less than predetermined voltage, it can make diode 1814 conducting, thus the electric power be stored in electric capacity 1804 is provided to load 1880 by supply access 1823.
In another embodiment, when there is power down in main frame 1800, or when stopping is provided electric power to memory device 1810 by main frame 1800 (such as, due to dormancy), main frame 1800 initiates a message to memory device 1810 generation indicating power loss event.Control circuit 1818 based on to the reception of power loss event and the identification that carry out from host 1800, and can export control signal, to disconnect N-channel MOS FET1816 to N-channel MOS FET1816.
In a further embodiment, control circuit 1818, after the power down of identification main frame 1800, starts timer.When control circuit 1818 maintains this timer, until detect that the voltage being supplied to load 1880 on supply access 1823 is less than the voltage threshold that can maintain load 1880 and normally work.Record and preserve the timing time of timer, this timing time is corresponding to the time utilizing the electricity of main frame electric capacity 1804 can maintain the normal work of load 1880.In another embodiment, for improving reliability, timing can be stopped when the magnitude of voltage that voltage supply access 1823 being supplied to load 1880 is less than on the voltage threshold that can maintain the normal work of load 1880 being detected, thus for providing nargin to the power supply of load 1880.
Return referring to Figure 13, interrupt control circuit 1301 to be monitored in memory buffer 106 and is not yet write the data volume in flash chip 105.When this data volume is more than a predetermined threshold, and when making the energy of standby power supply 1305 that this data volume cannot be supported to be written to flash chip 105, interrupt control circuit 1301 will temporarily suppress the activity sending message or interruption to main frame 101.And the feed circuit provided in Figure 18 A are provided, due to the electricity stored in the electric capacity 1804 of main frame can be utilized, thus after a power failure, the data of the greater number in memory buffer 106 can be supported to be written in flash chip 105.Thus, based on the timing time of timer measuring, the predetermined threshold that amendment interrupt control circuit 1301 monitors.Make when memory device normally works, larger memory buffer 106 can be utilized, thus obtain better performance.The corresponding relation of the increment of the predetermined threshold of timing time and memory buffer 106 obtains by testing, and is stored in memory device 1810 with the form such as fitting function or look-up table.Thus, memory device 1810 after obtaining the timing time of timer, the predetermined threshold of the memory buffer 106 that renewable interrupt control circuit 1301 monitors.Similarly, return referring to Figure 16 A, Figure 16 B, renewable interruptable controller 1601 monitor for the predetermined threshold being not yet written to the data volume of flash chip 105 in memory buffer 106; Return referring to Figure 16 C, renewable interruptable controller 1602 monitor for the predetermined threshold being not yet written to the data volume of flash chip 105 in memory buffer 106; And return referring to Figure 16 D, renewable interruptable controller 1603 monitor correspond to Flash interface 1231,1232,1233 each for the predetermined threshold being not yet written to the data volume of flash chip 105 in memory buffer 106.
Still referring to Figure 13, in one example in which, interrupt control circuit 1301 safeguards a counter.When control circuit 104 is by data write buffering memory 106, counter increment; And when the data in memory buffer 106 are taken out and write flash chip 105 by control circuit 104, counter decrement.Thus when the value of this counter exceedes predetermined threshold, interrupt control circuit 1301 is implemented to interrupt suppressing.At control circuit 1818 (Figure 18 A) after the power down of identification main frame 1800, the first count value of the counter that record interrupt control circuit 1301 is safeguarded.And when detecting that the voltage being supplied to load 1880 on supply access 1823 is less than the voltage threshold that can maintain the normal work of load 1880, record the second count value of this counter.When after power down, main frame can not send write request to memory device 1810 again, and thus counter can not increase progressively again; And only can be written into flash chip 105 and monotone decreasing along with the data of memory buffer 106 li.Thus the difference of the first count value and the second count value is corresponding to the data volume utilizing the electricity of main frame electric capacity 1804 to maintain the data in memory buffer 106 to be written in flash chip 105.The predetermined threshold that interrupt control circuit 1301 monitors can be revised according to this data volume.Similarly, the count value of the counter of the data volume of the flash chip to be written 105 indicated in memory buffer 106 can also be recorded in Figure 16 A, 16B, 16C.And correspondingly amendment is used for the predetermined threshold of memory buffer 106.
Figure 18 B is the schematic diagram of the feed circuit of peripherals according to still another embodiment of the invention.The feed circuit that Figure 18 B provides are similar with the feed circuit shown in Figure 18 A.Difference is, also comprises diode 1820 and electric capacity 1812 in Figure 18 B.The other end of electric capacity 1812 is coupling to ground.Electric capacity 1812, as the standby power supply of memory device 1810, provides emergency electric power for the load 1880 to memory device 1810.The conducting resistance of diode 1820 is greater than the conducting resistance of N-channel MOS FET1816, thus, when power supply 1802 normal power supply, control circuit 1818 controls to close as the N-channel MOS FET1816 of switch, thus is provided to load 1880 from the electric power of power supply 1802 by N-channel MOS FET1816.And when control circuit 1818, by detecting, supply access 1821 determines power supply 1802 power down from the voltage of power supply 1802, exporting control signal makes N-channel MOS FET1816 disconnect, and the output voltage from power supply 1802 of supply access 1821 can make diode 1820 conducting, thus the electric power of power supply 1802 is made to be provided to load 1880 by diode 1820.And now, electric capacity 1812 also provides electric power to load 1880, and can voltage on stable power-supplying path 1823.In another embodiment, when there is power down in main frame 1800, or when stopping is provided electric power to memory device 1810 by main frame 1800 (such as, due to dormancy), main frame 1800 initiates a message to memory device 1810 generation indicating power loss event.Control circuit 1818 based on to the reception of power loss event and the identification that carry out from host 1800, and can export control signal, to disconnect N-channel MOS FET1816 to N-channel MOS FET1816.
One of ordinary skill in the art will recognize, power supply 1802 can also charge for electric capacity 1812.In one embodiment, undertaken by diode 1814 charging of electric capacity 1812, and along with the increase of electricity in electric capacity 1812, the voltage of diode 1814 negative electrode raises, when the voltage difference at diode 1814 two ends is less than its cut-in voltage, diode 1814 ends.Also N-channel MOS FET1816 can be passed through, to charge to electric capacity 1812.
One of ordinary skill in the art also will recognize, can use the battery of variform, rechargeable battery substitutes electric capacity 1812, or together use with electric capacity 1812 and as the standby power supply of memory device 1810.
In the feed circuit with electric capacity 1812, control circuit 1818 record and the timing time of the timer preserved, corresponding to the time utilizing the electricity of main frame electric capacity 1804 and electric capacity 1812 can maintain the normal work of load 1880.Based on the timing time of this timer, modification as the interrupt control circuit 1301 in Figure 13 the predetermined threshold that monitors.Make when memory device normally works, larger memory buffer 106 can be utilized, thus obtain better performance.Also can revise the predetermined threshold for the memory buffer 106 in Figure 16 A, 16B, 16C, thus the storage space of larger memory buffer 106 can be utilized.
Figure 18 C is the schematic diagram of the feed circuit of peripherals according to another embodiment of the invention.The feed circuit that Figure 18 C provides are similar with the feed circuit shown in Figure 18 B.Difference is, also comprises N-channel MOS FET1822 in Figure 18 C.When control circuit 1818 determines power supply 1802 normal power supply by detecting the output voltage from power supply 1802 of supply access 1821, control circuit 1818 makes to close as the N-channel MOS FET1816 of switch, and export control signal, N-channel MOS FET1822 as switch is disconnected, thus is provided to load 1880 from the electric power of power supply 1802 by N-channel MOS FET1816.And when control circuit 1818 determines power supply 1802 power down by detecting the output voltage from power supply 1802 of supply access 1821, exporting control signal makes N-channel MOS FET1816 disconnect, and exports control signal and make the N-channel MOS FET1822 as switch closed.Thus make the electric power of power supply 1802 be provided to load 1880 by diode 1814 with as the N-channel MOS FET1822 of switch, and the electric power carrying out self-capacitance 1812 is also provided to load 1880 by N-channel MOS FET1822.And be also provided to load 1880 by diode 1820 from the electric power of power supply 1802.One of ordinary skill in the art also will recognize, as Figure 18 C in the feed circuit that provide, also can not use diode 1820.Other forms of switch can be adopted with alternative N-channel MOS FET1822, and other forms of switch includes but not limited to the switch of such as P channel mosfet, triode, other PN junction forms, also can be the mechanical switch of such as relay.
Figure 19 A, 19B, 19C, 19D and 19E respectively illustrate the embodiment of the control circuit in feed circuit of the present invention.
Referring to Figure 19 A, its control circuit 1818 comprises ADC (AnalogDigitalConverter, analogue-to-digital converters) 1901 and digital comparator 1903.The output voltage from power supply 1802 of supply access 1821 is carried out analog to digital conversion by ADC1901, obtains the digital value of the output voltage indicating power supply 1802.The digital value that ADC1901 exports by digital comparator 1903 is compared with predetermined digital value.When the digital value that ADC1901 exports is more than or equal to predetermined digital value, digital comparator 1903 exports control signal with closed N-channel MOS FET1816; And when the digital value that ADC1901 exports is less than predetermined digital value, digital comparator 1903 exports control signal to disconnect N-channel MOS FET1816.Based on similar principle, digital comparator 1903 can also provide control signal to the N-channel MOS FET1822 in Figure 18 C.In a further embodiment, when the digital value that ADC1901 exports is less than predetermined digital value, control circuit 1818 starts timer.Also utilize ADC1901 to detect the voltage be supplied on the voltage of load 1880 or supply access 1821, and be converted into digital value.When the digital value that ADC1901 exports is less than the second predetermined digital value with the voltage maintaining the normal work of load 1880 is corresponding, stops the timing of timer, and preserve the timing time of timer.
Referring to Figure 19 B, which provide control circuit 1818 according to another embodiment of the present invention.Control circuit 1818 in Figure 19 B comprises comparer 1913.Comparer 1913 is analog comparators, and receives output voltage from power supply 1802 and reference voltage 1915 from supply access 1821, reference voltage 1915 indicate power supply 1802 normally work time output voltage.When the output voltage of power supply 1802 is more than or equal to reference voltage 1915, comparer 1913 exports control signal, with closed N-channel MOS FET1816 to N-channel MOS FET1816.And when the output voltage of power supply 1802 is less than reference voltage 1915, comparer 1913 exports control signal, to disconnect N-channel MOS FET1816 to N-channel MOS FET1816.Based on similar principle, comparer 1913 can also provide control signal to the N-channel MOS FET1822 in Figure 18 C.In a further embodiment, and when the output voltage of power supply 1802 is less than reference voltage 1915, control circuit 1818 starts timer.Also utilize comparer 1913 to detect to be supplied to the magnitude relationship of voltage on the voltage of load 1880 or supply access 1821 and the second reference voltage.When the voltage on the voltage being supplied to load 1880 that comparer 1913 detects or supply access 1821 is less than the second reference voltage with the voltage maintaining the normal work of load 1880 is corresponding, stop the timing of timer, and preserve the timing time of timer.
Referring to Figure 19 C, which provide control circuit 1818 according to another embodiment of the present invention.The output voltage of power supply 1802 may have higher magnitude of voltage, and on memory device 1810, provide the reference voltage with higher voltage value may be inconvenient.The bleeder circuit that control circuit 1818 in Figure 19 C comprises comparer 1923 and is made up of resistor 1928,1929.Resistor 1928,1929 is connected, the coupled one end of resistor 1929 to supply access 1821 to receive the output voltage from power supply 1802, the other end of resistor 1929 is coupled to one end of resistor 1928, and the other end of resistor 1928 is coupled to reference potential (such as).One end that resistor 1928,1929 is coupled mutually provides and exports the dividing potential drop of the output voltage of power supply 1802, this dividing potential drop is exported and is coupled to comparer 1923, and another input end of comparer 1923 receives reference voltage 1925.When power supply 1802 normally works, this dividing potential drop exports and is more than or equal to reference voltage 1825, and comparer 1923 exports control signal, with closed N-channel MOS FET1816 to N-channel MOS FET1816.And when power supply 1802 power down, this dividing potential drop exports and is less than reference voltage 1925, comparer 1923 exports control signal, to disconnect N-channel MOS FET1816 to N-channel MOS FET1816.Based on similar principle, comparer 1923 can also provide control signal to the N-channel MOS FET1822 in Figure 18 C.In a further embodiment, and when the output voltage of power supply 1802 is less than reference voltage 1925, control circuit 1818 starts timer.Comparer 1923 is also utilized to detect the magnitude relationship of voltage on the voltage being supplied to load 1880 or supply access 1821 of dividing potential drop and the second reference voltage.Voltage on the voltage being supplied to load 1880 detected when comparer 1923 or supply access 1821 is less than with the second corresponding reference voltage of the voltage maintaining the normal work of load 1880 after dividing potential drop, stop the timing of timer, and preserve the timing time of timer.
Referring to Figure 19 D, which provide control circuit 1818 according to another embodiment of the present invention.In Figure 19 D, control circuit 1818 comprises ORing controller 1933.The input end of ORing controller 1933 is coupled to the output terminal of the power supply 1802 on supply access 1821 and the output terminal (drain electrode) 1935 of N-channel MOS FET1816.The output terminal of ORing controller 1933 is coupled to the grid of N-channel MOS FET1816, to control the closed of N-channel MOS FET1816 and to disconnect.When difference between the voltage of the output terminal of the power supply 1802 on supply access 1821 and the voltage of the output terminal 1935 of N-channel MOS FET1816 is more than or equal to predetermined value, the output terminal that ORing controller 1933 controls N-channel MOS FET1816 closes, and the difference between the voltage of the output terminal of the power supply 1802 on supply access 1821 and the voltage of the output terminal 1935 of N-channel MOS FET1816 is when being less than predetermined value, the output terminal that ORing controller 1933 controls N-channel MOS FET1816 disconnects.ORing controller 1933 can be the ORing controller of TPS2419 from the model of Texas Instruments.Based on similar principle, ORing controller 1933 can also provide control signal to the N-channel MOS FET1822 in Figure 18 C.In a further embodiment, can the output terminal disconnection of N-channel MOS FET1816 be controlled based on ORing controller 1933 and start timer, and the voltage on the voltage being supplied to load 1880 or supply access 1821 is when being less than the voltage maintaining the normal work of load 1880, controls timer and stop timing.
Referring to Figure 19 E, which provide control circuit 1818 according to another embodiment of the present invention.In Figure 19 E, control circuit 1818 comprises controller 1943, and it receives and identifies the message of the instruction power down that main frame sends.When not receiving the message of instruction power down, controller 1943 provides control signal to N-channel MOS FET1816, close to indicate N-channel MOS FET1816, and after the message receiving instruction power down, controller 1943 provides control signal to N-channel MOS FET1816, disconnects to indicate N-channel MOS FET1816.Controller 1943 can be implemented in memory device 1810 in the interface controller that communicates with main frame 1800.Based on the difference of interface type, interface controller can SATA (SerialAdvancedTechnologyAttachment, Serial Advanced Technology Attachment) controller, USB (UniversalSerialBus, USB (universal serial bus)) controller, PCI (PeripheralComponentInterconnect, periphery component interconnection) controller, PCIE (PeripheralComponentInterconnectExpress, quick peripheral assembly interconnecting) controller, SCSI (SmallComputerSystemInterface, small computer system interface) controller, IDE (IntegratedDriveElectronics, integrated drive electronics) controller etc.Based on similar principle, controller 1943 can also provide control signal to the N-channel MOS FET1822 in Figure 18 C.In a further embodiment, can the message of instruction power down be received based on controller 1943 and start timer, and when being supplied to the voltage on the voltage of load 1880 or supply access 1821 or supply access 1823 and being less than the voltage maintaining the normal work of load 1880, control timer and stop timing.
Figure 20 A is the process flow diagram of the method according to embodiments of the invention determination buffer area data volume threshold value.Referring to Figure 18 A-18C, when controller 1818 receives the reset signal (step 2001) of from host, start timer (step 2003).This reset signal instruction main frame 1800 is about to stop providing electric power to memory device 1810.Control circuit 1818 detects the voltage be supplied on the voltage of load 1880, supply access 1821 or supply access 1823 and whether is less than the available threshold (step 2005) that can maintain the normal work of load 1880.If voltage equals available threshold greatly, mean that the electric power provided to load 1880 can also maintain load 1880 and normally work, then when keeping timer.If voltage is less than available threshold, means that the electric power provided to load 1880 cannot maintain load 1880 and normally work, then stop timer (step 2007).The timing time of timer, be utilize the electric capacity 1804 of main frame 1800 and or the electricity of electric capacity 1812 of memory device 1810 can maintain time of the normal work of load 1880.Based on this time, obtained cache data amount threshold value (step 2009) corresponding to this time by the look-up table that prestores or function.The look-up table of the corresponding relation of expression time and cache data amount threshold value or function, can be stored in advance in memory device 1810, and mode records by experiment.Also can add up the measurement result of many experiments, and need based on reliability and this corresponding relation be set or corresponding relation is fitted to suitable function.
In one embodiment, after main frame power down, and to the electric power that load 1880 provides can also maintain load 1880 normally work time, twice or repetitive measurement are applied to the voltage on the voltage of load 1880, supply access 1821 or supply access 1823, according to measurement result distribution in time, calculate based on the attenuation function of supply voltage or curve in main frame power down and the time of load 1880 normally between work cannot be maintained to the electric power that load 1880 provides, and determining cache data amount threshold value based on this time.
In one embodiment, until the electric power provided to load 1880 cannot maintain load 1880 normally between work after being recorded in main frame power down, from the data volume of the memory buffer write flash chip of memory device, and based on this data volume determination buffer area data volume threshold value.
In one embodiment, referring to Figure 16 D, when memory device comprises flash interface 1231,1232,1233, the data in memory buffer 106 will be write flash chip 105 by flash interface 1231,1232,1233 concurrently.After main frame power down, utilize electric capacity 1804 and or the electric power of electric capacity 1812 of memory device 1810, the data volume that flash interface 1231,1232,1233 can write flash chip 105 depend on self-capacitance 1804 and or the electric power of electric capacity 1812 of memory device 1810 can maintain time on available threshold voltages.Because arrange buffer area data volume threshold value, make the flash interface in flash interface 1231,1232,1233 with maximum data volume to be written after main frame power down occurs, the data to be written in memory buffer 106 can be written to flash chip 105.And for multiple flash interface 1231,1232,1233, single cache data amount threshold value is set.When the data volume to be written of any one flash interface in multiple flash interface 1231,1232,1233 exceedes this cache data amount threshold value, then implement the interruption suppression that composition graphs 16D has described.
Figure 20 B is the process flow diagram of the method for buffer set data-quantity threshold really according to another embodiment of the present invention.Referring to Figure 18 A-18C, controller 1818 detects the voltage (step 2011) that host power supply 1802 provides.Judge the magnitude relationship (step 2013) of the voltage that host power supply 1802 provides and shutdown voltage.When the voltage that host power supply 1802 provides is less than shutdown voltage, start timer (step 2015).The voltage that host power supply 1802 provides is less than shutdown voltage, means that main frame 1800 is about to stop providing electric power to memory device 1810.Control circuit 1818 detects the voltage be supplied on the voltage of load 1880, supply access 1821 or supply access 1823 and whether is less than the available threshold (step 2017) that can maintain the normal work of load 1880.If voltage equals available threshold greatly, mean that the electric power provided to load 1880 can also maintain load 1880 and normally work, then when keeping timer.If voltage is less than available threshold, means that the electric power provided to load 1880 cannot maintain load 1880 and normally work, then stop timer (step 2019).The timing time of timer, be utilize the electric capacity 1804 of main frame 1800 and or the electricity of electric capacity 1812 of memory device 1810 can maintain time of the normal work of load 1880.Based on this time, obtained cache data amount threshold value (step 2021) corresponding to this time by the look-up table that prestores or function.The look-up table of the corresponding relation of expression time and cache data amount threshold value or function, can be stored in advance in memory device 1810, and mode records by experiment.Also can add up the measurement result of many experiments, and need based on reliability and this corresponding relation be set or corresponding relation is fitted to suitable function.
Figure 21 is the process flow diagram of the method arranging buffer area data volume threshold value according to an embodiment of the invention.Different main frames 1800 can have different configurations, and thus, after a power failure, the electric capacity 1802 of main frame can provide the electric power of memory device 1810 may be different.The power supply capacity of main frame electric capacity 1802 also can change along with the time because of the factor such as aging.In one embodiment, when main frame 1800 uses memory device 1810 first, use the default setting of cache data amount threshold value.Generally, this default setting adopts conservative selection mode.Such as, cache data amount threshold value is set according to the electricity only utilizing the electric capacity 1812 of memory device to provide.Thus, need to determine whether memory device 1810 is used first on main frame 1800.For this purpose, when main frame 1800 starts (step 2101), main frame 1800 provides host identification to memory device 1810.Host identification can be the MAC Address of Network Card of main frame 1800 or the sequence number of other hardware devices, makes this host identification can identify main frame 1800 uniquely.Memory device 1810 receives this host identification, and compared with the host identification stored in memory device 1810 (step 2103).If the host identification received from main frame 1800 is different with the host identification stored memory device 1810, mean that memory device 1810 does not use on main frame 1800 or upper once use of at least memory device 1810 is not on main frame 1800.So, the cache data amount threshold value of memory device 1810 choice for use acquiescence, it is for arranging cache data amount threshold value (step 2113) according to the electricity only utilizing the electric capacity 1812 of memory device to provide.And alternatively, also remove (non-default) cache data amount threshold value (step 2111) stored in memory device 1810.In step 2103, if the host identification received from main frame 1800 is identical with the host identification stored memory device 1810, mean that main frame 1800 sent this host identification to memory device 1810, or front once use of memory device 1810 is carried out on main frame 1800.In step 2105, memory device 1810 judges whether the cache data amount threshold value using acquiescence.In some cases, such as, the configuration of main frame 1800 there occurs change, the power supply capacity of its electric capacity 1804 after main frame power down may change, in the case, main frame 1800 can be given an order to memory device 1810, uses acquiescence cache data amount threshold value to indicate memory device 1810.In another embodiment, on memory device 1810, setting example is as jumper switch, with the cache data amount threshold value indicating memory device 1810 whether to use acquiescence.When memory device 1810 is by the cache data amount threshold value of use acquiescence, perform step 2113 and/or step 2111.When judging in step 2105 not need to use acquiescence cache data amount threshold value, performing step 2107, determining cache data amount threshold value.Can read from memory device 1810 and obtain by the embodiment provided in Figure 20 A or 20B and be stored in the cache data amount threshold value on memory device 1810.In one embodiment, whenever main frame 1800 shut down or power supply 1802 power down of main frame 1800 time, the method provided in Figure 20 A or 20B is provided, and obtains a cache data amount threshold value.In step 2107, according to stored multiple cache data amount threshold values, preferred cache data amount threshold value can be calculated.Computing method can comprise averages or weighted mean value to multiple cache data amount threshold value.Also according to multiple cache data amount threshold value, its average and variance can be calculated, and be met the cache data amount threshold value of certain standby power supply reliable power supply probability.In step 2109, determined cache data amount threshold value is set to the cache data amount threshold value used in memory device 1810.
Present the description of this invention in order to the object illustrated and describe, and be not intended to disclosed form limit or restriction the present invention.To one of ordinary skill in the art, many adjustment and change are apparent.

Claims (10)

1. an interrupt control method for memory device, described memory device comprises flash memories and memory buffer, and described method comprises:
The data wanting write storage device are received from messaging device;
The received data of write storage device of wanting are write described memory buffer;
Data in described memory buffer are taken out and writes described flash memories;
Wherein, by received want the data of write storage device to write described memory buffer after, if the data volume in described memory buffer is less than predetermined threshold, then send to described messaging device the message that instruction write operation completes;
Described method also comprises power supply power-fail that described messaging device detected and starts timer, stop timer when the power supply of described messaging device is less than predetermined voltage threshold to the voltage that described memory device provides, revise described predetermined threshold according to the timing time of described timer.
2. method according to claim 1, also comprise described memory device receives messaging device described in unique identification the first identifier from described messaging device, if described first identifier is identical with the second identifier stored in described memory device, then revise described predetermined threshold according to the timing time of described timer.
3. method according to claim 2, if described first identifier is different from the second identifier stored in described memory device, then uses as default described predetermined threshold; And in described memory device, store described first identifier to replace described second identifier.
4., according to the method one of claim 1-3 Suo Shu, also comprise the timing time storing described timer.
5. method according to claim 4, wherein when described messaging device starts, described memory device receives the first identifier of messaging device described in unique identification from described messaging device, if described first identifier is identical with the second identifier stored in described memory device, then revise described predetermined threshold according to the timing time of stored described timer.
6. an interrupt control method for memory device, described memory device comprises flash memories and memory buffer, and described method comprises:
Write request is received from messaging device;
Based on said write request, data are write described memory buffer, and makes counter increment;
Described data in described memory buffer taken out and writes described flash memories, and making described counter decrement;
Wherein, if described counter is less than predetermined threshold, then send the message indicating said write request process to complete to described messaging device;
Described method also comprises the power supply power-fail described messaging device being detected and the first value recording described counter, record the second value of described counter when the power supply of described messaging device is less than predetermined voltage threshold to the voltage that described memory device provides, revise described predetermined threshold according to the difference of described first value and described second value.
7. a memory device, described memory device comprises memory buffer, flash memories, messaging device interface and control circuit, described control circuit also comprises counter and interruptable controller, and described memory device can be connected communicatedly with messaging device, wherein:
Described messaging device interface receives write request from messaging device;
Data, based on said write request, are write described memory buffer by described control circuit, and make described counter increment;
Described data in described memory buffer are taken out and are write described flash memories by described control circuit, and make described counter decrement;
When described counter is less than predetermined threshold, described interruptable controller sends the message indicating said write request process to complete to described messaging device;
When described control circuit determines that the power supply of described messaging device is in power-down state, start timer; When described control circuit determines that the voltage that the power supply of described messaging device provides is less than predetermined voltage threshold, stop described timer, and revise described predetermined threshold according to the timing time of described timer.
8. a memory device, described memory device comprises memory buffer, flash memories, messaging device interface and control circuit, described control circuit also comprises counter and interruptable controller, and described memory device can be connected communicatedly with messaging device, wherein:
Described messaging device interface receives the data wanting write storage device from messaging device;
The received data of write storage device of wanting are write described memory buffer by described control circuit;
Data in described memory buffer are taken out and are write described flash memories by described control circuit;
By received want the data of write storage device to write described memory buffer after, if the data volume in described memory buffer is less than predetermined threshold, then described interruptable controller sends to described messaging device the message that instruction write operation completes;
When described control circuit determines that the power supply of described messaging device is in power-down state, start timer; When described control circuit determines that the voltage that the power supply of described messaging device provides is less than predetermined voltage threshold, stop described timer, and revise described predetermined threshold according to the timing time of described timer.
9. measure a method for the power-on time after power supply power-fail, comprising:
Timer is started in response to described power supply power-fail being detected;
Detect the voltage that described power supply provides, when described voltage is less than predetermined voltage threshold, stop timer;
Store the timing time of described timer as the power-on time after described power supply power-fail.
10. method according to claim 9, also comprises the power-on time after the power supply power-fail storing repetitive measurement, and based on the power-on time after the power supply power-fail of described repetitive measurement, obtains the power-on time after the described power supply power-fail estimated.
CN201510494515.6A 2012-07-22 2012-07-22 Store equipment, interrupt control method and power-on time measurement method Active CN105138287B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510494515.6A CN105138287B (en) 2012-07-22 2012-07-22 Store equipment, interrupt control method and power-on time measurement method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210254881.0A CN102799396B (en) 2012-07-22 2012-07-22 Memory device, interrupt control method and power-on time measuring method
CN201510494515.6A CN105138287B (en) 2012-07-22 2012-07-22 Store equipment, interrupt control method and power-on time measurement method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201210254881.0A Division CN102799396B (en) 2012-07-22 2012-07-22 Memory device, interrupt control method and power-on time measuring method

Publications (2)

Publication Number Publication Date
CN105138287A true CN105138287A (en) 2015-12-09
CN105138287B CN105138287B (en) 2018-11-20

Family

ID=47198513

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201210254881.0A Active CN102799396B (en) 2012-07-22 2012-07-22 Memory device, interrupt control method and power-on time measuring method
CN201510494515.6A Active CN105138287B (en) 2012-07-22 2012-07-22 Store equipment, interrupt control method and power-on time measurement method

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201210254881.0A Active CN102799396B (en) 2012-07-22 2012-07-22 Memory device, interrupt control method and power-on time measuring method

Country Status (1)

Country Link
CN (2) CN102799396B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107025069A (en) * 2016-01-13 2017-08-08 桑迪士克科技有限责任公司 The data path control of nonvolatile memory
CN108369564A (en) * 2015-12-10 2018-08-03 高通股份有限公司 The number polymerization of interruption from peripheral equipment
CN110795364A (en) * 2019-10-31 2020-02-14 四川效率源信息安全技术股份有限公司 Method for accessing hard disk in IDE mode
CN111258937A (en) * 2020-01-23 2020-06-09 烽火通信科技股份有限公司 Transmission method and system of ring type linked list DMA

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015101211A1 (en) * 2013-12-30 2015-07-09 国民技术股份有限公司 Memory system and control method for nonvolatile memory of system
JP2015132894A (en) * 2014-01-09 2015-07-23 カシオ計算機株式会社 Micro controller device and operation control method of the same
CN103730951B (en) * 2014-01-24 2016-04-13 加弘科技咨询(上海)有限公司 A kind of power-supply management system and method thereof
CN105807885B (en) * 2014-12-31 2021-09-28 施耐德电气工业公司 Power failure protection method and device
CN106328179B (en) * 2015-06-22 2024-04-05 北京忆恒创源科技股份有限公司 Power supply circuit and power supply method
WO2017107048A1 (en) * 2015-12-22 2017-06-29 华为技术有限公司 Memory content protection circuit
CN106648016B (en) * 2016-12-02 2020-04-10 浙江宇视科技有限公司 Power supply circuit, power supply equipment and power supply method
CN108337035B (en) * 2018-02-05 2020-12-01 北京电子工程总体研究所 Satellite remote-measuring interruption processing method for remote-measuring downlink hot backup and seamless connection
KR20200057311A (en) * 2018-11-16 2020-05-26 삼성전자주식회사 Storage device throttling amount of communicated data depending on suspension frequency of operation
KR20210034378A (en) * 2019-09-20 2021-03-30 에스케이하이닉스 주식회사 Memory controller and operating method thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0671691A2 (en) * 1994-02-09 1995-09-13 Hitachi, Ltd. Storage controller and bus control method for use therewith
CN101446924A (en) * 2008-12-16 2009-06-03 成都市华为赛门铁克科技有限公司 Method and system for storing and obtaining data
CN101465164A (en) * 2009-01-12 2009-06-24 成都市华为赛门铁克科技有限公司 Method, device and system for obliterating data
CN101499313A (en) * 2009-01-06 2009-08-05 成都市华为赛门铁克科技有限公司 Method, equipment and memory system for guaranteeing data security

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6459513A (en) * 1987-08-31 1989-03-07 Pfu Ltd Power failure detecting circuit
CN101483480B (en) * 2009-02-18 2011-04-13 成都格莱科技有限公司 Power down warning apparatus for remote communication device and optical transceiving module

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0671691A2 (en) * 1994-02-09 1995-09-13 Hitachi, Ltd. Storage controller and bus control method for use therewith
CN101446924A (en) * 2008-12-16 2009-06-03 成都市华为赛门铁克科技有限公司 Method and system for storing and obtaining data
CN101499313A (en) * 2009-01-06 2009-08-05 成都市华为赛门铁克科技有限公司 Method, equipment and memory system for guaranteeing data security
CN101465164A (en) * 2009-01-12 2009-06-24 成都市华为赛门铁克科技有限公司 Method, device and system for obliterating data

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108369564A (en) * 2015-12-10 2018-08-03 高通股份有限公司 The number polymerization of interruption from peripheral equipment
CN108369564B (en) * 2015-12-10 2020-11-27 高通股份有限公司 Digital aggregation of interrupts from peripheral devices
CN107025069A (en) * 2016-01-13 2017-08-08 桑迪士克科技有限责任公司 The data path control of nonvolatile memory
CN107025069B (en) * 2016-01-13 2021-09-28 桑迪士克科技有限责任公司 Data path control for non-volatile memory
CN110795364A (en) * 2019-10-31 2020-02-14 四川效率源信息安全技术股份有限公司 Method for accessing hard disk in IDE mode
CN111258937A (en) * 2020-01-23 2020-06-09 烽火通信科技股份有限公司 Transmission method and system of ring type linked list DMA

Also Published As

Publication number Publication date
CN102799396B (en) 2015-09-16
CN102799396A (en) 2012-11-28
CN105138287B (en) 2018-11-20

Similar Documents

Publication Publication Date Title
CN102799396B (en) Memory device, interrupt control method and power-on time measuring method
CN102799392B (en) Memory device and interrupt control method thereof
CN102789439B (en) The method of the interruption in control data transmission process and memory device
CN102681952B (en) Method for writing data into memory equipment and memory equipment
CN102693198B (en) DMA (direct memory access) transmission method and system
KR102500661B1 (en) Cost-optimized single-level cell-mode non-volatile memory for multi-level cell-mode non-volatile memory
RU2348992C2 (en) Storage device and leading device
TWI788495B (en) Power-supply device and electronic device including the same
CN108710583A (en) Management method, device, computer equipment and the medium in SSD write buffers area
US20160350025A1 (en) Data storage device
TWI648634B (en) Memory management method, memory storage device and memory control circuit unit
KR20150055413A (en) Data storage device
KR20170129701A (en) Improved storage cache performance by using the compression rate of the data as the basis for cache insertion
CN107408018A (en) For adapting to the mechanism of refuse collection resource allocation in solid-state drive
EP4345595A1 (en) Method and device for data storage
CN115617503A (en) System and method for load balancing in heterogeneous memory systems
WO2023227004A1 (en) Memory access popularity statistical method, related apparatus and device
EP4325367A1 (en) Method and device for data caching
CN108984108A (en) For dispatching the method and solid storage device of I/O command
CN112463051A (en) Management method and data storage method of battery storage system
CN107766262B (en) Method and device for adjusting number of concurrent write commands
CN102819511B (en) Storage device and method for creating chain table in storage device
JP2024028145A (en) Information processing device and control method
WO2023173983A1 (en) Storage apparatus and related instruction delay statistical analysis method
CN108664210B (en) IO command control method, IO command control system and solid-state storage device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20190802

Address after: 215000 JIANGSU SUZHOU INDUSTRIAL PARK NO. 88 JINJIHU Avenue Artificial Intelligence Industrial Park G1-503

Patentee after: Suzhou Qiheng Rongzhi Information Technology Co., Ltd.

Address before: 100192 Beijing city Haidian District West Road No. 66 small Zhongguancun Dongsheng Technology Park building B-2 room A302

Patentee before: Beijing Memblaze Technology Co., Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200508

Address after: 100192 Beijing city Haidian District West Road No. 66 small Zhongguancun Dongsheng Technology Park building B-2 room A302

Patentee after: MEMBLAZE TECHNOLOGY (BEIJING) Co.,Ltd.

Address before: 215000 JIANGSU SUZHOU INDUSTRIAL PARK NO. 88 JINJIHU Avenue Artificial Intelligence Industrial Park G1-503

Patentee before: Suzhou Qiheng Rongzhi Information Technology Co., Ltd.

TR01 Transfer of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Memory device, interrupt control method and power supply time measuring method

Effective date of registration: 20200610

Granted publication date: 20181120

Pledgee: Beijing first financing Company limited by guarantee

Pledgor: MEMBLAZE TECHNOLOGY (BEIJING) Co.,Ltd.

Registration number: Y2020990000595

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20210720

Granted publication date: 20181120

Pledgee: Beijing first financing Company limited by guarantee

Pledgor: MEMBLAZE TECHNOLOGY (BEIJING) Co.,Ltd.

Registration number: Y2020990000595

PC01 Cancellation of the registration of the contract for pledge of patent right
CP01 Change in the name or title of a patent holder

Address after: 100192 room A302, building B-2, Dongsheng Science Park, Zhongguancun, 66 xixiaokou Road, Haidian District, Beijing

Patentee after: Beijing yihengchuangyuan Technology Co.,Ltd.

Address before: 100192 room A302, building B-2, Dongsheng Science Park, Zhongguancun, 66 xixiaokou Road, Haidian District, Beijing

Patentee before: MEMBLAZE TECHNOLOGY (BEIJING) Co.,Ltd.

CP01 Change in the name or title of a patent holder