CN104636087B - Read the control method and device of data - Google Patents
Read the control method and device of data Download PDFInfo
- Publication number
- CN104636087B CN104636087B CN201510068000.XA CN201510068000A CN104636087B CN 104636087 B CN104636087 B CN 104636087B CN 201510068000 A CN201510068000 A CN 201510068000A CN 104636087 B CN104636087 B CN 104636087B
- Authority
- CN
- China
- Prior art keywords
- reading
- virtual
- read
- directed toward
- practical
- 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.)
- Expired - Fee Related
Links
Landscapes
- Communication Control (AREA)
- Information Transfer Systems (AREA)
Abstract
The embodiment of the present invention provides a kind of control method and device for reading data, by increasing reading manner and interface signal corresponding with reading manner and the control mode to interface signal, according to reading manner, determines interface signal corresponding with above-mentioned reading manner;Above-mentioned interface signal corresponding with reading manner is controlled, realizes the repeatable reading of data and/or the reading of controlled data amount.
Description
Technical field
The present embodiments relate to computer technology more particularly to a kind of control methods and device for reading data.
Background technology
With multiple nucleus system chip (System on Chip, hereinafter referred to as:SoC) the extensive use of system, usually has
Some data flow of one core is sent to the demand of other multiple cores, is usually first write data into memory, with advanced
First go out (First Input First Output, hereinafter referred to as:FIFO it) for memory, is then read from FIFO memory
Data are sent to bus and are transmitted, and data flow replication are controlled to be sent to multiple cores by bus control module.
In the prior art, data are read from FIFO memory, data store in FIFO once reading and read data
Memory space is released, and the data read fail in FIFO memory, can not realize the repeatable reading of data.
Invention content
The embodiment of the present invention provides a kind of control method and device for reading data, to realize the repeatable reading of data.
First aspect of the embodiment of the present invention provides a kind of control method for reading data, including:
According to reading manner, interface signal corresponding with the reading manner is determined;
The interface signal corresponding with the reading manner is controlled.
With reference to first aspect, in the first possible realization method of first aspect, the reading manner includes:It is practical
It reads, virtual incremental reading or virtual resetting are read.
With reference to first aspect, it is described according to reading manner in second of possible realization method of first aspect, it determines
Interface signal corresponding with the reading manner, including:
When the reading manner is virtually incrementally reads, determine that interface signal corresponding with the reading manner includes void
Intend read pointer;
Described pair of interface signal corresponding with the reading manner controls, including:
It is read since the initial position for the FIFO storage units that virtual read pointer is directed toward, the data volume of reading is often more than one
During the corresponding data volume of a FIFO storage units, the virtual read pointer is directed toward next FIFO storage units.
With reference to first aspect, it is described according to reading manner in the third possible realization method of first aspect, it determines
Interface signal corresponding with the reading manner, including:
When the reading manner is virtually incrementally reads, determine that interface signal corresponding with the reading manner includes void
Intend read pointer and virtual reading deviates;
Described pair of interface signal corresponding with the reading manner controls, including:
It is read since the virtual position read offset and be directed toward, when the virtual numerical value for reading the position that offset is directed toward adds reading
Data volume when being more than the corresponding data volume of a FIFO storage unit, it is single that the virtual read pointer is directed toward next FIFO storages
Member;
At the end of reading, the virtual position for reading the end of data that the location updating that offset is directed toward is the reading.
With reference to first aspect, it is described according to reading manner in the 4th kind of possible realization method of first aspect, it determines
Interface signal corresponding with the reading manner, including:
When the reading manner is read for virtual resetting, determine that interface signal corresponding with the reading manner includes void
Intend read pointer;
Described pair of interface signal corresponding with the reading manner controls, including:
It is read since the initial position for the FIFO storage units that virtual read pointer is directed toward, at the end of reading, by described in
The position that the position reset that virtual read pointer is directed toward is directed toward to practical read pointer.
With reference to first aspect, it is described according to reading manner in the 5th kind of possible realization method of first aspect, it determines
Interface signal corresponding with the reading manner, including:
When the reading manner is read for virtual resetting, determine that interface signal corresponding with the reading manner includes void
Intend read pointer and virtual reading deviates;
Described pair of interface signal corresponding with the reading manner controls, including:
It reads to read position is directed toward in offset since virtual, at the end of reading, by the position of the virtual read pointer direction
It is reset to the position that practical read pointer is directed toward;
By the virtual position reset for reading offset direction to the practical position read offset and be directed toward.
With reference to first aspect, it is described according to reading manner in the 6th kind of possible realization method of first aspect, it determines
Interface signal corresponding with the reading manner, including:
When the reading manner for it is practical read offset when, determine that interface signal corresponding with the practical reading manner includes
Practical read pointer and practical reading deviate;
Described pair of interface signal corresponding with the reading manner controls, including:
It is read since the position for actually reading offset direction, when the practical numerical value for reading the position that offset is directed toward adds reading
Data volume when being more than the corresponding data volume of a FIFO storage unit, the practical read pointer is directed toward next FIFO storages singly
Member;
At the end of reading, the virtual position for reading the end of data that the location updating that offset is directed toward is the reading.
Second of possible realization method with reference to first aspect, in the 7th kind of possible realization method of first aspect
In, the initial position of the FIFO storage units being directed toward since virtual read pointer before reading, further include:
Valid data amount in the location determination FIFO being directed toward according to the position that write pointer is directed toward with virtual read pointer;
Determine that the valid data amount is more than or equal to the corresponding data volume of a FIFO storage unit.
The third possible realization method with reference to first aspect, in the 8th kind of possible realization method of first aspect
In, it is described before reading, to be further included since the virtual position read offset and be directed toward:
Position, the position of virtual read pointer direction and the virtual location determination read offset and be directed toward being directed toward according to write pointer
Valid data amount in FIFO;
Determine that the valid data amount is more than or equal to the minimum data amount for virtually reading and reading every time.
The 6th kind of possible realization method with reference to first aspect, in the 9th kind of possible realization method of first aspect
In, it is described before reading, to be further included since the position for actually reading offset direction:
Position, the position of practical read pointer direction and the practical location determination read offset and be directed toward being directed toward according to write pointer
Valid data amount in FIFO;
Determine that the valid data amount is more than or equal to the minimum data amount for actually reading and reading every time.
With reference to first aspect or first aspect the first to any possible reality in the 6th kind of possible realization method
Any possible realization method in existing mode or the 7th kind to the 9th kind possible realization method, at the tenth kind of first aspect
In possible realization method, after described pair of interface signal corresponding with the reading manner controls, further include:
According to the position that practical read pointer is directed toward, FIFO memory spaces are discharged.
With reference to first aspect or first aspect the first to any possible reality in the 9th kind of possible realization method
Existing mode, it is described that the corresponding interface of the reading manner is believed in a kind of the tenth possible realization method of first aspect
After number being controlled, further include:
The position and the practical position read offset and be directed toward being directed toward according to practical read pointer, discharge FIFO memory spaces.
Second aspect of the embodiment of the present invention provides a kind of control device for reading data, including:
Processing module, for according to reading manner, determining interface signal corresponding with the reading manner;
Control module, for controlling the interface signal corresponding with the reading manner.
With reference to second aspect, in the first possible realization method of second aspect, the reading manner includes:It is practical
It reads, virtual incremental reading or virtual resetting are read.
With reference to second aspect, in second of possible realization method of second aspect, the processing module is specifically used for
When the reading manner is virtually incrementally reads, determine that interface signal corresponding with the reading manner includes virtual reading and refers to
Needle;
The control module is specifically used for reading since the initial position for the FIFO storage units that virtual read pointer is directed toward,
The data volume of reading often more than one FIFO storage unit corresponding data volume when, the virtual read pointer is directed toward next FIFO
Storage unit.
With reference to second aspect, in the third possible realization method of second aspect, the processing module is specifically used for
When the reading manner is virtually incrementally reads, determine that interface signal corresponding with the reading manner includes virtual read pointer
Offset is read with virtual;
The control module since the virtual position read offset and be directed toward specifically for reading, when the virtual reading offset refers to
To the numerical value of position the data volume of reading is added to be more than a FIFO storage unit corresponding data volume when, the virtual read pointer
It is directed toward next FIFO storage units;
At the end of reading, the virtual position for reading the end of data that the location updating that offset is directed toward is the reading.
With reference to second aspect, in the 4th kind of possible realization method of second aspect, the processing module is specifically used for
When the reading manner is read for virtual resetting, determine that interface signal corresponding with the reading manner includes virtual reading and refers to
Needle;
The control module is specifically used for reading since the initial position for the FIFO storage units that virtual read pointer is directed toward,
At the end of reading, position that the position reset that the virtual read pointer is directed toward is directed toward to practical read pointer.
With reference to second aspect, in the 5th kind of possible realization method of second aspect, the processing module is specifically used for
When the reading manner is read for virtual resetting, determine that interface signal corresponding with the reading manner includes virtual read pointer
Offset is read with virtual;
The control module since virtual specifically for reading to read position is directed toward in offset, at the end of reading, by described in
The position that the position reset that virtual read pointer is directed toward is directed toward to practical read pointer;
By the virtual position reset for reading offset direction to the practical position read offset and be directed toward.
With reference to second aspect, in the 6th kind of possible realization method of second aspect, the processing module is specifically used for
When the reading manner for it is practical read offset when, determine that interface signal corresponding with the practical reading manner includes reality and reads to refer to
Needle and practical reading deviate;
The control module is specifically used for reading since reality reads the position of offset direction, when the practical reading offset refers to
To the numerical value of position the data volume of reading is added to be more than a FIFO storage unit corresponding data volume when, the practical read pointer
It is directed toward next FIFO storage units;
At the end of reading, the virtual position for reading the end of data that the location updating that offset is directed toward is the reading.
With reference to second of possible realization method of second aspect, in the 7th kind of possible realization method of second aspect
In, the processing module is additionally operable in the location determination FIFO being directed toward according to the position that write pointer is directed toward with virtual read pointer effectively
Data volume;Determine that the valid data amount is more than or equal to the corresponding data volume of a FIFO storage unit.
With reference to the third possible realization method of second aspect, in the 8th kind of possible realization method of second aspect
In, the processing module is additionally operable to the position being directed toward according to write pointer, the position that virtual read pointer is directed toward and virtual reading offset and refers to
To location determination FIFO in valid data amount;Determine that the valid data amount is more than or equal to the minimum for virtually reading and reading every time
Data volume.
With reference to the 6th kind of possible realization method of second aspect, in the 9th kind of possible realization method of second aspect
In, the processing module is additionally operable to the position being directed toward according to write pointer, the position that practical read pointer is directed toward and practical reading offset and refers to
To location determination FIFO in valid data amount;Determine that the valid data amount is more than or equal to the minimum for actually reading and reading every time
Data volume.
With reference to any possible reality in the first of second aspect or second aspect to the 6th kind of possible realization method
Any possible realization method in existing mode or the 7th kind to the 9th kind possible realization method, at the tenth kind of second aspect
In possible realization method, the control module is additionally operable to the position being directed toward according to practical read pointer, discharges FIFO memory spaces.
With reference to any possible reality in the first of second aspect or second aspect to the 9th kind of possible realization method
Existing mode, in a kind of the tenth possible realization method of second aspect, the control module is additionally operable to according to practical read pointer
The position of direction and the practical position read offset and be directed toward, discharge FIFO memory spaces.
It is provided in an embodiment of the present invention read data control method and device, by increase reading manner and with reading side
The corresponding interface signal of formula and the control mode to interface signal according to reading manner, determine corresponding with the reading manner
Interface signal;The interface signal corresponding with the reading manner is controlled, realize data repeatable reading and/
Or the reading of controlled data amount.
Description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention, for those of ordinary skill in the art, without having to pay creative labor, may be used also
To obtain other attached drawings according to these attached drawings.
Fig. 1 is the flow diagram for the control method embodiment one that the present invention reads data;
Fig. 2 is fifo structure schematic diagram of the embodiment of the present invention;
Fig. 3 is the practical application scenarios schematic diagram read of the embodiment of the present invention;
Fig. 4 is the virtual incremental application scenarios schematic diagram read and virtual resetting is read of the present invention;
Fig. 5 is the structure diagram for the control device embodiment one that the present invention reads data;
Fig. 6 is the structure diagram for the control device embodiment two that the present invention reads data.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other without making creative work
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the present invention is by increasing reading manner and interface signal corresponding with reading manner and to interface signal
Control mode, realize the repeatable reading of data and the reading of controlled data amount, specifically, reading manner includes:It is practical to read
It takes, virtually incrementally read and virtually reset reading;It is practical to read corresponding interface signal as practical read pointer, alternatively, practical read
Pointer and practical reading deviate;It is virtual incrementally to read corresponding interface signal as virtual read pointer, alternatively, virtual read pointer and virtual
Read offset;The virtual corresponding interface signal of reading that resets is virtual read pointer, alternatively, virtual read pointer and virtually reading deviate.
It is the finger according to read pointer practical in practical reading manner because of the memory space release in FIFO or data failure
To determining, therefore, the present invention increase it is virtual it is incremental read and virtual resetting is read, pass through the control to virtual read pointer and read
Data, meanwhile, the direction of practical read pointer is constant, so as to ensure that the memory space where the data read is not released (i.e.
Data do not fail), by virtually resetting reading, make after reading terminates, virtual read pointer is reset to the position of practical read pointer,
So that data repeat reading.
By increasing virtual reading offset, it is ensured that when being read using virtual incremental reading or virtual resetting, the data volume of reading
Controllably, by increasing practical reading offset, it is ensured that when reality is read, the data volume of reading is controllable.
Technical scheme of the present invention is described in detail with specifically embodiment below.These specific implementations below
Example can be combined with each other, and the same or similar concept or process may be repeated no more in some embodiments.
The interface signal that may be used to the present invention first is briefly described, in order to subsequent descriptions:
fifo_wen:FIFO writes enabled interface signal, and input interface, high effectively, the data volume being written every time is one
The corresponding data volume of FIFO bit wides, that is, the corresponding data volume of a FIFO storage unit.
fifo_wdata:FIFO's writes data-interface signal, input interface.
fifo_ren:FIFO reads enable signal, and input interface is high effectively.
fifo_rtype:FIFO reading manners, input interface are divided into following three kinds:
It is practical to read:After reading data, the corresponding memory space of data read in FIFO discharges, the data read
Failure, corresponding practical read pointer (actual_pointer) and practical reading deviate the number of (actual_offset) according to reading
It is incremented by according to amount.
Virtual incremental reading:After reading data, the corresponding memory space of data read in FIFO does not discharge, has read
Data it is effective, corresponding virtual read pointer (virtual_pointer) and virtual read offset (virtual_offset) basis
The data volume of reading and be incremented by.
Virtual resetting is read:After reading data, the corresponding memory space of data read in FIFO does not discharge, has read
Data it is effective, corresponding virtual read pointer (virtual_pointer) and virtual read offset (virtual_offset) resetting
Corresponding position is deviated to practical read pointer and practical reading.
fifo_rsize:FIFO read operations read valid data amount, unit be byte (byte), input interface, this hair
Bright embodiment supports the reading for being arbitrarily less than or equal to FIFO storage unit corresponding data amounts, matching bus each period (cycle)
Send the demand of arbitrary byte data amount.
fifo_rdata:FIFO reads data, and output interface, the bit wide for reading data is twice of FIFO width, because once
The valid data amount of operation, may be in cross-domain to the two corresponding storage units of continuous pointer.
fifo_roffset:FIFO reads offset, and output interface, fifo_roffset is directly by read pointer pair in FIFO
The data block answered and its continuously the corresponding data block reading of next pointer is gone with read pointer, FIFO user needs basis
Position of the valid data that fifo_roffset and fifo_rsize judges to read in fifo storage units, if virtually passing
Increasing reading or virtual resetting is read, fifo_roffset corresponding is virtual reading offset (virtual_roffset), if
Practical to read, fifo_roffset corresponding is practical reading offset (actual_roffset).
virtual byte_cnt:Virtual valid data amount in FIFO, unit be byte (byte), output interface, virtually
Valid data amount is determined by virtual read pointer, virtual reading offset and practical write pointer, when FIFO reading manners is virtually pass
When increasing reading or virtual resetting reading, determine whether to carry out virtually incremental read according to virtual valid data amount before reading
It takes or virtually resets reading.
actual byte_cnt:Actually active data volume in FIFO, unit are byte (byte), and output interface actually has
Effect data volume is determined by practical read pointer, practical reading offset and practical write pointer, when FIFO reading manners are read to be practical
When, it is determined whether according to actually active data volume to carry out practical reading before reading.
Fig. 1 is the flow diagram for the control method embodiment one that the present invention reads data, as shown in Figure 1, the present embodiment
Method it is as follows:
S101:According to reading manner, interface signal corresponding with reading manner is determined.
Specifically, reading manner includes:Practical reading, virtual incremental reading or virtual reset are read.
It is practical read pointer with the corresponding interface signal of practical reading, alternatively, being with the practical corresponding interface signal of reading
Practical read pointer and practical reading deviate;
With virtually incrementally reading corresponding interface signal as virtual read pointer, alternatively, with virtually incrementally reading corresponding connect
Message number is deviated for virtual read pointer and virtual reading;
It is virtual read pointer with the corresponding interface signal of virtual resetting readings, alternatively, with virtually resetting that reading is corresponding to be connect
Message number is deviated for virtual read pointer and virtual reading.
S102:Pair interface signal corresponding with reading manner controls.
For different reading manners and different interface signals, control mode is different:
During the 1st, for reading manner virtually incrementally to read, to the following two situations of control point of interface signal:
11:When the corresponding interface signal of reading manner is virtual read pointer, control mode is as follows:
It is read since the initial position for the FIFO storage units that virtual read pointer is directed toward, the data volume of reading is often more than one
During the corresponding data volume of a FIFO storage units, virtual read pointer is directed toward next FIFO storage units.
In this fashion, the corresponding data volume of a FIFO width, that is, a FIFO must be read by reading every time
The corresponding data volume of storage unit, the data volume of reading are uncontrollable.
12:When the corresponding interface signal of reading manner is virtual read pointer and virtual reading offset, control mode is as follows:
It is read since the virtual position read offset and be directed toward, when the virtual numerical value for reading the position that offset is directed toward adds the number of reading
During data volume corresponding according to more than one FIFO storage unit of amount, virtual read pointer is directed toward next FIFO storage units;Work as void
Intending the incremental numerical value for reading the position that offset is directed toward adds the data volume of reading to be less than the corresponding data of a FIFO storage unit
During amount, virtual read pointer direction does not change.
At the end of reading, whether the numerical value for no matter virtually reading the position that offset is directed toward adds the data volume of reading more than one
The corresponding data volume of FIFO storage units, it is virtual to read the position that the location updating that offset is directed toward is the end of data read.
In this fashion, data volume can be arbitrary by reading every time, and the data volume of reading is controllable.
When the 2nd, being read for reading manner for virtual resetting, to the following two situations of control point of interface signal:
21:When the corresponding interface signal of reading manner is virtual read pointer, control mode is as follows:
It is read since the initial position for the FIFO storage units that virtual read pointer is directed toward, it, will be virtual at the end of reading
The position that the position reset that read pointer is directed toward is directed toward to practical read pointer.
In this fashion, the corresponding data volume of a FIFO width, that is, a FIFO must be read by reading every time
The corresponding data volume of storage unit, the data volume of reading are uncontrollable.
22:When the corresponding interface signal of reading manner includes virtual read pointer and virtual reading offset, control mode is as follows:
It reads to read position is directed toward in offset since virtual, at the end of reading, the position that virtual read pointer is directed toward is heavy
Put the position that practical read pointer is directed toward;By the above-mentioned virtual position reset for reading offset direction to the practical position read offset and be directed toward
It puts.
In this fashion, data volume can be arbitrary by reading every time, and the data volume of reading is controllable.
At the end of reading, the above-mentioned virtual position for reading the end of data that the location updating that offset is directed toward is above-mentioned reading.
During the 3rd, for reading manner for practical reading, to the following two situations of control point of interface signal:
31st, when the corresponding interface signal of reading manner is practical read pointer, control mode is as follows:
It is read since the initial position for the FIFO storage units that practical read pointer is directed toward, the data volume of reading is often more than one
During the corresponding data volume of a FIFO storage units, practical read pointer is directed toward next FIFO storage units.
In this fashion, the corresponding data volume of a FIFO width, that is, a FIFO must be read by reading every time
The corresponding data volume of storage unit, the data volume of reading are uncontrollable.
At the end of reading, according to the position that practical read pointer is directed toward, FIFO memory spaces are discharged.
32nd, when the corresponding interface signal of reading manner is practical read pointer and practical reading offset, control mode is as follows:
It is read since the position for actually reading offset direction, when the numerical value for actually reading the position that offset is directed toward adds the number of reading
During data volume corresponding according to more than one FIFO storage unit of amount, practical read pointer is directed toward next FIFO storage units;Work as reality
When the numerical value that the position that offset is directed toward is read on border adds the data volume of reading to be less than a FIFO storage unit corresponding data volume,
Practical read pointer direction does not change.
At the end of reading, no matter whether the practical numerical value for reading the position that offset is directed toward adds the data volume of reading more than one
The corresponding data volume of FIFO storage units, the practical position for reading the end of data that the location updating that offset is directed toward is above-mentioned reading.
In this fashion, data volume can be arbitrary by reading every time, and the data volume of reading is controllable.
At the end of reading, the position and the practical position read offset and be directed toward be directed toward according to practical read pointer discharge FIFO
Memory space.
In the present embodiment, by increasing reading manner and interface signal corresponding with reading manner and to interface signal
Control mode, realize the repeatable reading of data and/or the reading of controlled data amount.
It should be noted that in the above-described embodiments, using be virtually incremented by reading manner or virtual resetting reading manner it
Before,
If corresponding interface signal is virtual read pointer during virtual incremental reading or virtual resetting are read, also wrap
It includes:Valid data amount in the location determination FIFO being directed toward according to the position that write pointer is directed toward with virtual read pointer;Determine significant figure
During data volume corresponding more than or equal to a FIFO storage unit according to amount, just allow progress is virtual incrementally to read or virtually reset
It reads.
Corresponding interface signal is read for virtual read pointer with virtual during if virtual incremental reading or virtual resetting are read
Offset, then further include:The position and the virtual position for reading offset direction being directed toward according to write pointer direction position, virtual read pointer are true
Determine valid data amount in FIFO, determine that valid data amount is more than or equal to the minimum data amount for virtually reading and reading every time.
In the above-described embodiments, before using practical reading manner, if practical read corresponding interface signal as reality
Read pointer then further includes:Valid data in the location determination FIFO being directed toward according to the position that write pointer is directed toward with virtual read pointer
Amount;When determining that valid data amount is more than or equal to the corresponding data volume of a FIFO storage unit, just allow to carry out practical reading.
If reality reads corresponding interface signal and deviated for practical read pointer and practical reading, further include:Refer to according to writing
Valid data amount in position, the position of practical read pointer direction and the practical location determination FIFO for reading offset and being directed toward that needle is directed toward;
Determine that above-mentioned valid data amount is more than or equal to the minimum data amount for actually reading and reading every time.
In the above-described embodiments, when writing data, the data volume being written every time must be that a FIFO storage unit is corresponding
Data volume, after the corresponding data volume of a FIFO storage unit is often written, write pointer adds 1.
Fig. 2 is fifo structure schematic diagram of the embodiment of the present invention, as shown in Fig. 2, laterally referring to the width of FIFO, is longitudinally referred to
Be FIFO depth (' h0~' hN is shown in Fig. 2), the valid data amount stored in the mark FIFO of shaded block, blank block
The invalid data block in FIFO is identified, the reading of data fifo is mainly included to the corresponding interface signal of three kinds of reading manners
It controls, is shown in figure, instruction, virtual read pointer and virtual reading offset are actually write in practical read pointer, practical reading offset.
Fig. 3 is described for actually reading, and Fig. 3 is the practical application scenarios schematic diagram read 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, and the right figure in Fig. 3 is has in FIFO after reading
The signal of data and Interface status is imitated, the interface signal shown in Fig. 3 is practical read pointer, practical reading deviates and actually write finger
Needle, as shown in figure 3, shaded block is the valid data in FIFO, practical read pointer direction ' h1, practical write pointer direction ' h4 are real
Read the initial position that valid data are directed toward in offset, the i.e. ' part to the left of h1 in border;Practical read operation is carried out, offset is read from practical
Start to read, the quantity amount actually read adds practical reading offset to be more than the corresponding data volume of a FIFO storage unit, practical
Read pointer is directed toward ' h2;It is practical to read offset update to the position of the end of data read.The storage of data read after reading
Space is released, i.e., data are deactivated, and as shown in the right figure in Fig. 3, shaded block is the valid data after the practical readings of FIFO,
Blank block is the invalid data after practical read.
Fig. 4 is the virtual incremental application scenarios schematic diagram read and virtual resetting is read of the present invention, attached comprising four in Fig. 4
Figure, the picture left above are the status diagram of the valid data and interface signal before reading, and top right plot is read to be virtually incremental for the first time
Effectively have data and a status diagram of interface signal after taking, bottom right for second it is virtual it is incremental read after valid data and
The status diagram of interface signal, state signal of the lower-left for valid data and interface signal after the virtual resetting reading of third time
Figure.Shaded block is valid data in each figure of Fig. 4, and blank block is invalid data;
Incremental reading virtual for the first time, fifo_rtype are set as virtually incremental and read, and the position being directed toward is deviated from virtual reading
Put and start to read, the data of reading be updated to across address ' h3 and ' h4, the direction of virtual read pointer by ' h3 ' h4, it is virtual read it is inclined
The location updating of shifting is the position for reading end of data;The practical position for reading offset, practical read pointer and practical write pointer is not
Become.
Second of virtual incremental reading, fifo_rtype are set as virtually incremental and read, and the position being directed toward is deviated from virtual reading
It puts and starts to read, ' in h4, the direction of virtual read pointer is constant, and the location updating of virtual reading offset is in address for the data of reading
Read the position of end of data;The practical position for reading offset, practical read pointer and practical write pointer is constant.
The virtual resetting of third time is read, and fifo_rtype, which is set as virtually resetting, to be read, from the virtual position read offset and be directed toward
It puts and starts to read, the data of reading cross over address ' h4 and ' h5, after reading, the virtual position reset for reading offset is read to reality
Offset, the direction of virtual read pointer are reset to the direction of practical read pointer.
In the present embodiment, by increasing reading manner and interface signal corresponding with reading manner and to interface signal
Control mode, realize the repeatable reading of data and/or the reading of controlled data amount.
Fig. 5 is the structure diagram for the control device embodiment one that the present invention reads data, as shown in figure 5, the present embodiment
Device include:Processing module 501 and control module 502, wherein, processing module 501 is used for according to reading manner, determine with it is upper
State the corresponding interface signal of reading manner;Control module 502 be used for above-mentioned interface signal corresponding with above-mentioned reading manner into
Row control.
In the above-described embodiments, above-mentioned reading manner includes:Practical reading, virtual incremental reading or virtual reset are read.
In the above-described embodiments, above-mentioned processing module 501 is specifically used for when above-mentioned reading manner is virtually incrementally reads,
Determine that interface signal corresponding with above-mentioned reading manner includes virtual read pointer;
Above-mentioned control module 502 is specifically used for reading since the initial position for the FIFO storage units that virtual read pointer is directed toward
Take, the data volume of reading often more than one FIFO storage unit corresponding data volume when, above-mentioned virtual read pointer is directed toward next
FIFO storage units.
In the above-described embodiments, above-mentioned processing module 501 is specifically used for when above-mentioned reading manner is virtually incrementally reads,
Determine that interface signal corresponding with above-mentioned reading manner includes virtual read pointer and virtual reading offset;
Above-mentioned control module 502 since the virtual position read offset and be directed toward specifically for reading, when above-mentioned virtual reading is inclined
When moving the numerical value of the position being directed toward the data volume of reading being added to be more than the corresponding data volume of a FIFO storage unit, above-mentioned virtual reading
Pointer is directed toward next FIFO storage units;
At the end of reading, the above-mentioned virtual position for reading the end of data that the location updating that offset is directed toward is above-mentioned reading.
In the above-described embodiments, above-mentioned processing module 501 is specifically used for when above-mentioned reading manner is read for virtual resetting,
Determine that interface signal corresponding with above-mentioned reading manner includes virtual read pointer;
Above-mentioned control module 502 is specifically used for reading since the initial position for the FIFO storage units that virtual read pointer is directed toward
It takes, at the end of reading, position that the position reset that above-mentioned virtual read pointer is directed toward is directed toward to practical read pointer.
In the above-described embodiments, above-mentioned processing module 501 is specifically used for when above-mentioned reading manner is read for virtual resetting,
Determine that interface signal corresponding with above-mentioned reading manner includes virtual read pointer and virtual reading offset;
Above-mentioned control module 502 is specifically used for reading to read position is directed toward in offset since virtual, will be upper at the end of reading
State the position that the position reset that virtual read pointer is directed toward is directed toward to practical read pointer;
By the above-mentioned virtual position reset for reading offset direction to the practical position read offset and be directed toward.
In the above-described embodiments, above-mentioned processing module 501 is specifically used for when above-mentioned reading manner is practical reading offset, really
Fixed interface signal corresponding with above-mentioned practical reading manner includes practical read pointer and reality reading offset;
Above-mentioned control module 502 is specifically used for reading since reality reads the position of offset direction, when above-mentioned practical reading is inclined
It is above-mentioned practical to read when moving the numerical value of the position being directed toward the data volume of reading being added to be more than the corresponding data volume of a FIFO storage unit
Pointer is directed toward next FIFO storage units;
At the end of reading, the above-mentioned virtual position for reading the end of data that the location updating that offset is directed toward is above-mentioned reading.
In the above-described embodiments, above-mentioned processing module 501 is additionally operable to according to the position that write pointer is directed toward and virtual read pointer
Valid data amount in the location determination FIFO of direction;Determine that above-mentioned valid data amount is more than or equal to a FIFO storage unit and corresponds to
Data volume.
In the above-described embodiments, above-mentioned processing module 501 is additionally operable to the position being directed toward according to write pointer, virtual read pointer refers to
To position and the virtual location determination FIFO for reading offset and being directed toward in valid data amount;Determine that above-mentioned valid data amount is more than or equal to
Virtually read the minimum data amount read every time.
In the above-described embodiments, above-mentioned processing module 501 is additionally operable to the position being directed toward according to write pointer, practical read pointer refers to
To position and the practical location determination FIFO for reading offset and being directed toward in valid data amount;Determine that above-mentioned valid data amount is more than or equal to
Actually read the minimum data amount read every time.
In the above-described embodiments, above-mentioned control module 502 is additionally operable to the position being directed toward according to practical read pointer, discharges FIFO
Memory space.
In the above-described embodiments, above-mentioned control module 502 is additionally operable to the position being directed toward according to practical read pointer and practical reading
The position being directed toward is deviated, discharges FIFO memory spaces.
Above device embodiment, by increasing reading manner and interface signal corresponding with reading manner and to interface
The control mode of signal, processing module determine interface signal corresponding with above-mentioned reading manner according to reading manner;Control module
Pair interface signal corresponding with above-mentioned reading manner controls, and realizes the repeatable reading of data and/or controlled data amount
It reads.
Fig. 6 is the structure diagram for the control device embodiment two that the present invention reads data, as shown in fig. 6, reading data
Control device 600 include communication interface 601, memory 603 and processor 602, wherein, communication interface 601, processor 602,
Memory 603 is connected with each other by bus 604;Bus 604 can be pci bus or eisa bus etc..Above-mentioned bus can divide
For address bus, data/address bus, controlling bus etc..For ease of representing, only represented in Fig. 6 with a thick line, it is not intended that only
There are a bus or a type of bus.
Memory 603, for storing program.Specifically, program can include program code, and above procedure code includes meter
Calculation machine operational order.Memory 603 may include RAM, it is also possible to further include nonvolatile memory (non-volatile
Memory), a for example, at least magnetic disk storage.
Processor 602 performs the program that memory 603 is stored, and realizes the present invention control shown in FIG. 1 for reading data
Method, including:
According to reading manner, interface signal corresponding with above-mentioned reading manner is determined;
Above-mentioned interface signal corresponding with above-mentioned reading manner is controlled.
Above-mentioned processor 602 can be general processor, including CPU, NP etc.;It can also be digital signal processor
(DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate
Or transistor logic, discrete hardware components.
The present embodiment, by increasing reading manner and interface signal corresponding with reading manner and to interface signal
Control mode, processor determine interface signal corresponding with above-mentioned reading manner according to reading manner;Pair with above-mentioned reading manner
Corresponding interface signal is controlled, and realizes the repeatable reading of data and/or the reading of controlled data amount.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Aforementioned program can be stored in a computer read/write memory medium.The journey
Sequence when being executed, performs the step of including above-mentioned each method embodiment;And aforementioned storage medium includes:ROM, RAM, magnetic disc or
The various media that can store program code such as person's CD.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe is described in detail the present invention with reference to foregoing embodiments, it will be understood by those of ordinary skill in the art that:Its according to
Can so modify to the technical solution recorded in foregoing embodiments either to which part or all technical features into
Row equivalent replacement;And these modifications or replacement, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (6)
1. a kind of control method for reading data, which is characterized in that including:
According to reading manner, interface signal corresponding with the reading manner is determined;
The interface signal corresponding with the reading manner is controlled;
The reading manner includes:Virtual resetting is read, and the virtual resetting is read as virtual read pointer and reads offset weight with virtual
Put practical read pointer and the practical mode for reading to deviate corresponding position;
It is described that interface signal corresponding with the reading manner is determined according to reading manner, including:
When the reading manner is read for virtual resetting, determine that interface signal corresponding with the reading manner includes virtual read
Pointer;
Described pair of interface signal corresponding with the reading manner controls, including:
It is read since the initial position for the FIFO storage units that virtual read pointer is directed toward, it, will be described virtual at the end of reading
The position that the position reset that read pointer is directed toward is directed toward to practical read pointer;
Alternatively,
It is described that interface signal corresponding with the reading manner is determined according to reading manner, including:
When the reading manner is read for virtual resetting, determine that interface signal corresponding with the reading manner includes virtual read
Pointer and virtual reading deviate;
Described pair of interface signal corresponding with the reading manner controls, including:
It reads to read position is directed toward in offset since virtual, at the end of reading, by the position reset of the virtual read pointer direction
The position being directed toward to practical read pointer;
By the virtual position reset for reading offset direction to the practical position read offset and be directed toward.
2. according to the method described in claim 1, it is characterized in that, described pair of interface signal corresponding with the reading manner into
After row control, further include:
According to the position that practical read pointer is directed toward, FIFO memory spaces are discharged.
3. method according to claim 1 or 2, which is characterized in that described pair of interface letter corresponding with the reading manner
After number being controlled, further include:
The position and the practical position read offset and be directed toward being directed toward according to practical read pointer, discharge FIFO memory spaces.
4. a kind of control device for reading data, which is characterized in that including:
Processing module, for according to reading manner, determining interface signal corresponding with the reading manner;
Control module, for controlling the interface signal corresponding with the reading manner;
The reading manner includes:Virtual resetting is read, and the virtual resetting is read as virtual read pointer and reads offset weight with virtual
Put practical read pointer and the practical mode for reading to deviate corresponding position;
The processing module is specifically used for, when the reading manner is read for virtual resetting, determining corresponding with the reading manner
Interface signal include virtual read pointer;
The control module is specifically used for reading since the initial position for the FIFO storage units that virtual read pointer is directed toward, works as reading
At the end of taking, position that the position reset that the virtual read pointer is directed toward is directed toward to practical read pointer;
Alternatively,
The processing module is specifically used for, when the reading manner is read for virtual resetting, determining corresponding with the reading manner
Interface signal include virtual read pointer and virtual read to deviate;
The control module is specifically used for reading to read position is directed toward in offset since virtual, will be described virtual at the end of reading
The position that the position reset that read pointer is directed toward is directed toward to practical read pointer;
By the virtual position reset for reading offset direction to the practical position read offset and be directed toward.
5. device according to claim 4, the control module is additionally operable to the position being directed toward according to practical read pointer, release
FIFO memory spaces.
6. device according to claim 4 or 5, which is characterized in that the control module is additionally operable to according to practical read pointer
The position of direction and the practical position read offset and be directed toward, discharge FIFO memory spaces.
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 CN104636087A (en) | 2015-05-20 |
CN104636087B true 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) |
Families Citing this family (1)
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 (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Family Cites Families (3)
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 |
US6381659B2 (en) * | 1999-01-19 | 2002-04-30 | Maxtor Corporation | 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 |
US7467242B2 (en) * | 2003-05-13 | 2008-12-16 | Via Technologies, Inc. | Method and system for dynamic FIFO flow control |
-
2015
- 2015-02-09 CN CN201510068000.XA patent/CN104636087B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Also Published As
Publication number | Publication date |
---|---|
CN104636087A (en) | 2015-05-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105608027B (en) | Non-volatile memory apparatus and the method for accessing non-volatile memory apparatus | |
CN104781801B (en) | Solid state drive is set to be configured to the technology operated using memory module or memory mode | |
CN103019970B (en) | Memory storage and control method thereof | |
CN103366794B (en) | For reducing the device and method of pin count rambus interface | |
TW201413453A (en) | Data storage device and flash memory control method | |
CN101008928A (en) | Method and apparatus for tracking command order dependencies | |
CN105229592B (en) | For generating the apparatus and method to access the descriptor of the nonvolatile semiconductor memory of memory driver again due to mistake | |
TW201447897A (en) | System and method of reading data from memory concurrently with sending write data to the memory | |
CN109313620A (en) | Memory protocol | |
CN101303884A (en) | Nand type flash memory controller and read-write control system and method | |
CN107291392A (en) | A kind of solid state hard disc and its reading/writing method | |
CN110211621A (en) | Bidirectional counter in flash memory | |
CN113868039A (en) | Test method, test device and related equipment | |
CN104636087B (en) | Read the control method and device of data | |
CN108572932A (en) | More plane NVM command fusion methods and device | |
CN203084718U (en) | Field-programmable gate array (FPGA) | |
US8239637B2 (en) | Byte mask command for memories | |
CN105354153A (en) | Implement method for data exchange and cache of tightly-coupled heterogeneous multi-processor | |
CN109710547B (en) | Buffer memory management design and implementation method in industrial Internet of things | |
CN105264608A (en) | Data storage method, memory controller and central processing unit | |
KR20110054788A (en) | Apparatus and method for storing data using non-volatile buffer | |
CN103500585B (en) | A kind of control circuit and its control method for being used to control single programmable memory | |
CN103488597A (en) | First-in first-out buffer and data reading-writing method thereof | |
CN110007853A (en) | A kind of Nandflash command handling method, device, terminal and storage medium | |
CN110515535A (en) | Disk read-write control method, device, electronic equipment and storage medium |
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 |
Granted publication date: 20180626 Termination date: 20190209 |
|
CF01 | Termination of patent right due to non-payment of annual fee |