It is a kind of that table tennis date storage method is gone based on FPGA

文档序号:1771693 发布日期:2019-12-03 浏览:12次 中文

阅读说明:本技术 一种基于fpga的去乒乓数据存储方法 (It is a kind of that table tennis date storage method is gone based on FPGA ) 是由 肖钰 朱凯强 王翊坤 孙厚军 赵国强 于 2019-06-25 设计创作,主要内容包括:本发明公开了一种基于FPGA的去乒乓数据存储方法,通过在FPGA中划定一个RAM,在读取上一帧部分数据后,在空出的存储空间中存储下一阵部分数据;而且奇数帧存储顺序相同,读取顺序也相同,偶数帧存储顺序相同,读取顺序相同,相对常用的乒乓存储方法,可以达到最多的节省一半的RAM,从而节省FPGA的MEM资源。(The invention discloses a kind of to remove table tennis date storage method based on FPGA, by delimiting a RAM in FPGA, after reading previous frame partial data, and a burst of partial data under being stored in the memory space vacated;And odd-numbered frame storage order is identical, and reading order is also identical, and even frame storage order is identical, and reading order is identical, relatively conventional Pingpang Memory method, can achieve the RAM of most saving half, to save the MEM resource of FPGA.)

1. a kind of date storage method, which comprises the steps of:

Step zero, the frame sign for assuming the 2-D data of input are M × N, i.e. M row N column;I-th row jth column element aI, jTable Show, M and N be written as follow relational expression:

N=p × M+q

Wherein p is integer, and p ∈ [1 ,+∞), q is integer, and q ∈ [0, M-1];

Size delimited in FPGA isRAM;WhereinExpression rounds up to data *;It enablesI.e. RAM size is L × N;

Step 1: the 2-D data of M × N size is cached in the RAM according to line direction for input data;

Step 2: storage is read out to the first frame data in the RAM according to column direction by column;

Step 3: starting the 1st row for caching the second frame data into RAM, it may be assumed that by the 1st row when having read pth column data Middle element a1,1、a1,2、…a1, pSequence is stored in p-th the 1st Data Position, the 2nd Data Position ... of data of the 1st row of RAM Position;By element a in the 1st row1, p+1、a1, p+2、…a1,2pSequence is stored in the 1st Data Position of the 2nd row of RAM, the 2nd data P-th of position ... Data Position;And so on, until element a1, NIt is cached to the of L rowA data bit It sets;

Step 4 arranges to 2p column data according to pth in the 1st row of the first frame data in the method reading RAM of step 3, works as reading When taking 2p column data, starts to arrange toward the pth+1 of RAM into the memory space of 2p, cache the 2nd row of the second frame data, according to It is secondary to analogize, until having read the first frame data, and cache the second frame data;

Step 5 reads the second frame data in RAM, reading order are as follows: a by column since first row1,1、a2,1、…aM, 1、a1,2、 a2,2、…aM, 2…a1, p、a2, p、…aM, p, that is, complete the reading of p column data before the second frame data;

Step 6 before having read the second frame data when p column data, starts the 1st row for caching third frame data into RAM, writes Enter sequence are as follows: a1,1、a1,2、…a1, N, at the same time, the p+1 for reading the second frame data, which is arranged to 2p, to be arranged, reading order are as follows: a1, p+1、a2, p+1、…aM, p+1、a1, p+2、a2, p+2、…aM, p+2…a1,2p、a2,2p、…aM, 2p

Step 7 caches the 2nd row of third frame data, write sequence are as follows: a into RAM2,1、a2,2、…a2, N, at the same time, read The 2p+1 of second frame data is arranged to 3p and is arranged, reading order are as follows: a1,2p+1、a2,2p+1、…aM, 2p+1、a1,2p+2、a2,2p+2、… aM, 2p+2…a1,3p、a2,3p、…aM, 3p

RAM is all written until having read the second frame data, and by third frame data according to the method for step 7 in step 8;

Step 9, and so on, the method for step 2 to step 8 is constantly cached and is read to input data.

Technical field

The invention belongs to signal processing technology fields, and in particular to a kind of to remove table tennis date storage method based on FPGA.

Background technique

In the signal processing algorithms such as radar, optics, image, it is often necessary to use the processing of 2-D data.For example, In In radar imaging technology, two-dimensional fast fourier transform is a kind of common calculation.One group of 2-D data is defined as one Frame needs first to handle according to one-dimensional square, then carries and handle by two-dimensional directional during processing.

In Project Realization, algorithm as above is often realized in FPGA.Currently used processing mode is to be deposited using table tennis Storage scheme, using RAM in two block pieces, respectively as table tennis RAM and pang RAM.Data are inputted by one-dimensional square, while being done at flowing water Reason first caches the 1st frame data with table tennis RAM, then caches the 2nd frame data with pang RAM, meanwhile, table tennis is read by two-dimensional direction The 1st frame data in RAM, do the processing of the second dimension data.When pang RAM has cached 2 frame data, the 1st in table tennis RAM has been handled Then frame data cache the 3rd frame data with table tennis RAM, while by the 2nd frame data in two-dimensional directional processing pang RAM.Successively follow Ring, continuous processing multiframe data.

Data are handled according to such as upper type, then need the storage of twice frame data amount, the requirement meeting on piece storage It is very high.

Summary of the invention

Table tennis date storage method is gone based on FPGA in view of this, the object of the present invention is to provide a kind of, can be saved Storage resource.

A kind of date storage method, includes the following steps:

Step zero, the frame sign for assuming the 2-D data of input are M × N, i.e. M row N column;I-th row jth column element is used ai,jIt indicates, M and N is written as follow relational expression:

N=p × M+q

Wherein p is integer, and p ∈ [1 ,+∞), q is integer, and q ∈ [0, M-1];

Size delimited in FPGA isRAM;WhereinExpression rounds up to data *;It enables I.e. RAM size is L × N;

Step 1: the 2-D data of M × N size is cached in the RAM according to line direction for input data;

Step 2: storage is read out to the first frame data in the RAM according to column direction by column;

Step 3: starting the 1st row for caching the second frame data into RAM when having read pth column data, it may be assumed that by this Element a in 1 row1,1、a1,2、…a1, pSequence be stored in the 1st row of RAM the 1st Data Position, the 2nd p-th of Data Position ... Data Position;By element a in the 1st row1, p+1、a1, p+2、…a1,2pSequence is stored in the 1st Data Position of the 2nd row of RAM, the 2nd P-th of Data Position of Data Position ...;And so on, until element a1, NIt is cached to the of L rowA data Position;

Step 4 is arranged according to pth in the 1st row of the first frame data in the method reading RAM of step 3 to 2p column data, When having read 2p column data, start to arrange toward the pth+1 of RAM into the memory space of 2p, the 2nd of the second frame data of caching the Row, and so on, until having read the first frame data, and cache the second frame data;

Step 5 reads the second frame data in RAM, reading order are as follows: a by column since first row1,1、a2,1、…aM, 1、 a1,2、a2,2、…aM, 2…a1, p、a2, p、…aM, p, that is, complete the reading of p column data before the second frame data;

Step 6 before having read the second frame data when p column data, starts to cache the 1st of third frame data into RAM Row, write sequence are as follows: a1,1、a1,2、…a1, N, at the same time, the p+1 for reading the second frame data, which is arranged to 2p, to be arranged, reading order Are as follows: a1, p+1、a2, p+1、…aM, p+1、a1, p+2、a2, p+2、…aM, p+2…a1,2p、a2,2p、…aM, 2p

Step 7 caches the 2nd row of third frame data, write sequence are as follows: a into RAM2,1、a2,2、…a2, N, at the same time, The 2p+1 for reading the second frame data, which is arranged to 3p, to be arranged, reading order are as follows: a1,2p+1、a2,2p+1、…aM, 2p+1、a1,2p+2、a2,2p+2、… aM, 2p+2…a1,3p、a2,3p、…aM, 3p

Step 8 is all written according to the method for step 7 until having read the second frame data, and by third frame data RAM;

Step 9, and so on, the method for step 2 to step 8 is constantly cached and is read to input data.

The invention has the following beneficial effects:

It is of the invention a kind of to go table tennis date storage method reading by delimiting a RAM in FPGA based on FPGA After taking previous frame partial data, a burst of partial data under being stored in the memory space vacated;And odd-numbered frame storage order phase Together, reading order is also identical, and even frame storage order is identical, and reading order is identical, relatively conventional Pingpang Memory method, can be with Reach the RAM of most saving half, to save the MEM resource of FPGA.

Detailed description of the invention

Fig. 1 is original two dimensional schematic diagram data;

Fig. 2 is put in order schematic diagram of the 1st frame data in RAM;

Fig. 3 is that the data arrangement sequential schematic after the 1st row of the 2nd frame data is written into RAM;

Fig. 4 is the data arrangement sequential schematic write after the 2nd frame data into RAM;

Fig. 5 is the 2nd frame data reading order schematic diagram;

Fig. 6 is that the data arrangement sequential schematic after the 1st row of the 3rd frame data is written into RAM.

Specific embodiment

The present invention will now be described in detail with reference to the accompanying drawings and examples.

A kind of two-dimensional data storage method for removing table tennis, it is assumed that the 2-D data specification of input is M × N, i.e. M row N is arranged, and It is defined as a frame data, the i-th row jth column element ai,jIt indicates, M and N can be indicated with following relational expression:

N=p × M+q

Wherein p is integer, and p ∈ [1 ,+∞), q is integer, and q ∈ [0, M-1].

The RAM size to be used is needed to beWhereinExpression rounds up to data *, indicates for convenience, enablesI.e. RAM size is L × N.

Specific processing includes the following steps:

Step 1: input data is according to first dimension, i.e. line direction, into FPGA, after stream treatment, it is cached to RAM In;And so on, until having cached the data of M row, that is, cache the data volume of a frame.

Step 2: according to second dimension, i.e. column direction reads the data in RAM, carries out the second dimension data processing, reads Take sequence are as follows: the 1st column, the 2nd column, the 3rd column, and so on, run through N column data.

Step 3: starting the 1st row for caching the 2nd frame data into RAM, caching sequence when having read pth column data Are as follows: a1,1、a1,2、…a1, pIt is stored in p-th the 1st Data Position, the 2nd Data Position ... of data bit of the 1st row of RAM respectively It sets;a1, p+1、a1, p+2、…a1,2pIt is stored in p-th the 1st Data Position, the 2nd Data Position ... of data of the 2nd row of RAM respectively Position;And so on, until a1, NIt is cached to the of L rowA Data Position.

Step 4 repeats step 3, when having read 2p column data, starts empty to the storage of 2p toward the column of pth+1 of RAM Between in, cache the 2nd row of the 2nd frame data, and so on, until read the first frame data, and cached the second frame data.

Step 5 reads the 2nd frame data, reading order are as follows: a by the two-dimensional directional of data1,1、a2,1、…aM, 1、a1,2、 a2,2、…aM, 2…a1, p、a2, p、…aM, p, i.e., the reading of p column data before the 2nd frame data of completion.

Step 6 before having read the 2nd frame data when p column data, starts to cache the 1st row of the 3rd frame data into RAM, write Enter sequence are as follows: a1,1、a1,2、…a1, N, simultaneously, the p+1 for reading the 2nd frame data, which is arranged to 2p, to be arranged, reading order are as follows: a1, p+1、 a2, p+1、…aM, p+1、a1, p+2、a2, p+2、…aM, p+2…a1,2p、a2,2p、…aM, 2p

Step 7 caches the 2nd row of the 3rd frame data, write sequence are as follows: a into RAM2,1、a2,2、…a2, N, simultaneously, read It takes the 2p+1 of the 2nd frame data to arrange to 3p to arrange, reading order are as follows: a1,2p+1、a2,2p+1、…aM, 2p+1、a1,2p+2、a2,2p+2、… aM, 2p+2…a1,3p、a2,3p、…aM, 3p

Step 8 repeats step 7, and RAM is all written until having read the 2nd frame data, and by the 3rd frame data.At this time Storage order of 3 frame data in RAM is identical as the 1st frame data, therefore realizes odd number frame data in the storage order phase of RAM Together, reading order is also identical, and storage order of the same even number frame data in RAM is identical, and reading order is also identical.

Step 9 repeats step 2 to step 8, realizes caching and the reading of the multiframe data for removing table tennis MEM.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于UVM验证方法学的AES验证装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!