Improved NCO: 200MHz

This commit is contained in:
Jojojoppe
2025-10-06 16:25:40 +02:00
parent 1e9d7b7680
commit 06ef70e1ee
5 changed files with 154 additions and 192 deletions

View File

@@ -1,8 +1,6 @@
`timescale 1ns/1ps
module tb_nco_q15();
`include "core/nco_q15_funcs.vh"
// Clock and reset generation
reg clk;
reg resetn;
@@ -20,26 +18,26 @@ module tb_nco_q15();
end;
reg [31:0] ftw_in;
reg [31:0] freq;
wire [15:0] sin_q15;
wire [15:0] cos_q15;
wire out_en;
nco_q15 #(.PHASE_BITS(16)) nco (
nco_q15 #(.CLK_HZ(120_000_000), .FS_HZ(40_000)) nco (
.clk (clk),
.rst_n (resetn),
.ftw_in (ftw_in),
.freq_hz(freq),
.sin_q15(sin_q15),
.cos_q15(cos_q15),
.clk_en (out_en)
);
initial begin
ftw_in = 32'h0;
freq = 32'h0;
#100
ftw_in = ftw_from_hz(1000, 16, 40000);
freq = 32'd1000;
#2_500_000
ftw_in = ftw_from_hz(2000, 16, 40000);
freq = 32'd2000;
end;
endmodule