CN109426623A - A kind of method and device reading data - Google Patents

A kind of method and device reading data Download PDF

Info

Publication number
CN109426623A
CN109426623A CN201710757725.9A CN201710757725A CN109426623A CN 109426623 A CN109426623 A CN 109426623A CN 201710757725 A CN201710757725 A CN 201710757725A CN 109426623 A CN109426623 A CN 109426623A
Authority
CN
China
Prior art keywords
data
read request
main equipment
eflash
read
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.)
Pending
Application number
CN201710757725.9A
Other languages
Chinese (zh)
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.)
Sanechips Technology Co Ltd
Shenzhen ZTE Microelectronics Technology Co Ltd
Original Assignee
Shenzhen ZTE Microelectronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen ZTE Microelectronics Technology Co Ltd filed Critical Shenzhen ZTE Microelectronics Technology Co Ltd
Priority to CN201710757725.9A priority Critical patent/CN109426623A/en
Publication of CN109426623A publication Critical patent/CN109426623A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0868Data transfer between cache memory and other subsystems, e.g. storage devices or host systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0893Caches characterised by their organisation or structure
    • G06F12/0895Caches characterised by their organisation or structure of parts of caches, e.g. directory or tag array
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/20Employing a main memory using a specific memory technology
    • G06F2212/202Non-volatile memory

Abstract

A kind of method and device reading data, comprising: according to the read request of the main equipment received, determine the data whether stored in preset caching (buffer) corresponding to read request;When being stored with the data corresponding to read request in preset caching, the data feedback of read request will be corresponded in caching to main equipment.The embodiment of the present invention shorten main equipment read data it is waiting for a long time, improve data access efficiency.

Description

A kind of method and device reading data
Technical field
Present document relates to but be not limited to system on chip (SOC) technology, espespecially it is a kind of read data method and device.
Background technique
To low side SOC technology, the especially field Internet of Things and micro-control unit (MCU), it is based on cost consideration, Double Data Rate Synchronous DRAM (DDR), embedded multi-media card (EMMC) etc. are generally not used;Relative to DDR and EMMC etc., The storage combination that low capacity static random access memory (SRAM) and built-in embedded flash memory (eflash) are constituted is suitable for object The low sides SOC such as networking and micro-control unit (MCU).
Eflash be it is non-volatile, be suitable for save routine and data;Meanwhile the read access time of eflash device compared with It is short, it is suitable for random write, the program being stored in eflash can be directly processed device execution;Therefore, depositing based on eflash Storage scheme can lack chip piece in total solution level compared to external storage scheme.In addition, eflash is with very high Integrated level, random access memory (RAM) resource that storage scheme based on eflash needs greatly reduces, and compares other sides Case has more advantage.Eflash reading rate is nominally between 30~50 megahertzs (Mhz), it is sufficient to match the processor of 100Mhz magnitude Requirement to reading performance;Therefore, program code generally is stored with eflash when in use, the SRAM of low capacity of arranging in pairs or groups is stored Data.
In the higher scene of processor running frequency, especially multiple main equipments (processor, direct memory access DMA etc.) When by multilayer advanced high-performance bus (AHB) come share and access eflash, it is easy to appear eflash read access number and increases, is main The problems such as equipment is waiting for a long time and access efficiency reduces, affects system by the access mode of AHB share and access eflash Working performance.
Summary of the invention
It is the general introduction to the theme being described in detail herein below.This general introduction is not the protection model in order to limit claim It encloses.
The embodiment of the present invention provides a kind of method and device for reading data, can shorten the waiting that main equipment reads data Time is long, promotes data access efficiency.
The embodiment of the invention provides a kind of methods for reading data, comprising:
According to the read request of the main equipment received, determine whether store corresponding to read request in preset caching buffer Data;
When being stored with the data corresponding to read request in preset caching, the data feedback of read request will be corresponded in caching To main equipment.
Optionally, in the preset caching when the not stored data having corresponding to read request, the method also includes:
It is read from built-in embedded flash memory eflash according to the read request received corresponding to the read request Data, and by the data feedback read to corresponding main equipment.
Optionally, before this method further include:
Corresponding buffer is respectively configured for each main equipment.
Optionally, each storage unit of the caching includes: address field, data field and mark domain;
Wherein, the address field and data field are used for storage address data pair, and the mark domain is used to identify address date To whether effectively.
Optionally, described when being read from eflash and feeding back the data corresponding to read request, the method also includes:
The data corresponding to read request that will be feedbacked to main equipment are stored in the corresponding caching of main equipment.
Optionally, which is characterized in that the communication bus of the eflash is equal with the bit wide of the communication bus of the caching, And the 2 of the bit wide of the Advanced High-Performance Bus (AHB) used for main equipmentnTimes;
Wherein, n is the integer more than or equal to 1.
Optionally, the method also includes: read cached data from the eflash, and cache in the buffer.
Optionally, the read request that the basis receives reads the data corresponding to the read request from eflash Include:
When receiving the read request of two or more main equipments, according to pre-set priority policy from described The data for corresponding to read request are read in eflash.
Optionally, described read from eflash includes: corresponding to the data of read request
Corresponding counter is set on the port that eflash corresponds to each main equipment, the excellent of business is related to according to main equipment First grade and pre-set resolving strategy carry out counter counting;
According to the count results of the counter of setting, the read request for corresponding to each main equipment is read from eflash Data.
Optionally, described that the priority and pre-set resolving strategy progress counter counts of business are related to according to main equipment Number includes:
The corresponding initial value of each counter of priority design for being related to business according to main equipment;
When receiving the read request of two or more main equipments, if the read request of main equipment carries out data by arbitration It reads, then counter values are jumped to default value;If the read request of main equipment does not carry out reading data by arbitration, according to master The priority that equipment is related to business carries out increase processing according to predetermined amplitude to counter values.
Optionally, the count results according to counter read data according to the read request of each main equipment from eflash Include:
When determining a counter maximum there is only value, arbitrate to the read request of the corresponding main equipment of the counter into Row reading data;
When determining two or more counters maximum there are value, any one counter is selected, is arbitrated to choosing The read request of the corresponding main equipment of the counter selected carries out reading data.
On the other hand, the embodiment of the present invention also provides a kind of device for reading data, comprising: determination unit and feedback Member;Wherein,
Determination unit is used for: according to the read request of the main equipment received, determining in preset caching whether store correspondence In the data of read request;
Feedback unit is used for: determination unit determines when being stored with the data corresponding to read request in preset caching, will delay Data feedback in depositing corresponding to read request is to main equipment.
Optionally, the feedback unit is also used to:
The data corresponding to the read request are read from eflash according to the read request received, and will be read Data feedback to corresponding main equipment.
Optionally, the communication bus of the eflash is equal with the bit wide of the communication bus of the caching, and is main equipment The 2 of the bit wide of the Advanced High-Performance Bus (AHB) usednTimes;
Wherein, n is the integer more than or equal to 1.
Optionally, described device further includes cache element, for reading cached data from the eflash, And it caches in the buffer.
In another aspect, the embodiment of the present invention also provides a kind of computer storage medium, it is stored in computer storage medium Computer executable instructions, the method that computer executable instructions are used to execute above-mentioned reading data.
Also on the one hand, the embodiment of the present invention also provides a kind of terminal, comprising: memory and processor;Wherein,
Processor is configured as executing the program instruction in memory;
Program instruction reads in processor and executes following operation:
According to the read request of the main equipment received, determine whether store corresponding to read request in preset caching buffer Data;
When being stored with the data corresponding to read request in preset caching, the data feedback of read request will be corresponded in caching To main equipment.
Compared with the relevant technologies, technical scheme includes: to be determined default according to the read request of the main equipment received Caching (buffer) in whether store data corresponding to read request;The number corresponding to read request is stored in preset caching According to when, by caching correspond to read request data feedback to main equipment.The embodiment of the present invention shortens main equipment and reads data It is waiting for a long time, improve data access efficiency.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by specification, right Specifically noted structure is achieved and obtained in claim and attached drawing.
Detailed description of the invention
Attached drawing is used to provide to further understand technical solution of the present invention, and constitutes part of specification, with this The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is the flow chart for the method that the embodiment of the present invention reads data;
Fig. 2 is the structural block diagram for the device that the embodiment of the present invention reads data;
Fig. 3 is the structural block diagram that the present invention applies exemplary device;
Fig. 4 is the composed structure schematic diagram of this application example caching;
Fig. 5 is the schematic diagram that reading data is carried out using the relevant technologies;
Fig. 6 is the schematic diagram that this application example carries out reading data.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable Sequence executes shown or described step.
Fig. 1 is the flow chart for the method that the embodiment of the present invention reads data, as shown in Figure 1, comprising:
The read request for the main equipment that step 100, basis receive, determines in preset caching buffer whether store correspondence In the data of read request;
It should be noted that whether can be carried out by the relevant technologies comprising the data corresponding to read request in caching true Fixed, the embodiment of the present invention carries out reading data by preset caching, improves data reading speed.Such as by data Address field, mark domain for including etc. determine whether to be stored with the data corresponding to read request.
Optionally, in preset caching when the not stored data having corresponding to read request, present invention method is also wrapped It includes:
The data corresponding to the read request are read from built-in embedded flash memory eflash according to the read request received, And by the data feedback read to corresponding main equipment.
Optionally, before step 100 of the embodiment of the present invention further include:
Corresponding buffer is respectively configured for each main equipment.
It should be noted that be that each main equipment distributes independent for data cached for the embodiment of the present invention Buffer, as main equipment 1 be arranged buffer1, for main equipment 2 be arranged buffer2, and so on.The size of the caching of setting It can be set by those skilled in the art according to the business that main equipment is related to.
Optionally, each storage unit of caching of the embodiment of the present invention includes: address field, data field and mark domain;
Wherein, the address field and data field are used for storage address data pair, and the mark domain is used to identify address date To whether effectively.
Optionally, when the embodiment of the present invention reads from eflash and feeds back the data corresponding to read request, the method Further include:
The data corresponding to read request that will be feedbacked to main equipment are stored in the corresponding caching of main equipment.
The embodiment of the present invention caches the data read from eflash in the buffer, and subsequent receive again reads this When the read request of data, it can be directly acquired from caching.
Optionally, the embodiment of the present invention, the bit wide of communication bus of communication bus and caching of eflash is equal, and based on The 2 of the bit wide for the Advanced High-Performance Bus (AHB) that equipment usesnTimes;
Wherein, n is the integer more than or equal to 1.
The embodiment of the present invention, the bit wide of the communication bus of the communication bus and caching of eflash can by the relevant technologies into Row customization is realized.The transmission rate of data can be improved by the bit wide of increase.
Optionally, the embodiment of the present invention reads from eflash according to the read request received and asks corresponding to the reading The data asked include:
When receiving the read request of two or more main equipments, according to pre-set priority policy from described The data for corresponding to read request are read in eflash.
Optionally, the embodiment of the present invention is read from eflash includes: corresponding to the data of read request
Corresponding counter is set on the port that eflash corresponds to each main equipment, the excellent of business is related to according to main equipment First grade and pre-set resolving strategy carry out counter counting;
According to the count results of the counter of setting, the read request for corresponding to each main equipment is read from eflash Data.
It should be noted that main equipment be related to business priority can by those skilled in the art according to type of service and Attribute carries out analysis determination;When big with the value of counter, for the read request priority processing of main equipment, industry that main equipment is related to When priority of being engaged in is high, the initial value that counter can be set is high, in this way the read request of the main equipment of the business from high priority It can be by priority processing.
Optionally, the embodiment of the present invention is related to the priority of business according to main equipment and pre-set resolving strategy carries out Counter counts
The corresponding initial value of each counter of priority design for being related to business according to main equipment;
When receiving the read request of two or more main equipments, if the read request of main equipment carries out data by arbitration It reads, then counter values are jumped to default value;If the read request of main equipment does not carry out reading data by arbitration, according to master The priority that equipment is related to business carries out increase processing according to predetermined amplitude to counter values.
It should be noted that the embodiment of the present invention to each counter initial value can be it is the same;It such as is all 0; Certainly, the difference for the priority that initial value can also be related to business according to main equipment is set as different values.The present invention is implemented The upper and lower limits of each counter can be arranged in example according to the priority for the business that main equipment is related to, and can be matched by register It sets, it can reconfigure in the process of running.Such as setting correspond to processor 1 be arranged the lower limit of counter 1 be 0, on Limit is 7;It obtains primary arbitration and just jumps back to 0;Otherwise, arbitration plus 1 is lost every time until 7;Corresponding to processor 2, counter 2 is set Lower limit be the 8, upper limit be 15;At this point, the priority of the corresponding port of processor 2 is always above the corresponding port of processor 1, only There is first eloquence when second mouth does not access to be possible to win arbitration.When main equipment is related to the priority difference of business, Carrying out the increased predetermined amplitude of counter values may be the same or different;Theoretically, main equipment is related to the priority of business Higher, the predetermined amplitude of the increased numerical value of counter is about big.
In addition, default value may include: initial value or preset lower limit value.
Optionally, the embodiment of the present invention according to the count results of counter from eflash according to the read request of each main equipment Read data packet includes:
When determining a counter maximum there is only value, arbitrate to the read request of the corresponding main equipment of the counter into Row reading data;
When determining two or more counters maximum there are value, any one counter is selected, is arbitrated to choosing The read request of the corresponding main equipment of the counter selected carries out reading data.
It should be noted that the embodiment of the present invention, there are the values of the counter of two or more main equipments most When big and identical, the read request an of main equipment can therefrom be selected to carry out reading data processing;Selection mode can select at random It selects;If counter has coding or other information, can sequentially be selected according to the sequence of coding or other information.
When being stored with the data corresponding to read request in step 101, preset caching, read request will be corresponded in caching Data feedback is to main equipment.
It should be noted that the embodiment of the present invention determines in caching when being stored with the data corresponding to read request, how root It can be using the conventional techniques realization of those skilled in the art according to reading and feedbacking data to main equipment.
Optionally, present invention method further include: read cached data from the eflash, and caching Middle caching.
Cached data is directly stored in advance on the corresponding caching of each main equipment by the embodiment of the present invention, is further mentioned High main equipment reads the rate of cached data, improves the efficiency of reading data;Cached data includes according to place The data that the operation characteristic of reason device is read in advance, the operation data that high-frequency is read when including processor operation.
Compared with the relevant technologies, technical scheme includes: to be determined default according to the read request of the main equipment received Caching (buffer) in whether store data corresponding to read request;The number corresponding to read request is stored in preset caching According to when, by caching correspond to read request data feedback to main equipment.The embodiment of the present invention shortens main equipment and reads data It is waiting for a long time, improve data access efficiency.
Fig. 2 is the structural block diagram for the device that the embodiment of the present invention reads data, as shown in Fig. 2, comprising determining that unit and anti- Present unit;Wherein,
Determination unit is used for: according to the read request of the main equipment received, determining in preset caching whether store correspondence In the data of read request;
Feedback unit is used for: determination unit determines when being stored with the data corresponding to read request in preset caching, will delay Data feedback in depositing corresponding to read request is to main equipment.
Optionally, the feedback unit is also used to:
The data corresponding to the read request are read from eflash according to the read request received, and will be read Data feedback to corresponding main equipment.
Optionally, described device further includes setting unit: for corresponding buffer to be respectively configured for each main equipment.
Optionally, each storage unit of the caching includes: address field, data field and mark domain;
Wherein, the address field and data field are used for storage address data pair, and the mark domain is used to identify address date To whether effectively.
Optionally, described device further includes caching process unit, reads to ask for will be feedbacked to correspond to described in main equipment The data asked are stored in the corresponding caching of main equipment.
Optionally, the communication bus of the eflash is equal with the bit wide of the communication bus of the caching, and is main equipment The 2 of the bit wide of the Advanced High-Performance Bus (AHB) usednTimes;
Wherein, n is the integer more than or equal to 1.
Optionally, the feedback unit is used to read from eflash according to the read request received corresponding to described The data of read request include:
When receiving the read request of two or more main equipments, according to pre-set priority policy from described The data for corresponding to read request are read in eflash.
Optionally, the feedback unit from the eflash for reading correspondence according to pre-set priority policy Include: in the data of read request
Corresponding counter is set on the port that eflash corresponds to each main equipment, the excellent of business is related to according to main equipment First grade and pre-set resolving strategy carry out counter counting;
According to the count results of the counter of setting, the read request for corresponding to each main equipment is read from eflash Data.
It should be noted that the embodiment of the present invention counter can be arranged inside moderator, correspond to for each Respectively there is a counter in the port of main equipment.
Optionally, the feedback unit from the eflash for reading correspondence according to pre-set priority policy Include: in the data of read request
The corresponding initial value of each counter of priority design for being related to business according to main equipment;
When receiving the read request of two or more main equipments, if the read request of main equipment carries out data by arbitration It reads, then counter values are jumped to default value;If the read request of main equipment does not carry out reading data by arbitration, according to master The priority that equipment is related to business carries out increase processing according to predetermined amplitude to counter values.
Optionally, the feedback unit is used for according to the count results of counter from eflash according to the reading of each main equipment Requests data reading includes:
When determining a counter maximum there is only value, arbitrate to the read request of the corresponding main equipment of the counter into Row reading data;
When determining two or more counters maximum there are value, any one counter is selected, is arbitrated to choosing The read request of the corresponding main equipment of the counter selected carries out reading data.
The embodiment of the present invention also provides a kind of computer storage medium, and computer is stored in computer storage medium to be held Row instruction, the method that computer executable instructions are used to execute above-mentioned reading data.
The embodiment of the present invention also provides a kind of terminal, comprising: memory and processor;Wherein,
Processor is configured as executing the program instruction in memory;
Program instruction reads in processor and executes following operation:
According to the read request of the main equipment received, determine whether store corresponding to read request in preset caching buffer Data;
When being stored with the data corresponding to read request in preset caching, the data feedback of read request will be corresponded in caching To main equipment.
Present invention method is carried out to understand detailed description below by way of using example, is only used for using example old The present invention is stated, is not intended to limit the scope of protection of the present invention.
Using example
Fig. 3 is the structural block diagram that the present invention applies exemplary device, as shown in figure 3, AHB 1x2 bridge, pre-set Buffer, moderator, controller, eflash;Wherein,
AHB 1x2 bridge is used for: being access eflash or other resources according to access address decision;Moderator can be used for The pre-set priority policy mentioned in load setting above-described embodiment;Controller is used for the operation result according to moderator Carry out reading data;The bit wide of communication bus of communication bus and buffer of eflash is equal, and is the bit wide of AHB 1x2 2nTimes, n is the integer more than or equal to 1;It is specific:
AHB 1x2 bridge is existing bus assembly in SOC system, for accessing two different slave equipment (slave) devices Part.Two address space mutual exclusions from equipment, one mouth of this application example access eflash, and other system resources all pass through another A mouthful of access.In this application example, it can realize and be compatible with the relevant technologies, it can is simultaneous with the system of existing reading data Hold, is independent of each other;AHB 1x2 bridge does not access eflash directly, passes through above-mentioned buffer, moderator, control during processing Device processed.This application example setting AHB 1x2 bridge is only used for some very high main equipments of memory access performance requirement, these high-performance master The ahb bus mouth of equipment is directly over AHB1x2 bridge to connect buffer to access eflash.Memory access performance requirement is less high Main equipment may first pass through traditional ahb bus system and be connected to buffer.
When eflash bit wide is greater than AHB bit wide, the data that are buffered in buffer maximum probability will be connect in subsequent very much The access got off is read.Because buffer is built by register, access speed ratio eflash is fast very much, thus directly by Buffer returned data, rather than data are read inside eflash every time, reduce the number of access eflash, shortens The main equipment waiting time reduces access conflict in the scene of shared eflash, accelerates other main equipment access eflash Speed.In addition, the cached data that this application example is related to using the fast feature main equipment business of buffer access speed It is stored in advance in the buffer, improves cache hit rate.Controller is reduced according to the treating capacity of the arbitration result of moderator, is promoted The treatment effeciency of reading data.
Fig. 4 is the composed structure schematic diagram of this application example caching, as shown in figure 4, caching is 32 bits by bit wide Ahb bus is connected with main equipment.The write operation of eflash can be connect by the peripheral bus (APB) of controller in this application example Mouth is completed indirectly, does not support directly to write eflash by buffer.Buffer only handles the AHB mouthfuls of read operations come in, for The AHB mouthfuls of write operations come do invalidation.It is connected between buffer and moderator by the big bit wide bus of internal custom;Such as When fruit, buffer and moderator building multilayer system, the interconnection between component also uses the customized big bit wide bus;It is designed Thought is that the no bit width conversion logic of the communication between buffer to eflash device is to guarantee efficiently to pass data to buffer.Three domains of each storage unit point of caching: address field, data field, mark domain.Address field and data field are used to store Whether effectively one address date pair, mark domain are used to refer to the address date to.Having the clear signal of an input to be used to will The mark domain of all storage units of the component is set in vain.When receiving the AHB mouthfuls of read requests sent, all storage units are checked Address field whether in the buffer judge the read address, if in the buffer, hit, in the number of the storage unit of hit According to taking out in domain, with read address, corresponding 32 data return to main equipment.It is total by the big bit wide of internal custom when miss Line initiates read request to eflash controller.
This application example arbitrates the data read request from multiple main equipments by moderator, determines to which read request It is handled.The priority of different main equipments can be set in moderator;For example, moderator carries out each main equipment by counter The processing of read request, main equipment be related to service priority it is high when, the initial value that counter can be set is larger;Here, initially Value can be set as the lower limit value of counter;In addition, when counter is counted, main equipment be related to service priority it is high when, The increasing degree of counter is relatively bigger;The corresponding counter of each main equipment also can be set using identical increasing in this application example Amplitude is added to carry out counting increase.This application example moderator has with the port being connected the buffer being arranged for each main equipment One counter, which can be according to the initial value of the priority level initializing counter for the business that main equipment is related to, but master sets When preparation send read request, moderator carries out the arbitration of read request according to the value in counter;The work of this application example moderator Read request is handled when as mechanism may include: bus free, bus busy suspends request;If handle read request when only one Main equipment has initiated read request, and then the main equipment automatically obtains arbitration, and arbitrated logic gives the corresponding counter loopback one of the main equipment Pulse is arbitrated in a acquisition, receives the initial value for obtaining the counter loading setting of arbitration pulse, and the Counter Value of other ports is protected It holds constant.Then compare the corresponding counter current count value of these equipment when multiple equipment accesses simultaneously, count value is maximum That main equipment obtains the arbitration of read request, i.e., handles the read request of the maximum main equipment of count value;When there is multiple meters When the count value of number device is equal and maximum, that the smallest main equipment of port index is arbitrated.The counter for obtaining arbitration will An acquisition arbitration pulse is received, counter is loaded into initial value;The counter for losing arbitration will receive one and lose arbitration pulse, Judge whether current count value has reached the upper limit, not reaching the upper limit, then count value adds the numerical value of default increasing degree;Work as count value When having reached the upper limit, keep current count value constant;The read request can be hung up and participate in subsequent arbitration simultaneously;The port that do not request Priority counter count value keeps current value constant.It can be reached by upper limit value and lower limit value that each port priority is arranged To the purpose of setting fixed priority.Wherein, initial value can be the minimum value allowed when counter counts.
Controller carries out reading data processing to which read request according to what moderator was arbitrated out;This application example will count When according to feeding back to main equipment according to read request, while being cached in the buffer.
This application example eflash, bit wide can be 32/64/128/256.In the related technology, common low side SOC is 32 ahb bus systems, this application example are suitable for that the big bit wide eflash of selection 64/128/256 cooperates above-mentioned component Form an eflash reading data device.
This application example reduces the waiting time of main equipment, reduces the access conflict between multiple main frames, improves Eflash read access efficiency, improves systematic entirety energy.In addition, main equipment execute speed accelerate mean business processing when Between shorten, processor can faster enter sleep to save Overall Power Consumption.
It is connected between controller and moderator by self-defined bus, for handling read access request;This application example relates to And the bit wide of the self-defined bus communication bus that is referred to eflash and buffer be configured.This application example eflash The mechanism for operating with traditional indirect operation such as erasable, controller separately has one group of APB interface for receiving the erasable of system Equal operational orders.Fig. 5 is the schematic diagram that reading data is carried out using the relevant technologies, as shown in figure 5, eflash bit wide 128, it is false If four operating clock cycles can return back read data.If the space some main equipment (CPU, DMA etc.) connected reference eflash Preceding 16 bytes, access order 0x00-0x04-0x08-0x0c, in the case where no access conflict the relevant technologies due to Presence is not cached, so four access require 4 periods, 16 periods of total used time every time.
Fig. 6 is the schematic diagram that this application example carries out reading data, as shown in fig. 6, when accessing the address 0x00, controller Can 128 data of return are buffered in buffer after 4 periods, together with one piece of data store be 128 bit location A corresponding 16 byte-aligned addresses and effective marker.Data while caching on eflash read data bus are corresponding That four bytes of the address 0x00 can be transparent to main equipment.When main equipment accesses 0x04-0x08-0x0c again, because this is several There is caching in a address in buffer, so subsequent access three times can be completed in one cycle respectively, main equipment Access 7 periods of total used time four times.In this embodiment, always accessing the used time for the main equipment greatly reduces.The master in the example Equipment is also reduced to 1 time the access times of eflash by 4 times, for more main equipment share and access eflash, due to every The number of a main equipment access eflash greatly reduces, and the access conflict between main equipment can also greatly reduce, and improve entire system The access efficiency of system.
Those of ordinary skill in the art will appreciate that all or part of the steps in the above method can be instructed by program Related hardware (such as processor) is completed, and described program can store in computer readable storage medium, as read-only memory, Disk or CD etc..Optionally, one or more integrated circuits also can be used in all or part of the steps of above-described embodiment It realizes.Correspondingly, each module/unit in above-described embodiment can take the form of hardware realization, such as pass through integrated electricity Its corresponding function is realized on road, can also be realized in the form of software function module, such as is stored in by processor execution Program/instruction in memory realizes its corresponding function.The present invention is not limited to the hardware and softwares of any particular form In conjunction with.
Although disclosed herein embodiment it is as above, the content only for ease of understanding the present invention and use Embodiment is not intended to limit the invention.Technical staff in any fields of the present invention is taken off not departing from the present invention Under the premise of the spirit and scope of dew, any modification and variation, but the present invention can be carried out in the form and details of implementation Scope of patent protection, still should be subject to the scope of the claims as defined in the appended claims.

Claims (18)

1. a kind of method for reading data characterized by comprising
According to the read request of the main equipment received, the number whether stored in preset caching buffer corresponding to read request is determined According to;
When being stored with the data corresponding to read request in preset caching, the data feedback of read request will be corresponded in caching to master Equipment.
2. the method according to claim 1, wherein not stored in the preset caching have corresponding to read request Data when, the method also includes:
The data corresponding to the read request are read from built-in embedded flash memory eflash according to the read request received, And by the data feedback read to corresponding main equipment.
3. the method according to claim 1, wherein before this method further include:
Corresponding buffer is respectively configured for each main equipment.
4. the method according to claim 1, wherein each storage unit of the caching include: address field, Data field and mark domain;
Wherein, the address field and data field are used for storage address data pair, and the mark domain is used to identify address date to being It is no effective.
5. according to the method described in claim 3, it is characterized in that, described read and feed back corresponding to read request from eflash Data when, the method also includes:
The data corresponding to read request that will be feedbacked to main equipment are stored in the corresponding caching of main equipment.
6. described in any item methods according to claim 1~5, which is characterized in that the communication bus of the eflash with it is described The bit wide of the communication bus of caching is equal, and the 2 of the bit wide of the Advanced High-Performance Bus (AHB) used for main equipmentnTimes;
Wherein, n is the integer more than or equal to 1.
7. described in any item methods according to claim 1~5, which is characterized in that the method also includes: from the eflash Middle reading cached data, and cache in the buffer.
8. according to the method described in claim 2, it is characterized in that, the read request that receives of the basis is from eflash It reads and includes: corresponding to the data of the read request
When receiving the read request of two or more main equipments, according to pre-set priority policy from the eflash It is middle to read the data for corresponding to read request.
9. according to the method described in claim 8, it is characterized in that, described read the data for corresponding to read request from eflash Include:
Corresponding counter is set on the port that eflash corresponds to each main equipment, the priority of business is related to according to main equipment And pre-set resolving strategy carries out counter counting;
According to the count results of the counter of setting, the number for corresponding to the read request of each main equipment is read from eflash According to.
10. according to the method described in claim 9, it is characterized in that, described be related to the priority of business and pre- according to main equipment The resolving strategy being first arranged carries out counter counting
The corresponding initial value of each counter of priority design for being related to business according to main equipment;
When receiving the read request of two or more main equipments, if the read request of main equipment carries out data reading by arbitration It takes, then counter values are jumped to default value;If the read request of main equipment does not carry out reading data by arbitration, set according to master The standby priority for being related to business carries out increase processing according to predetermined amplitude to counter values.
11. according to the method described in claim 10, it is characterized in that, the count results according to counter are from eflash It is included according to the read request read data packet of each main equipment:
When determining a counter maximum there is only value, arbitration counts the read request of the corresponding main equipment of the counter According to reading;
When determining two or more counters maximum there are value, any one counter is selected, is arbitrated to selection The read request of the corresponding main equipment of counter carries out reading data.
12. a kind of device for reading data characterized by comprising determination unit and feedback unit;Wherein,
Whether determination unit is used for: according to the read request of the main equipment received, determining to store to correspond in preset caching and read The data of request;
Feedback unit is used for: determination unit determines when being stored with the data corresponding to read request in preset caching, will be in caching Data feedback corresponding to read request is to main equipment.
13. device according to claim 12, which is characterized in that the feedback unit is also used to:
The data corresponding to the read request, and the number that will be read are read from eflash according to the read request received According to feeding back to corresponding main equipment.
14. device according to claim 12, which is characterized in that the communication bus of the eflash is logical with the caching Believe that the bit wide of bus is equal, and the 2 of the bit wide of the Advanced High-Performance Bus (AHB) used for main equipmentnTimes;
Wherein, n is the integer more than or equal to 1.
15. device according to claim 13, which is characterized in that the feedback unit is used for according to the reading received It requests to read from eflash and includes: corresponding to the data of the read request
When receiving the read request of two or more main equipments, according to pre-set priority policy from the eflash It is middle to read the data for corresponding to read request.
16. 2~15 described in any item devices according to claim 1, which is characterized in that described device further includes cache list Member is cached for reading cached data from the eflash, and in the caching.
17. a kind of computer storage medium, computer executable instructions are stored in computer storage medium, computer is executable Instruction is for executing the method for reading data as described in any one of claim 1~11.
18. a kind of terminal, comprising: memory and processor;Wherein,
Processor is configured as executing the program instruction in memory;
Program instruction reads in processor and executes following operation:
According to the read request of the main equipment received, the number whether stored in preset caching buffer corresponding to read request is determined According to;
When being stored with the data corresponding to read request in preset caching, the data feedback of read request will be corresponded in caching to master Equipment.
CN201710757725.9A 2017-08-29 2017-08-29 A kind of method and device reading data Pending CN109426623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710757725.9A CN109426623A (en) 2017-08-29 2017-08-29 A kind of method and device reading data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710757725.9A CN109426623A (en) 2017-08-29 2017-08-29 A kind of method and device reading data

Publications (1)

Publication Number Publication Date
CN109426623A true CN109426623A (en) 2019-03-05

Family

ID=65503625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710757725.9A Pending CN109426623A (en) 2017-08-29 2017-08-29 A kind of method and device reading data

Country Status (1)

Country Link
CN (1) CN109426623A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110716888A (en) * 2019-09-27 2020-01-21 山东华芯半导体有限公司 Method for realizing AXI bus cache mechanism
CN113918483A (en) * 2021-12-14 2022-01-11 南京芯驰半导体科技有限公司 Multi-master device cache control method and system
CN115378762A (en) * 2022-10-25 2022-11-22 芯动微电子科技(珠海)有限公司 Dynamic scheduling method and device for bus transmission performance
WO2023005352A1 (en) * 2021-07-30 2023-02-02 上海商汤智能科技有限公司 Data processing apparatus and method, computer device, and storage medium
CN116126763A (en) * 2023-04-17 2023-05-16 苏州浪潮智能科技有限公司 Bus interconnection system, data processing method and device, electronic equipment and medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517884A (en) * 2003-01-09 2004-08-04 三星电子株式会社 Device and method for controllintg proper execution in serial flash memory and corresponding chip
CN101833516A (en) * 2007-12-14 2010-09-15 创惟科技股份有限公司 Storage system and method for improving access efficiency of flash memory
CN101923499A (en) * 2009-03-30 2010-12-22 英特尔公司 Techniques to perform power fail-safe caching without atomic metadata
US20140006665A1 (en) * 2011-09-14 2014-01-02 Hiroshi Amano Resource request arbitration device, resource request arbitration system, resource request arbitration method, integrated circuit, and program
US20140115255A1 (en) * 2012-10-19 2014-04-24 Hitachi, Ltd. Storage system and method for controlling storage system
US20140189204A1 (en) * 2012-12-28 2014-07-03 Hitachi, Ltd. Information processing apparatus and cache control method
CN105376269A (en) * 2014-08-11 2016-03-02 中国电信股份有限公司 Virtual machine storage system, virtual machine storage system realizing method and virtual machine storage system realizing device
CN106033323A (en) * 2015-02-17 2016-10-19 慧荣科技股份有限公司 Method for reading storage unit in flash memory and device using the same
CN106874237A (en) * 2017-03-08 2017-06-20 上海冉能自动化科技有限公司 Method of data synchronization and system based on two lines bus

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517884A (en) * 2003-01-09 2004-08-04 三星电子株式会社 Device and method for controllintg proper execution in serial flash memory and corresponding chip
CN101833516A (en) * 2007-12-14 2010-09-15 创惟科技股份有限公司 Storage system and method for improving access efficiency of flash memory
CN101923499A (en) * 2009-03-30 2010-12-22 英特尔公司 Techniques to perform power fail-safe caching without atomic metadata
US20140006665A1 (en) * 2011-09-14 2014-01-02 Hiroshi Amano Resource request arbitration device, resource request arbitration system, resource request arbitration method, integrated circuit, and program
US20140115255A1 (en) * 2012-10-19 2014-04-24 Hitachi, Ltd. Storage system and method for controlling storage system
US20140189204A1 (en) * 2012-12-28 2014-07-03 Hitachi, Ltd. Information processing apparatus and cache control method
CN105376269A (en) * 2014-08-11 2016-03-02 中国电信股份有限公司 Virtual machine storage system, virtual machine storage system realizing method and virtual machine storage system realizing device
CN106033323A (en) * 2015-02-17 2016-10-19 慧荣科技股份有限公司 Method for reading storage unit in flash memory and device using the same
CN106874237A (en) * 2017-03-08 2017-06-20 上海冉能自动化科技有限公司 Method of data synchronization and system based on two lines bus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
马秦生等: "多端口存储器控制器IP核的研究", 《西安电子科技大学学报》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110716888A (en) * 2019-09-27 2020-01-21 山东华芯半导体有限公司 Method for realizing AXI bus cache mechanism
WO2023005352A1 (en) * 2021-07-30 2023-02-02 上海商汤智能科技有限公司 Data processing apparatus and method, computer device, and storage medium
CN113918483A (en) * 2021-12-14 2022-01-11 南京芯驰半导体科技有限公司 Multi-master device cache control method and system
CN113918483B (en) * 2021-12-14 2022-03-01 南京芯驰半导体科技有限公司 Multi-master device cache control method and system
CN115378762A (en) * 2022-10-25 2022-11-22 芯动微电子科技(珠海)有限公司 Dynamic scheduling method and device for bus transmission performance
CN116126763A (en) * 2023-04-17 2023-05-16 苏州浪潮智能科技有限公司 Bus interconnection system, data processing method and device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN109426623A (en) A kind of method and device reading data
KR102319809B1 (en) A data processing system and method for handling multiple transactions
US20150127691A1 (en) Efficient implementations for mapreduce systems
US10241722B1 (en) Proactive scheduling of background operations for solid state drives
US11748174B2 (en) Method for arbitration and access to hardware request ring structures in a concurrent environment
US11093388B2 (en) Method, apparatus, device and storage medium for accessing static random access memory
CN103970520A (en) Resource management method and device in MapReduce framework and framework system with device
CN105677580A (en) Method and device for accessing cache
US8447897B2 (en) Bandwidth control for a direct memory access unit within a data processing system
CN114356223B (en) Memory access method and device, chip and electronic equipment
CN111324427B (en) Task scheduling method and device based on DSP
CN107430554A (en) Storage cache performance is improved as the standard that cache is inserted by using the compressibility of data
EP3662376B1 (en) Reconfigurable cache architecture and methods for cache coherency
US9946461B2 (en) In-flash immutable object processing
TW201303870A (en) Effective utilization of flash interface
CN104991745B (en) A kind of memory system data wiring method and system
WO2019174206A1 (en) Data reading method and apparatus of storage device, terminal device, and storage medium
CN110737618B (en) Method, device and storage medium for embedded processor to carry out rapid data communication
CN103176941B (en) Communication method between cores and agent apparatus
US10445267B2 (en) Direct memory access (DMA) unit with address alignment
US9733988B1 (en) Systems and methods to achieve load balancing among a plurality of compute elements accessing a shared memory pool
WO2013184855A1 (en) Memory with bank-conflict-resolution (bcr) module including cache
CN110489353A (en) A kind of raising solid state hard disk bandwidth reading performance method and device
CN116132369A (en) Flow distribution method of multiple network ports in cloud gateway server and related equipment
CN105659216B (en) The CACHE DIRECTORY processing method and contents controller of multi-core processor system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190305

WD01 Invention patent application deemed withdrawn after publication