CN104636087A - Method and device for controlling reading data - Google Patents

Method and device for controlling reading data Download PDF

Info

Publication number
CN104636087A
CN104636087A CN201510068000.XA CN201510068000A CN104636087A CN 104636087 A CN104636087 A CN 104636087A CN 201510068000 A CN201510068000 A CN 201510068000A CN 104636087 A CN104636087 A CN 104636087A
Authority
CN
China
Prior art keywords
reading
virtual
read
actual
read pointer
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
CN201510068000.XA
Other languages
Chinese (zh)
Other versions
CN104636087B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201510068000.XA priority Critical patent/CN104636087B/en
Publication of CN104636087A publication Critical patent/CN104636087A/en
Application granted granted Critical
Publication of CN104636087B publication Critical patent/CN104636087B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention provides a method for controlling reading data and a device for controlling reading data. The method comprises the steps that: through adding a reading method and an interface signal corresponding to the reading method, and control method of abutting interface signal, confirming the interface signal corresponding to the reading method according to the reading method; controlling the interface signal corresponding to the reading method, and realizing the repeatable reading of data and/or reading of controllable data amount.

Description

Read control method and the device of data
Technical field
The embodiment of the present invention relates to computer technology, particularly relates to a kind of control method and the device that read data.
Background technology
Along with multiple nucleus system chip (System on Chip, hereinafter referred to as: the SoC) widespread use of system, usually have the demand of certain data flow of a core to other multiple cores, usually first write data in storer, with first in first out (First Input First Output, hereinafter referred to as: FIFO) storer is example, then from FIFO memory, data are read, be sent to bus to transmit, carry out control data stream by bus control module and copy and be sent to multiple core.
In prior art, from FIFO memory, read data, data are once read, and namely the storage space storing sense data in FIFO is released, and namely the data read lost efficacy in FIFO memory, and the repeatable read that cannot realize data is got.
Summary of the invention
The embodiment of the present invention provides a kind of control method and the device that read data, gets with the repeatable read realizing data.
Embodiment of the present invention first aspect provides a kind of control method reading data, comprising:
According to reading manner, determine the interface signal corresponding with described reading manner;
The interface signal corresponding to described and described reading manner controls.
In conjunction with first aspect, in the first possible implementation of first aspect, described reading manner comprises: actual reading, virtual increasing progressively are read or virtual replacement reading.
In conjunction with first aspect, in the implementation that the second of first aspect is possible, described according to reading manner, determine the interface signal corresponding with described reading manner, comprising:
When described reading manner be virtual increase progressively reading time, determine that the interface signal corresponding with described reading manner comprises virtual read pointer;
Described the interface signal corresponding with described reading manner to be controlled, comprising:
Read the reference position of the FIFO storage unit pointed to from virtual read pointer, during often corresponding more than the FIFO storage unit data volume of the data volume of reading, described virtual read pointer points to next FIFO storage unit.
In conjunction with first aspect, in the third possible implementation of first aspect, described according to reading manner, determine the interface signal corresponding with described reading manner, comprising:
When described reading manner be virtual increase progressively reading time, determine that the interface signal corresponding with described reading manner comprises virtual read pointer and virtual reading offsets;
Described the interface signal corresponding with described reading manner to be controlled, comprising:
From virtual read to offset the position pointed to read, when described virtual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, described virtual read pointer points to next FIFO storage unit;
At the end of reading, described virtual reading offsets the position that the location updating pointed to is the ED of described reading.
In conjunction with first aspect, in the 4th kind of possible implementation of first aspect, described according to reading manner, determine the interface signal corresponding with described reading manner, comprising:
When described reading manner is virtual replacement reading, determine that the interface signal corresponding with described reading manner comprises virtual read pointer;
Described the interface signal corresponding with described reading manner to be controlled, comprising:
Read the reference position of the FIFO storage unit pointed to from virtual read pointer, at the end of reading, by the position that the position reset that described virtual read pointer points to points to actual read pointer.
In conjunction with first aspect, in the 5th kind of possible implementation of first aspect, described according to reading manner, determine the interface signal corresponding with described reading manner, comprising:
When described reading manner is virtual replacement reading, determine that the interface signal corresponding with described reading manner comprises virtual read pointer and virtual reading offsets;
Described the interface signal corresponding with described reading manner to be controlled, comprising:
Read position is pointed in skew from virtual reading, at the end of reading, by the position that the position reset that described virtual read pointer points to points to actual read pointer;
The described virtual position reset reading to offset sensing is offset to actual reading the position pointed to.
In conjunction with first aspect, in the 6th kind of possible implementation of first aspect, described according to reading manner, determine the interface signal corresponding with described reading manner, comprising:
When described reading manner be actual read skew time, determine that the interface signal corresponding with described actual reading manner comprises actual read pointer and actual reading offsets;
Described the interface signal corresponding with described reading manner to be controlled, comprising:
From actual read to offset the position pointed to read, when described actual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, described actual read pointer points to next FIFO storage unit;
At the end of reading, described virtual reading offsets the position that the location updating pointed to is the ED of described reading.
In conjunction with the implementation that the second of first aspect is possible, in the 7th kind of possible implementation of first aspect, before reading the reference position of the described FIFO storage unit pointed to from virtual read pointer, also comprise:
Valid data amount in FIFO is determined according to the position that position and the virtual read pointer of write pointers point point to;
Determine that described valid data amount is more than or equal to data volume corresponding to a FIFO storage unit.
In conjunction with the third possible implementation of first aspect, in the 8th kind of possible implementation of first aspect, described from virtual read offset point to position read before, also comprise:
Valid data amount in FIFO is determined in the position pointed to according to the position of write pointers point, virtual read pointer and the virtual position reading to offset sensing;
Determine the minimum data amount that described valid data amount is more than or equal to virtual reading and reads at every turn.
In conjunction with the 6th kind of possible implementation of first aspect, in the 9th kind of possible implementation of first aspect, described from actual read offset point to position read before, also comprise:
Valid data amount in FIFO is determined in the position pointed to according to the position of write pointers point, actual read pointer and the actual position reading to offset sensing;
Determine that described valid data amount is more than or equal to each minimum data amount read of actual reading.
In conjunction with the first of first aspect or first aspect to any one possible implementation in any one possible implementation in the 6th kind of possible implementation or the 7th kind to the 9th kind possible implementation, in the tenth kind of possible implementation of first aspect, described the interface signal corresponding with described reading manner is controlled after, also comprise:
According to the position that actual read pointer points to, release FIFO storage space.
In conjunction with the first of first aspect or first aspect to any one possible implementation in the 9th kind of possible implementation, in the 11 kind of possible implementation of first aspect, after the described interface signal corresponding for described reading manner controls, also comprise:
The position pointed to according to actual read pointer and actual reading offset the position pointed to, release FIFO storage space.
Embodiment of the present invention second aspect provides a kind of control device reading data, comprising:
Processing module, for according to reading manner, determines the interface signal corresponding with described reading manner;
Control module, controls for the interface signal corresponding to described and described reading manner.
In conjunction with second aspect, in the first possible implementation of second aspect, described reading manner comprises: actual reading, virtual increasing progressively are read or virtual replacement reading.
In conjunction with second aspect, in the implementation that the second of second aspect is possible, described processing module specifically for when described reading manner be virtual increase progressively reading time, determine that the interface signal corresponding with described reading manner comprises virtual read pointer;
Described control module reads specifically for the reference position of FIFO storage unit pointed to from virtual read pointer, and during often corresponding more than the FIFO storage unit data volume of the data volume of reading, described virtual read pointer points to next FIFO storage unit.
In conjunction with second aspect, in the third possible implementation of second aspect, described processing module specifically for when described reading manner be virtual increase progressively reading time, determine that the interface signal corresponding with described reading manner comprises virtual read pointer and virtual reading offsets;
Described control module specifically for from virtual read offset point to position read, when described virtual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, described virtual read pointer points to next FIFO storage unit;
At the end of reading, described virtual reading offsets the position that the location updating pointed to is the ED of described reading.
In conjunction with second aspect, in the 4th kind of possible implementation of second aspect, when described processing module is specifically for being virtual replacement reading when described reading manner, determine that the interface signal corresponding with described reading manner comprises virtual read pointer;
Described control module reads, at the end of reading, by the position that the position reset that described virtual read pointer points to points to actual read pointer specifically for the reference position of FIFO storage unit pointed to from virtual read pointer.
In conjunction with second aspect, in the 5th kind of possible implementation of second aspect, when described processing module is specifically for being virtual replacement reading when described reading manner, determine that the interface signal corresponding with described reading manner comprises virtual read pointer and virtual reading offsets;
Described control module is specifically for reading skew and point to position from virtual and read, at the end of reading, by the position that the position reset that described virtual read pointer points to points to actual read pointer;
The described virtual position reset reading to offset sensing is offset to actual reading the position pointed to.
In conjunction with second aspect, in the 6th kind of possible implementation of second aspect, described processing module specifically for when described reading manner be actual read skew time, determine that the interface signal corresponding with described actual reading manner comprises actual read pointer and actual reading offsets;
Described control module specifically for from actual read offset point to position read, when described actual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, described actual read pointer points to next FIFO storage unit;
At the end of reading, described virtual reading offsets the position that the location updating pointed to is the ED of described reading.
In conjunction with the implementation that the second of second aspect is possible, in the 7th kind of possible implementation of second aspect, valid data amount in FIFO is determined in the position of described processing module also for pointing to according to position and the virtual read pointer of write pointers point; Determine that described valid data amount is more than or equal to data volume corresponding to a FIFO storage unit.
In conjunction with the third possible implementation of second aspect, in the 8th kind of possible implementation of second aspect, described processing module also for the position according to write pointers point, virtual read pointer point to position and virtual read offset point to position determine valid data amount in FIFO; Determine the minimum data amount that described valid data amount is more than or equal to virtual reading and reads at every turn.
In conjunction with the 6th kind of possible implementation of second aspect, in the 9th kind of possible implementation of second aspect, described processing module also for the position according to write pointers point, actual read pointer point to position and actual read offset point to position determine valid data amount in FIFO; Determine that described valid data amount is more than or equal to each minimum data amount read of actual reading.
In conjunction with the first of second aspect or second aspect to any one possible implementation in any one possible implementation in the 6th kind of possible implementation or the 7th kind to the 9th kind possible implementation, in the tenth kind of possible implementation of second aspect, the position of described control module also for pointing to according to actual read pointer, release FIFO storage space.
In conjunction with the first of second aspect or second aspect to any one possible implementation in the 9th kind of possible implementation, in the 11 kind of possible implementation of second aspect, described control module also offsets for the position pointed to according to actual read pointer and actual reading the position pointed to, release FIFO storage space.
The control method of the reading data that the embodiment of the present invention provides and device, by increasing reading manner and the interface signal corresponding with reading manner, and the control mode of docking port signal, according to reading manner, determine the interface signal corresponding with described reading manner; The interface signal corresponding to described and described reading manner controls, and the repeatable read realizing data is got and/or the reading of controlled data amount.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet that the present invention reads the control method embodiment one of data;
Fig. 2 is embodiment of the present invention fifo structure schematic diagram;
Fig. 3 is the application scenarios schematic diagram of the actual reading of the embodiment of the present invention;
Fig. 4 is that virtual the increasing progressively of the present invention is read and the virtual application scenarios schematic diagram resetting reading;
Fig. 5 is the structural representation that the present invention reads the control device embodiment one of data;
Fig. 6 is the structural representation that the present invention reads the control device embodiment two of data.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention is by increasing reading manner and the interface signal corresponding with reading manner, and the control mode of docking port signal, the repeatable read realizing data gets the reading with controlled data amount, and particularly, reading manner comprises: actual reading, virtual increasing progressively are read and virtual replacement reading; The actual interface signal reading correspondence is actual read pointer, or actual read pointer and actual reading offset; The virtual interface signal increasing progressively reading corresponding is virtual read pointer, or virtual read pointer and virtual reading offset; The virtual interface signal resetting reading corresponding is virtual read pointer, or virtual read pointer and virtual reading offset.
Because of the storage space release in FIFO or data failure, determine according to the sensing of read pointer actual in actual reading manner, therefore, the present invention increases virtual increasing progressively and reads and virtual replacement reading, by reading data to the control of virtual read pointer, simultaneously, the sensing of actual read pointer is constant, thus ensure that the storage space at the data place of having read is not released (namely data did not lose efficacy), read by virtual replacement, make after reading terminates, virtual read pointer is reset to the position of actual read pointer, gets to make data repeatable read.
By increase virtual read skew, guarantee adopt virtual increase progressively reading or virtual replacements read time, the data volume of reading is controlled, by increase actual read offset, when guaranteeing actual reading, the data volume of reading is controlled.
With embodiment particularly, technical scheme of the present invention is described in detail below.These specific embodiments can be combined with each other below, may repeat no more for same or analogous concept or process in some embodiment.
First concise and to the point introduction is carried out, so that subsequent descriptions to the interface signal that the present invention may use:
Fifo_wen:FIFO writes enable interface signal, input interface, high effectively, and the data volume of each write is data volume corresponding to a FIFO bit wide, the data volume that namely a FIFO storage unit is corresponding.
Fifo_wdata:FIFO writes data-interface signal, input interface.
Fifo_ren:FIFO reads enable signal, input interface, effectively high.
Fifo_rtype:FIFO reading manner, input interface, is divided into following three kinds:
Actual reading: after reading data, the storage space release that the data read in FIFO are corresponding, the data failure read, corresponding actual read pointer (actual_pointer) and actually read to offset (actual_offset) and increase progressively according to the data volume of reading.
Virtually increase progressively reading: after reading data, storage space corresponding to the data read in FIFO does not discharge, the data read are effective, corresponding virtual read pointer (virtual_pointer) and virtually read to offset (virtual_offset) and increase progressively according to the data volume of reading.
Virtual replacement is read: after reading data, storage space corresponding to the data read in FIFO does not discharge, the data read are effective, corresponding virtual read pointer (virtual_pointer) and virtually read to offset (virtual_offset) and be reset to actual read pointer and the actual position reading to offset correspondence.
The valid data amount that fifo_rsize:FIFO read operation is read, unit is byte (byte), input interface, embodiment of the present invention support is less than or equal to arbitrarily the reading of FIFO storage unit corresponding data amount, and matching bus each cycle (cycle) sends the demand of any byte data amount.
Fifo_rdata:FIFO read data, output interface, the bit wide of read data is the twice of FIFO width, because the valid data amount of single job, may in the cross-domain storage unit corresponding to two continuous pointers.
Fifo_roffset:FIFO reads side-play amount, output interface, data block corresponding for read pointer in FIFO and the data block corresponding with the next pointer of read pointer continuous print thereof directly read to go by fifo_roffset, FIFO user needs the position of valid data in fifo storage unit judging reading according to fifo_roffset and fifo_rsize, reading or virtual replacement reading is increased progressively if virtual, what fifo_roffset was corresponding is that virtual reading offsets (virtual_roffset), read if actual, what fifo_roffset was corresponding is that actual reading offsets (actual_roffset).
Virtual valid data amount in virtual byte_cnt:FIFO, unit is byte (byte), output interface, virtual valid data amount be by virtual read pointer, virtual read skew and actual write pointer determine, when FIFO reading manner be virtual increase progressively reading or virtual replacements read time, judge whether to allow to carry out virtually to increase progressively reading or virtual replacement reading according to virtual valid data amount before reading.
Actual valid data amount in actual byte_cnt:FIFO, unit is byte (byte), output interface, actual valid data amount be by actual read pointer, actual read skew and actual write pointer determine, when FIFO reading manner is actual reading, judge whether to allow to carry out actual reading according to actual valid data amount before reading.
Fig. 1 is the schematic flow sheet that the present invention reads the control method embodiment one of data, and as shown in Figure 1, the method for the present embodiment is as follows:
S101: according to reading manner, determines the interface signal corresponding with reading manner.
Particularly, reading manner comprises: actual reading, virtual increasing progressively are read or virtual replacement reading.
Reading corresponding interface signal with reality is actual read pointer, or reading corresponding interface signal with reality is that actual read pointer and actual reading offset;
Increase progressively that to read corresponding interface signal be virtual read pointer with virtual, or, increase progressively that to read corresponding interface signal be that virtual read pointer and virtual reading offset with virtual;
Reset that to read corresponding interface signal be virtual read pointer with virtual, or, reset that to read corresponding interface signal be that virtual read pointer and virtual reading offset with virtual.
S102: the interface signal corresponding with reading manner is controlled.
For different reading manners, and different interface signals, control mode is different:
1, for reading manner be virtual increase progressively reading time, the control of docking port signal divides following two kinds of situations:
11: when the interface signal that reading manner is corresponding is virtual read pointer, control mode is as follows:
Read the reference position of the FIFO storage unit pointed to from virtual read pointer, during often corresponding more than the FIFO storage unit data volume of the data volume of reading, virtual read pointer points to next FIFO storage unit.
In this fashion, each reading must read data volume corresponding to a FIFO width, the data volume that namely a FIFO storage unit is corresponding, and the data volume of reading is uncontrollable.
12: the interface signal that reading manner is corresponding be virtual read pointer and virtual read skew time, control mode is as follows:
From virtual read to offset the position pointed to read, when virtual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, virtual read pointer points to next FIFO storage unit; When virtual increase progressively read data volume that the numerical value of position that skew points to the adds reading data volume corresponding more than FIFO storage unit time, virtual read pointer points to and does not change.
At the end of reading, the data volume whether the data volume no matter virtual numerical value reading to offset the position pointed to adds reading is corresponding more than a FIFO storage unit, virtual reading offsets the position that the location updating pointed to is the ED read.
In this fashion, each reading can be arbitrary data volume, and the data volume of reading is controlled.
When being 2, virtual replacement reading for reading manner, the control of docking port signal divides following two kinds of situations:
21: when the interface signal that reading manner is corresponding is virtual read pointer, control mode is as follows:
Read the reference position of the FIFO storage unit pointed to from virtual read pointer, at the end of reading, the position that the position reset pointed to by virtual read pointer points to actual read pointer.
In this fashion, each reading must read data volume corresponding to a FIFO width, the data volume that namely a FIFO storage unit is corresponding, and the data volume of reading is uncontrollable.
22: the interface signal that reading manner is corresponding comprise virtual read pointer and virtual read skew time, control mode is as follows:
Read skew and point to position from virtual and read, at the end of reading, virtual read pointer is pointed to the position pointed to actual read pointer of position reset; The above-mentioned virtual position reset reading to offset sensing is offset to actual reading the position pointed to.
In this fashion, each reading can be arbitrary data volume, and the data volume of reading is controlled.
At the end of reading, above-mentioned virtual reading offsets the position that the location updating pointed to is the ED of above-mentioned reading.
When being 3, actual reading for reading manner, the control of docking port signal divides following two kinds of situations:
31, when the interface signal that reading manner is corresponding is actual read pointer, control mode is as follows:
Read the reference position of the FIFO storage unit pointed to from actual read pointer, during often corresponding more than the FIFO storage unit data volume of the data volume of reading, actual read pointer points to next FIFO storage unit.
In this fashion, each reading must read data volume corresponding to a FIFO width, the data volume that namely a FIFO storage unit is corresponding, and the data volume of reading is uncontrollable.
At the end of reading, according to the position that actual read pointer points to, release FIFO storage space.
32, when the interface signal that reading manner is corresponding be actual read pointer and actual read skew time, control mode is as follows:
From actual read to offset the position pointed to read, when actual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, actual read pointer points to next FIFO storage unit; When reality reads data volume that the numerical value of position that skew points to the adds reading data volume corresponding more than FIFO storage unit, actual read pointer points to and does not change.
At the end of reading, the data volume whether the data volume no matter actual numerical value reading to offset the position pointed to adds reading is corresponding more than a FIFO storage unit, actual reading offsets the position that the location updating pointed to is the ED of above-mentioned reading.
In this fashion, each reading can be arbitrary data volume, and the data volume of reading is controlled.
At the end of reading, the position pointed to according to actual read pointer and actual reading offset the position pointed to, release FIFO storage space.
In the present embodiment, by increasing reading manner and the interface signal corresponding with reading manner, and the control mode of docking port signal, the repeatable read realizing data is got and/or the reading of controlled data amount.
It should be noted that, in the above-described embodiments, adopt virtual increase progressively reading manner or virtual replacement reading manner before,
Increasing progressively corresponding interface signal in reading or virtual replacement reading if virtual is virtual read pointer, then also comprise: determine valid data amount in FIFO according to the position that position and the virtual read pointer of write pointers point point to; When determining that effective data volume is more than or equal to data volume corresponding to FIFO storage unit, just allow to carry out virtually to increase progressively reading or virtual replacements reading.
Increasing progressively corresponding interface signal in reading or virtual replacement reading if virtual is that virtual read pointer and virtual reading offset, then also comprise: the position pointed to according to write pointers point position, virtual read pointer and virtually read to offset the position pointed to and determine valid data amount in FIFO, determine the minimum data amount that effective data volume is more than or equal to virtual reading and reads at every turn.
In the above-described embodiments, before adopting actual reading manner, reading corresponding interface signal if actual is actual read pointer, then also comprise: determine valid data amount in FIFO according to the position that position and the virtual read pointer of write pointers point point to; When determining that effective data volume is more than or equal to data volume corresponding to FIFO storage unit, just allow to carry out actual reading.
Offset if the interface signal of actual reading correspondence is actual read pointer and actual reading, then also comprise: valid data amount in FIFO is determined in the position pointed to according to the position of write pointers point, actual read pointer and the actual position reading to offset sensing; Determine that above-mentioned valid data amount is more than or equal to each minimum data amount read of actual reading.
In the above-described embodiments, when writing data, the data volume of each write must be data volume corresponding to a FIFO storage unit, and after often writing data volume corresponding to FIFO storage unit, write pointer adds 1.
Fig. 2 is embodiment of the present invention fifo structure schematic diagram, as shown in Figure 2, laterally refer to the width of FIFO, longitudinally to refer to the degree of depth (' h0 ~ ' hN is shown in Fig. 2) of FIFO, the valid data amount deposited in the mark FIFO of shaded block, invalid data block in blank block mark FIFO, control to interface signal corresponding to three kinds of reading manners is mainly comprised to the reading of data fifo, there is shown, actual read pointer, actual read skew, actual write instruction, virtual read pointer and virtual read offset.
Fig. 3 is described with the actual example that is read as, Fig. 3 is the application scenarios schematic diagram of the actual reading of the embodiment of the present invention, left figure in Fig. 3 is the state of valid data and interface signal in FIFO before reading, right figure in Fig. 3 is the signal of valid data and Interface status in FIFO after reading, interface signal shown in Fig. 3 is actual read pointer, actual reading offsets and actual write pointer, as shown in Figure 3, shaded block is the valid data in FIFO, actual read pointer points to ' h1, actual write pointers point ' h4, actual reading offsets the reference position pointing to valid data, i.e. ' the part to the left of h1, carry out actual read operation, from actual read skew read, the actual quantity amount read add actual read to offset exceeded data volume corresponding to a FIFO storage unit, actual read pointer points to ' h2, the actual position reading to offset the ED being updated to reading.The storage space of the data read after reading is released, and namely data are disabled, and as shown in the right figure in Fig. 3, shaded block is the valid data after the actual reading of FIFO, and blank block is the invalid data after actual reading.
Fig. 4 is that virtual the increasing progressively of the present invention is read and the virtual application scenarios schematic diagram resetting reading, four width accompanying drawings are comprised in Fig. 4, the picture left above be read before valid data and the view of interface signal, top right plot be first time virtual increase progressively reading after the view effectively having data and interface signal, bottom right is the virtual view increasing progressively the valid data after reading and interface signal of second time, and lower-left is the third time virtual view resetting the valid data after reading and interface signal.In each figure of Fig. 4, shaded block is valid data, and blank block is invalid data;
First time virtually increases progressively reading, fifo_rtype is set as virtually increasing progressively reading, from virtual read offset point to position read, the data read cross over address ' h3 and ' h4, the sensing of virtual read pointer is by ' h3 is updated to ' h4, and the virtual location updating reading to offset is the position of reading ED; Actually read to offset, the invariant position of actual read pointer and actual write pointer.
Second time is virtual increases progressively reading, fifo_rtype is set as virtually increasing progressively reading, from virtual read to offset the position pointed to read, the data of reading are in address ' in h4, the sensing of virtual read pointer is constant, and the virtual location updating reading to offset is the position of reading ED; Actually read to offset, the invariant position of actual read pointer and actual write pointer.
Third time, virtual replacement was read, fifo_rtype is set as that virtual replacement is read, from virtual read offset point to position read, the data read cross over address ' h4 and ' h5, after reading terminates, the virtual position reset reading to offset reads skew to actual, and the sensing of virtual read pointer is reset to the sensing of actual read pointer.
In the present embodiment, by increasing reading manner and the interface signal corresponding with reading manner, and the control mode of docking port signal, the repeatable read realizing data is got and/or the reading of controlled data amount.
Fig. 5 is the structural representation that the present invention reads the control device embodiment one of data, as shown in Figure 5, the device of the present embodiment comprises: processing module 501 and control module 502, wherein, processing module 501, for according to reading manner, determines the interface signal corresponding with above-mentioned reading manner; Control module 502 controls for the interface signal corresponding to above-mentioned and above-mentioned reading manner.
In the above-described embodiments, above-mentioned reading manner comprises: actual reading, virtual increasing progressively are read or virtual replacement reading.
In the above-described embodiments, above-mentioned processing module 501 specifically for when above-mentioned reading manner be virtual increase progressively reading time, determine that the interface signal corresponding with above-mentioned reading manner comprises virtual read pointer;
Above-mentioned control module 502 reads specifically for the reference position of FIFO storage unit pointed to from virtual read pointer, and during often corresponding more than the FIFO storage unit data volume of the data volume of reading, above-mentioned virtual read pointer points to next FIFO storage unit.
In the above-described embodiments, above-mentioned processing module 501 specifically for when above-mentioned reading manner be virtual increase progressively reading time, determine that the interface signal corresponding with above-mentioned reading manner comprises virtual read pointer and virtual reading offsets;
Above-mentioned control module 502 specifically for from virtual read offset point to position read, when above-mentioned virtual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, above-mentioned virtual read pointer points to next FIFO storage unit;
At the end of reading, above-mentioned virtual reading offsets the position that the location updating pointed to is the ED of above-mentioned reading.
In the above-described embodiments, when above-mentioned processing module 501 is specifically for being virtual replacement reading when above-mentioned reading manner, determine that the interface signal corresponding with above-mentioned reading manner comprises virtual read pointer;
Above-mentioned control module 502 reads, at the end of reading, by the position that the position reset that above-mentioned virtual read pointer points to points to actual read pointer specifically for the reference position of FIFO storage unit pointed to from virtual read pointer.
In the above-described embodiments, when above-mentioned processing module 501 is specifically for being virtual replacement reading when above-mentioned reading manner, determine that the interface signal corresponding with above-mentioned reading manner comprises virtual read pointer and virtual reading offsets;
Above-mentioned control module 502 is specifically for reading skew and point to position from virtual and read, at the end of reading, by the position that the position reset that above-mentioned virtual read pointer points to points to actual read pointer;
The above-mentioned virtual position reset reading to offset sensing is offset to actual reading the position pointed to.
In the above-described embodiments, above-mentioned processing module 501 specifically for when above-mentioned reading manner be actual read skew time, determine that the interface signal corresponding with above-mentioned actual reading manner comprises actual read pointer and actual reading offsets;
Above-mentioned control module 502 specifically for from actual read offset point to position read, when above-mentioned actual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, above-mentioned actual read pointer points to next FIFO storage unit;
At the end of reading, above-mentioned virtual reading offsets the position that the location updating pointed to is the ED of above-mentioned reading.
In the above-described embodiments, valid data amount in FIFO is determined in the position of above-mentioned processing module 501 also for pointing to according to position and the virtual read pointer of write pointers point; Determine that above-mentioned valid data amount is more than or equal to data volume corresponding to a FIFO storage unit.
In the above-described embodiments, above-mentioned processing module 501 also for the position according to write pointers point, virtual read pointer point to position and virtual read offset point to position determine valid data amount in FIFO; Determine the minimum data amount that above-mentioned valid data amount is more than or equal to virtual reading and reads at every turn.
In the above-described embodiments, above-mentioned processing module 501 also for the position according to write pointers point, actual read pointer point to position and actual read offset point to position determine valid data amount in FIFO; Determine that above-mentioned valid data amount is more than or equal to each minimum data amount read of actual reading.
In the above-described embodiments, the above-mentioned position of control module 502 also for pointing to according to actual read pointer, release FIFO storage space.
In the above-described embodiments, above-mentioned control module 502 also offsets for the position pointed to according to actual read pointer and actual reading the position pointed to, release FIFO storage space.
Said apparatus embodiment, by increasing reading manner and the interface signal corresponding with reading manner, and the control mode of docking port signal, processing module, according to reading manner, determines the interface signal corresponding with above-mentioned reading manner; The control module pair interface signal corresponding with above-mentioned reading manner controls, and the repeatable read realizing data is got and/or the reading of controlled data amount.
Fig. 6 is the structural representation that the present invention reads the control device embodiment two of data, as shown in Figure 6, the control device 600 reading data comprises communication interface 601, storer 603 and processor 602, wherein, communication interface 601, processor 602, storer 603, be interconnected by bus 604; Bus 604 can be pci bus or eisa bus etc.Above-mentioned bus can be divided into address bus, data bus, control bus etc.For ease of representing, only representing with a thick line in Fig. 6, but not representing the bus only having a bus or a type.
Storer 603, for depositing program.Particularly, program can comprise program code, and said procedure code comprises computer-managed instruction.Storer 603 may comprise RAM, still may comprise nonvolatile memory (non-volatile memory), such as at least one magnetic disk memory.
The program that processor 602 execute store 603 is deposited, realizes the method for the control of the reading data shown in Fig. 1 of the present invention, comprising:
According to reading manner, determine the interface signal corresponding with above-mentioned reading manner;
The interface signal corresponding to above-mentioned and above-mentioned reading manner controls.
Above-mentioned processor 602 can be general processor, comprises CPU, NP etc.; Can also be digital signal processor (DSP), special IC (ASIC), field programmable gate array (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete hardware components.
The present embodiment, by increasing reading manner and the interface signal corresponding with reading manner, and the control mode of docking port signal, processor, according to reading manner, determines the interface signal corresponding with above-mentioned reading manner; Control the interface signal corresponding with above-mentioned reading manner, the repeatable read realizing data is got and/or the reading of controlled data amount.
One of ordinary skill in the art will appreciate that: all or part of step realizing above-mentioned each embodiment of the method can have been come by the hardware that programmed instruction is relevant.Aforesaid program can be stored in a computer read/write memory medium.This program, when performing, performs the step comprising above-mentioned each embodiment of the method; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.

Claims (24)

1. read a control method for data, it is characterized in that, comprising:
According to reading manner, determine the interface signal corresponding with described reading manner;
The interface signal corresponding to described and described reading manner controls.
2. method according to claim 1, is characterized in that, described reading manner comprises: actual reading, virtual increasing progressively are read or virtual replacement reading.
3. method according to claim 2, is characterized in that, described according to reading manner, determines the interface signal corresponding with described reading manner, comprising:
When described reading manner be virtual increase progressively reading time, determine that the interface signal corresponding with described reading manner comprises virtual read pointer;
Described the interface signal corresponding with described reading manner to be controlled, comprising:
Read the reference position of the FIFO storage unit pointed to from virtual read pointer, during often corresponding more than the FIFO storage unit data volume of the data volume of reading, described virtual read pointer points to next FIFO storage unit.
4. method according to claim 2, is characterized in that,
Described according to reading manner, determine the interface signal corresponding with described reading manner, comprising:
When described reading manner be virtual increase progressively reading time, determine that the interface signal corresponding with described reading manner comprises virtual read pointer and virtual reading offsets;
Described the interface signal corresponding with described reading manner to be controlled, comprising:
From virtual read to offset the position pointed to read, when described virtual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, described virtual read pointer points to next FIFO storage unit;
At the end of reading, described virtual reading offsets the position that the location updating pointed to is the ED of described reading.
5. method according to claim 2, is characterized in that,
Described according to reading manner, determine the interface signal corresponding with described reading manner, comprising:
When described reading manner is virtual replacement reading, determine that the interface signal corresponding with described reading manner comprises virtual read pointer;
Described the interface signal corresponding with described reading manner to be controlled, comprising:
Read the reference position of the FIFO storage unit pointed to from virtual read pointer, at the end of reading, by the position that the position reset that described virtual read pointer points to points to actual read pointer.
6. method according to claim 2, is characterized in that,
Described according to reading manner, determine the interface signal corresponding with described reading manner, comprising:
When described reading manner is virtual replacement reading, determine that the interface signal corresponding with described reading manner comprises virtual read pointer and virtual reading offsets;
Described the interface signal corresponding with described reading manner to be controlled, comprising:
Read position is pointed in skew from virtual reading, at the end of reading, by the position that the position reset that described virtual read pointer points to points to actual read pointer;
The described virtual position reset reading to offset sensing is offset to actual reading the position pointed to.
7. method according to claim 2, is characterized in that,
Described according to reading manner, determine the interface signal corresponding with described reading manner, comprising:
When described reading manner be actual read skew time, determine that the interface signal corresponding with described actual reading manner comprises actual read pointer and actual reading offsets;
Described the interface signal corresponding with described reading manner to be controlled, comprising:
From actual read to offset the position pointed to read, when described actual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, described actual read pointer points to next FIFO storage unit;
At the end of reading, described virtual reading offsets the position that the location updating pointed to is the ED of described reading.
8. method according to claim 3, is characterized in that, before reading, also comprises the reference position of the described FIFO storage unit pointed to from virtual read pointer:
Valid data amount in FIFO is determined according to the position that position and the virtual read pointer of write pointers point point to;
Determine that described valid data amount is more than or equal to data volume corresponding to a FIFO storage unit.
9. method according to claim 4, is characterized in that, described from virtual read offset point to position read before, also comprise:
Valid data amount in FIFO is determined in the position pointed to according to the position of write pointers point, virtual read pointer and the virtual position reading to offset sensing;
Determine the minimum data amount that described valid data amount is more than or equal to virtual reading and reads at every turn.
10. method according to claim 7, is characterized in that, described from actual read offset point to position read before, also comprise:
Valid data amount in FIFO is determined in the position pointed to according to the position of write pointers point, actual read pointer and the actual position reading to offset sensing;
Determine that described valid data amount is more than or equal to each minimum data amount read of actual reading.
11. according to claim 1 ~ 6,8, method described in 9 or 10 any one, it is characterized in that, described the interface signal corresponding with described reading manner is controlled after, also comprise:
According to the position that actual read pointer points to, release FIFO storage space.
12. methods according to any one of claim 1 ~ 10, is characterized in that, after the described interface signal corresponding for described reading manner controls, also comprise:
The position pointed to according to actual read pointer and actual reading offset the position pointed to, release FIFO storage space.
13. 1 kinds of control device reading data, is characterized in that, comprising:
Processing module, for according to reading manner, determines the interface signal corresponding with described reading manner;
Control module, controls for the interface signal corresponding to described and described reading manner.
14. devices according to claim 13, is characterized in that, described reading manner comprises: actual reading, virtual increasing progressively are read or virtual replacement reading.
15. devices according to claim 14, is characterized in that, described processing module specifically for when described reading manner be virtual increase progressively reading time, determine that the interface signal corresponding with described reading manner comprises virtual read pointer;
Described control module reads specifically for the reference position of FIFO storage unit pointed to from virtual read pointer, and during often corresponding more than the FIFO storage unit data volume of the data volume of reading, described virtual read pointer points to next FIFO storage unit.
16. devices according to claim 14, is characterized in that, described processing module specifically for when described reading manner be virtual increase progressively reading time, determine that the interface signal corresponding with described reading manner comprises virtual read pointer and virtual reading offsets;
Described control module specifically for from virtual read offset point to position read, when described virtual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, described virtual read pointer points to next FIFO storage unit;
At the end of reading, described virtual reading offsets the position that the location updating pointed to is the ED of described reading.
17. devices according to claim 14, is characterized in that, when described processing module is specifically for being virtual replacement reading when described reading manner, determine that the interface signal corresponding with described reading manner comprises virtual read pointer;
Described control module reads, at the end of reading, by the position that the position reset that described virtual read pointer points to points to actual read pointer specifically for the reference position of FIFO storage unit pointed to from virtual read pointer.
18. devices according to claim 14, is characterized in that, when described processing module is specifically for being virtual replacement reading when described reading manner, determine that the interface signal corresponding with described reading manner comprises virtual read pointer and virtual reading offsets;
Described control module is specifically for reading skew and point to position from virtual and read, at the end of reading, by the position that the position reset that described virtual read pointer points to points to actual read pointer;
The described virtual position reset reading to offset sensing is offset to actual reading the position pointed to.
19. devices according to claim 14, is characterized in that, described processing module specifically for when described reading manner be actual read skew time, determine that the interface signal corresponding with described actual reading manner comprises actual read pointer and actual reading offsets;
Described control module specifically for from actual read offset point to position read, when described actual read to offset data volume that the numerical value of position pointed to the adds reading data volume corresponding more than FIFO storage unit time, described actual read pointer points to next FIFO storage unit;
At the end of reading, described virtual reading offsets the position that the location updating pointed to is the ED of described reading.
20. devices according to claim 15, is characterized in that, valid data amount in FIFO is determined in the position of described processing module also for pointing to according to position and the virtual read pointer of write pointers point; Determine that described valid data amount is more than or equal to data volume corresponding to a FIFO storage unit.
21. devices according to claim 16, is characterized in that, described processing module also for the position according to write pointers point, virtual read pointer point to position and virtual read offset point to position determine valid data amount in FIFO; Determine the minimum data amount that described valid data amount is more than or equal to virtual reading and reads at every turn.
22. devices according to claim 19, is characterized in that, described processing module also for the position according to write pointers point, actual read pointer point to position and actual read offset point to position determine valid data amount in FIFO; Determine that described valid data amount is more than or equal to each minimum data amount read of actual reading.
23. according to claim 13 ~ 18,20, device described in 21 or 22 any one, the position of described control module also for pointing to according to actual read pointer, release FIFO storage space.
24. devices according to any one of claim 13 ~ 22, is characterized in that, described control module also offsets the position pointed to, release FIFO storage space for the position pointed to according to actual read pointer and actual reading.
CN201510068000.XA 2015-02-09 2015-02-09 Read the control method and device of data Expired - Fee Related CN104636087B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510068000.XA CN104636087B (en) 2015-02-09 2015-02-09 Read the control method and device of data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510068000.XA CN104636087B (en) 2015-02-09 2015-02-09 Read the control method and device of data

Publications (2)

Publication Number Publication Date
CN104636087A true CN104636087A (en) 2015-05-20
CN104636087B CN104636087B (en) 2018-06-26

Family

ID=53214898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510068000.XA Expired - Fee Related CN104636087B (en) 2015-02-09 2015-02-09 Read the control method and device of data

Country Status (1)

Country Link
CN (1) CN104636087B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783403A (en) * 2017-11-10 2019-05-21 深圳超级数据链技术有限公司 Read the method, apparatus and data processor of data

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6269413B1 (en) * 1998-10-30 2001-07-31 Hewlett Packard Company System with multiple dynamically-sized logical FIFOs sharing single memory and with read/write pointers independently selectable and simultaneously responsive to respective read/write FIFO selections
US20010054121A1 (en) * 1999-01-19 2001-12-20 Timothy Proch Method and circuit for controlling a first-in-first-out (fifo) buffer using a bank of fifo address registers capturing and saving beginning and ending write-pointer addresses
CN1550991A (en) * 2003-05-13 2004-12-01 ��ʢ���ӹɷ����޹�˾ Method and system for dynamic controlling fifo internal memory accessing flowchart
CN1949163A (en) * 2006-11-30 2007-04-18 北京中星微电子有限公司 Virtual FIFO internal storage realizing method and controlling device thereof
CN101063978A (en) * 2006-04-28 2007-10-31 联发科技股份有限公司 Apparatus for file system management
CN103902471A (en) * 2012-12-28 2014-07-02 华为技术有限公司 Data cache processing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6269413B1 (en) * 1998-10-30 2001-07-31 Hewlett Packard Company System with multiple dynamically-sized logical FIFOs sharing single memory and with read/write pointers independently selectable and simultaneously responsive to respective read/write FIFO selections
US20010054121A1 (en) * 1999-01-19 2001-12-20 Timothy Proch Method and circuit for controlling a first-in-first-out (fifo) buffer using a bank of fifo address registers capturing and saving beginning and ending write-pointer addresses
CN1550991A (en) * 2003-05-13 2004-12-01 ��ʢ���ӹɷ����޹�˾ Method and system for dynamic controlling fifo internal memory accessing flowchart
CN101063978A (en) * 2006-04-28 2007-10-31 联发科技股份有限公司 Apparatus for file system management
CN1949163A (en) * 2006-11-30 2007-04-18 北京中星微电子有限公司 Virtual FIFO internal storage realizing method and controlling device thereof
CN103902471A (en) * 2012-12-28 2014-07-02 华为技术有限公司 Data cache processing method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783403A (en) * 2017-11-10 2019-05-21 深圳超级数据链技术有限公司 Read the method, apparatus and data processor of data

Also Published As

Publication number Publication date
CN104636087B (en) 2018-06-26

Similar Documents

Publication Publication Date Title
CN102654827B (en) First-in first-out buffer and data caching method
CN111813713B (en) Data acceleration operation processing method and device and computer readable storage medium
CN109726163A (en) A kind of communication system based on SPI, method, equipment and storage medium
CN105242879A (en) Data storage method and protocol server
CN105023612B (en) Bidirectional counter in flash memory
CN101877666B (en) Method and device for receiving multi-application program message based on zero copy mode
CN104932994A (en) Data processing method and device
CN110941582B (en) USB bus structure of BMC chip and communication method thereof
US9569384B2 (en) Conditional links for direct memory access controllers
CN108062235A (en) Data processing method and device
CN113726498A (en) SPI-based dual-full-duplex communication method, host, slave and storage medium
US20140351508A1 (en) Offloading raid update operations to disk controllers
CN107291392A (en) A kind of solid state hard disc and its reading/writing method
CN104636087A (en) Method and device for controlling reading data
CN104102552A (en) Message processing method and device
CN107894900A (en) A kind of method and system of MCU upgradings
US20140333634A1 (en) Image processing apparatus and image processing method
CN105264608A (en) Data storage method, memory controller and central processing unit
KR20110054788A (en) Apparatus and method for storing data using non-volatile buffer
US7174405B1 (en) Method and system for replacing a read-modify-write operation with an atomic set-bits or clear-bits operation
CN110780803A (en) Improving read performance on SATA storage devices behind a host bus adapter
CN111052100B (en) Bit-operable direct memory access
CN105204774A (en) Method for processing data and electronic device
CN114610231A (en) Control method, system, equipment and medium for large-bit-width data bus segmented storage
CN103594110B (en) Substitute the memory construction of dual-port RAM

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180626

Termination date: 20190209