Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without making any inventive effort are within the scope of the present application.
The core of the application is to provide an interface IP core control method to reduce the configuration AHB protocol conversion of the interface IP core alone.
In order to better understand the aspects of the present application, the present application will be described in further detail with reference to the accompanying drawings and detailed description.
Fig. 1 is a flowchart of an interface IP core control method provided by an embodiment of the present application, and as shown in fig. 1, the present application provides an interface IP core control method, including:
S10, receiving first data information stored in the FIFO memory 22, wherein the first data information is sent to the FIFO memory 22 by the main device 21;
S11, converting the first data information into an AHB protocol standard format;
And S12, transmitting the converted first data information to the slave device 24.
First-in first-Out (FIRST IN FIRST Out, FIFO), the FIFO memory 22 mentioned in this embodiment is a first-in first-Out data buffer. In system design, FIFO memory 22 is widely used for the purpose of increasing data transfer rate, processing a large number of data streams, matching systems with different transfer rates, thereby improving system performance. FIFO memory 22 is a first-in first-out dual-port buffer, i.e., the first data entered therein is first shifted out, with one input port of the memory and the other port being the output port of the memory. The FIFO memory 22 is divided into a write-dedicated area and a read-dedicated area. The read operation and the write operation may be performed asynchronously, and data written on the write area is read out from the area at the read end in the order of writing.
In addition, different areas may be divided in the FIFO memory 22 for storing different data types, and the embodiment is not particularly limited.
The present embodiment is not limited to the specific form of the master device 21 and the slave device 24, for example, DSP, CPU, field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA), image processor (Graphics Processing Unit, GPU), etc., any device may be used as the master device 21, any device may also be used as the slave device 24, and the present embodiment is not limited specifically and may be designed according to practical situations. When the slave device 24 and the interface IP core are connected through the AHB bus, the data received by the AHB should conform to the AHB protocol specification, and the data conforming to the AHB protocol specification is transmitted to the slave device 24 through the AHB bus. In addition, the present embodiment does not limit the connection manner between the host device 21 and the interface IP core.
The embodiment does not limit the specific information type of the first data information, such as information of a read instruction, a write instruction, write data, and the like.
Specifically, after the master device 21 sends the first data information to the FIFO memory 22, the FIFO memory 22 buffers the received first data information, and the controller 23 converts the first data information received by the FIFO memory 22 into an AHB bus protocol standard format and then transmits the converted first data information to the slave device 24.
In addition, when the slave device 24 needs to return the data information to the master device 21 after the first data information is transmitted to the slave device 24, the embodiment provides a preferred embodiment, where the method for controlling the interface IP core further includes, after transmitting the converted first data information to the slave device 24:
Receiving second data information stored in the FIFO memory 22, the second data information being returned to the FIFO memory 22 by the slave device 24;
the second data information is sent to the master device 21.
The second data information mentioned in this embodiment refers to the data information returned after the first data information is received from the device 24, and the specific information type of the second data information is not limited in this embodiment.
Specifically, when the first data information is received from the device 24, the second data information is returned, the FIFO memory 22 receives and buffers the second data information, and the controller 23 sends the second data information read-out to the master device 21.
The present embodiment provides a preferred solution, where the interface IP core receives the second data information returned from the device 24, and completes the return operation of the data information.
The interface IP core control method provided by the present application converts the received first data information into the AHB protocol standard format by receiving and buffering the first data information sent by the master device 21, and sends the first data information subjected to format conversion to the slave device 24. According to the interface IP core control method provided by the application, the output data information is in the AHB protocol standard format, and the interface IP core is not required to be solely configured with AHB protocol conversion.
According to the above embodiment, the present embodiment provides a preferred solution when the interface IP core performs a read operation, where the first data information includes a read instruction and read control information;
correspondingly, the second data information comprises read data and a read response signal;
Transmitting the second data information to the master 21 includes reading out the read data and the read response signal and returning to the master 21 when the read FIFO223 is not empty.
It should be noted that the read FIFO223 refers to a portion of the memory space in the FIFO memory 22 for storing read data and read response signals.
Specifically, the master device 21 transmits a read instruction and read control information to the FIFO memory 22, the controller 23 converts the read instruction and read control information into an AHB protocol standard format and transmits the converted read instruction and read control information to the slave device 24, the slave device 24 receives the read instruction and read control information, returns read data and read response signals, the FIFO memory 22 receives and stores the read data and read response signals, and when the read FIFO223 is not empty, the controller 23 reads out the read data and read response signals and returns them to the master device 21.
The embodiment provides a specific scheme for performing the read operation, and the controller 23 converts the read instruction and the read control information into the standard format of the AHB protocol and sends the converted data to the slave device 24, so that the problem that the common interface IP core needs to perform configuration AHB protocol conversion on the interface IP core alone is avoided.
According to the embodiment, when writing operation is performed, in the interface IP core control method, the first data information comprises a writing instruction, writing control information and writing data;
Correspondingly, transmitting the converted first data information to the slave device 24 comprises:
Write data read-outs are sent to the slave device 24 when the write FIFO222 is not empty, and write data read-outs are sent to the slave device 24 when the write FIFO222 is empty waiting for the write FIFO222 to be non-empty.
It should be noted that, the write FIFO222 refers to a portion of the storage space in the FIFO memory for writing data.
Specifically, the master device 21 sends a write command, write control information, and write data to the FIFO memory 22, and after the controller 23 converts the write data into an AHB protocol standard format, the controller 23 determines that the current data FIFO is not empty, sends a write data read to the slave device 24, and waits for the write FIFO222 to be empty when the write FIFO222 is empty, and sends a write data read to the slave device 24.
The embodiment provides a specific scheme for performing the writing operation, and the controller 23 converts the writing data into the standard format of the AHB protocol and sends the standard format of the AHB protocol to the slave device 24, so that the problem that a common interface IP core needs to perform configuration AHB protocol conversion on the interface IP core alone is avoided.
According to the above embodiment, the present embodiment provides a preferred embodiment, in which the interface IP core is connected to the JPEG module of the slave device 24 through the AHB bus, and in the above interface IP core control method, the sending the converted first data information to the slave device 24 includes:
and sending the converted first data information to a JPEG module.
When the JPEG module is required to be debugged by the FPGA, the JPEG module register is checked by the interface IP provided by the application to read and write, so that the configuration of JPEG is completed, and the interface IP core is not required to be independently configured with AHB protocol conversion, so that the debugging speed is accelerated, the labor force is saved, and the debugging period is shortened.
Fig. 2 is a schematic diagram of an interface IP core provided by an embodiment of the present application, and as shown in fig. 2, the present application further provides an interface IP core, including:
FIFO memory 22, controller 23;
The FIFO memory 22 is for receiving and buffering the first data information transmitted by the master device 21;
The controller 23 is configured to receive the first data information stored in the FIFO memory 22, convert the first data information into an AHB protocol standard format, and transmit the converted first data information to the slave device 24.
The FIFO memory 22 according to the present embodiment is a first-in first-out data buffer. In system design, FIFO memory 22 is widely used for the purpose of increasing data transfer rate, processing a large number of data streams, matching systems with different transfer rates, thereby improving system performance. FIFO memory 22 is a first-in first-out dual-port buffer, i.e., the first data entered therein is first shifted out, with one input port of the memory and the other port being the output port of the memory. The FIFO memory 22 is divided into a write-dedicated area and a read-dedicated area. The read operation and the write operation may be performed asynchronously, and data written on the write area is read out from the area at the read end in the order of writing.
The present embodiment does not limit what the controller 23 is specifically, such as a CPU, an MCU, or the like. The present embodiment is not particularly limited.
The present embodiment is not limited to the specific form of the master device 21 and the slave device 24, for example, DSP, CPU, field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA), image processor (Graphics Processing Unit, GPU), etc., any device may be used as the master device 21, any device may also be used as the slave device 24, and the present embodiment is not limited specifically and may be designed according to practical situations. When the slave device 24 and the interface IP core are connected through the AHB bus, the data received by the AHB should conform to the AHB protocol specification, and the data conforming to the AHB protocol specification is transmitted to the slave device 24 through the AHB bus. In addition, the present embodiment does not limit the connection manner between the host device 21 and the interface IP core.
After the master device 21 transmits the first data information to the FIFO memory 22, the FIFO memory 22 is configured to receive and buffer the first data information transmitted by the master device 21, and the controller 23 receives the first data information stored in the FIFO memory 22, converts the first data information into an AHB protocol standard format, and transmits the converted first data information to the slave device 24.
In addition, when the slave device 24 needs to return the data information to the master device 21 after the first data information is transmitted to the slave device 24, the embodiment provides a preferred scheme
The FIFO memory 22 is also used to receive and buffer the second data information returned from the device 24;
the controller 23 is further configured to receive the second data information stored in the FIFO memory 22 and to transmit the second data information to the master device 21.
When the slave device 24 returns the second data information to the FIFO memory 22, the FIFO stores the second data information received and buffered from the slave device 24, and the controller 23 receives the second data information stored in the FIFO memory 22 and transmits the second data information to the master device 21.
The present embodiment provides a preferred solution, where the interface IP core receives the second data information returned from the device 24, and completes the return operation of the data information.
The interface IP core provided by the present application receives and caches the first data information sent by the master device 21 through the FIFO memory 22, and the controller 23 converts the received first data information into an AHB protocol standard format, and sends the first data information subjected to format conversion to the slave device 24. The interface IP core provided by the application outputs the data information in the AHB protocol standard format, and the interface IP core does not need to be solely configured with AHB protocol conversion.
According to the above embodiment, when the interface IP core performs a read operation, the present embodiment provides a preferred scheme, and fig. 3 is a schematic diagram of a FIFO memory according to an embodiment of the present application;
The control information FIFO221 is used for receiving and buffering the read instruction and the read control information;
The read FIFO223 is for receiving and buffering read data and read response signals;
The controller 23 is configured to read the read data and the read response signal from the read FIFO223 and return the read data and the read response signal to the master 21 when the read FIFO223 is not empty.
The read FIFO223 is used to buffer read data and response signals returned from the device 24, and the control information FIFO221 is used to buffer read instructions and read control information sent by the master device 21.
When the master device 21 sends a read command and read control information to the interface IP core, the control information FIFO221 receives and buffers the read command and read control information, the controller 23FIFO converts the read command and read control information into an AHB protocol standard format according to the AHB protocol and transmits the converted read command and read control information to the slave device 24, the slave device 24 returns read data and read response signals, the read FIFO223 receives and buffers the read data and read response signals, and when the read FIFO223 is not empty, the controller 23 reads the read data and read response signals from the read FIFO223 and returns the read data and read response signals to the master device 21.
The present embodiment provides an interface IP core, where the controller 23 converts the read command and the read control information into the standard format of the AHB protocol and sends the converted read command and the read control information to the slave device 24, so that the need of configuring the AHB protocol conversion on the interface IP core alone by the common interface IP core is avoided.
According to the above embodiment, when the interface IP core is used for performing a write operation, the present embodiment provides a preferred scheme in which the FIFO memory 22 includes a write FIFO222;
The control information FIFO221 is also used to receive and buffer write instructions and write control information;
Write FIFO222 is used to receive and buffer write data;
the controller 23 is configured to send the write data read-out to the slave device 24 when the write FIFO222 is not empty, and to wait for the write FIFO222 to be empty to send the write data read-out to the slave device 24 when the write FIFO222 is empty.
Write FIFO222 is used to receive and buffer write data information sent by master device 21.
When a write operation is required, the master 21 sends a write instruction, write control information and write data to the interface IP core, the control information FIFO221 receives and buffers the write instruction and write control information, the write FIFO222 receives and buffers the write data, the controller 23 converts the write data into an AHB protocol standard format according to the AHB protocol, sends write data readout to the slave 24 when the write FIFO222 is not empty, and waits for the write FIFO222 to be sent to the slave 24 when the write FIFO222 is not empty.
The present embodiment provides an interface IP core when performing a write operation, where the controller 23 converts write data into an AHB protocol standard format and sends the write data to the slave device 24, so that a common interface IP core is avoided from needing to perform configuration AHB protocol conversion on the interface IP core alone.
According to the above embodiment, the present embodiment provides a preferred embodiment, where the interface IP core is connected to the slave device 24JPEG module via an AHB bus,
The controller 23 is connected to the JPEG module and is configured to send the converted first data information to the JPEG module.
When the JPEG module is required to be debugged by the FPGA, the JPEG module register is checked by the interface IP provided by the application to read and write, so that the configuration of JPEG is completed, and the interface IP core is not required to be independently configured with AHB protocol conversion, so that the debugging speed is accelerated, the labor force is saved, and the debugging period is shortened.
In addition, it should be noted that the controller 23 in this embodiment is mainly implemented by a state machine, and includes 6 states, FIDLE, BUSREQ, ADDR, RD _data, wr_data, and FRETRY.
The state is specifically described as follows:
FIDLE an idle state, a default state after the interface IP core is reset, and returning to the state when the main equipment 21 does not send an instruction or after all the instructions sent by the main equipment 21 are executed;
BUSREQ, requesting bus state, applying bus control right to arbiter by m_ hbusreq signal, obtaining bus control right and then entering ADDR state;
address field state, send out initial address and control signal to slave device 24, when master device 21 sends out read command and read FIFO223 is not full, go into RD_DATA state, when master device 21 sends out write command and write FIFO222 is not empty, go into WR_DATA state;
RD_DATA is read DATA state, according to the received control information, the control address and htrans are changed, the DATA and response of slave end are received, when the last DATA of the instruction is received, the state is FIDLE, when the response of slave end is RETRY, the state is FRETRY;
writing DATA state, controlling address and htrans change according to received control information, sending DATA to slave end, when the last DATA of said instruction is sent, making FIDLE state, when the response of slave end is RETRY, making FRETRY state;
FRETRY a RETRY state, which re-reads and writes the DATA of the RETRY address, and resumes the bus transfer operation after two clock cycles, and enters the rd_data state or the wr_data state.
The main signals of the interface at the end of the main device 21 are as follows:
Fig. 4 is a timing chart of a write operation performed by a master device according to the present application, as shown in fig. 4, the control information FIFO221 and the write FIFO222 use independent full signals, when the control information is valid and the control information FIFO221 is not full, control information (l_addr, l_burst, l_size, l_length) of the master device 21 is put into the control information FIFO221, and when the data is valid and the write data FIFO is not full, data to be transmitted by the master device 21 is put into the write data FIFO in sequence.
Fig. 5 is a timing chart of a read operation performed by a master device according to the present application, as shown in fig. 5, a read operation master device 21 only needs to send control information, and a l_resp signal is a read response signal returned to the master device 21, and is output after being buffered in a read data FIFO and synchronized with returned data l_rdata, where one data corresponds to one response signal on an AHB bus.
In the above embodiments, the detailed description is given to the method for controlling the interface IP core, and the present application further provides a corresponding embodiment of the device for controlling the interface IP core. It should be noted that the present application describes an embodiment of the device portion from two angles, one based on the angle of the functional module and the other based on the angle of the hardware.
Fig. 6 is a block diagram of an interface IP core control device according to an embodiment of the present application, and the present application further provides an interface IP core control device, including:
A receiving module 61, configured to receive first data information stored in the FIFO memory, where the first data information is sent to the FIFO memory by the master device;
A conversion module 62, configured to convert the first data information into an AHB protocol standard format;
A sending module 63, configured to send the converted first data information to the slave device.
The receiving module 61 receives the first data information stored in the FIFO memory, the first data information is transmitted from the master device to the FIFO memory, the converting module 62 converts the first data information into an AHB protocol standard format, and the transmitting module 63 transmits the converted first data information to the slave device.
The interface IP core control device provided by the application outputs the data information in the AHB protocol standard format, and the interface IP core is not required to be solely configured with AHB protocol conversion.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
Fig. 7 is a block diagram of an interface IP core control apparatus according to another embodiment of the present application, and as shown in fig. 7, the interface IP core control apparatus includes a memory 70 for storing a computer program;
The processor 71 is configured to implement the steps of the method for acquiring user operation habit information according to the above-described embodiment (interface IP core control method) when executing the computer program.
The interface IP core control device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Processor 71 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 71 may be implemented in at least one hardware form of Digital Signal Processing (DSP), field-Programmable gate array (fieldprogrammable GATE ARRAY, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 71 may also include a main processor, which is a processor for processing data in a wake-up state, also referred to as a central processor (Central Processing Unit, CPU), and a coprocessor, which is a low-power processor for processing data in a standby state. In some embodiments, the processor 71 may be integrated with an image processor (Graphics Processing Unit, GPU) for rendering and rendering of content to be displayed by the display screen. In some embodiments, the processor 71 may also include an artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) processor for processing computing operations related to machine learning.
Memory 70 may include one or more computer-readable storage media, which may be non-transitory. Memory 70 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 70 is used to store at least a computer program 701 that, when loaded and executed by the processor 71, is capable of performing the relevant steps of the xxxxxx method disclosed in any of the previous embodiments. In addition, the resources stored in the memory 70 may further include an operating system 702, data 703, and the like, where the storage manner may be transient storage or permanent storage. Operating system 702 may include Windows, unix, linux, among other things. The data 703 may include, but is not limited to, data involved in implementing the interface IP core control method, and the like.
In some embodiments, the interface IP core control device may further include a display screen 72, an input/output interface 73, a communication interface 74, a power supply 75, and a communication bus 76.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is not limiting of the interface IP core control device and may include more or fewer components than shown.
The interface IP core control apparatus provided by the embodiment of the present application includes a memory and a processor, where the processor is capable of implementing a method of receiving and buffering first data information sent by a master device 21, converting the received first data information into an AHB protocol standard format, and sending the first data information subjected to format conversion to a slave device 24 when executing a program stored in the memory. Because the output data information is in an AHB protocol standard format, the interface IP core does not need to be solely configured with AHB protocol conversion.
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps described in the above-described method embodiments (the method may be a method corresponding to the server side, a method corresponding to the diagnostic apparatus side, or a method corresponding to the server side and the diagnostic apparatus side).
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium for performing all or part of the steps of the method according to the embodiments of the present application. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RandomAccess Memory, RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The computer readable storage medium provided in this embodiment has a computer program stored thereon, and when the processor executes the program, the interface IP core control method is implemented to convert the received first data information into an AHB protocol standard format by receiving and buffering the first data information transmitted by the master device 21, and transmit the first data information subjected to the format conversion to the slave device 24. Because the output data information is in an AHB protocol standard format, the interface IP core does not need to be solely configured with AHB protocol conversion.
The method, the interface IP core, the device and the medium for controlling the interface IP core are described in detail. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the application can be made without departing from the principles of the application and these modifications and adaptations are intended to be within the scope of the application as defined in the following claims.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.