WO2012174807A1 - Method and system for compressing and decompressing configuration data stream of programmable logic device - Google Patents

Method and system for compressing and decompressing configuration data stream of programmable logic device Download PDF

Info

Publication number
WO2012174807A1
WO2012174807A1 PCT/CN2011/080428 CN2011080428W WO2012174807A1 WO 2012174807 A1 WO2012174807 A1 WO 2012174807A1 CN 2011080428 W CN2011080428 W CN 2011080428W WO 2012174807 A1 WO2012174807 A1 WO 2012174807A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
frame
compression
unit
command
Prior art date
Application number
PCT/CN2011/080428
Other languages
French (fr)
Chinese (zh)
Inventor
包朝伟
刘仕东
王佩宁
Original Assignee
深圳市国微电子股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市国微电子股份有限公司 filed Critical 深圳市国微电子股份有限公司
Publication of WO2012174807A1 publication Critical patent/WO2012174807A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction

Definitions

  • the present invention relates to the field of data processing, and in particular, to a method and system for compressing and decompressing a configuration data stream of a programmable logic device.
  • PLD Traditional programmable logic device
  • FPGA Field Program Gate
  • a design file contains millions or more of configuration data bits, which requires a large external memory to store the configuration data stream, and the download operation of the configuration data stream will also cost a lot. time. Therefore, in order to save storage space and save download time, compressing the configuration data stream is a very effective technical measure.
  • LZ compression algorithm is mainly for the compression of strings or data strings (hereinafter referred to as strings), such as saving the latest compressed data in a buffer buffer.
  • strings data strings
  • the encoding consists of three parts, including matching. The position, length, and character or data of the last digit of the data string.
  • a part of the conventional FPGA is configured in units of frame frames, and is compressed in units of frames, that is, compression outside the frame.
  • 1 is a schematic diagram of an FPGA of the prior art, including an FPGA 11, a programmable logic unit 12, and a frame 13.
  • the FPGA 11 represents a structure of an FPGA, and each dotted line bar represents a frame (the number of dashed lines does not mean any meaning) , here is just a schematic diagram), the FPGA completes the configuration by frame by frame.
  • a frame of data will contain a number of bits or fields. Depending on the type and capacity of the FPGA, the number of bits or fields it contains will be different.
  • FIG. 2 is a schematic diagram of a frame structure in an FPGA in the prior art.
  • the first word is represented by W0, and the second word is represented by W1.
  • the last word is represented by Wm-1.
  • the length of this frame is said to be m.
  • the traditional method of external compression of the frame considers the structural characteristics and programming features of the FPGA to some extent, but does not take into account the data characteristics inside the frame. Therefore, the traditional method of compressing the frame based on the frame unit has certain limitations. , low efficiency.
  • the present invention provides a more efficient method and system for compressing and decompressing a configuration data stream of a programmable logic device.
  • the present invention adopts the following technical solutions:
  • a method for compressing a configuration data stream of a programmable logic device comprising:
  • the data unit includes one or more bit values, or the data unit includes one or more field values.
  • the process of obtaining the reference value and the command unit after performing compression processing on the data unit inside the data frame to be compressed is specifically:
  • Determining whether the number of consecutive and identical data units is greater than or equal to the preset value by comparing the number of consecutive and identical data units in the frame obtained by the statistics with a preset value;
  • the command unit obtained by processing the consecutive and identical plurality of data units includes command type information for indicating a compression type, and an address for indicating that the consecutive and identical plurality of data units are located inside the frame Information and number information for indicating the plurality of consecutive and identical data units;
  • the command unit obtained by processing the consecutive and identical plurality of data units or 1 data unit includes command type information for indicating an uncompressed type, and is used to represent the continuous and identical plurality of data.
  • the unit or one data unit is located in the address information inside the frame and is used to indicate the number information of the consecutive and identical plurality of data units or one data unit.
  • the preset value is an integer greater than or equal to 3.
  • a method for decompressing a configuration data stream of a programmable logic device comprising:
  • the process of decompressing the data unit inside the data frame to be decompressed is specifically:
  • the process of decompressing the data unit inside the data frame to be decompressed according to the command unit and the reference value is specifically:
  • the command type information in the command unit is a compression type, according to the address information in the command unit for indicating that the consecutive and identical plurality of data units are located inside the frame and for indicating the continuous and the same Number information of the plurality of data units, the reference value is copied to a corresponding address in the frame;
  • command type information in the command unit is an uncompressed type, according to the address information in the command unit for indicating that the consecutive and identical plurality of data units or one data unit are located inside the frame and for indicating The number information of the consecutive and identical plurality of data units or 1 data unit copies the reference value to a corresponding address within the frame.
  • a compression processing system for configuring a data stream of a programmable logic device comprising: a data acquisition module to be compressed and a first compression processing module, wherein
  • the data processing module to be compressed is used to acquire a data frame to be compressed in the configuration data stream;
  • the first compression processing module is configured to perform compression processing on the data unit inside the data frame to be compressed.
  • the first compression processing module is configured to perform compression processing on the data unit inside the data frame to be compressed to obtain a reference value and a command unit.
  • the first compression processing module is specifically configured to: compare the number of consecutive and identical data units in the statistically derived frame with a preset value, and determine whether the number of the consecutive and identical data units is greater than or equal to the a preset value; if yes, the command unit obtained by processing the consecutive and identical plurality of data units includes command type information for indicating a compression type, and is used to represent the continuous and identical plurality of data units Address information located inside the frame and number information for indicating the continuous and identical plurality of data units; if not, the command unit obtained by processing the consecutive and identical plurality of data units or 1 data unit includes Command type information for indicating an uncompressed type, address information for indicating that the continuous and identical plurality of data units or one data unit is located inside the frame, and for indicating the continuous and identical plurality of data units or The number information of 1 data unit.
  • a second compression processing module is further included, the second compression processing module is configured to perform compression processing on the frame unit in the configuration data stream.
  • a decompression processing system for configuring a data stream of a programmable logic device comprising: a data acquisition module to be decompressed and a first decompression module, wherein:
  • the data to be decompressed processing module is configured to acquire a data frame to be decompressed in the configuration data stream;
  • the first decompression module is configured to perform decompression processing on the data unit inside the data frame to be decompressed.
  • the first decompression module is specifically configured to acquire a command unit and a reference value inside the data frame to be decompressed; and to use a data unit in the data frame to be decompressed according to the command unit and the reference value. Perform decompression processing.
  • the first decompression module is specifically configured to acquire command type information in the command unit; if the command type information in the command unit is a compression type, according to the command unit, the continuous and identical Address data of the plurality of data units located inside the frame and number information for indicating the continuous and identical plurality of data units, copying the reference value to a corresponding address within the frame; if in the command unit
  • the command type information is an uncompressed type, and according to the address information in the command unit for indicating that the consecutive and identical multiple data units or one data unit are located inside the frame, and for indicating the continuous and the same The number of data units or the number of data units is copied to the corresponding address within the frame.
  • a second decompression module is further included, and the second decompression module is configured to perform decompression processing on the frame unit in the configuration data stream.
  • the present invention provides a compression and decompression processing method and system for a configuration data stream of a programmable logic device, wherein the compression method includes performing compression processing on data units inside a data frame to be compressed, and compressing data units inside the frame.
  • the present invention can also select an optimal compression ratio for the characteristics of the data frame or the internal data unit of the frame by setting a preset value, and therefore, has a strong flexibility.
  • FIG. 1 is a schematic diagram of an FPGA of the prior art
  • FIG. 2 is a schematic diagram of a frame structure in an FPGA in the prior art
  • FIG. 3 is a flowchart of a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention
  • FIG. 4 is a flowchart of a method for compressing a frame in a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a command unit obtained by processing a plurality of consecutive and identical data units whose number is greater than or equal to the preset value according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a command unit obtained by processing a plurality of consecutive or identical data units having a number smaller than the preset value according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of internal compressed data of a frame in a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention
  • FIG. 8 is a flowchart of a configuration data stream decompression processing method of a programmable logic device according to an embodiment of the present invention
  • FIG. 9 is a schematic diagram of decompressing data in a frame in a configuration data stream decompression processing method of a programmable logic device according to an embodiment of the present invention.
  • FIG. 10 is a block diagram of a configuration data stream compression processing system of a programmable logic device according to an embodiment of the present invention
  • FIG. 11 is a block diagram of a configuration data stream compression processing system of a programmable logic device according to another embodiment of the present invention.
  • FIG. 12 is a block diagram of a configuration data stream decompression processing system of a programmable logic device according to an embodiment of the present invention
  • FIG. 13 is a block diagram of a configuration data stream decompression processing system of a programmable logic device according to another embodiment of the present invention.
  • a method for compressing a configuration data stream of a programmable logic device comprising:
  • FIG. 3 is a flowchart of a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention. Referring to FIG. 3, this embodiment uses a compression method of an FPGA configuration data stream as an example:
  • step S32 it is determined whether the frame outside frame unit based compression processing can be performed, and if so, step S33 is performed, otherwise step S34 is performed;
  • the present invention is also applicable to a method of performing internal compression of the frame and then external compression of the frame.
  • the specific process of performing intra-frame compression on the data stream in step S34 includes:
  • the compression condition performs compression processing on a plurality of consecutive and identical data units that satisfy the compression condition.
  • the data unit can be a bit value or a field value or the like, and the compression and decompression methods are similar.
  • the present invention is not limited to compression with a bit value or a field value as a data unit, and may also be compressed with a plurality of bit values or a plurality of field values as one data unit, and the preset value is an integer greater than or equal to 3.
  • a data unit is a field value in a frame:
  • the size of the buffer A is one bit longer than the configuration data length of one frame, and is used as a flag bit.
  • the preferred flag bit is the first bit of the buffer A;
  • S342 Determine whether the data stream is subjected to frame-based external unit frame-based compression processing.
  • the frame compression command or other flag attached to the frame after the frame unit-based compression processing is used to determine, if yes, execute S343. Otherwise, execute S344;
  • step S343 in the step S341, the flag bit reserved by the buffer A, that is, the first bit of the buffer A is written with a "1" flag, and S345 is executed;
  • step S344 in step S341, the flag bit reserved by the buffer A, that is, the first bit of the buffer A is written with a "0" flag, and S345 is executed;
  • the basic addressing unit is a field, that is, 32 bits is an addressing unit.
  • the buffer B size is 106 ⁇ 32 bits, and there are 106 fields, and each field is addressed, and the address is addressed. Is 1-106, expressed in binary is 00000001-01101010, expressed in hexadecimal is 00-6A;
  • one field value is one data unit
  • the processing sequence is performed according to the address of the buffer B from low to high, and each field is processed in turn, and the number of consecutive and identical field values is counted, and a preset is made.
  • Value comparison determining whether the number of consecutive and identical field values is greater than or equal to the preset value, and if so, executing S347, otherwise, executing S348;
  • command unit + reference value included in the command unit.
  • the command unit includes command type information for indicating a compression type, address information for indicating that the continuous and identical plurality of field values are located inside the frame, and number information for indicating the continuous and identical plurality of field values , execute S349;
  • FIG. 5 is a schematic structural diagram of a command unit obtained by processing a plurality of consecutive and identical data units whose number is greater than or equal to the preset value according to an embodiment of the present invention.
  • the command unit in this embodiment is a command field.
  • the width of the command field may be 32 bits, wherein the first part of the content is used to indicate the command type information of the compression type, and may be identified by one binary bit “0”, indicating that the command type is a compression type, and the second part is used.
  • S348 Process the consecutive and identical multiple field values or one field value that is less than the preset value to obtain the following form: command unit + reference value, where the command unit includes command type information for indicating an uncompressed type, S349 is performed to indicate that the consecutive and identical plurality of data units or one data unit is located inside the frame and the number information indicating the continuous and identical plurality of data units or one data unit, S349;
  • FIG. 6 is a schematic structural diagram of a command unit obtained by processing a plurality of consecutive or identical data units having a number smaller than the preset value according to an embodiment of the present invention.
  • the command unit in this embodiment is an instruction.
  • the width of the command word may be 32 bits, and its structure, format and meaning are similar to the above-mentioned command unit obtained by compressing a plurality of consecutive and identical data units whose number is greater than or equal to a preset value, wherein the first part of the content Used to indicate the uncompressed type, the highest bit, that is, the 31st bit is identified by 1 binary bit "1", indicating that the command type is uncompressed, and the second part is used to indicate that the number is less than the preset value and
  • the address information refers to the order or number of each field in a frame of data, or the address information of the first field in these fields, due to these The fields are contiguous, so after knowing
  • FIG. 7 is a schematic diagram of internal compressed data of a frame in a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention.
  • CMD1 and CMD2 By specifying CMD1 and CMD2, you can get: 8000_0001, 0000_0000, 0002_000E, 1111_1111, 8010_0005, 2222_2222, 3333_3333, 4444_4444, 4444_4444, 5555_5555, 0015_0056, 6666_6666, 8067_0003, 7777_7777, 6666_6666, 6666_6666.
  • 106 fields of one frame can be compressed into 16 fields, which improves the efficiency of data compression.
  • a plurality of consecutive and identical data units having a number less than a preset value, that is, when the number of consecutive and identical data units is an integer greater than or equal to 2, and the number is less than a preset value, in which case the command unit is included for Command type information indicating an uncompressed type, address information indicating that the continuous and identical plurality of data units are located inside the frame, and number information indicating the continuous and identical plurality of data units, wherein Address information indicating that the consecutive and identical plurality of data units are located inside the frame includes address information in which each data unit is located inside the frame, or address information in which the first data unit of the same data unit is located inside the frame, for The number information indicating the continuous and identical plurality of data units is the number of the same data units, such as the 18th field value and the 19th field value in FIG.
  • the data unit that is, the number of consecutive and identical data units is 1, and the number is less than a preset value, in which case the command unit is included for Command information indicating an uncompressed type, address information indicating that the data unit is located inside the frame, and number information indicating the data unit, wherein the number information of the data unit is 1, as shown in FIG. Field 2222_2222, field 17 3333_3333.
  • steps S347 and S348 are placed in the buffer C until the data of the buffer B is completely processed, and the content of the buffer C is output.
  • the command type information in the command unit can be facilitated by identifying the command type information in the command unit during decompression.
  • the region is divided into internal compression of the frame and data that has not been internally compressed by the frame.
  • the existing technology is used in decompression, and only two additional decoding lines can be added to distinguish between intra-frame compression and intra-frame compression. The data.
  • FIG. 8 is a flowchart of a configuration data stream decompression processing method of the programmable logic device according to an embodiment of the present invention.
  • the present invention is also applicable to a method of performing external decompression of the frame and then decompressing the intra-frame.
  • FIG. 9 is a schematic diagram of decompressing data in a frame in a configuration data stream decompression processing method of a programmable logic device according to an embodiment of the present invention.
  • a received frame data compressed internally by a frame is as follows:
  • 8000_0001, 8010_0005, and 8067_0003 are CMD1 for CMD20002_000E and 0015_0056.
  • the decompression circuit When receiving 8000_0001, it informs the decompression circuit to directly put 0000_0000 on the corresponding address of the buffer D, and receives 0002_000E. When notified, the decompression circuit next decompresses a plurality of consecutive identical fields, followed by 0002_000E.
  • the address information indicating that the plurality of identical fields are located inside the frame and the number information for indicating the plurality of identical fields, and copying the corresponding number of 1111_1111 to the corresponding address in the frame, and then decompressing the operation get a frame of data: the 0th field value is 0000_0000; the first field value to the 15th field value data is the same, is 1111_1111; the 16th field value to the 20th field value are: 2222_2222, 3333_3333, 4444_4444, 4444_4444, 5555_5555; the 21st field value is the same as the 102nd field value, which is 6666_6666; the 103th field
  • a typical FPGA configuration data stream file compression method in the industry is a frame external frame-based unit compression processing method adopted by Xilinx XC2V40 device.
  • This embodiment uses ISE10.1 development tool and uses Verilog.
  • HDL generates a standard configuration stream file through ISE10.1, and uses the generated standard configuration stream file with ISE10.1.
  • the external frame is compressed based on the frame unit compression algorithm to obtain the compressed first compressed data stream file.
  • the XC2V40 configuration data stream file generated by ISE10.1 is used in ISE10.1.
  • the external frame is compressed based on the frame unit-based compression algorithm, and then compressed by the compression method of the frame internal data unit of the present invention to obtain a compressed second compressed data stream file obtained by the above two compression methods.
  • the file size of the compressed data stream file is shown in Table 1:
  • Input design file Standard configuration stream file size (byte) The size of the first compressed data stream file (byte) The size of the second compressed data stream file (byte) Cuonter20.v 57.4K 21.6K 11.0K Div5.v 57.4K 12.1K 8.6K Mult2.v 57.4K 13.1K 9.0K Mult4.v 57.4K 15.9K 9.7K Mult8.v 57.4K 19.7K 10.7K Mult16.v 57.4K 25.5K 12.2K Add4.v 57.4K 15.9K 9.5K Add8.v 57.4K 19.3K 10.1K Add16.v 57.4K 21.4K 11.3K Add24.v 57.4K 26.3K 13.3K
  • the compression of the compressed data stream file obtained by the above two compression methods is respectively calculated as shown in Table 2.
  • the compression ratio refers to the percentage of the result obtained by dividing the compressed file size by the size of the original file.
  • the increase ratio of the compression ratio refers to: the size of the first compressed data stream file is subtracted from the size of the second compressed data stream file, and the obtained result is divided by the size of the first compressed data stream file, and the obtained percentage is obtained. .
  • the present invention combines the compression ratio obtained by combining the conventional frame-based frame unit-based compression method with the frame internal compression method, and the compression ratio obtained by using the frame unit-based compression method alone. Increased by 42.81%. Therefore, the compression method proposed by the present invention can greatly improve the compression performance of the FPGA configuration stream file.
  • FIG. 10 is a block diagram of a configuration data stream compression processing system of a programmable logic device according to an embodiment of the present invention. Please refer to FIG. 10:
  • a data compression processing system includes a data processing module 101 to be compressed and a first compression processing module 102.
  • the data processing module 101 to be compressed is used to acquire a data frame to be compressed in the configuration data stream.
  • the first compression processing module 102 uses And compressing the data unit inside the data frame to be compressed.
  • the first compression processing module 102 is configured to perform compression processing on the data unit inside the data frame to be compressed to obtain a reference value and a command unit.
  • the first compression processing module 102 is specifically configured to compare the number of consecutive and identical data units in the statistically derived frame with a preset value, and determine whether the number of consecutive and identical data units is greater than or equal to the number. a preset value; if yes, the command unit obtained by processing the consecutive and identical plurality of data units includes command type information for indicating a compression type, and is used to represent the continuous and identical plurality of data units Address information located inside the frame and number information for indicating the continuous and identical plurality of data units; if not, the command unit obtained by processing the consecutive and identical plurality of data units or 1 data unit includes Command type information for indicating an uncompressed type, address information for indicating that the continuous and identical plurality of data units or one data unit is located inside the frame, and for indicating the continuous and identical plurality of data units or The number information of 1 data unit.
  • FIG. 11 is a block diagram of a configuration data stream compression processing system of a programmable logic device according to another embodiment of the present invention.
  • a second compression processing module 103 is further included, and the second compression processing module 103 is used for Compressing the frame units in the configuration data stream.
  • FIG. 12 is a block diagram of a configuration data stream decompression processing system of a programmable logic device according to an embodiment of the present invention. Please refer to FIG. 12:
  • a data decompression processing system includes a data processing module 121 to be decompressed and a first decompression module 122.
  • the data to be decompressed is used to obtain a data frame to be decompressed in the configuration data stream.
  • the decompression module 122 is configured to perform decompression processing on the data unit inside the data frame to be decompressed.
  • the first decompression module 122 is specifically configured to acquire a command unit and a reference value inside the data frame to be decompressed; and to perform internal data of the data frame to be decompressed according to the command unit and the reference value.
  • the unit performs decompression processing.
  • the first decompression module 122 is specifically configured to acquire command type information in the command unit; if the command type information in the command unit is a compression type, according to the command unit, the continuous Address information of the same plurality of data units located inside the frame and number information for indicating the continuous and identical plurality of data units, copying the reference value to a corresponding address within the frame; if the command unit is Command type information is an uncompressed type, according to address information in the command unit for indicating that the consecutive and identical plurality of data units or one data unit is located inside the frame and for indicating the continuous and identical The number information of a plurality of data units or 1 data unit is copied to a corresponding address within the frame.
  • FIG. 13 is a block diagram of a configuration data stream decompression processing system of a programmable logic device according to another embodiment of the present invention. Referring to FIG. 3, a second decompression module 123 is further included. The frame unit in the configuration data stream is decompressed.

Abstract

Disclosed are a method and a system for compressing and decompressing a configuration data stream of a programmable logic device. The compression method comprises: acquiring a data frame to be compressed in a configuration data stream, and compressing a data unit in the data frame to be compressed. Through the foregoing technical solution, the present invention provides a more efficient method and system for compressing and decompressing a configuration data stream of a programmable logic device.

Description

可编程逻辑器件配置数据流压缩、解压缩处理方法及系统  Programmable logic device configuration data stream compression and decompression processing method and system 技术领域Technical field
本发明涉及数据处理领域,尤其涉及一种可编程逻辑器件的配置数据流的压缩、解压缩处理方法及系统。 The present invention relates to the field of data processing, and in particular, to a method and system for compressing and decompressing a configuration data stream of a programmable logic device.
背景技术Background technique
传统的可编程逻辑器件(programmable logic device ,PLD),比如现场可编程门阵列FPGA(Field Program Gate Array)是通过相应的配置数据流进行配置的,配置数据流被下载到可编程逻辑器件,然后存储在配置存储单元中,最后根据配置存储单元的内容对可编程逻辑器件进行相应的配置,从而将可编程逻辑器件构造成用户预设的特定功能的器件。Traditional programmable logic device , PLD), such as Field Program Gate FPGA (Field Program Gate) Array) is configured by the corresponding configuration data stream, the configuration data stream is downloaded to the programmable logic device, and then stored in the configuration storage unit, and finally the programmable logic device is configured according to the content of the configuration storage unit, thereby A programmable logic device is constructed as a device of a particular function preset by a user.
通常情况下,一个设计文件中所包含的配置数据位有上百万个甚至更多,这就需要很大的外部存储器来存储配置数据流,同时配置数据流的下载操作也会相应地花费很多时间。因此,为了节省存储空间和节约下载时间,压缩配置数据流是一个很有效的技术措施。Usually, a design file contains millions or more of configuration data bits, which requires a large external memory to store the configuration data stream, and the download operation of the configuration data stream will also cost a lot. time. Therefore, in order to save storage space and save download time, compressing the configuration data stream is a very effective technical measure.
压缩一般分为有损压缩和无损压缩。,其中一个著名的的最常用的无损压缩算法是基于字典的LZ(根据原始提出人 Lempel-Ziv命名)系列。传统的FPGA开发商采用的基本上都是基于LZ的压缩算法,LZ压缩算法主要是针对字符串或者数据串(以下简称串)的压缩,如在一个缓冲器buffer中保存最新的被压缩的数据流,当有数据输入时,LZ算法就查找输入数据与缓冲器的数据的匹配性,找出最长的匹配数据,然后就输出一段编码来代替匹配的数据,编码由三部分组成,包括匹配数据串的位置,长度和紧接着匹配数据串的最后一位的字符或者数据。传统的部分FPGA是以帧frame为单位进行配置,以帧为单位进行压缩,即帧外部的压缩。图1为现有技术一种FPGA的示意图,包括FPGA11、可编程逻辑单元12和帧13,FPGA11表示FPGA的一种结构,里面的每一个虚线条表示一帧(虚线条的数目不代表任何含义,此处只是一种示意图),FPGA通过一帧一帧地完成配置。一帧数据又会包含若干个比特或字段,根据FPGA类型和容量的不同,其包含的比特或字段个数也不同,假设一帧数据包含的字段个数为m,相应的位数为 32*m;再用大写字母 W 加上下脚标来表示帧内部字段及其顺序,如图2所示,图2为现有技术一种FPGA中帧结构的示意图,用W0表示第一个字,W1表示第二个字,以此类推,最后一个字用Wm-1来表示,通常当一帧数据包含的字段个数为m时,就说这个帧的长度为m。Compression is generally divided into lossy compression and lossless compression. One of the famous most commonly used lossless compression algorithms is a dictionary-based LZ (according to the original author Lempel-Ziv named) series. The traditional FPGA developers basically use LZ-based compression algorithms. The LZ compression algorithm is mainly for the compression of strings or data strings (hereinafter referred to as strings), such as saving the latest compressed data in a buffer buffer. Stream, when there is data input, the LZ algorithm looks for the matching of the input data with the data of the buffer, finds the longest matching data, and then outputs a piece of code instead of the matched data. The encoding consists of three parts, including matching. The position, length, and character or data of the last digit of the data string. A part of the conventional FPGA is configured in units of frame frames, and is compressed in units of frames, that is, compression outside the frame. 1 is a schematic diagram of an FPGA of the prior art, including an FPGA 11, a programmable logic unit 12, and a frame 13. The FPGA 11 represents a structure of an FPGA, and each dotted line bar represents a frame (the number of dashed lines does not mean any meaning) , here is just a schematic diagram), the FPGA completes the configuration by frame by frame. A frame of data will contain a number of bits or fields. Depending on the type and capacity of the FPGA, the number of bits or fields it contains will be different. Suppose that the number of fields in a frame of data is m, and the corresponding number of bits is 32*m; use uppercase letter W The lower footer is used to indicate the internal field of the frame and its order. As shown in FIG. 2, FIG. 2 is a schematic diagram of a frame structure in an FPGA in the prior art. The first word is represented by W0, and the second word is represented by W1. In this way, the last word is represented by Wm-1. Usually, when the number of fields included in one frame of data is m, the length of this frame is said to be m.
传统的帧外部进行压缩的方法在一定程度上考虑了FPGA本身的结构特征和编程特点,但是没有考虑到帧内部的数据特征,因此传统的帧外部基于帧单元进行压缩的方法存在一定的局限性,效率较低。The traditional method of external compression of the frame considers the structural characteristics and programming features of the FPGA to some extent, but does not take into account the data characteristics inside the frame. Therefore, the traditional method of compressing the frame based on the frame unit has certain limitations. , low efficiency.
技术问题technical problem
本发明提供一种更加高效的可编程逻辑器件的配置数据流的压缩、解压缩处理方法及系统。 The present invention provides a more efficient method and system for compressing and decompressing a configuration data stream of a programmable logic device.
技术解决方案Technical solution
为解决上述技术问题,本发明采用以下技术方案:In order to solve the above technical problems, the present invention adopts the following technical solutions:
一种可编程逻辑器件的配置数据流的压缩处理方法,包括:A method for compressing a configuration data stream of a programmable logic device, comprising:
获取所述配置数据流中待压缩处理的数据帧;Obtaining a data frame to be compressed in the configuration data stream;
对所述待压缩处理的数据帧内部的数据单元进行压缩处理。Compressing the data unit inside the data frame to be compressed.
所述数据单元包括一个或多个比特值,或者所述数据单元包括一个或多个字段值。The data unit includes one or more bit values, or the data unit includes one or more field values.
对所述待压缩处理的数据帧内部的数据单元进行压缩处理后得到参考值和命令单元。Performing compression processing on the data unit inside the data frame to be compressed to obtain a reference value and a command unit.
对所述待压缩处理的数据帧内部的数据单元进行压缩处理后得到参考值和命令单元的过程具体为:The process of obtaining the reference value and the command unit after performing compression processing on the data unit inside the data frame to be compressed is specifically:
将由统计得出的帧内部连续且相同的数据单元的数目与一预设值比较,判断所述连续且相同的数据单元的数目是否大于或等于所述预设值;Determining whether the number of consecutive and identical data units is greater than or equal to the preset value by comparing the number of consecutive and identical data units in the frame obtained by the statistics with a preset value;
如果是,对所述连续且相同的多个数据单元进行处理后得到的命令单元包括用于表示压缩类型的命令类型信息、用于表示所述连续且相同的多个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元的数目信息;If yes, the command unit obtained by processing the consecutive and identical plurality of data units includes command type information for indicating a compression type, and an address for indicating that the consecutive and identical plurality of data units are located inside the frame Information and number information for indicating the plurality of consecutive and identical data units;
如果否,对所述连续且相同的多个数据单元或1个数据单元进行处理后得到的命令单元包括用于表示非压缩类型的命令类型信息、用于表示所述连续且相同的多个数据单元或1个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元或1个数据单元的数目信息。If not, the command unit obtained by processing the consecutive and identical plurality of data units or 1 data unit includes command type information for indicating an uncompressed type, and is used to represent the continuous and identical plurality of data. The unit or one data unit is located in the address information inside the frame and is used to indicate the number information of the consecutive and identical plurality of data units or one data unit.
所述预设值为大于或等于3的整数。The preset value is an integer greater than or equal to 3.
还包括:Also includes:
对所述配置数据流中的帧单元进行压缩处理。Compressing the frame units in the configuration data stream.
一种可编程逻辑器件的配置数据流的解压缩处理方法,包括:A method for decompressing a configuration data stream of a programmable logic device, comprising:
获取所述配置数据流中待解压缩处理的数据帧; Obtaining a data frame to be decompressed in the configuration data stream;
对所述待解压缩处理的数据帧内部的数据单元进行解压缩处理。Decompressing the data unit inside the data frame to be decompressed.
对所述待解压缩处理的数据帧内部的数据单元进行解压缩处理的过程具体为: The process of decompressing the data unit inside the data frame to be decompressed is specifically:
获取所述待解压缩处理的数据帧内部的命令单元和参考值;Obtaining a command unit and a reference value inside the data frame to be decompressed;
根据所述命令单元和参考值对所述待解压缩处理的数据帧内部的数据单元进行解压缩处理。And decompressing the data unit inside the data frame to be decompressed according to the command unit and the reference value.
根据所述命令单元和参考值对所述待解压缩处理的数据帧内部的数据单元进行解压缩处理的过程具体为:The process of decompressing the data unit inside the data frame to be decompressed according to the command unit and the reference value is specifically:
获取所述命令单元中的命令类型信息;Obtaining command type information in the command unit;
如果所述命令单元中的命令类型信息为压缩类型,则根据所述命令单元中用于表示所述连续且相同的多个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元的数目信息,将所述参考值复制到帧内的相应地址上; If the command type information in the command unit is a compression type, according to the address information in the command unit for indicating that the consecutive and identical plurality of data units are located inside the frame and for indicating the continuous and the same Number information of the plurality of data units, the reference value is copied to a corresponding address in the frame;
如果所述命令单元中的命令类型信息为非压缩类型,则根据所述命令单元中用于表示所述连续且相同的多个数据单元或1个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元或1个数据单元的数目信息,将所述参考值复制到帧内的相应地址上。If the command type information in the command unit is an uncompressed type, according to the address information in the command unit for indicating that the consecutive and identical plurality of data units or one data unit are located inside the frame and for indicating The number information of the consecutive and identical plurality of data units or 1 data unit copies the reference value to a corresponding address within the frame.
还包括:Also includes:
对所述配置数据流中的帧单元进行解压缩处理。Decompressing the frame units in the configuration data stream.
一种可编程逻辑器件的配置数据流的压缩处理系统,包括待压缩处理数据获取模块和第一压缩处理模块,其中,A compression processing system for configuring a data stream of a programmable logic device, comprising: a data acquisition module to be compressed and a first compression processing module, wherein
所述待压缩处理数据获取模块用于获取所述配置数据流中待压缩处理的数据帧;The data processing module to be compressed is used to acquire a data frame to be compressed in the configuration data stream;
所述第一压缩处理模块用于对所述待压缩处理的数据帧内部的数据单元进行压缩处理。The first compression processing module is configured to perform compression processing on the data unit inside the data frame to be compressed.
所述第一压缩处理模块用于对所述待压缩处理的数据帧内部的数据单元进行压缩处理后得到参考值和命令单元。The first compression processing module is configured to perform compression processing on the data unit inside the data frame to be compressed to obtain a reference value and a command unit.
所述第一压缩处理模块具体用于:将由统计得出的帧内部连续且相同的数据单元的数目与一预设值比较,判断所述连续且相同的数据单元的数目是否大于或等于所述预设值;如果是,则对所述连续且相同的多个数据单元进行处理后得到的命令单元包括用于表示压缩类型的命令类型信息、用于表示所述连续且相同的多个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元的数目信息;如果否,对所述连续且相同的多个数据单元或1个数据单元进行处理得到的命令单元包括用于表示非压缩类型的命令类型信息、用于表示所述连续且相同的多个数据单元或1个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元或1个数据单元的数目信息。The first compression processing module is specifically configured to: compare the number of consecutive and identical data units in the statistically derived frame with a preset value, and determine whether the number of the consecutive and identical data units is greater than or equal to the a preset value; if yes, the command unit obtained by processing the consecutive and identical plurality of data units includes command type information for indicating a compression type, and is used to represent the continuous and identical plurality of data units Address information located inside the frame and number information for indicating the continuous and identical plurality of data units; if not, the command unit obtained by processing the consecutive and identical plurality of data units or 1 data unit includes Command type information for indicating an uncompressed type, address information for indicating that the continuous and identical plurality of data units or one data unit is located inside the frame, and for indicating the continuous and identical plurality of data units or The number information of 1 data unit.
还包括第二压缩处理模块,所述第二压缩处理模块用于对所述配置数据流中的帧单元进行压缩处理。A second compression processing module is further included, the second compression processing module is configured to perform compression processing on the frame unit in the configuration data stream.
一种可编程逻辑器件的配置数据流的解压缩处理系统,包括待解压缩处理数据获取模块和第一解压缩模块,其中:A decompression processing system for configuring a data stream of a programmable logic device, comprising: a data acquisition module to be decompressed and a first decompression module, wherein:
所述待解压缩处理数据获取模块用于获取所述配置数据流中待解压缩处理的数据帧; The data to be decompressed processing module is configured to acquire a data frame to be decompressed in the configuration data stream;
所述第一解压缩模块用于对所述待解压缩数据帧内部的数据单元进行解压缩处理。The first decompression module is configured to perform decompression processing on the data unit inside the data frame to be decompressed.
所述第一解压缩模块具体用于获取所述待解压缩处理的数据帧内部的命令单元和参考值;根据所述命令单元和参考值对所述待解压缩处理的数据帧内部的数据单元进行解压缩处理。The first decompression module is specifically configured to acquire a command unit and a reference value inside the data frame to be decompressed; and to use a data unit in the data frame to be decompressed according to the command unit and the reference value. Perform decompression processing.
所述第一解压缩模块具体用于获取所述命令单元中的命令类型信息;如果所述命令单元中的命令类型信息为压缩类型,则根据所述命令单元中用于表示所述连续且相同的多个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元的数目信息,将所述参考值复制到帧内的相应地址上;如果所述命令单元中的命令类型信息为非压缩类型,则根据所述命令单元中用于表示所述连续且相同的多个数据单元或1个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元或1个数据单元的数目信息,将所述参考值复制到帧内的相应地址上。The first decompression module is specifically configured to acquire command type information in the command unit; if the command type information in the command unit is a compression type, according to the command unit, the continuous and identical Address data of the plurality of data units located inside the frame and number information for indicating the continuous and identical plurality of data units, copying the reference value to a corresponding address within the frame; if in the command unit The command type information is an uncompressed type, and according to the address information in the command unit for indicating that the consecutive and identical multiple data units or one data unit are located inside the frame, and for indicating the continuous and the same The number of data units or the number of data units is copied to the corresponding address within the frame.
还包括第二解压缩模块,所述第二解压缩模块用于对所述配置数据流中的帧单元进行解压缩处理。A second decompression module is further included, and the second decompression module is configured to perform decompression processing on the frame unit in the configuration data stream.
本发明提供一种可编程逻辑器件的配置数据流的压缩、解压缩处理方法及系统,压缩方法中包括对待压缩处理的数据帧内部的数据单元进行压缩处理,通过对帧内部的数据单元进行压缩,提高压缩效率,本发明还可以通过设置预设值,针对数据帧或帧内部数据单元的特点,选择最佳的压缩比,因此,还具有很强的灵活性。The present invention provides a compression and decompression processing method and system for a configuration data stream of a programmable logic device, wherein the compression method includes performing compression processing on data units inside a data frame to be compressed, and compressing data units inside the frame. In order to improve the compression efficiency, the present invention can also select an optimal compression ratio for the characteristics of the data frame or the internal data unit of the frame by setting a preset value, and therefore, has a strong flexibility.
附图说明DRAWINGS
图1为现有技术一种FPGA的示意图;1 is a schematic diagram of an FPGA of the prior art;
图2为现有技术一种FPGA中帧结构的示意图;2 is a schematic diagram of a frame structure in an FPGA in the prior art;
图3为本发明实施例一种可编程逻辑器件的配置数据流压缩处理方法的流程图;3 is a flowchart of a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention;
图4为本发明实施例一种可编程逻辑器件的配置数据流压缩处理方法中帧内部压缩方法的流程图;4 is a flowchart of a method for compressing a frame in a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention;
图5为本发明实施例对数目大于或等于该预设值的连续且相同的多个数据单元进行处理后得到的命令单元的结构示意图;FIG. 5 is a schematic structural diagram of a command unit obtained by processing a plurality of consecutive and identical data units whose number is greater than or equal to the preset value according to an embodiment of the present invention;
图6为本发明实施例对数目小于该预设值的连续且相同的多个或1个数据单元进行处理后得到的命令单元的结构示意图;FIG. 6 is a schematic structural diagram of a command unit obtained by processing a plurality of consecutive or identical data units having a number smaller than the preset value according to an embodiment of the present invention;
图7为本发明实施例一种可编程逻辑器件的配置数据流压缩处理方法中帧内部压缩数据的示意图;7 is a schematic diagram of internal compressed data of a frame in a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention;
图8为本发明实施例一种可编程逻辑器件的配置数据流解压缩处理方法的流程图;8 is a flowchart of a configuration data stream decompression processing method of a programmable logic device according to an embodiment of the present invention;
图9为本发明实施例一种可编程逻辑器件的配置数据流解压缩处理方法中帧内部解压缩数据的示意图;FIG. 9 is a schematic diagram of decompressing data in a frame in a configuration data stream decompression processing method of a programmable logic device according to an embodiment of the present invention; FIG.
图10为本发明实施例一种可编程逻辑器件的配置数据流压缩处理系统的模块图;10 is a block diagram of a configuration data stream compression processing system of a programmable logic device according to an embodiment of the present invention;
图11为本发明另一实施例一种可编程逻辑器件的配置数据流压缩处理系统的模块图;11 is a block diagram of a configuration data stream compression processing system of a programmable logic device according to another embodiment of the present invention;
图12本发明实施例一种可编程逻辑器件的配置数据流解压缩处理系统的模块图;12 is a block diagram of a configuration data stream decompression processing system of a programmable logic device according to an embodiment of the present invention;
图13本发明另一实施例一种可编程逻辑器件的配置数据流解压缩处理系统的模块图。FIG. 13 is a block diagram of a configuration data stream decompression processing system of a programmable logic device according to another embodiment of the present invention.
本发明的实施方式Embodiments of the invention
下面通过具体实施方式结合附图对本发明作进一步详细说明。The present invention will be further described in detail below with reference to the accompanying drawings.
一种可编程逻辑器件的配置数据流的压缩处理方法,包括:A method for compressing a configuration data stream of a programmable logic device, comprising:
获取所述配置数据流中待压缩处理的数据帧;Obtaining a data frame to be compressed in the configuration data stream;
对所述待压缩处理的数据帧内部的数据单元进行压缩处理。Compressing the data unit inside the data frame to be compressed.
图3为本发明实施例一种可编程逻辑器件的配置数据流压缩处理方法的流程图,请参考图3,本实施例以FPGA配置数据流的压缩方法为例:FIG. 3 is a flowchart of a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention. Referring to FIG. 3, this embodiment uses a compression method of an FPGA configuration data stream as an example:
S31、利用设计文件产生数据流;S31. Generate a data stream by using a design file.
S32、判断是否可以进行帧外部基于帧单元的压缩处理,若是,则执行步骤S33,否则执行步骤S34;S32, it is determined whether the frame outside frame unit based compression processing can be performed, and if so, step S33 is performed, otherwise step S34 is performed;
S33、对数据流进行帧外部基于帧单元的压缩处理,帧外部帧单元的压缩结束后,执行S34;S33, performing frame-based frame unit-based compression processing on the data stream, after the compression of the frame external frame unit is completed, executing S34;
S34、对数据流进行帧内部基于帧内部数据单元的压缩处理;S34: Perform a compression process on the data stream based on the internal data unit of the frame;
S35、将压缩结果存储到压缩数据流存储器中。S35. Store the compression result in the compressed data stream memory.
本实施例优选的是先进行帧外部压缩,再进行帧内部压缩,本发明还适用于先进行帧内部压缩,再进行帧外部压缩的方法。In this embodiment, it is preferable to perform external compression of the frame and then perform internal compression of the frame. The present invention is also applicable to a method of performing internal compression of the frame and then external compression of the frame.
其中步骤S34对数据流进行帧内部压缩的具体过程包括:The specific process of performing intra-frame compression on the data stream in step S34 includes:
将由统计得出的帧内部连续且相同的数据单元的数目与一预设值比较,判断该连续且相同的数据单元的数目是否大于或等于所述预设值;如果是,则判断结果为满足压缩条件,对满足压缩条件的连续且相同的多个数据单元进行压缩处理。Comparing the number of consecutive and identical data units in the frame obtained by the statistics with a preset value, determining whether the number of consecutive and identical data units is greater than or equal to the preset value; if yes, the determination result is satisfied The compression condition performs compression processing on a plurality of consecutive and identical data units that satisfy the compression condition.
根据数据流中的数据类型不同,数据单元可以是比特值或字段值或其他,其压缩和解压缩方法相类似。本发明不局限于以一个比特值或一个字段值为数据单元进行压缩,还可以以多个比特值或多个字段值为一个数据单元进行压缩,预设值为大于或等于3的整数。Depending on the type of data in the data stream, the data unit can be a bit value or a field value or the like, and the compression and decompression methods are similar. The present invention is not limited to compression with a bit value or a field value as a data unit, and may also be compressed with a plurality of bit values or a plurality of field values as one data unit, and the preset value is an integer greater than or equal to 3.
图4为本发明实施例一种可编程逻辑器件的配置数据流压缩处理方法中帧内部压缩方法的流程图,请参考图4,本实施例中一个数据单元为帧内的一个字段值:4 is a flowchart of a method for compressing a frame in a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention. Referring to FIG. 4, in this embodiment, a data unit is a field value in a frame:
S341、将数据流加载到缓冲器A中,优选的,缓冲器A的大小比一帧的配置数据长度多出一位,用作标志位,优选的标志位为缓冲器A的第一位;S341, loading the data stream into the buffer A. Preferably, the size of the buffer A is one bit longer than the configuration data length of one frame, and is used as a flag bit. The preferred flag bit is the first bit of the buffer A;
S342、判断数据流是否进行过帧外部基于帧单元的压缩处理,本实施例可以通过帧外部基于帧单元的压缩处理后,帧所附带的帧压缩命令或者其他标志来判断,若是,则执行S343,否则执行S344;S342: Determine whether the data stream is subjected to frame-based external unit frame-based compression processing. In this embodiment, the frame compression command or other flag attached to the frame after the frame unit-based compression processing is used to determine, if yes, execute S343. Otherwise, execute S344;
S343、在步骤S341中缓冲器A所预留的标志位,即缓冲器A的第一位上写进“1”标志,执行S345;S343, in the step S341, the flag bit reserved by the buffer A, that is, the first bit of the buffer A is written with a "1" flag, and S345 is executed;
S344、在步骤S341中缓冲器A所预留的标志位,即缓冲器A的第一位上写进“0”标志,执行S345;S344, in step S341, the flag bit reserved by the buffer A, that is, the first bit of the buffer A is written with a "0" flag, and S345 is executed;
S345、将缓冲器A中的数据流复制到同样大小的缓冲器B中,复制完之后缓冲器A继续接收新的数据流,缓冲器B除了第一位之外,其他的都是经过编址的,其中基本的编址单元是一个字段,即32位为一个编址单位,比如:缓冲器B大小为106×32位(bits),有106个字段,对每个字段进行编址,地址是1-106,用二进制表示是00000001-01101010,用十六进制表示是00-6A; S345, copying the data stream in the buffer A to the buffer B of the same size, after the copying, the buffer A continues to receive the new data stream, and the buffer B is addressed except the first bit. The basic addressing unit is a field, that is, 32 bits is an addressing unit. For example, the buffer B size is 106×32 bits, and there are 106 fields, and each field is addressed, and the address is addressed. Is 1-106, expressed in binary is 00000001-01101010, expressed in hexadecimal is 00-6A;
S346、以一个字段值为一个数据单位,处理的顺序按照缓冲器B的地址由低到高来进行,依次处理每一个字段,统计连续且相同的该字段值的数目,将其与一预设值比较,判断连续且相同的该字段值的数目是否大于或等于该预设值,如果是,则执行S347,否则,执行S348;S346, wherein one field value is one data unit, and the processing sequence is performed according to the address of the buffer B from low to high, and each field is processed in turn, and the number of consecutive and identical field values is counted, and a preset is made. Value comparison, determining whether the number of consecutive and identical field values is greater than or equal to the preset value, and if so, executing S347, otherwise, executing S348;
S347、对数目大于或等于该预设值的连续且相同多个字段值进行处理后得到以下形式:命令单元+参考值。其中命令单元包括用于表示压缩类型的命令类型信息、用于表示所述连续且相同的多个字段值位于帧内部的地址信息和用于表示所述连续且相同的多个字段值的数目信息,执行S349; S347. Process the consecutive and identical multiple field values of the number greater than or equal to the preset value to obtain the following form: command unit + reference value. Wherein the command unit includes command type information for indicating a compression type, address information for indicating that the continuous and identical plurality of field values are located inside the frame, and number information for indicating the continuous and identical plurality of field values , execute S349;
图5为本发明实施例对数目大于或等于该预设值的连续且相同的多个数据单元进行处理后得到的命令单元的结构示意图,请参考图5,本实施例的命令单元为命令字段,这个命令字段的宽度可以是32bit,其中第一部分内容用于表示压缩类型的命令类型信息,可以用1个二进制位“0”来标识,表示该命令类型的为压缩类型,第二部分内容用于表示所述连续且相同的多个字段值位于帧内部的地址信息,地址信息指一帧数据内每个字段所在的顺序或者编号,也可以是这些被压缩的连续且相同的多个字段值中的第一个字段值的地址信息,由于这些字段是连续的,因此知道第一个字段的地址信息之后,可以推算其他字段的地址信息;第三部分内容用于表示所述连续且相同的多个字段值的数目信息。FIG. 5 is a schematic structural diagram of a command unit obtained by processing a plurality of consecutive and identical data units whose number is greater than or equal to the preset value according to an embodiment of the present invention. Referring to FIG. 5, the command unit in this embodiment is a command field. The width of the command field may be 32 bits, wherein the first part of the content is used to indicate the command type information of the compression type, and may be identified by one binary bit “0”, indicating that the command type is a compression type, and the second part is used. The address information indicating that the consecutive and identical multiple field values are located inside the frame, the address information refers to the order or number of each field in a frame of data, or may be the compressed consecutive and identical multiple field values. Address information of the first field value in the field, since these fields are continuous, after knowing the address information of the first field, the address information of other fields can be estimated; the third part is used to indicate the continuous and identical The number information of multiple field values.
S348、对数目小于该预设值的连续且相同多个字段值或1个字段值进行处理后得到以下形式:命令单元+参考值,命令单元包括用于表示非压缩类型的命令类型信息、用于表示所述连续且相同的多个数据单元或1个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元或1个数据单元的数目信息,执行S349;S348. Process the consecutive and identical multiple field values or one field value that is less than the preset value to obtain the following form: command unit + reference value, where the command unit includes command type information for indicating an uncompressed type, S349 is performed to indicate that the consecutive and identical plurality of data units or one data unit is located inside the frame and the number information indicating the continuous and identical plurality of data units or one data unit, S349;
图6为本发明实施例对数目小于该预设值的连续且相同的多个或1个数据单元进行处理后得到的命令单元的结构示意图,请参考图6,本实施例的命令单元为命令字段,这个命令字的宽度可以是32bit,其结构、格式和含义类似于上述对数目大于或等于预设值的连续且相同的多个数据单元进行压缩处理后得到的命令单元,其中第一部分内容用于表示非压缩类型,最高位,即第31位用1个二进制位“1”来标识,表示该命令类型为非压缩类型,第二部分内容用于表示数目小于该预设值的连续且相同的多个字段值或1个字段值位于帧内部的地址信息,地址信息指一帧数据内每个字段所在的顺序或者编号,也可以是这些字段中第一个字段的地址信息,由于这些字段是连续的,因此,知道第一个字段的地址信息之后,可以推算其他字段的地址信息;第三部分内容用于表示所述连续且相同的多个字段值或1个字段值的数目信息。FIG. 6 is a schematic structural diagram of a command unit obtained by processing a plurality of consecutive or identical data units having a number smaller than the preset value according to an embodiment of the present invention. Referring to FIG. 6, the command unit in this embodiment is an instruction. Field, the width of the command word may be 32 bits, and its structure, format and meaning are similar to the above-mentioned command unit obtained by compressing a plurality of consecutive and identical data units whose number is greater than or equal to a preset value, wherein the first part of the content Used to indicate the uncompressed type, the highest bit, that is, the 31st bit is identified by 1 binary bit "1", indicating that the command type is uncompressed, and the second part is used to indicate that the number is less than the preset value and The same multiple field value or one field value is located in the address information inside the frame, the address information refers to the order or number of each field in a frame of data, or the address information of the first field in these fields, due to these The fields are contiguous, so after knowing the address information of the first field, the address information of other fields can be extrapolated; the third part is used for the table. The number information of the continuous and identical plurality of field values or 1 field value is shown.
图7为本发明实施例一种可编程逻辑器件的配置数据流压缩处理方法中帧内部压缩数据的示意图,请参考图7,假设一帧数据的长度 m=106,根据命令字段的定义,其地址编码从 0000到0069,指向相应的字段,而每个字段的内容也被数据填满了,这里的地址和字段值都是用十六进制表示,字段值的省略部分表示相同的若干个字段值,而地址的省略部分表示递增的若干个地址值,第0个字段值为:0000_0000;第1个字段值到第15个字段值相同,为1111_1111;第16个字段值到第20字段值分别为:2222_2222,3333_3333, 4444_4444,4444_4444,5555_5555;第21个字段值到第102个字段值相同,为6666_6666;第103个字段值到105个字段值分别为:7777_7777,6666_6666,6666_6666,假设预设值为10,假设本实施例对数目大于或等于预设值的连续且相同的多个字段值进行压缩处理后得到的命令单元为CMD1, 对数目小于预设值的连续且相同的多个或1个字段值进行处理得到的命令单元为CMD2,则处理过程为:由于第0个字段值的数目为1,所以将其处理为CMD2,0000_0000,即命令单元和参考值,参考值为该字段值本身,第1个字段值到第15个字段值连续且相同,连续且相同的字段值的数目为15,大于预设值,所以将其压缩为:CMD1, 1111_1111,即命令单元和参考值,参考值为该字段值本身,同理,剩下的字段值分别处理为:CMD2, 2222_2222,3333_3333, 4444_4444,4444_4444,5555_5555; CMD1,6666_6666; CMD2,7777_7777,6666_6666,6666_6666 。FIG. 7 is a schematic diagram of internal compressed data of a frame in a configuration data stream compression processing method of a programmable logic device according to an embodiment of the present invention. Referring to FIG. 7, assuming a frame data length m=106, according to the definition of the command field, its address is encoded from 0000 to 0069, pointing to the corresponding field, and the content of each field is also filled with data, where the address and field values are expressed in hexadecimal, the omitted part of the field value represents the same number of field values, The omitted part of the address indicates an increment of several address values, the 0th field value is: 0000_0000; the first field value to the 15th field value are the same, being 1111_1111; the 16th field value to the 20th field value are respectively :2222_2222,3333_3333, 4444_4444, 4444_4444, 5555_5555; the 21st field value is the same as the 102nd field value, which is 6666_6666; the 103th field value to 105 field values are: 7777_7777, 6666_6666, 6666_6666, assuming the default value is 10, assuming this An embodiment obtains a command unit obtained by compressing a plurality of consecutive and identical plurality of field values that are greater than or equal to a preset value, and is a CMD1, The command unit obtained by processing the consecutive and identical multiple or one field values whose number is less than the preset value is CMD2, and the process is: since the number of the 0th field value is 1, it is processed as CMD2, 0000_0000, that is, the command unit and the reference value, the reference value is the field value itself, the first field value to the 15th field value are consecutive and identical, and the number of consecutive and identical field values is 15, which is greater than the preset value, so Its compression is: CMD1, 1111_1111, that is, the command unit and the reference value, the reference value is the value of the field itself. Similarly, the remaining field values are respectively processed as: CMD2, 2222_2222, 3333_3333, 4444_4444, 4444_4444, 5555_5555; CMD1, 6666_6666; CMD2, 7777_7777, 6666_6666, 6666_6666.
具体化CMD1和CMD2,就可以得到:8000_0001,0000_0000,0002_000E, 1111_1111,8010_0005,2222_2222,3333_3333, 4444_4444,4444_4444,5555_5555,0015_0056,6666_6666,8067_0003,7777_7777,6666_6666,6666_6666。By specifying CMD1 and CMD2, you can get: 8000_0001, 0000_0000, 0002_000E, 1111_1111, 8010_0005, 2222_2222, 3333_3333, 4444_4444, 4444_4444, 5555_5555, 0015_0056, 6666_6666, 8067_0003, 7777_7777, 6666_6666, 6666_6666.
在这个实施例中,可以将一帧的106个字段压缩成16个字段,提高了数据压缩的效率。In this embodiment, 106 fields of one frame can be compressed into 16 fields, which improves the efficiency of data compression.
数目小于预设值的多个连续且相同的数据单元,即当连续且相同的数据单元的数目为大于或等于2的整数,且该数目小于预设值,这种情况其命令单元包括用于表示非压缩类型的命令类型信息、用于表示所述连续且相同的多个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元的数目信息,其中,用于表示所述连续且相同的多个数据单元位于帧内部的地址信息包括各个数据单元位于帧内部的地址信息,或者是这些相同数据单元中的第一个数据单元位于帧内部的地址信息,用于表示所述连续且相同的多个数据单元的数目信息为这些相同数据单元的数目,如图7中的第18个字段值和第19字段值:4444_4444,4444_4444;数目小于预设值的1个数据单元,即连续且相同的数据单元的数目为1,且该数目小于预设值,这种情况其命令单元包括用于表示非压缩类型的命令类型信息、用于表示该数据单元位于帧内部的地址信息和用于表示该数据单元的数目信息,其中该数据单元的数目信息为1,如图7中的第16个字段2222_2222,第17字段3333_3333。a plurality of consecutive and identical data units having a number less than a preset value, that is, when the number of consecutive and identical data units is an integer greater than or equal to 2, and the number is less than a preset value, in which case the command unit is included for Command type information indicating an uncompressed type, address information indicating that the continuous and identical plurality of data units are located inside the frame, and number information indicating the continuous and identical plurality of data units, wherein Address information indicating that the consecutive and identical plurality of data units are located inside the frame includes address information in which each data unit is located inside the frame, or address information in which the first data unit of the same data unit is located inside the frame, for The number information indicating the continuous and identical plurality of data units is the number of the same data units, such as the 18th field value and the 19th field value in FIG. 7: 4444_4444, 4444_4444; the number is less than the preset value The data unit, that is, the number of consecutive and identical data units is 1, and the number is less than a preset value, in which case the command unit is included for Command information indicating an uncompressed type, address information indicating that the data unit is located inside the frame, and number information indicating the data unit, wherein the number information of the data unit is 1, as shown in FIG. Field 2222_2222, field 17 3333_3333.
S349、将步骤S347和S348的处理结果放到缓冲器C中,直到缓冲器B的数据完全被处理,再将缓冲器C的内容输出。S349. The processing results of steps S347 and S348 are placed in the buffer C until the data of the buffer B is completely processed, and the content of the buffer C is output.
本实施例通过命令单元中的命令类型信息,即用于表示压缩类型的命令类型信息和用于表示非压缩类型的命令类型信息,在解压缩时可以通过识别命令单元中的命令类型信息,方便地区分经过帧内部压缩和未经过帧内部压缩的数据,优先的,在解压缩时利用现有的技术,只需增加两根译码线,就可以区分经过帧内部压缩和未经过帧内部压缩的数据。In this embodiment, the command type information in the command unit, that is, the command type information for indicating the compression type and the command type information for indicating the uncompressed type, can be facilitated by identifying the command type information in the command unit during decompression. The region is divided into internal compression of the frame and data that has not been internally compressed by the frame. First, the existing technology is used in decompression, and only two additional decoding lines can be added to distinguish between intra-frame compression and intra-frame compression. The data.
本实施例还包括一种数据解压缩处理方法,图8为本发明实施例一种可编程逻辑器件的配置数据流解压缩处理方法的流程图,请参考图8:The embodiment further includes a data decompression processing method. FIG. 8 is a flowchart of a configuration data stream decompression processing method of the programmable logic device according to an embodiment of the present invention.
S81、获取待解压缩处理的数据流,放入缓冲器D中;S81. Acquire a data stream to be decompressed and put it into the buffer D.
S82、对数据帧进行解析,判断是否经过帧内部数据单元的压缩处理,若是,则执行S83,否则执行步骤S84;S82, parsing the data frame, determining whether the compression processing of the internal data unit of the frame is passed, and if so, executing S83, otherwise executing step S84;
S83、对帧内部的数据单元进行解压缩处理,结束帧内部解压缩处理之后,执行S84;S83, performing decompression processing on the data unit inside the frame, and ending the internal decompression processing of the frame, executing S84;
S84、将经过帧内部解压缩处理和未经过帧内部解压缩处理的数据帧放入缓冲器D中,并检测缓冲器D中第一位的值是否为“1”,若是则执行S85,否则执行S86;S84. Put the data frame that has undergone intra-frame decompression processing and the intra-frame decompression processing into the buffer D, and detect whether the value of the first bit in the buffer D is “1”, and if yes, execute S85, otherwise Execute S86;
S85、进行帧外部基于帧单元的解压缩处理,执行S87;S85, performing frame-based frame unit-based decompression processing, executing S87;
S86、不进行帧外部基于帧单元的解压缩处理,执行S87; S86, without frame external frame unit based decompression processing, executing S87;
S87、将步骤S85和S86得到的数据流下载到FPGA中;S87. Download the data stream obtained in steps S85 and S86 to the FPGA.
本实施例优选的是先进行帧内部解压缩,再进行帧外部解压缩,本发明还适用于先进行帧外部解压缩,再进行帧内部解压缩的方法。In this embodiment, it is preferable to perform intra-frame decompression and then external decompression of the frame. The present invention is also applicable to a method of performing external decompression of the frame and then decompressing the intra-frame.
图9为本发明实施例一种可编程逻辑器件的配置数据流解压缩处理方法中帧内部解压缩数据的示意图,请参考图9,比如接收到的经过帧内部压缩的一帧数据如下:FIG. 9 is a schematic diagram of decompressing data in a frame in a configuration data stream decompression processing method of a programmable logic device according to an embodiment of the present invention. Referring to FIG. 9, for example, a received frame data compressed internally by a frame is as follows:
8000_0001,0000_0000,0002_000E, 1111_1111,8010_0005,2222_2222,3333_3333, 4444_4444,4444_4444,5555_5555,0015_0056,6666_6666,8067_0003,7777_7777,6666_6666,6666_6666。8000_0001, 0000_0000, 0002_000E, 1111_1111, 8010_0005, 2222_2222, 3333_3333, 4444_4444, 4444_4444, 5555_5555, 0015_0056, 6666_6666, 8067_0003, 7777_7777, 6666_6666, 6666_6666.
其中8000_0001、8010_0005和8067_0003为CMD2,0002_000E和0015_0056为CMD1。Among them, 8000_0001, 8010_0005, and 8067_0003 are CMD1 for CMD20002_000E and 0015_0056.
当接收到8000_0001时,就通知解压电路直接将0000_0000放到缓冲器D相应的地址上,接收到0002_000E 时,就通知解压电路接下来要对连续的多个相同字段进行解压缩操作,紧接着根据0002_000E 中用于表示该多个相同字段位于帧内部的地址信息和用于表示该多个相同字段的数目信息,将相应数目的1111_1111复制到帧内的相应地址上,接下来的解压缩操作依次类推,得到一帧数据:第0个字段值为0000_0000;第1个字段值到第15个字段值数据相同,为1111_1111;第16个字段值到第20个字段值分别为:2222_2222,3333_3333, 4444_4444,4444_4444,5555_5555;第21个字段值到第102个字段值相同,为6666_6666;第103个字段值到第105个字段值分别为7777_7777,6666_6666,6666_6666。When receiving 8000_0001, it informs the decompression circuit to directly put 0000_0000 on the corresponding address of the buffer D, and receives 0002_000E. When notified, the decompression circuit next decompresses a plurality of consecutive identical fields, followed by 0002_000E The address information indicating that the plurality of identical fields are located inside the frame and the number information for indicating the plurality of identical fields, and copying the corresponding number of 1111_1111 to the corresponding address in the frame, and then decompressing the operation , get a frame of data: the 0th field value is 0000_0000; the first field value to the 15th field value data is the same, is 1111_1111; the 16th field value to the 20th field value are: 2222_2222, 3333_3333, 4444_4444, 4444_4444, 5555_5555; the 21st field value is the same as the 102nd field value, which is 6666_6666; the 103th field value to the 105th field value are 7777_7777, 6666_6666, 6666_6666, respectively.
目前业界典型的一种FPGA配置数据流文件压缩方法是Xilinx公司XC2V40器件采用的帧外部基于帧单元的压缩处理方法,本实施例采用ISE10.1开发工具,用Verilog HDL作为设计的输入文件,通过ISE10.1生成标准配置流文件,将生成的标准配置流文件用ISE10.1 自带的帧外部基于帧单元的压缩算法进行压缩,获得压缩后的第一压缩数据流文件;另外将ISE10.1生成的XC2V40配置数据流文件在采用ISE10.1 自带的帧外部基于帧单元的压缩算法进行压缩的基础上,再采用本发明帧内部数据单元的压缩方法进行压缩,获得压缩后的第二压缩数据流文件,由上述两种压缩方法获得的压缩数据流文件的文件大小如表1所示: At present, a typical FPGA configuration data stream file compression method in the industry is a frame external frame-based unit compression processing method adopted by Xilinx XC2V40 device. This embodiment uses ISE10.1 development tool and uses Verilog. As the input file of the design, HDL generates a standard configuration stream file through ISE10.1, and uses the generated standard configuration stream file with ISE10.1. The external frame is compressed based on the frame unit compression algorithm to obtain the compressed first compressed data stream file. In addition, the XC2V40 configuration data stream file generated by ISE10.1 is used in ISE10.1. The external frame is compressed based on the frame unit-based compression algorithm, and then compressed by the compression method of the frame internal data unit of the present invention to obtain a compressed second compressed data stream file obtained by the above two compression methods. The file size of the compressed data stream file is shown in Table 1:
表1 Table 1
输入设计文件 Input design file 标准配置流文件大小(byte) Standard configuration stream file size (byte) 第一压缩数据流文件的大小(byte) The size of the first compressed data stream file (byte) 第二压缩数据流文件的大小(byte) The size of the second compressed data stream file (byte)
cuonter20.v Cuonter20.v 57.4K 57.4K 21.6K 21.6K 11.0K 11.0K
div5.v Div5.v 57.4K 57.4K 12.1K 12.1K 8.6K 8.6K
mult2.v Mult2.v 57.4K 57.4K 13.1K 13.1K 9.0K 9.0K
mult4.v Mult4.v 57.4K 57.4K 15.9K 15.9K 9.7K 9.7K
mult8.v Mult8.v 57.4K 57.4K 19.7K 19.7K 10.7K 10.7K
mult16.v Mult16.v 57.4K 57.4K 25.5K 25.5K 12.2K 12.2K
add4.v Add4.v 57.4K 57.4K 15.9K 15.9K 9.5K 9.5K
add8.v Add8.v 57.4K 57.4K 19.3K 19.3K 10.1K 10.1K
add16.v Add16.v 57.4K 57.4K 21.4K 21.4K 11.3K 11.3K
add24.v Add24.v 57.4K 57.4K 26.3K 26.3K 13.3K 13.3K
分别计算采用上述两种压缩方法所得到的压缩数据流文件的压缩比如表2所示,压缩比指的是:用压缩后的文件大小除以原文件的大小所得结果的百分比。The compression of the compressed data stream file obtained by the above two compression methods is respectively calculated as shown in Table 2. The compression ratio refers to the percentage of the result obtained by dividing the compressed file size by the size of the original file.
表2 Table 2
输入的设计文件 Input design file 第一 压缩 数据流文件的压缩比 The compression ratio of the first compressed data stream file 第二 压缩 数据流文件的压缩比 The compression ratio of the second compressed data stream file 压缩比提高幅度 Compression ratio increase
cuonter20.v Cuonter20.v 37.6% 37.6% 19.2% 19.2% 49.0% 49.0%
div5.v Div5.v 21.1% 21.1% 15.0% 15.0% 28.9% 28.9%
mult2.v Mult2.v 22.9% 22.9% 15.7% 15.7% 31.4% 31.4%
mult4.v Mult4.v 26.8% 26.8% 16.9% 16.9% 36.9% 36.9%
mult8.v Mult8.v 34.3% 34.3% 18.6% 18.6% 45.8% 45.8%
mult16.v Mult16.v 44.4% 44.4% 21.3% 21.3% 52.0% 52.0%
add4.v Add4.v 27.7% 27.7% 16.6% 16.6% 40.0% 40.0%
add8.v Add8.v 33.6% 33.6% 17.6% 17.6% 47.6% 47.6%
add16.v Add16.v 37.3% 37.3% 19.7% 19.7% 47.2% 47.2%
add24.v Add24.v 45.8% 45.8% 23.2% 23.2% 49.3% 49.3%
平均值 average value 33.15% 33.15% 18.38% 18.38% 42.81% 42.81%
其中压缩比提高幅度指的是:将第一压缩数据流文件的大小减去第二压缩数据流文件的大小,再将所得到的结果除以第一压缩数据流文件的大小,所得到的百分比。The increase ratio of the compression ratio refers to: the size of the first compressed data stream file is subtracted from the size of the second compressed data stream file, and the obtained result is divided by the size of the first compressed data stream file, and the obtained percentage is obtained. .
由表2对比数据可见,本发明将传统的帧外部基于帧单元的压缩方法和帧内部的压缩方法相结合所获得的压缩比,比单独使用基于帧单元的压缩方法所获得的压缩比,平均提高了42.81%。因此,本发明提出的压缩方法可以大幅度的提高FPGA配置流文件的压缩性能。As can be seen from the comparison data of Table 2, the present invention combines the compression ratio obtained by combining the conventional frame-based frame unit-based compression method with the frame internal compression method, and the compression ratio obtained by using the frame unit-based compression method alone. Increased by 42.81%. Therefore, the compression method proposed by the present invention can greatly improve the compression performance of the FPGA configuration stream file.
本实施例还包括一种数据压缩处理系统,图10为本发明实施例一种可编程逻辑器件的配置数据流压缩处理系统的模块图,请参考图10:The embodiment further includes a data compression processing system. FIG. 10 is a block diagram of a configuration data stream compression processing system of a programmable logic device according to an embodiment of the present invention. Please refer to FIG. 10:
一种数据压缩处理系统包括待压缩处理数据获取模块101和第一压缩处理模块102,待压缩处理数据获取模块101用于获取配置数据流中待压缩处理的数据帧,第一压缩处理模块102用于对所述待压缩处理的数据帧内部的数据单元进行压缩处理。 A data compression processing system includes a data processing module 101 to be compressed and a first compression processing module 102. The data processing module 101 to be compressed is used to acquire a data frame to be compressed in the configuration data stream. The first compression processing module 102 uses And compressing the data unit inside the data frame to be compressed.
进一步,第一压缩处理模块102用于对所述待压缩处理的数据帧内部的数据单元进行压缩处理后得到参考值和命令单元。Further, the first compression processing module 102 is configured to perform compression processing on the data unit inside the data frame to be compressed to obtain a reference value and a command unit.
进一步,第一压缩处理模块102具体用于将由统计得出的帧内部连续且相同的数据单元的数目与一预设值比较,判断所述连续且相同的数据单元的数目是否大于或等于所述预设值;如果是,则对所述连续且相同的多个数据单元进行处理后得到的命令单元包括用于表示压缩类型的命令类型信息、用于表示所述连续且相同的多个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元的数目信息;如果否,对所述连续且相同的多个数据单元或1个数据单元进行处理得到的命令单元包括用于表示非压缩类型的命令类型信息、用于表示所述连续且相同的多个数据单元或1个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元或1个数据单元的数目信息。Further, the first compression processing module 102 is specifically configured to compare the number of consecutive and identical data units in the statistically derived frame with a preset value, and determine whether the number of consecutive and identical data units is greater than or equal to the number. a preset value; if yes, the command unit obtained by processing the consecutive and identical plurality of data units includes command type information for indicating a compression type, and is used to represent the continuous and identical plurality of data units Address information located inside the frame and number information for indicating the continuous and identical plurality of data units; if not, the command unit obtained by processing the consecutive and identical plurality of data units or 1 data unit includes Command type information for indicating an uncompressed type, address information for indicating that the continuous and identical plurality of data units or one data unit is located inside the frame, and for indicating the continuous and identical plurality of data units or The number information of 1 data unit.
图11为本发明另一实施例一种可编程逻辑器件的配置数据流压缩处理系统的模块图,请参考图11,还包括第二压缩处理模块103,第二压缩处理模块103用于用于对所述配置数据流中的帧单元进行压缩处理。FIG. 11 is a block diagram of a configuration data stream compression processing system of a programmable logic device according to another embodiment of the present invention. Referring to FIG. 11, a second compression processing module 103 is further included, and the second compression processing module 103 is used for Compressing the frame units in the configuration data stream.
图12本发明实施例一种可编程逻辑器件的配置数据流解压缩处理系统的模块图,请参考图12:FIG. 12 is a block diagram of a configuration data stream decompression processing system of a programmable logic device according to an embodiment of the present invention. Please refer to FIG. 12:
一种数据解压缩处理系统,包括待解压缩处理数据获取模块121和第一解压缩模块122,待解压缩处理数据获取模块121用于获取配置数据流中待解压缩处理的数据帧,第一解压缩模块122用于对所述待解压缩数据帧内部的数据单元进行解压缩处理。A data decompression processing system includes a data processing module 121 to be decompressed and a first decompression module 122. The data to be decompressed is used to obtain a data frame to be decompressed in the configuration data stream. The decompression module 122 is configured to perform decompression processing on the data unit inside the data frame to be decompressed.
进一步,第一解压缩模块122具体用于获取所述待解压缩处理的数据帧内部的命令单元和参考值;根据所述命令单元和参考值对所述待解压缩处理的数据帧内部的数据单元进行解压缩处理。Further, the first decompression module 122 is specifically configured to acquire a command unit and a reference value inside the data frame to be decompressed; and to perform internal data of the data frame to be decompressed according to the command unit and the reference value. The unit performs decompression processing.
进一步,第一解压缩模块122具体用于获取所述命令单元中的命令类型信息;如果所述命令单元中的命令类型信息为压缩类型,则根据所述命令单元中用于表示所述连续且相同的多个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元的数目信息,将所述参考值复制到帧内的相应地址上;如果所述命令单元中的命令类型信息为非压缩类型,则根据所述命令单元中用于表示所述连续且相同的多个数据单元或1个数据单元位于帧内部的地址信息和用于表示所述连续且相同的多个数据单元或1个数据单元的数目信息,将所述参考值复制到帧内的相应地址上。 Further, the first decompression module 122 is specifically configured to acquire command type information in the command unit; if the command type information in the command unit is a compression type, according to the command unit, the continuous Address information of the same plurality of data units located inside the frame and number information for indicating the continuous and identical plurality of data units, copying the reference value to a corresponding address within the frame; if the command unit is Command type information is an uncompressed type, according to address information in the command unit for indicating that the consecutive and identical plurality of data units or one data unit is located inside the frame and for indicating the continuous and identical The number information of a plurality of data units or 1 data unit is copied to a corresponding address within the frame.
图13本发明另一实施例一种可编程逻辑器件的配置数据流解压缩处理系统的模块图,请参考图3,还包括第二解压缩模块123,第二解压缩模块123用于对所述配置数据流中的帧单元进行解压缩处理。FIG. 13 is a block diagram of a configuration data stream decompression processing system of a programmable logic device according to another embodiment of the present invention. Referring to FIG. 3, a second decompression module 123 is further included. The frame unit in the configuration data stream is decompressed.
以上内容是结合具体的实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本发明的保护范围。The above is a further detailed description of the present invention in connection with the specific embodiments, and the specific embodiments of the present invention are not limited to the description. It will be apparent to those skilled in the art that the present invention may be made without departing from the spirit and scope of the invention.

Claims (25)

  1. 一种可编程逻辑器件的配置数据流的压缩处理方法,其特征在于,包括: A method for compressing a configuration data stream of a programmable logic device, comprising:
    获取所述配置数据流中的一个数据帧;Obtaining a data frame in the configuration data stream;
    对所述数据帧内部的各数据单元进行压缩处理。Compressing each data unit inside the data frame.
  2. 如权利要求1所述的方法,其特征在于,所述数据单元包括一个或多个比特,或者所述数据单元包括一个或多个字段。 The method of claim 1 wherein said data unit comprises one or more bits or said data unit comprises one or more fields.
  3. 如权利要求1所述的方法,其特征在于,对所述数据帧内部连续的数据单元进行压缩处理得到参考值和命令单元;所述参考值包括数据单元的数据内容;所述命令单元包括命令类型信息、数据单元的地址信息、数据单元的数量信息。 The method of claim 1 wherein compressing processing of consecutive data units within said data frame results in a reference value and a command unit; said reference value comprising data content of the data unit; said command unit including command Type information, address information of a data unit, and quantity information of a data unit.
  4. 如权利要求3所述的方法,其特征在于,对所述数据帧内部的各数据单元进行压缩处理的过程具体为:判断连续的数据单元是否满足压缩条件,如果满足压缩条件,则对满足压缩条件的连续的数据单元进行压缩处理后得到参考值和命令单元;所述参考值为所述满足压缩条件的连续的数据单元中的一个数据单元的数据内容,所述命令单元包括用于表示压缩类型的命令类型信息、所述满足压缩条件的连续的数据单元的地址信息、所述满足压缩条件的连续的数据单元的数量信息。 The method according to claim 3, wherein the process of performing compression processing on each data unit inside the data frame is specifically: determining whether a continuous data unit satisfies a compression condition, and if the compression condition is satisfied, satisfying the compression The continuous data unit of the condition is subjected to compression processing to obtain a reference value and a command unit; the reference value is data content of one of the consecutive data units satisfying the compression condition, and the command unit includes Type of command type information, address information of consecutive data units satisfying the compression condition, and number information of consecutive data units satisfying the compression condition.
  5. 如权利要求4所述的方法,其特征在于,如果不满足压缩条件,则对不满足压缩条件的连续的数据单元进行处理后得到参考值和命令单元;所述参考值为所述不满足压缩条件的连续的数据单元的全部数据内容,所述命令单元包括用于表示非压缩类型的的命令类型信息、所述不满足压缩条件的连续的数据单元的地址信息、所述不满足压缩条件的连续的数据单元的数量信息。 The method according to claim 4, wherein if the compression condition is not satisfied, the continuous data unit that does not satisfy the compression condition is processed to obtain a reference value and a command unit; and the reference value is the unsatisfied compression All data contents of a conditional continuous data unit, the command unit including command type information indicating an uncompressed type, address information of consecutive data units not satisfying the compression condition, and the unsatisfied compression condition The number of consecutive data units.
  6. 如权利要求4所述的方法,其特征在于,判断连续的数据单元是否满足压缩条件的过程具体为:将由统计得出的连续且相同的数据单元的数目与一预设值比较;如果大于或等于所述预设值,则判断结果为满足压缩条件;否则判断结果为不满足压缩条件。 The method according to claim 4, wherein the process of determining whether the continuous data unit satisfies the compression condition is specifically: comparing the number of consecutive and identical data units obtained by statistics with a preset value; if greater than or If it is equal to the preset value, the judgment result is that the compression condition is satisfied; otherwise, the judgment result is that the compression condition is not satisfied.
  7. 如权利要求6所述的方法,其特征在于,所述预设值为大于或等于3的整数。 The method of claim 6 wherein said predetermined value is an integer greater than or equal to three.
  8. 如权利要求1至7任一项所述的方法,其特征在于,在对所述数据帧内部的各数据单元进行压缩处理之前,还包括:对所述未经帧内部压缩处理的数据帧进行帧外部压缩处理。 The method according to any one of claims 1 to 7, wherein before performing compression processing on each data unit inside the data frame, the method further comprises: performing data processing on the frameless internal compression processing Frame external compression processing.
  9. 如权利要求1至7任一项所述的方法,其特征在于,在对所述数据帧内部的各数据单元进行压缩处理之后,还包括:对所述经过帧内部压缩处理后的压缩帧进行帧外部压缩处理。 The method according to any one of claims 1 to 7, wherein after performing compression processing on each data unit inside the data frame, the method further comprises: performing compression processing on the frame after internal compression processing Frame external compression processing.
  10. 一种可编程逻辑器件的配置数据流的解压缩处理方法,其特征在于,包括:A method for decompressing a configuration data stream of a programmable logic device, comprising:
    获取所述配置数据流中的一个压缩帧; Obtaining a compressed frame in the configuration data stream;
    对所述压缩帧进行帧内部解压缩处理,得到帧内部解压缩处理后的各数据单元。Performing intra-frame decompression processing on the compressed frame to obtain each data unit after the intra-frame decompression process.
  11. 如权利要求10所述的方法,其特征在于,对所述压缩帧进行帧内部解压缩处理,得到帧内部解压缩处理后的各数据单元的过程具体为:  The method according to claim 10, wherein the process of performing intra-frame decompression processing on the compressed frame to obtain each data unit after decompressing the intra-frame is specifically:
    获取所述压缩帧内部的命令单元和参考值;所述参考值包括数据单元的数据内容;所述命令单元包括命令类型信息、数据单元的地址信息、数据单元的数量信息; Obtaining a command unit and a reference value inside the compressed frame; the reference value includes data content of the data unit; the command unit includes command type information, address information of the data unit, and quantity information of the data unit;
    根据所述命令单元和所述参考值对所述压缩帧进行帧内部解压缩处理,得到帧内部解压缩处理后的各数据单元。Performing intra-frame decompression processing on the compressed frame according to the command unit and the reference value to obtain each data unit after the intra-frame decompression process.
  12. 如权利要求11所述的方法,其特征在于,根据所述命令单元和所述参考值对所述压缩帧进行帧内部解压缩处理,得到帧内部解压缩处理后的各数据单元的过程具体为: The method according to claim 11, wherein the intra-frame decompression process is performed on the compressed frame according to the command unit and the reference value, and the process of obtaining each data unit after the intra-frame decompression process is specifically :
    获取所述命令单元中的命令类型信息;Obtaining command type information in the command unit;
    如果所述命令单元中的命令类型信息为压缩类型,则根据所述命令单元中满足压缩条件的连续的数据单元的地址信息和数目信息,将所述参考值复制到相应地址上,所述参考值为所述满足压缩条件的连续的数据单元中的一个数据单元的数据内容。If the command type information in the command unit is a compression type, copying the reference value to a corresponding address according to address information and number information of consecutive data units satisfying the compression condition in the command unit, the reference The value is the data content of one of the consecutive data units that satisfy the compression condition.
  13. 如权利要求12所述的方法,其特征在于,如果所述命令单元中的命令类型信息为非压缩类型,则根据所述命令单元中不满足压缩条件的连续的数据单元的地址信息和数目信息,将所述参考值写入到相应地址上,所述参考值为所述不满足压缩条件的连续的数据单元的全部数据内容。 The method according to claim 12, wherein if the command type information in the command unit is of an uncompressed type, address information and number information of consecutive data units that do not satisfy the compression condition in the command unit are And writing the reference value to a corresponding address, where the reference value is the entire data content of the consecutive data units that do not satisfy the compression condition.
  14. 如权利要求10至13任一项所述的方法,其特征在于,在对所述压缩帧进行帧内部解压缩处理之前,还包括对所述压缩帧进行帧外部解压缩处理。 The method according to any one of claims 10 to 13, further comprising performing frame external decompression processing on the compressed frame before performing intraframe decompression processing on the compressed frame.
  15. 如权利要求10至13任一项所述的方法,其特征在于,在对所述压缩帧进行帧内部解压缩处理之后,还包括对帧内部解压缩处理后的数据帧进行帧外部解压缩处理。 The method according to any one of claims 10 to 13, wherein after performing intraframe decompression processing on the compressed frame, the method further comprises performing frame external decompression processing on the data frame after intraframe decompression processing. .
  16. 一种可编程逻辑器件的配置数据流的压缩处理系统,其特征在于,包括待压缩处理数据获取模块和第一压缩处理模块,其中, A compression processing system for configuring a data stream of a programmable logic device, comprising: a data acquisition module to be compressed and a first compression processing module, wherein
    所述待压缩处理数据获取模块用于获取所述配置数据流中的一个数据帧;The to-be-compressed processing data acquiring module is configured to acquire one data frame in the configuration data stream;
    所述第一压缩处理模块用于对所述数据帧内部的各数据单元进行压缩处理。The first compression processing module is configured to perform compression processing on each data unit inside the data frame.
  17. 如权利要求16所述的系统,其特征在于,所述第一压缩处理模块用于对所述数据帧内部连续的数据单元进行压缩处理得到参考值和命令单元;所述参考值包括数据单元的数据内容;所述命令单元包括命令类型信息、数据单元的地址信息、数据单元的数量信息。 The system according to claim 16, wherein said first compression processing module is configured to perform compression processing on consecutive data units in said data frame to obtain reference values and command units; said reference value comprising data units Data content; the command unit includes command type information, address information of a data unit, and quantity information of a data unit.
  18. 如权利要求17所述的系统,其特征在于,所述第一压缩处理模块具体用于:判断连续的数据单元是否满足压缩条件,如果满足压缩条件,则对满足压缩条件的连续的数据单元进行压缩处理后得到参考值和命令单元;所述参考值为所述满足压缩条件的连续的数据单元中的一个数据单元的数据内容,所述命令单元包括用于表示压缩类型的命令类型信息、所述满足压缩条件的连续的数据单元的地址信息、所述满足压缩条件的连续的数据单元的数量信息。 The system according to claim 17, wherein the first compression processing module is specifically configured to: determine whether a continuous data unit satisfies a compression condition, and if the compression condition is satisfied, perform continuous data units that satisfy the compression condition. Deriving a reference value and a command unit; the reference value is data content of one of the consecutive data units satisfying the compression condition, the command unit including command type information for indicating a compression type, Address information of consecutive data units satisfying the compression condition, and information of the number of consecutive data units satisfying the compression condition.
  19. 如权利要求18所述的系统,其特征在于,所述第一压缩处理模块还用于如果不满足压缩条件,则对不满足压缩条件的连续的数据单元进行处理后得到参考值和命令单元;所述参考值为所述不满足压缩条件的连续的数据单元的全部数据内容,所述命令单元包括用于表示非压缩类型的命令类型信息、所述不满足压缩条件的连续的数据单元的地址信息、所述不满足压缩条件的连续的数据单元的数量信息。 The system according to claim 18, wherein the first compression processing module is further configured to: if the compression condition is not satisfied, process the consecutive data units that do not satisfy the compression condition to obtain a reference value and a command unit; The reference value is the entire data content of the consecutive data units that do not satisfy the compression condition, and the command unit includes command type information indicating an uncompressed type, and an address of the consecutive data units that do not satisfy the compression condition. Information, the number information of consecutive data units that do not satisfy the compression condition.
  20. 如权利要求18所述的系统,其特征在于,所述第一压缩处理模块具体用于将由统计得出的连续且相同的数据单元的数目与一预设值比较;如果大于或等于所述预设值,则判断结果为满足压缩条件;否则判断结果为不满足压缩条件。 The system of claim 18, wherein the first compression processing module is specifically configured to compare the number of consecutive and identical data units obtained by statistics with a preset value; if greater than or equal to the predetermined If the value is set, the judgment result is that the compression condition is satisfied; otherwise, the judgment result is that the compression condition is not satisfied.
  21. 如权利要求16至20任一项所述的系统,其特征在于,还包括第二压缩处理模块,所述第二压缩处理模块用于在所述第一压缩处理模块对所述数据帧内部的各数据单元进行压缩处理之前, 对所述未经帧内部压缩处理的数据帧进行帧外部压缩处理;或者在所述第一压缩处理模块对所述数据帧内部的各数据单元进行压缩处理之后,对所述经过帧内部压缩处理后的压缩帧进行帧外部压缩处理。 The system according to any one of claims 16 to 20, further comprising a second compression processing module, wherein the second compression processing module is configured to be internal to the data frame by the first compression processing module Before each data unit is compressed, Performing frame external compression processing on the data frame that is not subjected to intra-frame compression processing; or performing internal compression processing on the frame after the first compression processing module performs compression processing on each data unit inside the data frame The compressed frame is subjected to frame external compression processing.
  22. 一种可编程逻辑器件的配置数据流的解压缩处理系统,其特征在于,包括待解压缩处理数据获取模块和第一解压缩模块,其中: A decompression processing system for configuring a data stream of a programmable logic device, comprising: a data acquisition module to be decompressed and a first decompression module, wherein:
    所述待解压缩处理数据获取模块用于获取所述配置数据流中的一个压缩帧; The data to be decompressed processing module is configured to acquire a compressed frame in the configuration data stream;
    所述第一解压缩模块用于对所述压缩帧进行帧内部解压缩处理,得到帧内部解压缩处理后的各数据单元。The first decompression module is configured to perform intra-frame decompression processing on the compressed frame to obtain each data unit after the intra-frame decompression process.
  23. 如权利要求22所述的系统,其特征在于,所述第一解压缩模块具体用于获取所述压缩帧内部的命令单元和参考值;所述参考值包括数据单元的数据内容;所述命令单元包括命令类型信息、数据单元的地址信息、数据单元的数量信息;并根据所述命令单元和所述参考值对所述压缩帧进行帧内部解压缩处理,得到帧内部解压缩处理后的各数据单元。 The system according to claim 22, wherein the first decompression module is specifically configured to acquire a command unit and a reference value inside the compressed frame; the reference value includes data content of the data unit; The unit includes command type information, address information of the data unit, and quantity information of the data unit; and performs internal frame decompression processing on the compressed frame according to the command unit and the reference value, and obtains each of the internal decompression processing of the frame. Data unit.
  24. 如权利要求23所述的系统,其特征在于,所述第一解压缩模块具体用于获取所述命令单元中的命令类型信息;如果所述命令单元中的命令类型信息为压缩类型,则所述第一解压缩模块用于根据所述命令单元中满足压缩条件的连续的数据单元的地址信息和数目信息,将所述参考值复制到相应地址上,所述参考值为所述满足压缩条件的连续的数据单元中的一个数据单元的数据内容。 The system according to claim 23, wherein the first decompression module is specifically configured to acquire command type information in the command unit; if the command type information in the command unit is a compression type, The first decompression module is configured to copy the reference value to a corresponding address according to address information and number information of consecutive data units satisfying a compression condition in the command unit, where the reference value satisfies the compression condition The data content of one data unit in a continuous data unit.
  25. 如权利要求24所述的系统,其特征在于,如果所述命令单元中的命令类型信息为非压缩类型,所述第一解压缩模块用于根据所述命令单元中不满足压缩条件的连续的数据单元的地址信息和数目信息,将所述参考值还原到相应地址上,所述参考值为所述不满足压缩条件的连续的数据单元的全部数据内容。 The system according to claim 24, wherein if the command type information in the command unit is of an uncompressed type, the first decompression module is configured to perform continuous according to the command unit that does not satisfy the compression condition The address information and the number information of the data unit are restored to the corresponding address, and the reference value is the entire data content of the consecutive data units that do not satisfy the compression condition.
    26. 如权利要求22至25任一项所述的系统,其特征在于,还包括第二解压缩模块,所述第二解压缩模块在所述第一解压缩模块对所述压缩帧进行帧内部解压缩处理之前,用于对所述压缩帧进行帧外部解压缩处理;或者,所述第二解压缩模块在所述第一解压缩模块对所述压缩帧进行帧内部解压缩处理之后,用于对帧内部解压缩处理后的数据帧进行帧外部解压缩处理。26. The system according to any one of claims 22 to 25, further comprising a second decompression module, wherein the second decompression module performs a frame internal solution on the compressed frame in the first decompression module Before the compression process, the frame is externally decompressed for the compressed frame; or the second decompression module is used after the first decompression module performs intraframe decompression processing on the compressed frame. The frame external decompression process is performed on the data frame after the frame internal decompression process.
PCT/CN2011/080428 2011-06-23 2011-09-30 Method and system for compressing and decompressing configuration data stream of programmable logic device WO2012174807A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110171082.2 2011-06-23
CN 201110171082 CN102843142B (en) 2011-06-23 2011-06-23 Compression and decompression processing method and system of configuration data stream for programmable logic device

Publications (1)

Publication Number Publication Date
WO2012174807A1 true WO2012174807A1 (en) 2012-12-27

Family

ID=47370241

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/080428 WO2012174807A1 (en) 2011-06-23 2011-09-30 Method and system for compressing and decompressing configuration data stream of programmable logic device

Country Status (2)

Country Link
CN (1) CN102843142B (en)
WO (1) WO2012174807A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103368579B (en) * 2013-07-09 2016-08-17 杭州东方通信软件技术有限公司 The compression method of a kind of WLAN Network Management Equipment data and system
WO2016186563A1 (en) * 2015-05-21 2016-11-24 Zeropoint Technologies Ab Methods, devices and systems for hybrid data compression and decompression
CN110958212B (en) * 2018-09-27 2022-04-12 阿里巴巴集团控股有限公司 Data compression method, data decompression method, device and equipment
CN112597082B (en) * 2020-12-18 2023-02-24 龙芯中科技术股份有限公司 Bus data transmission method and electronic equipment
CN114040030B (en) * 2021-11-18 2023-11-24 深圳智慧林网络科技有限公司 Data compression method, device, equipment and medium based on preset rules

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1558682A (en) * 2004-01-14 2004-12-29 华中科技大学 Embedded image processor
CN101426139A (en) * 2008-12-08 2009-05-06 中国科学院长春光学精密机械与物理研究所 Image compression apparatus
US7589648B1 (en) * 2005-02-10 2009-09-15 Lattice Semiconductor Corporation Data decompression
US7902865B1 (en) * 2007-11-15 2011-03-08 Lattice Semiconductor Corporation Compression and decompression of configuration data using repeated data frames

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4633464B2 (en) * 2002-10-21 2011-02-16 エヌエックスピー ビー ヴィ Sub-image manipulation in compressed video signals
CN100538820C (en) * 2005-07-06 2009-09-09 凌阳科技股份有限公司 A kind of method and device that voice data is handled
US20070110151A1 (en) * 2005-11-14 2007-05-17 Ess Technology, Inc. System and method for video frame buffer compression
CN100409690C (en) * 2006-05-19 2008-08-06 北京工业大学 Video interframe compression method based on space-time correlation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1558682A (en) * 2004-01-14 2004-12-29 华中科技大学 Embedded image processor
US7589648B1 (en) * 2005-02-10 2009-09-15 Lattice Semiconductor Corporation Data decompression
US7902865B1 (en) * 2007-11-15 2011-03-08 Lattice Semiconductor Corporation Compression and decompression of configuration data using repeated data frames
CN101426139A (en) * 2008-12-08 2009-05-06 中国科学院长春光学精密机械与物理研究所 Image compression apparatus

Also Published As

Publication number Publication date
CN102843142A (en) 2012-12-26
CN102843142B (en) 2013-07-31

Similar Documents

Publication Publication Date Title
WO2012174807A1 (en) Method and system for compressing and decompressing configuration data stream of programmable logic device
US8233545B2 (en) Run length encoding in VLIW architecture
US6819271B2 (en) Parallel compression and decompression system and method having multiple parallel compression and decompression engines
US6885319B2 (en) System and method for generating optimally compressed data from a plurality of data compression/decompression engines implementing different data compression algorithms
US9391635B2 (en) Block scanner and run-level encoder from AC to DC values
US7538695B2 (en) System and method for deflate processing within a compression engine
US6145069A (en) Parallel decompression and compression system and method for improving storage density and access speed for non-volatile memory and embedded memory devices
US8704686B1 (en) High bandwidth compression to encoded data streams
JP4491798B2 (en) Method and system for performing two-dimensional transformation on data value array with low power consumption
US20110280314A1 (en) Slice encoding and decoding processors, circuits, devices, systems and processes
US8806292B2 (en) Method of hybrid compression acceleration utilizing special and general purpose processors
US9106251B2 (en) Data compression utilizing longest common subsequence template
EP3295568B1 (en) Improved compressed caching in a virtual memory system
Kim et al. ASIP approach for implementation of H. 264/AVC
US9106252B2 (en) Selective recompression of a string compressed by a plurality of diverse lossless compression techniques
Feygin et al. Architectural advances in the VLSI implementation of arithmetic coding for binary image compression
Habboush et al. DE-ZFP: An FPGA implementation of a modified ZFP compression/decompression algorithm
WO2021027487A1 (en) Encoding method and related device
Nunez-Yanez et al. A configurable statistical lossless compression core based on variable order Markov modeling and arithmetic coding
US9455743B2 (en) Dedicated arithmetic encoding instruction
Chen et al. High-throughput Binary Arithmetic Encoder architecture for CABAC in H. 265/HEVC
JP2007295157A (en) Unit, method and program for data coding, and information recording medium having recorded data coding program
Nunez‐Yanez et al. Gigabyte per second streaming lossless data compression hardware based on a configurable variable-geometry CAM dictionary
Michael et al. A low-power design of quantization for H. 264 video coding standard
US20030097386A1 (en) Method and apparatus for quantifying the number of identical consecutive digits within a string

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11868394

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09/05/2014)

122 Ep: pct application non-entry in european phase

Ref document number: 11868394

Country of ref document: EP

Kind code of ref document: A1