Memory read-write structure and method and FFT (Fast Fourier Transform) processor
By controlling the write and read order of pipeline data in the FFT processor, synchronous operations in the memory are realized, and the problem of excessive hardware consumption caused by the need for two pieces of memory to read and write in the prior art is solved, and data throughput is improved and reduces the chip area.
Patent Information
- Application Number
- CN202410990952.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-22
AI Technical Summary
The existing FFT computing processor requires two pieces of memory to complete the reading and writing of data, resulting in an increase in the memory structure and increasing the hardware consumption chip area.
By controlling the writing order of pipeline data and the reading order in memory, the synchronous reading and writing in the same memory is achieved, which reduces the number of memory requirements and reduces the consumption of hardware chip area.
It improves the data throughput of memory, reduces the memory quantity requirement, reduces the consumption of hardware chip area, and effectively solves the problem of excessive memory structure in the prior art.
Smart Images

Figure CN119007768A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of semiconductor integrated circuit technology, and in particular to a memory read-write structure, method and FFT processor. Background Art
[0002] The existing FFT (Fast Fourier Transformation) operation processor is usually composed of a data writing unit, a data reading unit, a multi-stage butterfly operation unit and a data storage unit. The data input to the FFT operation processor passes through the multi-stage butterfly operation unit to complete the fast Fourier operation to obtain the operation result, and the operation result is written into the data storage unit through the data writing unit, and then the stored data is read out from the data storage unit through the data reading unit and output.
[0003] The data storage unit in the existing FFT operation processor is composed of two memories, and the structure of the two memories is a ping-pong structure, such as Figure 1 As shown. When writing data, the write address and the memory (RAM1 or RAM2) of the data are first determined through the write address addressing and RAM selection module, and then the data is written to the selected memory according to the write address; when reading data, the read address and the memory (RAM1 or RAM2) of the data are first determined through the read address addressing and RAM selection module, and then the stored data is read from the selected memory according to the read address. The ping-pong structure refers to two memories performing read and write operations alternately. When one memory is writing data, the other memory is performing a data read operation. For example, when RAM1 is writing data, RAM2 is performing a data read operation.
[0004] The memory contains N address units, and the order in which data is written to the address units in the memory can be written in forward order or reverse order. Forward order writing refers to writing data from address 0 in an increasing manner from 0 to N until the data written in address N ends data writing. Reverse order writing is to reverse the order according to the specific encoding method and write in the reversed order. For example, when the encoding method is binary and the memory written is a 16-level memory, the write address is 0001, and the read address after reversing the order is 1000, which is the 8th storage address. The data reading order is also divided into forward order and reverse order.
[0005] This ping-pong data storage method requires two memories to complete data reading and writing because the same memory cannot read data due to address conflicts when writing data. This requires a larger memory structure and increases the chip area consumed by the hardware. Summary of the invention
[0006] The present invention provides a memory read-write structure, method and FFT processor to solve the problem that the current FFT operation processor needs two memories to complete data reading and writing, the required memory structure is larger, and the hardware consumes more chip area.
[0007] In a first aspect, the present invention provides a memory read-write structure, comprising: a clock control module, an address selection module and a memory; the clock control module is connected to the address selection module and the memory respectively; the address selection module is connected to the memory;
[0008] The clock control module is used to generate a clock cycle;
[0009] The site selection module is used to:
[0010] When the pipeline data of the previous frame is written into the memory in the first order, the pipeline data of the current frame is written into the memory in the second order according to the clock cycle;
[0011] In the process of writing the pipeline data of the current frame into the memory in the second order, when the preset number of bits in the pipeline data of the current frame is written, reading the pipeline data of the current frame from the memory in the first order starting from the clock cycle;
[0012] Wherein, the pipeline data is the operation result output by the multi-stage butterfly operation unit;
[0013] When the first sequence is in positive order, the second sequence is in negative order; when the first sequence is in negative order, the second sequence is in positive order.
[0014] The initial writing order of the pipeline input data is set to a positive order, and the writing order of the pipeline input data is controlled to cycle in a positive order and a reverse order based on a preset rule;
[0015] If the writing order of pipeline input data is positive writing, the reading order of pipeline output data in the memory is reverse reading;
[0016] Otherwise, the read data of the pipeline output data in the memory is read out in positive order.
[0017] In a possible implementation, the address selection module includes a read address addressing module and a write address addressing module;
[0018] The read address addressing module is used to read out the current frame pipeline data from the memory in a first order starting from the clock cycle when a preset number of bits in the current frame pipeline data is written;
[0019] The write address addressing module is used to write the current frame pipeline data into the memory in a second order according to the clock cycle when the previous frame pipeline data is written into the memory in a first order.
[0020] In a possible implementation, the address selection module includes a read address addressing module and a write address addressing module;
[0021] The read address addressing module is used to read out the current frame pipeline data from the memory in a first order starting from the clock cycle when a preset number of bits in the current frame pipeline data is written;
[0022] The write address addressing module is used to write the current frame pipeline data into the memory in a second order according to the clock cycle when the previous frame pipeline data is written into the memory in a first order.
[0023] In the second aspect, the present invention provides an FFT processor, comprising: a data sorting module, a multi-stage butterfly operation unit and a memory read-write structure as described in claim 1 or 2; the clock control module of the memory read-write structure is respectively connected to the data sorting module and the multi-stage butterfly operation unit; the data sorting module is connected to the multi-stage butterfly operation unit; the multi-stage butterfly unit operation module is connected to the memory of the memory read-write structure.
[0024] In a third aspect, the present invention provides a memory reading and writing method, comprising:
[0025] When the pipeline data of the previous frame is written into the memory in the first order, the pipeline data of the current frame is written into the memory in the second order;
[0026] In the process of writing the current frame pipeline data into the memory in the second order, when a preset number of bits in the current frame pipeline data is written, starting to read the current frame pipeline data from the memory in the first order;
[0027] Wherein, the pipeline data is the operation result output by the multi-stage butterfly operation unit;
[0028] When the first sequence is in positive order, the second sequence is in negative order; when the first sequence is in negative order, the second sequence is in positive order.
[0029] In a possible implementation manner, the preset number of digits is the last digit, or the second to last digit.
[0030] In a possible implementation, the method further includes:
[0031] When the current frame pipeline data is the starting frame pipeline data, the current frame pipeline data is written into the memory in a positive order or a reverse order.
[0032] In a possible implementation, when the starting frame pipeline data is written into the memory in reverse order, and when the previous frame pipeline data is written into the memory in the first order, writing the current frame pipeline data into the memory in the second order includes:
[0033] If the number of frames of the current frame pipeline data is an odd number, writing the current frame pipeline data into the memory in reverse order;
[0034] If the number of frames of the current frame pipeline data is an even number, writing the current frame pipeline data into the memory in positive order;
[0035] In the process of writing the current frame pipeline data into the memory in the second order, when a preset number of bits in the current frame pipeline data is written, starting to read the current frame pipeline data from the memory in the first order, including:
[0036] If the number of frames of the current frame pipeline data is an odd number, when the preset number of bits in the current frame pipeline data is written, the current frame pipeline data begins to be read out from the memory in a positive order;
[0037] If the frame number of the current frame pipeline data is an even number, then when the preset number of bits in the current frame pipeline data is written, the current frame pipeline data begins to be read out from the memory in reverse order.
[0038] In one possible implementation, the method further includes:
[0039] Determine a frame marker code of the pipeline data of the current frame based on the frame number of the pipeline data of the current frame, wherein the frame marker code includes a first value and a second value, the first value indicates that the frame number of the pipeline data of the current frame is an odd number, and the second value indicates that the frame number of the pipeline data of the current frame is an even number;
[0040] Based on the frame mark code, it is determined whether the frame number of the current frame pipeline data is an odd number or an even number.
[0041] In a possible implementation, writing the current frame pipeline data into the memory in the second order includes:
[0042] Writing the pipeline data of the current frame into the memory in a second order according to the clock cycle;
[0043] Starting to read the current frame pipeline data from the memory in a first order, comprising:
[0044] According to the clock cycle, the pipeline data of the current frame starts to be read out from the memory in a first order.
[0045] In one possible implementation, the memory includes a dual-port random access memory RAM;
[0046] The multi-stage butterfly operation unit is located in a fast Fourier transform FFT processor, and the FFT processor also includes the memory.
[0047] The present invention provides a memory read-write structure, method and FFT processor, which are used in an FFT processor, and perform forward and reverse cycles by controlling the writing order of pipeline data and the reading order of pipeline data in a memory, and control the pipeline data in the memory to be read when the pipeline data of the current frame is written to a preset number of bits, thereby realizing synchronous reading and writing in the same memory, improving the data throughput rate of the memory, thereby reducing the number requirement of the memory, and reducing the consumption of hardware chip area by reducing the number requirement. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0049] Figure 1 It is a structural schematic diagram of the prior art of a memory read-write structure;
[0050] Figure 2 It is a binary FFT operation flow chart of a FFT processor with a sequence length of 16 provided by an embodiment of the present invention;
[0051] Figure 3 It is a schematic diagram of the addressing method of two memories of a ping-pong structure with a binary structure of a sequence length of 16 in an FFT processor in the prior art;
[0052] Figure 4 It is a structural schematic diagram of a memory read-write structure provided by an embodiment of the present invention;
[0053] Figure 5 It is a structural schematic diagram of a multi-stage butterfly operation unit in an FFT processor provided by an embodiment of the present invention;
[0054] Figure 6It is a schematic diagram of the connection mode of a clock control module, a write address selection module, a read address addressing module and a memory in a memory read-write structure provided by an embodiment of the present invention;
[0055] Figure 7 It is a flow chart of an implementation method of a memory reading and writing method provided by an embodiment of the present invention;
[0056] Figure 8 It is a schematic diagram of a specific writing and reading process of a binary pipeline data with a sequence length of 16 and a preset number of bits as the last bit in a memory reading and writing method provided by an embodiment of the present invention;
[0057] Fig. 9 It is a schematic diagram of a specific writing and reading process of a binary pipeline data with a sequence length of 16 and a preset number of bits being the second to last bit in a memory reading and writing method provided by an embodiment of the present invention.
[0058] Fig.10 It is a schematic diagram of a specific writing and reading process of binary pipeline data with a sequence length of 1024 and a preset bit number as the last bit in a memory reading and writing method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0060] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0061] In related technologies, in signal processing, discrete Fourier transform DFT and fast Fourier transform FFT are commonly used spectrum analysis methods. DFT is a mathematical method for converting discrete signals into frequency domain representation. The transformation formula corresponding to DFT is:
[0062]
[0063] Among them, X(K) is the frequency domain data, x(n) is the nth time domain data in the data sequence, and N is the sequence length of the data sequence. is the rotation factor.
[0064] FFT is an algorithm that speeds up DFT calculations by using multi-stage butterfly units. The FFT calculation flow chart for a binary sequence length of 16 is as follows: Figure 2As shown, when the order of the input time domain data x(n) is positive order input, the order of the output frequency domain data X(K) is reverse order output, and the input and output order is shown in Table 1.
[0065] Table 1-16-point FFT input and output data sequence
[0066]
[0067] Existing FFT processors usually use two memories, and the structure of these two memories is a ping-pong structure. The addressing method of the two memories with a binary structure of sequence length 16 is as follows: Figure 3 As shown, in the 0-15 clock cycles, the pipeline data is written into the memory 1 in reverse order according to the clock, in the 16-31 clock cycles, the pipeline data is read out from the memory 1 in positive order, and the next frame of pipeline data is written into the memory 2 in reverse order, and in the 32-47 clock cycles, the pipeline data is read out from the memory 2 in positive order and the next frame of pipeline data is written into the memory 1 in reverse order. The real-time processing of pipeline data is achieved by repeatedly reading and writing the memory 1 and the memory 2.
[0068] This ping-pong data storage method requires two memories to complete data reading and writing because the same memory cannot read data due to address conflicts when writing data. In addition, the memory throughput is low and a larger memory structure is required, which will increase the chip area consumed by the hardware.
[0069] Reference Figure 4 A memory read-write structure in an embodiment of the present invention may include: a clock control module, an address selection module and a memory. The clock control module is connected to the address selection module and the memory respectively; the address selection module is connected to the memory.
[0070] The clock control module is used to generate a clock cycle.
[0071] Site selection module for:
[0072] When the pipeline data of the previous frame is written into the memory in the first order, the pipeline data of the current frame is written into the memory in the second order according to the clock cycle;
[0073] During the process of writing the current frame pipeline data into the memory in the second order, when the preset number of bits in the current frame pipeline data is written, the current frame pipeline data is read out from the memory in the first order starting according to the clock cycle.
[0074] The pipeline data is the operation result output by the multi-stage butterfly operation unit.
[0075] When the first sequence is in positive order, the second sequence is in reverse order; when the first sequence is in reverse order, the second sequence is in positive order.
[0076] In this embodiment, the current frame pipeline data refers to a frame of pipeline data currently being written.
[0077] Optionally, the preset number of digits is the last digit or the second to last digit.
[0078] The multi-stage butterfly operation unit is used to gradually convert the time domain signal into the frequency domain signal through iteration. The number of stages of the multi-stage butterfly operation unit is related to the encoding method and the sequence length, for example: Figure 5 As shown, when the sequence length is 1024 and the encoding method is binary, due to 2 10 =16, the required number of multi-stage butterfly operation units is 5.
[0079] In some embodiments, the address selection module includes a read address addressing module and a write address addressing module.
[0080] The read address addressing module is used to: when writing a preset number of bits in the current frame pipeline data, read out the current frame pipeline data from the memory in a first order according to the clock cycle.
[0081] The write address addressing module is used to: when the pipeline data of the previous frame is written into the memory in the first sequence, write the pipeline data of the current frame into the memory in the second sequence according to the clock cycle.
[0082] Reference Figure 6 In an embodiment of the present invention, an FFT processor may include: a data sorting module, a multi-stage butterfly operation unit and a memory read-write structure. The clock control module of the memory read-write structure is respectively connected to the data sorting module and the multi-stage butterfly operation unit; the data sorting module is connected to the multi-stage butterfly operation unit; the multi-stage butterfly unit operation module is connected to the memory of the memory read-write structure.
[0083] In this embodiment, the memory read-write structure is Figure 4 The memory read and write structure.
[0084] The above embodiment reduces the original two-chip memory of the ping-pong structure to one chip, reduces the inter-chip interconnection required by the ping-pong structure and the inherent area required for the ping-pong operation, effectively reduces the hardware area required for the memory by more than 50% and saves hardware costs.
[0085] Figure 7 is a flow chart of a memory reading and writing method provided by an embodiment of the present invention, such as Figure 7 As shown, the method includes:
[0086] When the pipeline data of the previous frame is written into the memory in the first order, the pipeline data of the current frame is written into the memory in the second order;
[0087] In the process of writing the pipeline data of the current frame into the memory in the second sequence, when the preset number of bits in the pipeline data of the current frame is written, the pipeline data of the current frame begins to be read out from the memory in the first sequence;
[0088] The pipeline data is the operation result output by the multi-stage butterfly operation unit.
[0089] In an optional embodiment, the process of writing the pipeline data of the current frame into the memory in the second order may include:
[0090] Writing the pipeline data of the current frame into the memory in the second order according to the clock cycle;
[0091] Start reading the current frame pipeline data from the memory in the first order, including:
[0092] According to the clock cycle, start reading the current frame pipeline data from the memory in the first order.
[0093] In this embodiment, the current frame pipeline data represents a frame of pipeline data that is being written.
[0094] The frame number indicates the frame number of the data. For example, if the frame number of the current frame pipeline data is 3, it means that the current frame pipeline data is the 3rd frame pipeline data.
[0095] Optionally, the positive sequence is the order of data in 0, 1...n, and the reverse order is to reverse the order of each digit of the data, for example, the reverse order of 21 is 12. Taking the binary sequence length of 16 digits as an example, the positive sequence is 0000(0), 0001(1), 0010(2), 0011(3), 0100(4), 0101(5), 0110(6), 0111(7), 1000(8), 1001(9), 1010(10), 1011(11), 1100(12), 1101(13), 1110(14), 1111(15), in reverse order: 0000(0), 1000(8), 0100(4), 1100(12), 0010(2), 1010(10), 0110(6), 1110(14), 0001(1), 1001(9), 0101(5), 1101(13), 0011(3), 1011(11), 0111(7), 1111(15).
[0096] This method can be applied to the memory read-write structure of any of the above embodiments. Figure 4, the clock control module is used to generate a continuous clock cycle that is not affected by other modules, and transmit the clock cycle to the address selection module and the memory. The write address addressing module in the addressing module obtains the writing order of the pipeline data of the previous frame. If the writing order of the pipeline data of the previous frame is in positive order, the writing order of the pipeline data of the current frame is controlled to be in reverse order, and the pipeline data of the current frame is controlled to be written to the memory according to the clock cycle generated by the clock control module. The read address addressing module in the addressing module obtains the writing order of the pipeline data of the current frame. If the writing order of the pipeline data of the current frame is in reverse order, the pipeline data in the memory is read out in positive order when the pipeline data is written to the preset number of bits; if the writing order of the pipeline data of the current frame is in positive order, the pipeline data in the memory is read out in reverse order when the pipeline data of the current frame is written to the preset number of bits.
[0097] When the first sequence is in positive order, the second sequence is in reverse order; when the first sequence is in reverse order, the second sequence is in positive order.
[0098] In an optional embodiment, the preset number of digits is the last digit, or the second to last digit.
[0099] In one implementation, the preset number of bits is the last bit. When the pipeline data of the current frame is written into the memory in positive order, the pipeline data of the current frame is read out from the memory in reverse order at the last clock cycle of writing the pipeline data of the current frame; when the pipeline data of the current frame is written into the memory in reverse order, the pipeline data of the current frame is read out from the memory in positive order at the last clock cycle of writing the pipeline data of the current frame.
[0100] In another implementation, the preset number of bits is the second to last bit. When the pipeline data of the current frame is written into the memory in a positive order, the pipeline data of the current frame is read out from the memory in a reverse order at the second to last clock cycle of writing the pipeline data of the current frame; when the pipeline data of the current frame is written into the memory in a reverse order, the pipeline data of the current frame is read out from the memory in a positive order at the second to last clock cycle of writing the pipeline data of the current frame.
[0101] The above embodiment starts to read data in the order opposite to the writing order when the pipeline data of the current frame is written to the preset number of bits, and controls the pipeline data of the next frame to be written in the order opposite to the current frame pipeline data. Since the first and last bits are unchanged in the process of writing the pipeline data in the positive order and in the process of writing the pipeline data in the reverse order, when the preset number of bits is the last bit or the second to last bit, it can be ensured that when the pipeline data is written to each position in the memory, the data stored in this position has been read out, and when the data is written to each position in the memory, the data at this position in the memory is not read, which effectively avoids the occurrence of data loss caused by reading and writing RAM at the same time.
[0102] In an optional embodiment, when the current frame pipeline data is the starting frame pipeline data, the current frame pipeline data is written into the memory in a forward order or a reverse order.
[0103] The starting frame pipeline data can be written into the memory in positive order or in reverse order, which is not limited here.
[0104] For example, refer to Figure 4 When the current frame pipeline data is the starting frame pipeline data, the writing order of the current frame pipeline data is determined by the write address addressing module.
[0105] When the writing order of the starting frame pipeline data is in positive order and the preset number of bits is the last bit, the write address addressing module is controlled to determine the write address corresponding to each clock cycle in positive order, and the starting frame pipeline data is written to the corresponding storage address. At the clock cycle of the last data written, the read address addressing module is controlled to start reading the starting frame pipeline data in the memory in reverse order. After the writing of the starting frame pipeline data is completed, the write address addressing module starts to determine the write address corresponding to each clock cycle in reverse order, and writes the second frame pipeline data to the corresponding storage address. At the clock cycle of the last data written, the read address addressing module is controlled to start reading the second frame pipeline data in the memory in positive order.
[0106] When the writing order of the starting frame pipeline data is in reverse order and the preset number of bits is the penultimate bit, the write address addressing module is controlled to determine the write address corresponding to each clock cycle in reverse order, and the starting frame pipeline data is written to the corresponding storage address, and the read address addressing module is controlled to start reading the starting frame pipeline data in the memory in positive order at the same clock cycle as the penultimate data is written. After the writing of the starting frame pipeline data is completed, the write address addressing module starts to determine the write address corresponding to each clock cycle in positive order, and writes the second frame pipeline data to the corresponding storage address, and the read address addressing module is controlled to start reading the second frame pipeline data in the memory in reverse order at the same cycle as the penultimate data is written.
[0107] In some embodiments, a memory reading and writing method may include:
[0108] Writing the starting frame pipeline data into a memory in reverse order;
[0109] If the number of frames of the current frame pipeline data is an odd number, writing the current frame pipeline data into the memory in reverse order;
[0110] If the number of frames of the current frame pipeline data is an even number, writing the current frame pipeline data into the memory in positive order;
[0111] If the number of frames of the current frame pipeline data is an odd number, when the preset number of bits in the current frame pipeline data is written, the current frame pipeline data begins to be read out from the memory in a positive order;
[0112] If the frame number of the current frame pipeline data is an even number, then when the preset number of bits in the current frame pipeline data is written, the current frame pipeline data begins to be read out from the memory in reverse order.
[0113] Optionally, the preset number of digits is the last digit, or the second to last digit.
[0114] In some embodiments, the preset bit number is the last bit. Specifically, when the frame number of the current frame pipeline data is an odd number, the current frame pipeline data is written into the memory in reverse order, and when the last data of the current frame pipeline data is written, the current frame pipeline data in the memory is read out in positive order. When the frame number of the current frame pipeline data is an even number, the current frame pipeline data is written into the memory in positive order, and when the last data of the current frame pipeline data is written, the current frame pipeline data in the memory is read out in reverse order.
[0115] In some other embodiments, the preset bit number is the penultimate bit. Specifically, when the frame number of the current frame pipeline data is an odd number, the current frame pipeline data is written into the memory in reverse order, and when the penultimate data of the current frame pipeline data is written, the current frame pipeline data in the memory starts to be read out in positive order. When the frame number of the current frame pipeline data is an even number, the current frame pipeline data is written into the memory in positive order, and when the penultimate data of the current frame pipeline data is written, the current frame pipeline data in the memory starts to be read out in reverse order.
[0116] In some other embodiments, a memory reading and writing method may include:
[0117] Writing the starting frame pipeline data into a memory in positive order;
[0118] If the number of frames of the current frame pipeline data is an odd number, writing the current frame pipeline data into the memory in a positive order;
[0119] If the number of frames of the current frame pipeline data is an even number, writing the current frame pipeline data into the memory in reverse order;
[0120] If the number of frames of the current frame pipeline data is an odd number, when a preset number of bits in the current frame pipeline data is written, the current frame pipeline data begins to be read out from the memory in reverse order;
[0121] If the frame number of the current frame pipeline data is an even number, then when the preset number of bits in the current frame pipeline data is written, the current frame pipeline data begins to be read out from the memory in a positive order.
[0122] Optionally, the preset number of digits is the last digit, or the second to last digit.
[0123] In some embodiments, the preset bit number is the last bit. Specifically, when the frame number of the current frame pipeline data is an odd number, the current frame pipeline data is written into the memory in positive order, and when the last data of the current frame pipeline data is written, the current frame pipeline data in the memory is read out in reverse order. When the frame number of the current frame pipeline data is an even number, the current frame pipeline data is written into the memory in reverse order, and when the last data of the current frame pipeline data is written, the current frame pipeline data in the memory is read out in positive order.
[0124] In other embodiments, the preset bit number is the last bit. Specifically, when the frame number of the previous frame pipeline data is an odd number, the current frame pipeline data is written into the memory in positive order, and when the second to last data of the current frame pipeline data is written, the current frame pipeline data in the memory is read out in reverse order. When the frame number of the current frame pipeline data is an even number, the current frame pipeline data is written into the memory in reverse order, and when the second to last data of the current frame pipeline data is written, the current frame pipeline data in the memory is read out in positive order.
[0125] In an optional embodiment, a frame marker code of the pipeline data of the current frame is determined based on the frame number of the pipeline data of the current frame, wherein the frame marker code includes a first value and a second value, the first value indicates that the frame number of the pipeline data of the current frame is an odd number, and the second value indicates that the frame number of the pipeline data of the current frame is an even number;
[0126] Based on the frame mark code, determine whether the frame number of the current frame pipeline data is odd or even.
[0127] The first value and the second value are different, and the specific values can be set according to actual conditions. For example, the first value can be 0 and the second value can be 1. For another example, the first value can be 00 and the second value can be 10. For another example, the first value can be 2 and the second value can be 3.
[0128] In this embodiment, the frame marker code is used to determine the writing order and reading order of the pipeline data of the current frame when encoding.
[0129] The read data addressing address and the write data addressing address can be determined based on the frame mark code and the sequence length, which are used to determine the data write address corresponding to each clock cycle and the address for reading data from the memory. For example, the sequence length is 1024 (1024 = 2 10 ), and the frame marker code of the odd frame is 0 and the frame marker code of the even frame is 1, the write data addressing address encoding of the pipeline data of the odd frame is: WADDR = CNT[n-1:0], n = 10, and the read data addressing address encoding is: RADDR = CNT[0:n-1], n = 10; the write data addressing address encoding of the pipeline data of the even frame is: WADDR = CNT[0:n-1], n = 10, and the read data addressing address encoding is: RADDR = CNT[n-1:0], n = 10.
[0130] The above embodiment avoids conflicts between data writing and data reading in the memory by cycling the writing and reading orders of pipeline data in forward and reverse order, and starts reading the current frame data stored in the memory at the last clock cycle, thereby effectively improving data throughput, reducing the demand for memory, and further reducing the hardware area required for the memory.
[0131] The following describes a memory reading and writing method provided by an embodiment of the present invention through two specific embodiments:
[0132] Embodiment 1:
[0133] like Figure 8 As shown, the input length of pipeline data is 16, the writing order of the first frame pipeline data is in reverse order, and the preset bit is the last bit. When the frame number is an odd number, the first value of the frame mark code is 0, and when the frame number is an even number, the second value of the frame mark code is 1.
[0134] The specific process of the memory reading and writing method is as follows:
[0135] The first frame of pipeline data is written to the memory in reverse order during the 0-15 clock cycles, and the first frame of pipeline data is read from the memory in positive order during the 15-30 clock cycles. The second frame of pipeline data is written to the memory in positive order during the 16-31 clock cycles, and the second frame of pipeline data is read from the memory in reverse order during the 31-46 clock cycles. The third frame of pipeline data is written to the memory in reverse order during the 32-47 clock cycles, and the second frame of pipeline data is read from the memory in positive order during the 47-62 clock cycles. The writing and reading of subsequent pipeline data is similar.
[0136] Specifically, taking the 15th-17th clock cycles as an example, in the 15th clock cycle, the last data of the first frame data is written to the 15th position in the memory, and the first data of the first frame pipeline data is read from the 0th position in the memory.
[0137] In the 16th clock cycle, the second data of the first frame of pipeline data is read from the 1st position in the memory, and the first data of the second frame of pipeline data is written to the 0th position in the memory.
[0138] In the 17th clock cycle, the third data of the first frame of pipeline data is read from the second position in the memory, and the second data of the second frame of pipeline data is written to the first position in the memory.
[0139] Embodiment 2:
[0140] like Fig. 9 As shown, the input length of pipeline data is 16, the writing order of the first frame pipeline data is positive order, and the preset bit number is the second to last bit. When the frame number is odd, the first value of the frame mark code is 0, and when the frame number is even, the second value of the frame mark code is 1.
[0141] Then the first frame of pipeline data is written into the memory in positive order in the 0-15 clock cycles, and the first frame of pipeline data is read out from the memory in reverse order in the 14-29 clock cycles. The second frame of pipeline data is written into the memory in positive order in the 16-31 clock cycles, and the second frame of pipeline data is read out from the memory in positive order in the 30-45 clock cycles. The third frame of pipeline data is written into the memory in positive order in the 32-47 clock cycles, and the second frame of pipeline data is read out from the memory in positive order in the 46-61 clock cycles. The writing and reading of subsequent pipeline data is similar.
[0142] Specifically, taking the 14th to 17th clock cycles as an example, in the 14th clock cycle, the second to last data of the first frame data is written to the 14th position in the memory, and the first data of the first frame pipeline data is read from the 0th position in the memory.
[0143] The 15th clock cycle reads the second data of the first frame of pipeline data from the 8th position in the memory, and writes the last data of the first frame of pipeline data to the 15th position in the memory.
[0144] The 16th clock cycle reads the third data of the first frame of pipeline data from the 4th position in the memory, and writes the first data of the second frame of pipeline data into the 0th position in the memory.
[0145] The 17th clock cycle reads the fourth data of the first frame pipeline data from the 3rd position in the memory, and writes the second data of the second frame pipeline data into the 8th position in the memory.
[0146] Embodiment 3:
[0147] like Fig.10 As shown, the input length of pipeline data is 1024, the writing order of the first frame pipeline data is in reverse order, and the preset bit is the last bit. When the frame number is odd, the first value of the frame mark code is 0, and when the frame number is even, the second value of the frame mark code is 1.
[0148] Then the first frame of pipeline data is written into the memory in reverse order at the 0-1023 clock cycles, and the first frame of pipeline data is read out from the memory in positive order at the 1023-2046 clock cycles. The second frame of pipeline data is written into the memory in positive order at the 1024-2047 clock cycles, and the second frame of pipeline data is read out from the memory in reverse order at the 2047-3070 clock cycles. The third frame of pipeline data is written into the memory in reverse order at the 2048-3071 clock cycles, and the second frame of pipeline data is read out from the memory in positive order at the 3071-4094 clock cycles. The writing and reading of subsequent pipeline data is similar.
[0149] Specifically, taking the 1023rd-1025th clock cycles as an example, in the 1023rd clock cycle, the last data of the first frame data is written to the 1023rd position in the memory, and the first data of the first frame pipeline data is read from the 0th position in the memory.
[0150] The 1024th clock cycle reads the second data of the first frame of pipeline data from the 1st position in the memory, and writes the first data of the second frame of pipeline data into the 0th position in the memory.
[0151] The 1025th clock cycle reads the third data of the first frame of pipeline data from the second position in the memory, and writes the second data of the second frame of pipeline data into the first position in the memory.
[0152] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0153] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0154] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0155] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0156] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0157] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0158] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned memory reading and writing method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium.
[0159] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A memory read-write structure, characterized in that: include: Clock control module, address selection module and memory; The clock control module is connected to the address selection module and the memory respectively; the address selection module is connected to the memory; The clock control module is used to generate a clock cycle; The site selection module is used to: When the pipeline data of the previous frame is written into the memory in the first order, the pipeline data of the current frame is written into the memory in the second order according to the clock cycle; In the process of writing the pipeline data of the current frame into the memory in the second order, when the preset number of bits in the pipeline data of the current frame is written, reading the pipeline data of the current frame from the memory in the first order starting from the clock cycle; Wherein, the pipeline data is the operation result output by the multi-stage butterfly operation unit; When the first sequence is in positive order, the second sequence is in negative order; when the first sequence is in negative order, the second sequence is in positive order.
2. A memory read-write structure according to claim 1, characterized in that: An address selection module, including a write address addressing module and a read address addressing module; The write address addressing module is used to write the pipeline data of the current frame into the memory in the second order according to the clock cycle when the pipeline data of the previous frame is written into the memory in the first order; The read address addressing module is used to read out the current frame pipeline data in a first order from the memory starting from the clock cycle when writing a preset number of bits in the current frame pipeline data.
3. An FFT processor, characterized in that: include: A data sorting module, a multi-stage butterfly operation unit and a memory read-write structure as described in claim 1 or 2; the clock control module of the memory read-write structure is respectively connected to the data sorting module and the multi-stage butterfly operation unit; the data sorting module is connected to the multi-stage butterfly operation unit; the multi-stage butterfly operation unit is connected to the memory of the memory read-write structure.
4. A memory reading and writing method, characterized in that: include: When the pipeline data of the previous frame is written into the memory in the first order, the pipeline data of the current frame is written into the memory in the second order; In the process of writing the current frame pipeline data into the memory in the second order, when a preset number of bits in the current frame pipeline data is written, starting to read the current frame pipeline data from the memory in the first order; Wherein, the pipeline data is the operation result output by the multi-stage butterfly operation unit; When the first sequence is in positive order, the second sequence is in negative order; when the first sequence is in negative order, the second sequence is in positive order.
5. A memory reading and writing method according to claim 4, characterized in that: The preset number of digits is the last digit, or the second to last digit.
6. A memory reading and writing method according to claim 4, characterized in that: The method further comprises: When the current frame pipeline data is the starting frame pipeline data, the current frame pipeline data is written into the memory in a positive order or a reverse order.
7. A memory reading and writing method according to claim 6, characterized in that: In a case where the pipeline data of the starting frame is written into the memory in reverse order, and in a case where the pipeline data of the previous frame is written into the memory in the first order, writing the pipeline data of the current frame into the memory in the second order comprises: If the number of frames of the current frame pipeline data is an odd number, writing the current frame pipeline data into the memory in reverse order; If the number of frames of the current frame pipeline data is an even number, writing the current frame pipeline data into the memory in positive order; In the process of writing the current frame pipeline data into the memory in the second order, when a preset number of bits in the current frame pipeline data is written, starting to read the current frame pipeline data from the memory in the first order, including: If the number of frames of the current frame pipeline data is an odd number, when the preset number of bits in the current frame pipeline data is written, the current frame pipeline data begins to be read out from the memory in a positive order; If the frame number of the current frame pipeline data is an even number, then when the preset number of bits in the current frame pipeline data is written, the current frame pipeline data begins to be read out from the memory in reverse order.
8. A memory reading and writing method according to claim 7, characterized in that: The method further comprises: Determine a frame marker code of the pipeline data of the current frame based on the frame number of the pipeline data of the current frame, wherein the frame marker code includes a first value and a second value, the first value indicates that the frame number of the pipeline data of the current frame is an odd number, and the second value indicates that the frame number of the pipeline data of the current frame is an even number; Based on the frame mark code, it is determined whether the frame number of the current frame pipeline data is an odd number or an even number.
9. A memory reading and writing method according to claim 4, characterized in that: Writing the current frame pipeline data into the memory in a second order comprises: Writing the pipeline data of the current frame into the memory in a second order according to the clock cycle; Starting to read the current frame pipeline data from the memory in a first order, comprising: According to the clock cycle, the pipeline data of the current frame starts to be read out from the memory in a first order.
10. A memory reading and writing method according to claim 4, characterized in that: The memory includes a dual-port random access memory RAM; the multi-stage butterfly operation unit is located in a fast Fourier transform FFT processor, and the FFT processor also includes the memory.
