readout_rm/nco_dpi/codegen/dll/nco_model/nco_dpi.sv

55 lines
1.2 KiB
Systemverilog

// File: C:\Users\Administrator\Desktop\gc_awg\demod_algorithm\daq_matlab\codegen\dll\nco\nco_dpi.sv
// Created: 2025-04-09 02:18:36
// Generated by MATLAB 24.1 and HDL Verifier 24.1
`timescale 1ns / 1ns
import nco_dpi_pkg::*;
module nco_dpi(
input bit clk,
input bit clk_enable,
input bit reset,
input real fcw,
input real ptw,
input real clr,
input real acc,
output real my_c,
output real my_s,
output real acc_o
);
chandle objhandle=null;
real my_c_temp;
real my_s_temp;
real acc_o_temp;
initial begin
objhandle=DPI_nco_initialize(objhandle);
end
final begin
DPI_nco_terminate(objhandle);
end
always @(posedge clk or posedge reset) begin
if(reset== 1'b1) begin
objhandle=DPI_nco_reset(objhandle,fcw,ptw,clr,acc,my_c_temp,my_s_temp,acc_o_temp);
my_c<=my_c_temp;
my_s<=my_s_temp;
acc_o<=acc_o_temp;
end
else if(clk_enable) begin
DPI_nco(objhandle,fcw,ptw,clr,acc,my_c_temp,my_s_temp,acc_o_temp);
my_c<=my_c_temp;
my_s<=my_s_temp;
acc_o<=acc_o_temp;
end
end
endmodule