Skip to content

Commit

Permalink
Break up ten of the longest Verilog source lines
Browse files Browse the repository at this point in the history
  • Loading branch information
ldoolitt committed Sep 4, 2024
1 parent 9e02e73 commit af704af
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
9 changes: 6 additions & 3 deletions cmoc/fdbk_core_tb.v
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,14 @@ always @(posedge clk) begin
sync_d2 <= sync_d;

// Write aligned input, set-point and error signals onto file (set-point scaling test)
if (out_file != 0 && sync_d2 && (test_type==0 || test_type==1)) $fwrite(out_file," %d %d %d %d %d %d\n", setmp_d2, setmp_d, in_mp_d2, in_mp_d, mp_err_d, mp_err);
if (out_file != 0 && sync_d2 && (test_type==0 || test_type==1))
$fwrite(out_file," %d %d %d %d %d %d\n", setmp_d2, setmp_d, in_mp_d2, in_mp_d, mp_err_d, mp_err);

// Write aligned input and output signals onto file (feedback gain scaling test)
if (out_file != 0 && ~iq && (test_type==2 || test_type==3)) $fwrite(out_file," %d %d %d %d %d %d\n", setmp_d, setmp, out_xy_d, out_xy, m_err_scaling, p_err_scaling);
if (out_file != 0 && ~iq && test_type==4) $fwrite(out_file," %d %d %d %d %d %d\n", in1_d, in1, out_xy_d, out_xy, m_err_scaling, p_err_scaling);
if (out_file != 0 && ~iq && (test_type==2 || test_type==3))
$fwrite(out_file," %d %d %d %d %d %d\n", setmp_d, setmp, out_xy_d, out_xy, m_err_scaling, p_err_scaling);
if (out_file != 0 && ~iq && test_type==4)
$fwrite(out_file," %d %d %d %d %d %d\n", in1_d, in1, out_xy_d, out_xy, m_err_scaling, p_err_scaling);
if (sync_d) count_syncs <= count_syncs + 1'b1;
end
`endif
Expand Down
18 changes: 12 additions & 6 deletions dsp/cim_12x.v
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,28 @@ module cim_12x #(
// Snapshots double-integrator outputs at times flagged by "sample", then shifts the results out on the next twelve cycles.
wire signed [dw-1:0] s01; wire g01;
wire signed [dw-1:0] s03; wire g03;
mon_2chan #(.dwi(16), .rwi(dw)) mon01(.clk(clk), .adcf(adca), .mcos(cosa), .msin(sina), .samp(sample), .s_in(s03), .s_out(s01), .g_in(g03), .g_out(g01), .reset(reset));
mon_2chan #(.dwi(16), .rwi(dw)) mon01(.clk(clk), .adcf(adca), .mcos(cosa), .msin(sina),
.samp(sample), .s_in(s03), .s_out(s01), .g_in(g03), .g_out(g01), .reset(reset));

wire signed [dw-1:0] s05; wire g05;
mon_2chan #(.dwi(16), .rwi(dw)) mon03(.clk(clk), .adcf(adcb), .mcos(cosa), .msin(sina), .samp(sample), .s_in(s05), .s_out(s03), .g_in(g05), .g_out(g03), .reset(reset));
mon_2chan #(.dwi(16), .rwi(dw)) mon03(.clk(clk), .adcf(adcb), .mcos(cosa), .msin(sina),
.samp(sample), .s_in(s05), .s_out(s03), .g_in(g05), .g_out(g03), .reset(reset));

wire signed [dw-1:0] s07; wire g07;
mon_2chan #(.dwi(16), .rwi(dw)) mon05(.clk(clk), .adcf(adcc), .mcos(cosa), .msin(sina), .samp(sample), .s_in(s07), .s_out(s05), .g_in(g07), .g_out(g05), .reset(reset));
mon_2chan #(.dwi(16), .rwi(dw)) mon05(.clk(clk), .adcf(adcc), .mcos(cosa), .msin(sina),
.samp(sample), .s_in(s07), .s_out(s05), .g_in(g07), .g_out(g05), .reset(reset));

wire signed [dw-1:0] s09; wire g09;
mon_2chiq #(.dwi(16), .rwi(dw)) mon07(.clk(clk), .iqd(inm), .scale(scale), .iqs(iqs), .samp(sample), .s_in(s09), .s_out(s07), .g_in(g09), .g_out(g07), .reset(reset));
mon_2chiq #(.dwi(16), .rwi(dw)) mon07(.clk(clk), .iqd(inm), .scale(scale), .iqs(iqs),
.samp(sample), .s_in(s09), .s_out(s07), .g_in(g09), .g_out(g07), .reset(reset));

wire signed [dw-1:0] s11; wire g11;
mon_2chiq #(.dwi(16), .rwi(dw)) mon09(.clk(clk), .iqd(outm), .scale(scale), .iqs(iqs), .samp(sample), .s_in(s11), .s_out(s09), .g_in(g11), .g_out(g09), .reset(reset));
mon_2chiq #(.dwi(16), .rwi(dw)) mon09(.clk(clk), .iqd(outm), .scale(scale), .iqs(iqs),
.samp(sample), .s_in(s11), .s_out(s09), .g_in(g11), .g_out(g09), .reset(reset));

wire signed [dw-1:0] s13; wire g13;
mon_2chan #(.dwi(16), .rwi(dw)) mon11(.clk(clk), .adcf(adcx), .mcos(cosb), .msin(sinb), .samp(sample), .s_in(s13), .s_out(s11), .g_in(g13), .g_out(g11), .reset(reset));
mon_2chan #(.dwi(16), .rwi(dw)) mon11(.clk(clk), .adcf(adcx), .mcos(cosb), .msin(sinb),
.samp(sample), .s_in(s13), .s_out(s11), .g_in(g13), .g_out(g11), .reset(reset));

// terminate the chain
assign s13 = {dw{`FILL_BIT}};
Expand Down
4 changes: 3 additions & 1 deletion fpga_family/spartan6/adc_cells.v
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ module adc_cells(
wire adc_iddr2_rst=1'b0;
wire adc_iddr2_set=1'b0;
wire adc_iddr2_ce=1'b1;
// IDDR2 primitive of sp6, refer to http://www.xilinx.com/support/documentation/sw_manuals/xilinx13_4/spartan6_hdl.pdf, page 56 for ddr_alignment
// IDDR2 primitive of sp6
// Refer to http://www.xilinx.com/support/documentation/sw_manuals/xilinx13_4/spartan6_hdl.pdf
// page 56 for ddr_alignment
genvar ix;
generate
for (ix=0; ix<width; ix=ix+1) begin: in_cell
Expand Down

0 comments on commit af704af

Please sign in to comment.