update phase comp with cmpy; add var cal module

This commit is contained in:
2023-06-12 17:35:52 +08:00
parent f7eb53ced7
commit d7cca991f1
220 changed files with 87094 additions and 1041 deletions
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:f720ec0096df81b52c0348a241fa1ed28cd46c40bd3dbb9cfd2f87e9f8ca252a
3 size 660813
@@ -0,0 +1,78 @@
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 06/11/2023 03:49:38 PM
// Design Name:
// Module Name: tb_var_cal
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module tb_var_cal;
reg clk = 1'b1;
reg rst = 1'b1;
reg cal_start = 1'b0;
reg cal_auto_en = 1'b0;
wire cal_busy;
reg din_valid = 1'b0;
reg [29:0] din_real = 'b0;
reg [29:0] din_imag = 'b0;
wire var_valid;
wire [31:0] var;
var_cal u_var_cal
(
.clk (clk ),
.rst (rst ),
.cal_start (cal_start ),
.cal_auto_en(cal_auto_en),
.cal_busy (cal_busy ),
.din_valid (din_valid ),
.din_real (din_real ),
.din_imag (din_imag ),
.var_valid (var_valid ),
.var (var )
);
integer i;
integer r_file;
initial begin
#102
rst = 1'b0;
#100
din_valid = 1'b1;
// cal_start = 1'b1;
cal_auto_en = 1'b1;
r_file = $fopen("./../../../../../testbenches/singletone.csv","r");
for (i = 0; i <= 32768; i = i + 1) begin
@(posedge clk)
$fscanf(r_file,"%d,%d",din_real,din_imag);
end
$fclose(r_file);
$stop;
end
always #10 clk = ~clk;
endmodule