Skip to content

Commit 149ad39

Browse files
committed
zest_dac_interp.v: Add new parameter to disable/enable CDC for input dac data [usecase: second_if_out style] and expose it to zest.v
1 parent 6e7af17 commit 149ad39

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

board_support/zest_soc/zest.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module zest #(
44
parameter FCNT_WIDTH = 16, // to speed up simulation. 125M / 2**16 = 1.9kHz update rate.
55
parameter PH_DIFF_DW = 13,
66
parameter real DAC_INTERP_COEFF_R = 1.0,
7+
parameter TRANSPARENT_DAC = 0,
78
localparam integer N_ADC = 2,
89
localparam integer N_CH = N_ADC*4,
910
localparam real CLKIN_PERIOD = 1000.0 / DSP_FREQ_MHZ / 2, // ns
@@ -427,7 +428,7 @@ assign dac_clk_out = dac_dco_clk;
427428

428429
// interpolator, crossing from dsp_clk to dac_clk domain
429430
wire signed [13:0] dac0_in_data;
430-
zest_dac_interp #(.DW(14)) dac_interp_a (
431+
zest_dac_interp #(.DW(14), .transparent(TRANSPARENT_DAC)) dac_interp_a (
431432
.dsp_clk (dsp_clk_out),
432433
.din (dac_in_data_i),
433434
.coeff (DAC_INTERP_COEFF),
@@ -436,7 +437,7 @@ zest_dac_interp #(.DW(14)) dac_interp_a (
436437
);
437438

438439
wire signed [13:0] dac1_in_data;
439-
zest_dac_interp #(.DW(14)) dac_interp_b (
440+
zest_dac_interp #(.DW(14), .transparent(TRANSPARENT_DAC)) dac_interp_b (
440441
.dsp_clk (dsp_clk_out),
441442
.din (dac_in_data_q),
442443
.coeff (DAC_INTERP_COEFF),

board_support/zest_soc/zest_dac_interp.v

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
module zest_dac_interp #(
2-
parameter integer DW=14
2+
parameter integer DW=14,
3+
parameter transparent=0
34
) (
45
input dsp_clk,
56
input signed [DW-1:0] din,
67
input signed [DW:0] coeff,
78
input dac_clk,
89
output signed [DW-1:0] dout
910
);
11+
generate if (!transparent) begin : add_cdc
1012
// input is: s0, s1, s2, ...
1113
// dac_clk is 2x of dsp_clk, phase aligned
1214
wire signed [DW-1:0] d1;
@@ -37,5 +39,8 @@ module zest_dac_interp #(
3739
dout_r <= ~tick ? r1[DW-1:0] : d3;
3840
end
3941
assign dout = dout_r;
42+
end else begin
43+
assign dout = din;
44+
end endgenerate
4045

4146
endmodule

0 commit comments

Comments
 (0)