Skip to content

Commit

Permalink
Fixed norm cordic bug and display 2 correlations at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchgu committed Dec 6, 2015
1 parent a8544db commit a2649a6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Nexys4Guitar/src/hdl/correlator.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module correlator(
output reg [41:0] dot_product,
output reg [31:0] normalizer,
output reg dot_product_valid,
output [76:0] debug
output [82:0] debug
);

parameter REF_MIF = "../mif/00.mif";
Expand Down
18 changes: 10 additions & 8 deletions Nexys4Guitar/src/hdl/nexys4_guitar.v
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ module nexys4_guitar (
.addrb(haddr), // input wire [9 : 0] addrb
.doutb(hdata) // output wire [15 : 0] doutb
);
wire [41:0] dot_product [0:47];
wire [31:0] normalizer [0:47];
wire [47:0] dot_product_valid;
wire [76:0] debug [0:47];
/*
correlator correlator_00(
.clk(clk_104mhz),
Expand Down Expand Up @@ -340,6 +336,10 @@ module nexys4_guitar (
defparam correlator_gen[47].c.REF_MIF = "../mif/47.mif";
defparam correlator_gen[47].c.NORM_REF = 21'b0000100011101110110010;

wire [41:0] dot_product [0:47];
wire [31:0] normalizer [0:47];
wire [47:0] dot_product_valid;
wire [82:0] debug [0:47];
genvar a;
generate for(a=0; a<48; a=a+1)
begin : correlator_gen
Expand Down Expand Up @@ -728,9 +728,9 @@ module nexys4_guitar (
.probe13(magnitude_tlast), // input wire [0:0] probe13
.probe14(mag_squared_tlast), // input wire [0:0] probe14
.probe15(in_range), // input wire [0:0] probe15
.probe16(debug[47][76:61]),
.probe17(debug[47][60:45]),
.probe18(debug[47][44:3]),
.probe16(debug[47][82:67]),
.probe17(debug[47][66:51]),
.probe18(debug[47][50:3]),
.probe19(debug[47][2]),
.probe20(debug[47][1]),
.probe21(debug[47][0])
Expand Down Expand Up @@ -764,7 +764,9 @@ module nexys4_guitar (
hsync_out <= hsync_stage[1];
vsync_out <= vsync_stage[1];
vcount_stage <= vcount;
correlate_pixel_out <= (vcount_stage < 48) ? correlate_pixel[vcount_stage[5:0]]: 3'b000;
if (vcount_stage < 64) correlate_pixel_out <= correlate_pixel[SW[5:0]];
else if (vcount_stage < 128) correlate_pixel_out <= correlate_pixel[SW[11:6]];
else correlate_pixel_out <= 3'b000;
end
assign VGA_R = {4{hist_pixel[0] | correlate_pixel_out[0]}};
assign VGA_G = {4{hist_pixel[1] | correlate_pixel_out[1]}};
Expand Down
2 changes: 1 addition & 1 deletion Nexys4Guitar/src/hdl/process_correlation.v
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module process_correlation(

always @(posedge clk) begin
if (~fifo_full & correlation_valid) begin
filter_correlation <= (correlation>>2) + filter_correlation - (filter_correlation>>2);
filter_correlation <= (correlation>>5) + filter_correlation - (filter_correlation>>5);
write_new_correlation <= 1;
end
else write_new_correlation <= 0;
Expand Down
6 changes: 3 additions & 3 deletions Nexys4Guitar/src/ip/ila_0/ila_0.xci

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Nexys4Guitar/src/ip/norm_sqrt/norm_sqrt.xci
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_ARCHITECTURE">2</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_COARSE_ROTATE">0</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_CORDIC_FUNCTION">6</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_DATA_FORMAT">1</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_DATA_FORMAT">2</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_HAS_ACLK">1</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_HAS_ACLKEN">0</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_HAS_ARESETN">0</spirit:configurableElementValue>
Expand All @@ -27,7 +27,7 @@
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_ITERATIONS">0</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_M_AXIS_DOUT_TDATA_WIDTH">24</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_M_AXIS_DOUT_TUSER_WIDTH">1</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_OUTPUT_WIDTH">21</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_OUTPUT_WIDTH">22</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_PHASE_FORMAT">0</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_PIPELINE_MODE">-2</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="MODELPARAM_VALUE.C_PRECISION">0</spirit:configurableElementValue>
Expand All @@ -46,11 +46,11 @@
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Coarse_Rotation">false</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Compensation_Scaling">No_Scale_Compensation</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Component_Name">norm_sqrt</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Data_Format">UnsignedFraction</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Data_Format">UnsignedInteger</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Functional_Selection">Square_Root</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Input_Width">42</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Iterations">0</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Output_Width">21</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Output_Width">22</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Phase_Format">Radians</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Pipelining_Mode">Maximum</spirit:configurableElementValue>
<spirit:configurableElementValue spirit:referenceId="PARAM_VALUE.Precision">0</spirit:configurableElementValue>
Expand Down

0 comments on commit a2649a6

Please sign in to comment.