parameterize modules
This commit is contained in:
parent
6215a3516d
commit
ec72ff7551
|
@ -32,9 +32,9 @@
|
|||
// Other:
|
||||
//-FHDR--------------------------------------------------------------------------------------------------------
|
||||
module IIR_Filter_p1 #(
|
||||
parameter data_in_width = 16
|
||||
parameter coef_width = 32
|
||||
,parameter data_in_width = 16
|
||||
,parameter cascade_in_width = 37
|
||||
,parameter coef_width = 32
|
||||
,parameter temp_var_width = cascade_in_width - 1
|
||||
,parameter data_out_width = cascade_in_width - 2
|
||||
)
|
||||
|
|
|
@ -32,12 +32,10 @@
|
|||
// Other:
|
||||
//-FHDR--------------------------------------------------------------------------------------------------------
|
||||
module IIR_Filter_p8 #(
|
||||
parameter data_in_width = 16
|
||||
,parameter coef_width = 32
|
||||
,parameter frac_data_out_width = 20//X for in,5
|
||||
,parameter frac_coef_width = 31//division
|
||||
,parameter temp_var_width = 42
|
||||
parameter coef_width = 32
|
||||
,parameter data_in_width = 16
|
||||
,parameter data_out_width = 37
|
||||
,parameter temp_var_width = data_out_width+5
|
||||
)
|
||||
// H(z) = a(1 + b*z^-1 + b^2*z^-2 + b^3*z^-3 + b^4*z^-4 + b^5*z^-5 + b^6*z^-6 + b^7*z^-7) / (1 - b^8*z^-8)
|
||||
(
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
//-FHDR--------------------------------------------------------------------------------------------------------
|
||||
|
||||
module IIR_top #(
|
||||
parameter temp_var_width = 37
|
||||
,parameter data_out_width = 23
|
||||
parameter data_out_width = 23
|
||||
,parameter temp_var_width = data_out_width + 14
|
||||
)
|
||||
(
|
||||
input rstn
|
||||
|
@ -104,7 +104,9 @@ wire signed [temp_var_width-15:0] IIRout_p7_im;
|
|||
|
||||
|
||||
|
||||
IIR_Filter_p8 inst_iir_p0 (
|
||||
IIR_Filter_p8 #(
|
||||
.data_out_width (temp_var_width )
|
||||
) inst_iir_p0 (
|
||||
.clk (clk ),
|
||||
.rstn (rstn ),
|
||||
.en (en ),
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
//-FHDR--------------------------------------------------------------------------------------------------------
|
||||
|
||||
module TailCorr_top #(
|
||||
parameter temp_var_width = 23
|
||||
parameter temp_var_width = 22
|
||||
)
|
||||
(
|
||||
input rstn
|
||||
|
@ -364,7 +364,9 @@ end
|
|||
|
||||
|
||||
|
||||
IIR_top inst_iir_top_0 (
|
||||
IIR_top #(
|
||||
.data_out_width (temp_var_width )
|
||||
) inst_iir_top_0 (
|
||||
.clk (clk ),
|
||||
.rstn (rstn ),
|
||||
.en (en ),
|
||||
|
@ -413,7 +415,9 @@ IIR_top inst_iir_top_0 (
|
|||
.IIRout_p7 (IIRout_p7[0] )
|
||||
);
|
||||
|
||||
IIR_top inst_iir_top_1 (
|
||||
IIR_top #(
|
||||
.data_out_width (temp_var_width )
|
||||
) inst_iir_top_1 (
|
||||
.clk (clk ),
|
||||
.rstn (rstn ),
|
||||
.en (en ),
|
||||
|
@ -462,7 +466,9 @@ IIR_top inst_iir_top_1 (
|
|||
.IIRout_p7 (IIRout_p7[1] )
|
||||
);
|
||||
|
||||
IIR_top inst_iir_top_2 (
|
||||
IIR_top #(
|
||||
.data_out_width (temp_var_width )
|
||||
) inst_iir_top_2 (
|
||||
.clk (clk ),
|
||||
.rstn (rstn ),
|
||||
.en (en ),
|
||||
|
@ -511,7 +517,9 @@ IIR_top inst_iir_top_2 (
|
|||
.IIRout_p7 (IIRout_p7[2] )
|
||||
);
|
||||
|
||||
IIR_top inst_iir_top_3 (
|
||||
IIR_top #(
|
||||
.data_out_width (temp_var_width )
|
||||
) inst_iir_top_3 (
|
||||
.clk (clk ),
|
||||
.rstn (rstn ),
|
||||
.en (en ),
|
||||
|
@ -560,7 +568,9 @@ IIR_top inst_iir_top_3 (
|
|||
.IIRout_p7 (IIRout_p7[3] )
|
||||
);
|
||||
|
||||
IIR_top inst_iir_top_4 (
|
||||
IIR_top #(
|
||||
.data_out_width (temp_var_width )
|
||||
) inst_iir_top_4 (
|
||||
.clk (clk ),
|
||||
.rstn (rstn ),
|
||||
.en (en ),
|
||||
|
@ -609,7 +619,9 @@ IIR_top inst_iir_top_4 (
|
|||
.IIRout_p7 (IIRout_p7[4] )
|
||||
);
|
||||
|
||||
IIR_top inst_iir_top_5 (
|
||||
IIR_top #(
|
||||
.data_out_width (temp_var_width )
|
||||
) inst_iir_top_5 (
|
||||
.clk (clk ),
|
||||
.rstn (rstn ),
|
||||
.en (en ),
|
||||
|
|
Loading…
Reference in New Issue