A Cascade Half-Band Filter RTL Automatic Generation System and Method

The RTL automatic generation system of cascaded semi-band filter jointly programmed by Matlab and Python solves the problems of complex design and long periods of cascaded semi-band filters, and realizes the automation of parameter design, RTL design and test platform, reducing design difficulty and shortening development cycle.

CN115017849BActive Publication Date: 2025-07-0158TH RES INST OF CETC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210608733.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2025-07-01
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

The design of cascaded semi-band filters is complex and the development cycle is long, making it difficult to achieve automated generation in the existing technology.

Method used

It provides a cascading semi-band filter RTL automatic generation system, including a cascading semi-band filter design module, RTL generation module and test platform generation module. It uses Matlab and Python for parameter design, code generation and test platform construction, and integrates a built-in self-test unit.

Benefits of technology

It realizes seamless connection between cascading semi-band filter parameter design and RTL design, reducing design difficulty, shortening development cycle, improving testing efficiency, and providing a complete automatic generation solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115017849B_ABST
    Figure CN115017849B_ABST
Patent Text Reader

Abstract

The present invention discloses a cascaded half-band filter RTL automatic generation system and method, belonging to the field of digital integrated circuit design, including a cascaded half-band filter design module, a cascaded half-band filter RTL generation module, and a cascaded half-band filter test platform generation module; the cascaded half-band filter design module designs a cascaded half-band filter based on Matlab according to user requirement parameters, and transfers the design parameters to the cascaded half-band filter RTL generation module; the cascaded half-band filter RTL generation module reads the design parameters, and automatically generates cascaded half-band filter RTL code based on Python, and transfers the RTL code to the cascaded half-band filter test platform generation module; the cascaded half-band filter test platform generation module reads the generated half-band filter RTL code, and automatically generates a cascaded half-band filter test platform based on Python and Matlab. The present invention provides an automatic generation solution for the parameter design, RTL design, and test platform design of a cascaded half-band filter, and has broad development space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of digital integrated circuit design, and particularly relates to a cascade half-band filter RTL automatic generation system and method based on combined programming of Python and Matlab. Background Art

[0002] Digital up and down conversion is the core part of the transceiver in software radio, and using a half-band filter for sampling rate conversion is one of the key technologies in digital up and down conversion. Therefore, the design and development of the half-band filter are particularly important.

[0003] The design process of the half-band filter is complex, including filter coefficient simulation calculation, RTL design, test verification, and spectrum analysis. For high-speed half-band filters, the traditional serial structure is difficult to implement complex multiply-accumulate operations and must use a parallel structure. The parallel structure involves multi-phase processing of data and complex timing, which directly leads to the problems of high design difficulty and long development cycle of the half-band filter.

[0004] Patent CN201911242091.9 proposes an automatic generation method for a single-stage half-band decimation filter, and patent CN202010896699.X proposes an automatic generation method for a single-stage half-band interpolation filter. These two methods shorten the development cycle of the single-stage half-band filter to a certain extent, but the premise of these two methods is that the coefficients of the single-stage half-band filter are known, and they do not achieve automatic generation from the design source of the half-band filter. In addition, in actual engineering applications, in order to achieve interpolation or decimation of powers of 2, a multi-stage cascade half-band filter is often used. Summary of the Invention

[0005] The purpose of the present invention is to provide a cascade half-band filter RTL automatic generation system and method to solve the problems of complex design process and long development cycle of the current cascade half-band filter.

[0006] To solve the above technical problems, the present invention provides a cascade half-band filter RTL automatic generation system, including a cascade half-band filter design module, a cascade half-band filter RTL generation module, and a cascade half-band filter test platform generation module;

[0007] The cascade half-band filter design module designs a cascade half-band filter based on Matlab according to user requirement parameters and transfers the design parameters to the cascade half-band filter RTL generation module;

[0008] The cascade half-band filter RTL generation module reads the design parameters and automatically generates cascade half-band filter RTL code based on Python, and transfers the RTL code to the cascade half-band filter test platform generation module;

[0009] The cascaded half-band filter test platform generation module reads the generated half-band filter RTL code and automatically generates a cascaded half-band filter test platform based on Python and Matlab.

[0010] In one implementation, the cascaded half-band filter design module includes a user interface and a cascaded half-band filter parameter design module;

[0011] The user interface receives user requirement parameters, including the type of cascaded half-band filter, the maximum interpolation or decimation ratio, the normalized cut-off frequency of each stage of the half-band filter, the stopband or passband tolerance, the minimum filter order, and the input and output data bit widths of the cascaded half-band filter;

[0012] The cascaded half-band filter parameter design module designs the cascaded half-band filter according to the user requirement parameters, and plots the unit impulse response and frequency response; after several iterations, when the design meets the requirements, it outputs the coefficient values of each stage of the half-band filter, the bit width after coefficient fixed-point, and the order of the cascaded half-band filter.

[0013] In one implementation, the cascaded half-band filter RTL generation module includes a cascaded half-band filter type selection module, a cascaded half-band interpolation filter RTL generation module, and a cascaded half-band decimation filter RTL generation module;

[0014] The cascaded half-band filter type selection module selects and generates a cascaded half-band interpolation filter or a cascaded half-band decimation filter according to the type parameter;

[0015] The cascaded half-band interpolation filter RTL generation module includes an interpolation clock generation unit, a single-stage half-band interpolation filter generation unit, an N-stage cascaded half-band interpolation filter generation unit, and an interpolation built-in self-test generation unit;

[0016] The interpolation clock generation unit generates the RTL code of the divided-frequency clock to provide a clock signal for each stage of the half-band interpolation filter;

[0017] The single-stage half-band interpolation filter generation unit consists of a delay generator, an addition generator, a multiplication generator, and a summation generator; the delay generator generates the RTL code of the delay unit. If the two inputs of the filter are A0 and A1, then A0 is delayed to obtain A(n-0), A(n-4), A(n-8)…A(n-4*k), and A1 is delayed to obtain A(n-2), A(n-6), A(n-10)…A(n-4*k+2); the addition generator generates the RTL code of the addition unit, adding two delay terms with the same coefficient, that is, adder1 = A(n-0)+A(n-N-1), adder2 = A(n-2)+A(n-N-2)…, and a total of (N+1) / 4 calculations are required; the multiplication generator generates the RTL code of the multiplication unit, multiplying the result of the addition generator by the corresponding filter coefficient, that is, mult1 = adder1*coeff1, mult2 = adder2*coeff2…, and a total of (N+1) / 8 calculations are required; the summation generator generates the RTL code of the summation unit, adding all the product terms for summation, that is, sum = mult1+mult2+mult3+…. The generated single-stage half-band interpolation filter is a 4-way parallel structure with 2 inputs and 4 outputs;

[0018] The N-stage cascaded half-band interpolation filter generation unit cascades the single-stage half-band interpolation filters to obtain an N-stage cascaded half-band interpolation filter; the number of stages of the half-band interpolation filter stage = log2(max_interp), where max_interp is the maximum interpolation multiple;

[0019] The interpolation built-in self-test generation unit consists of a ramp test generator and a pulse test generator, generating the RTL code for performing ramp tests and pulse tests on the N-stage cascaded half-band interpolation filter.

[0020] The cascaded half-band decimation filter RTL generation module includes a decimation clock generation unit, a single-stage half-band decimation filter generation unit, an N-stage cascaded half-band decimation filter generation unit, and a decimation built-in self-test generation unit.

[0021] The decimation clock generation unit generates the RTL code of the divided-frequency clock, providing a clock signal for each stage of the half-band decimation filter;

[0022] The single-stage half-band decimation filter generation unit consists of a multiplication generator and a summation generator; the multiplication generator generates the RTL code of the multiplication unit, multiplying the input data by the corresponding filter coefficients, i.e., mult1 = din1 * coeff1, mult2 = din2 * coeff2...; the summation generator generates the RTL code of the summation unit, adding all the product terms, i.e., sum = mult1 + mult2 + mult3 +...; the generated single-stage half-band decimation filter is a 4-way parallel structure with 4 inputs and 2 outputs;

[0023] The N-stage cascaded half-band decimation filter generation unit cascades the single-stage half-band decimation filters to obtain an N-stage cascaded half-band decimation filter; the number of stages of the half-band decimation filter stage = log2(max_decim), where max_decim is the maximum decimation factor;

[0024] The decimation built-in self-test generation unit consists of a ramp test generator and a pulse test generator, generating the RTL code for performing ramp tests and pulse tests on the N-stage cascaded half-band decimation filter.

[0025] In one implementation, the cascaded half-band filter test platform generation module includes an excitation signal generation module, an FFT spectrum analysis module, a cascaded half-band filter test platform type selection module, a cascaded half-band interpolation filter test platform generation module, and a cascaded half-band decimation filter test platform generation module;

[0026] The excitation signal generation module generates sine and cosine signals or Gaussian white noise, providing test excitation signals for the cascaded half-band interpolation filter or the cascaded half-band decimation filter;

[0027] The FFT spectrum analysis module performs spectrum analysis on the signals before and after filtering;

[0028] The cascaded half-band filter test platform type selection module selects and generates a cascaded half-band interpolation filter test platform or a cascaded half-band decimation filter test platform according to the type parameter;

[0029] The cascaded half-band interpolation filter test platform generation module reads the RTL code of the cascaded half-band interpolation filter and generates a test platform for the cascaded half-band interpolation filter;

[0030] The cascaded half-band decimation filter test platform generation module reads the RTL code of the cascaded half-band decimation filter and generates a test platform for the cascaded half-band decimation filter.

[0031] The present invention also provides a method for automatically generating the RTL of a cascaded half-band filter, including:

[0032] Step S1: Read the user requirement parameters and design a cascaded half-band filter based on Matlab;

[0033] Step S2: Based on the design parameters, analyze and generate the RTL code of the N-stage cascaded half-band filter using Python;

[0034] Step S3: Read the RTL code and analyze and generate a test bench for the cascaded half-band filter based on Python and Matlab.

[0035] In one implementation, step S1 includes:

[0036] S101: Select the type of the designed cascaded half-band filter according to the type parameter of the cascaded half-band filter. When the type parameter is 0, select to design a cascaded half-band interpolation filter; when the type parameter is 1, select to design a cascaded half-band decimation filter;

[0037] S102: Use the half-band filter design function firhalfband in Matlab to design the filter, i.e., coeff = firhalfband('minorder', fp, dev), where coeff is the single-stage half-band filter coefficient returned by the function, fp is the normalized cut-off frequency of the single-stage half-band filter, dev is the stopband or passband tolerance of the single-stage half-band filter, and minorder represents the minimum filter order that meets the requirements of the normalized cut-off frequency and passband-stopband tolerance;

[0038] S103: Use the impz function and freqz function in Matlab to plot the unit impulse response and frequency response of the cascaded half-band filter respectively;

[0039] S104: Quantize the coefficients of the cascaded half-band filter and compare and analyze the frequency responses of the half-band filter before and after quantization; after several iterations, when the design meets the requirements, output the coefficient values of each stage of the half-band filter, the bit width after coefficient quantization, and the order of the half-band filter.

[0040] In one implementation, step S2 includes:

[0041] S201: Select the type of the generated cascaded half-band filter according to the type parameter of the cascaded half-band filter. When the type parameter is 0, select to generate the RTL code of the cascaded half-band interpolation filter; when the type parameter is 1, select to generate the RTL code of the cascaded half-band decimation filter;

[0042] S202: Create a Python dictionary object and store the design type parameter generated in step S201 in this dictionary object;

[0043] S203. Read the design parameters in the dictionary object, and use the write function in Python to generate a clock, a single-stage half-band filter, an N-stage cascaded half-band filter, and a built-in self-test unit in sequence.

[0044] In one implementation, the step S3 includes:

[0045] S301. Select the type of the test platform for the cascaded half-band filter generated according to the type parameter of the cascaded half-band filter. That is, when the type parameter is 0, select to generate a test platform for the cascaded half-band interpolation filter; when the type parameter is 1, select to generate a test platform for the cascaded half-band decimation filter.

[0046] S302. Use the sin / cos function and the randn function in Matlab to generate sine and cosine signals and Gaussian white noise, and provide test excitation signals for the cascaded half-band filter.

[0047] S303. In the test platform of the cascaded half-band filter, input the excitation signal to the cascaded half-band filter generated in step S302 to generate a filtered signal, and perform spectral analysis on the signals before and after filtering.

[0048] The cascaded half-band filter RTL automatic generation system and method provided by the present invention have the following advantages:

[0049] (1) The present invention integrates the parameter design of the cascaded half-band filter into the system, realizing seamless connection of the parameter design, coefficient fixed-point conversion, and RTL design of the cascaded half-band filter, and reducing the design difficulty of the cascaded half-band filter.

[0050] (2) The cascaded half-band filter generated by the present invention contains a built-in self-test unit, which can perform ramp tests and pulse tests on the cascaded half-band filter, realizing testability design.

[0051] (3) The generated cascaded test platform of the present invention integrates an excitation signal generation module and an FFT spectral analysis module, improving the test verification efficiency of the cascaded half-band filter.

[0052] (4) The present invention provides a complete set of automatic generation solutions for the parameter design, RTL design, and test platform design of the cascaded half-band filter, greatly shortening the development cycle and having a very broad development space. Description of the Drawings

[0053] Figure 1 is a schematic structural diagram of a cascaded half-band filter RTL automatic generation system provided by the present invention;

[0054] Figure 2 is a schematic structural diagram of the cascaded half-band filter design module;

[0055] Figure 3 It is a schematic diagram of the architecture of the cascaded half-band filter RTL generation module;

[0056] Figure 4 It is a schematic diagram of the architecture of the cascaded half-band filter test platform generation module;

[0057] Figure 5 It is a schematic flow diagram of a method for automatically generating the cascaded half-band filter RTL provided by the present invention. Detailed implementation manners

[0058] The following further describes in detail a system and method for automatically generating the cascaded half-band filter RTL proposed by the present invention in conjunction with the accompanying drawings and specific embodiments. The advantages and features of the present invention will be clearer according to the following description and the claims. It should be noted that the accompanying drawings are all in a very simplified form and use non-precise scales, only for conveniently and clearly assisting in explaining the purpose of the embodiments of the present invention.

[0059] The present invention provides a system for automatically generating the cascaded half-band filter RTL, which is based on the joint programming of Python and Matlab. The schematic diagram of its system architecture is as Figure 1As shown, it includes a cascaded half-band filter design module, a cascaded half-band filter RTL generation module, and a cascaded half-band filter testbench generation module. The cascaded half-band filter design module includes a cascaded half-band interpolation filter design module and a cascaded half-band decimation filter design module; the cascaded half-band filter RTL generation module includes a cascaded half-band interpolation filter RTL generation module and a cascaded half-band decimation filter RTL generation module; the cascaded half-band filter testbench generation module includes a cascaded half-band interpolation filter testbench generation module and a cascaded half-band decimation filter testbench generation module. The cascaded half-band interpolation filter design module is used to design a cascaded half-band interpolation filter based on Matlab according to user requirement parameters, and transfer the design parameters to the cascaded half-band interpolation filter RTL generation module; the cascaded half-band interpolation filter RTL generation module is used to read the design parameters, automatically generate the RTL code of the cascaded half-band interpolation filter based on Python, and transfer the RTL code to the cascaded half-band interpolation filter testbench generation module; the cascaded half-band interpolation filter testbench generation module is used to read the generated half-band interpolation filter RTL code, and automatically generate a cascaded half-band interpolation filter testbench based on Python and Matlab; correspondingly, the cascaded half-band decimation filter design module is used to design a cascaded half-band decimation filter based on Matlab according to user requirement parameters, and transfer the design parameters to the cascaded half-band decimation filter RTL generation module; the cascaded half-band decimation filter RTL generation module is used to read the design parameters, automatically generate the RTL code of the cascaded half-band decimation filter based on Python, and transfer the RTL code to the cascaded half-band decimation filter testbench generation module; the cascaded half-band decimation filter testbench generation module is used to read the generated half-band decimation filter RTL code, and automatically generate a cascaded half-band decimation filter testbench based on Python and Matlab.

[0060] Figure 2 It is a schematic diagram of the cascaded half-band filter design module in the embodiment of the present invention, including a user interface and a cascaded half-band filter parameter design module; wherein, the user interface is used to receive user requirement parameters, including the cascaded half-band filter type, the maximum interpolation or decimation ratio, the normalized cut-off frequency of each stage of the half-band filter, the stopband or passband tolerance, the minimum filter order, and the input and output data bit widths of the cascaded half-band filter; the cascaded half-band filter parameter design module designs a cascaded half-band filter according to user requirement parameters, and plots the unit impulse response and frequency response; after several iterations, when the design meets the requirements, it outputs the coefficient values of each stage of the half-band filter, the bit width after coefficient quantization, and the order of the cascaded half-band filter.

[0061] Figure 3It is a schematic diagram of the cascaded half-band filter RTL generation module in the embodiments of the present invention, including a cascaded half-band filter type selection module, a cascaded half-band interpolation filter RTL generation module, and a cascaded half-band decimation filter RTL generation module; wherein, the cascaded half-band filter type selection module selects and generates a half-band interpolation filter or a half-band decimation filter according to the type parameter;

[0062] The cascaded half-band interpolation filter RTL generation module includes an interpolation clock generation unit, a single-stage half-band interpolation filter generation unit, an N-stage cascaded half-band interpolation filter generation unit, and an interpolation built-in self-test generation unit. The interpolation clock generation unit generates the RTL code of the divided-frequency clock to provide a clock signal for each stage of the half-band interpolation filter; the single-stage half-band interpolation filter generation unit is composed of a delay generator, an adder generator, a multiplier generator, and a summation generator. The delay generator generates the RTL code of the delay unit. If the two inputs of the filter are A0 and A1, then A0 is delayed to obtain A(n-0), A(n-4), A(n-8)…A(n-4*k), where k = 8; A1 is delayed to obtain A(n-2), A(n-6), A(n-10)…A(n-4*k+2), where k = 8; the adder generator generates the RTL code of the adder unit, adding two delay terms with the same coefficient, that is, adder1 = A(n-0)+A(n-N-1), adder2 = A(n-2)+A(n-N-2)…, and a total of (N+1) / 4 calculations are required; the multiplier generator generates the RTL code of the multiplier unit, multiplying the result of the adder generator by the corresponding filter coefficient, that is, mult1 = adder1*coeff1, mult2 = adder2*coeff2…, and a total of (N+1) / 8 calculations are required, where coeff1, coeff2,... are filter coefficients; the summation generator generates the RTL code of the summation unit, adding all the product terms for summation, that is, sum = mult1+mult2+mult3+…. The generated single-stage half-band interpolation filter is a 4-way parallel structure with 2 inputs and 4 outputs; the N-stage cascaded half-band interpolation filter generation unit cascades the single-stage half-band interpolation filter to obtain the final N-stage cascaded half-band interpolation filter; the number of stages of the half-band interpolation filter stage = log2(max_interp), where max_interp is the maximum interpolation multiple; the interpolation built-in self-test generation unit is composed of a ramp test generator and a pulse test generator, generating the RTL code for performing ramp tests and pulse tests on the N-stage cascaded half-band interpolation filter.

[0063] The cascade half-band decimation filter RTL generation module includes a decimation clock generation unit, a single-stage half-band decimation filter generation unit, an N-stage cascade half-band decimation filter generation unit, and a decimation built-in self-test generation unit. The decimation clock generation unit generates the RTL code of the divided-frequency clock to provide a clock signal for each stage of the half-band decimation filter; the single-stage half-band decimation filter generation unit consists of a multiplication generator and a summation generator; the multiplication generator generates the RTL code of the multiplication unit to multiply the input data by the corresponding filter coefficients, i.e., mult1 = din1 * coeff1, mult2 = din2 * coeff2...; the summation generator generates the RTL code of the summation unit to add and sum all the product terms, i.e., sum = mult1 + mult2 + mult3 +...; the generated single-stage half-band decimation filter is a 4-way parallel structure with 4 inputs and 2 outputs; the N-stage cascade half-band decimation filter generation unit cascades the single-stage half-band decimation filters to obtain the final N-stage cascaded half-band decimation filter; the number of stages of the half-band decimation filter stage = log2(max_decim), where max_decim is the maximum decimation ratio; the decimation built-in self-test generation unit consists of a ramp test generator and a pulse test generator, and generates the RTL code for performing ramp tests and pulse tests on the N-stage cascade half-band decimation filter.

[0064] Figure 4 It is a schematic diagram of the cascade half-band filter test platform generation module in an embodiment of the present invention, including an excitation signal generation module, an FFT spectrum analysis module, a cascade half-band filter test platform type selection module, a cascade half-band interpolation filter test platform generation module, and a cascade half-band decimation filter test platform generation module; among them,

[0065] The excitation signal generation module generates sine and cosine signals or Gaussian white noise to provide a test excitation signal for the cascade half-band interpolation filter or the cascade half-band decimation filter; the FFT spectrum analysis module performs spectrum analysis on the signals before and after filtering; the cascade half-band filter test platform type selection module selects and generates a cascade half-band interpolation filter test platform or a cascade half-band decimation filter test platform according to the type parameters; the cascade half-band interpolation filter test platform generation module reads the RTL code of the cascade half-band interpolation filter and generates a cascade half-band interpolation filter test platform; the cascade half-band decimation filter test platform generation module reads the RTL code of the cascade half-band decimation filter and generates a cascade half-band decimation filter test platform.

[0066] The present invention also provides a method for automatically generating the RTL of a cascade half-band filter, and its process is as Figure 5 shown, and this method includes:

[0067] Step S1: Read the user requirement parameters and design a cascaded half-band filter based on Matlab;

[0068] Step S2: Analyze and generate the RTL code of an N-stage cascaded half-band filter based on the design parameters using Python;

[0069] Step S3: Read the RTL code and analyze and generate a test bench for the cascaded half-band filter based on Python and Matlab.

[0070] The specific process of step S1 includes:

[0071] S101: Select the type of cascaded half-band filter to be designed according to the type parameter of the cascaded half-band filter. When the type parameter is 0, select to design a cascaded half-band interpolation filter; when the type parameter is 1, select to design a cascaded half-band decimation filter;

[0072] S102: Use the half-band filter design function firhalfband in Matlab to design the filter, i.e., coeff = firhalfband('minorder', fp, dev), where coeff is the single-stage half-band filter coefficient returned by the function, fp is the normalized cut-off frequency of the single-stage half-band filter, dev is the stopband or passband tolerance of the single-stage half-band filter, and minorder represents the minimum filter order that meets the requirements of the normalized cut-off frequency and the passband and stopband tolerances;

[0073] S103: Use the impz function and freqz function in Matlab to plot the unit impulse response and frequency response of the cascaded half-band filter respectively;

[0074] S104: Quantize the coefficients of the cascaded half-band filter and compare and analyze the frequency responses of the half-band filter before and after quantization; after several iterations, when the design meets the requirements, output the coefficient values of each stage of the half-band filter, the bit width after coefficient quantization, and the order of the half-band filter.

[0075] The specific process of step S2 includes:

[0076] S201: Select the type of cascaded half-band filter to be generated according to the type parameter of the cascaded half-band filter. When the type parameter is 0, select to generate the RTL code of a cascaded half-band interpolation filter; when the type parameter is 1, select to generate the RTL code of a cascaded half-band decimation filter;

[0077] S202: Create a Python dictionary object and store the design type parameter generated in step S201 in this dictionary object;

[0078] S203. Read the design parameters in the dictionary object, and use the write function in Python to generate a clock, a single-stage half-band filter, an N-stage cascaded half-band filter, and a built-in self-test unit in sequence.

[0079] The specific process of step S3 includes:

[0080] S301. Select the type of the test platform for the cascaded half-band filter generated according to the type parameter of the cascaded half-band filter. When the type parameter is 0, select to generate a test platform for the cascaded half-band interpolation filter; when the type parameter is 1, select to generate a test platform for the cascaded half-band decimation filter.

[0081] S302. Use the sin / cos function and the randn function in Matlab to generate sine and cosine signals and Gaussian white noise, and provide a test excitation signal for the cascaded half-band filter.

[0082] S303. In the test platform of the cascaded half-band filter, input the excitation signal to the cascaded half-band filter generated in step S302 to generate a filtered signal, and perform spectral analysis on the signals before and after filtering.

[0083] The above description is only a description of the preferred embodiments of the present invention, and does not limit the scope of the present invention in any way. Any changes and modifications made by those of ordinary skill in the art of the present invention according to the above disclosure shall fall within the protection scope of the claims.

Claims

1. A cascaded half-band filter RTL automatic generation system, characterized in that It includes a cascaded half-band filter design module, a cascaded half-band filter RTL generation module, and a cascaded half-band filter testbench generation module; The cascaded half-band filter design module designs a cascaded half-band filter based on Matlab according to user requirement parameters, and transfers the design parameters to the cascaded half-band filter RTL generation module; The cascaded half-band filter RTL generation module reads the design parameters, automatically generates cascaded half-band filter RTL code based on Python, and transfers the RTL code to the cascaded half-band filter testbench generation module; The cascaded half-band filter testbench generation module reads the generated half-band filter RTL code, and automatically generates a cascaded half-band filter testbench based on Python and Matlab; The cascaded half-band filter design module includes a user interface and a cascaded half-band filter parameter design module; The user interface receives user requirement parameters, including the type of cascaded half-band filter, the maximum interpolation or decimation ratio, the normalized cut-off frequency of each stage of the half-band filter, the stopband or passband tolerance, the minimum filter order, and the input and output data bit widths of the cascaded half-band filter; The cascaded half-band filter parameter design module designs a cascaded half-band filter according to user requirement parameters, and plots the unit impulse response and frequency response; after several iterations, when the design meets the requirements, it outputs the coefficient values of each stage of the half-band filter, the bit width after coefficient fixed-point, and the order of the cascaded half-band filter; The cascaded half-band filter RTL generation module includes a cascaded half-band filter type selection module, a cascaded half-band interpolation filter RTL generation module, and a cascaded half-band decimation filter RTL generation module; The cascaded half-band filter type selection module selects and generates a cascaded half-band interpolation filter or a cascaded half-band decimation filter according to the type parameters; The cascaded half-band interpolation filter RTL generation module includes an interpolation clock generation unit, a single-stage half-band interpolation filter generation unit, an N-stage cascaded half-band interpolation filter generation unit, and an interpolation built-in self-test generation unit; The interpolation clock generation unit generates RTL code for the divided-frequency clock to provide a clock signal for each stage of the half-band interpolation filter; The single - stage half - band interpolation filter generation unit consists of a delay generator, an addition generator, a multiplication generator, and a summation generator; the delay generator generates the RTL code of the delay unit. If the two inputs of the filter are A0 and A1, then A0 is delayed to obtain A(n - 0), A(n - 4), A(n - 8)…A(n - 4*k), and A1 is delayed to obtain A(n - 2), A(n - 6), A(n - 10)…A(n - 4*k + 2); the addition generator generates the RTL code of the addition unit, adding two delayed terms with the same coefficient, that is, adder1 = A(n - 0)+A(n - N - 1), adder2 = A(n - 2)+A(n - N - 2)…, and a total of (N + 1) / 4 calculations are required; the multiplication generator generates the RTL code of the multiplication unit, multiplying the result of the addition generator by the corresponding filter coefficient, that is, mult1 = adder1*coeff1, mult2 = adder2*coeff2…, and a total of (N + 1) / 8 calculations are required; the summation generator generates the RTL code of the summation unit, adding all the product terms for summation, that is, sum = mult1+mult2+mult3+…; the generated single - stage half - band interpolation filter is a 4 - way parallel structure with 2 inputs and 4 outputs; The N - stage cascaded half - band interpolation filter generation unit cascades the single - stage half - band interpolation filters to obtain an N - stage cascaded half - band interpolation filter; the number of stages of the half - band interpolation filter stage = log2(max_interp), where max_interp is the maximum interpolation multiple; The interpolation built - in self - test generation unit consists of a ramp test generator and a pulse test generator, generating the RTL code for performing ramp tests and pulse tests on the N - stage cascaded half - band interpolation filter; The cascaded half - band decimation filter RTL generation module includes a decimation clock generation unit, a single - stage half - band decimation filter generation unit, an N - stage cascaded half - band decimation filter generation unit, and a decimation built - in self - test generation unit; The decimation clock generation unit generates the RTL code of the divided - frequency clock, providing a clock signal for each stage of the half - band decimation filter; The single - stage half - band decimation filter generation unit consists of a multiplication generator and a summation generator; the multiplication generator generates the RTL code of the multiplication unit, multiplying the input data by the corresponding filter coefficient, that is, mult1 = din1*coeff1, mult2 = din2*coeff2…; the summation generator generates the RTL code of the summation unit, adding all the product terms for summation, that is, sum = mult1+mult2+mult3+…; the generated single - stage half - band decimation filter is a 4 - way parallel structure with 4 inputs and 2 outputs; The N - stage cascaded half - band decimation filter generation unit cascades the single - stage half - band decimation filters to obtain an N - stage cascaded half - band decimation filter; the number of stages of the half - band decimation filter stage = log2(max_decim), where max_decim is the maximum decimation multiple; The extraction built-in self-test generation unit consists of a ramp test generator and a pulse test generator, and generates RTL code for performing ramp tests and pulse tests on the N-stage cascaded half-band extraction filter.

2. The cascade half-band filter RTL automatic generation system according to claim 1, characterized in that, The cascaded half-band filter test platform generation module includes an excitation signal generation module, an FFT spectrum analysis module, a cascaded half-band filter test platform type selection module, a cascaded half-band interpolation filter test platform generation module, and a cascaded half-band extraction filter test platform generation module; The excitation signal generation module generates sine and cosine signals or Gaussian white noise to provide test excitation signals for the cascaded half-band interpolation filter or the cascaded half-band extraction filter; The FFT spectrum analysis module performs spectrum analysis on the signals before and after filtering; The cascaded half-band filter test platform type selection module selects and generates a cascaded half-band interpolation filter test platform or a cascaded half-band extraction filter test platform according to the type parameter; The cascaded half-band interpolation filter test platform generation module reads the RTL code of the cascaded half-band interpolation filter and generates a test platform for the cascaded half-band interpolation filter; The cascaded half-band extraction filter test platform generation module reads the RTL code of the cascaded half-band extraction filter and generates a test platform for the cascaded half-band extraction filter.

3. A method for an RTL automatic generation system of a cascaded half-band filter according to claim 1 or 2, characterized in that, Including: Step S1, read the user requirement parameters and design the cascaded half-band filter based on Matlab; Step S2, analyze and generate the RTL code of the N-stage cascaded half-band filter based on Python according to the design parameters; Step S3, read the RTL code and analyze and generate a test platform for the cascaded half-band filter based on Python and Matlab.

4. The method according to claim 3, wherein The said step S1 includes: S101, select the type of the cascaded half-band filter to be designed according to the type parameter of the cascaded half-band filter. When the type parameter is 0, select to design the cascaded half-band interpolation filter; when the type parameter is 1, select to design the cascaded half-band extraction filter; S102, use the half-band filter design function firhalfband in Matlab to design the filter, that is, coeff = firhalfband('minorder', fp, dev), where coeff is the single-stage half-band filter coefficient returned by the function, fp is the normalized cut-off frequency of the single-stage half-band filter, dev is the stopband or passband tolerance of the single-stage half-band filter, and minorder represents generating the minimum filter order that meets the requirements of the normalized cut-off frequency and the passband and stopband tolerances; S103, use the impz function and freqz function in Matlab to plot the unit impulse response and frequency response of the cascaded half-band filter respectively; S104, quantize the coefficients of the cascaded half-band filter and compare and analyze the frequency responses of the half-band filter before and after quantization; after several iterations, when the design meets the requirements, output the coefficient values of each stage of the half-band filter, the bit width after coefficient quantization, and the order of the half-band filter.

5. The method according to claim 4, wherein The said step S2 includes: S201. Select the generated type of cascaded half - band filter according to the type parameter of the cascaded half - band filter. When the type parameter is 0, select to generate the RTL code of the cascaded half - band interpolation filter. When the type parameter is 1, select to generate the RTL code of the cascaded half - band decimation filter; S202. Create a Python dictionary object and store the design type parameter generated in step S201 in this dictionary object; S203. Read the design parameters in the dictionary object and sequentially generate a clock, a single - stage half - band filter, an N - stage cascaded half - band filter, and a built - in self - test unit through the write function of Python.

6. The method according to claim 5, characterized in that, The said step S3 includes: S301. Select the generated type of test platform for the cascaded half - band filter according to the type parameter of the cascaded half - band filter. That is, when the type parameter is 0, select to generate the test platform for the cascaded half - band interpolation filter. When the type parameter is 1, select to generate the test platform for the cascaded half - band decimation filter; S302. Use the sin / cos functions and the randn function of Matlab to generate sine and cosine signals and Gaussian white noise to provide test excitation signals for the cascaded half - band filter; S303. In the test platform of the cascaded half - band filter, input the excitation signal to the cascaded half - band filter generated in step S302 to generate a filtered signal, and perform spectral analysis on the signals before and after filtering.

Citation Information

Patent Citations

  • RTL model automatic generation method

    CN111125976A

  • RTL code automatic verification device and method adopting AXI bus interface

    CN110688269A

  • Method for automatically generating RTL model of half-band interpolation filter

    CN111988018A