55 lines
1.3 KiB
Systemverilog
55 lines
1.3 KiB
Systemverilog
// File: /data/work/yzzhang/hdl/sv/readout_AWG_RM/codegen/dll/nco/nco_dpi.sv
|
|
// Created: 2024-10-26 13:13:02
|
|
// Generated by MATLAB 9.13 and HDL Verifier 7.0
|
|
|
|
//`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 result_cos,
|
|
output real result_sin,
|
|
output real result_acc
|
|
);
|
|
|
|
chandle objhandle=null;
|
|
real result_cos_temp;
|
|
real result_sin_temp;
|
|
real result_acc_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,result_cos_temp,result_sin_temp,result_acc_temp);
|
|
result_cos<=result_cos_temp;
|
|
result_sin<=result_sin_temp;
|
|
result_acc<=result_acc_temp;
|
|
|
|
end
|
|
else if(clk_enable) begin
|
|
DPI_nco(objhandle,fcw,ptw,clr,acc,result_cos_temp,result_sin_temp,result_acc_temp);
|
|
result_cos<=result_cos_temp;
|
|
result_sin<=result_sin_temp;
|
|
result_acc<=result_acc_temp;
|
|
|
|
end
|
|
end
|
|
endmodule
|