MMC/rtl/modelsim/ADC_sample_debug.v
2022-06-26 16:03:38 +08:00

46 lines
1.1 KiB
Verilog

/************************************************************\
** Copyright (c) 2011-2021 Anlogic, Inc.
** All Right Reserved.
\************************************************************/
/************************************************************\
** Log : This file is generated by Anlogic IP Generator.
** File : G:/Compete/Ass/ArmCortex-M0/CortexM0_SoC_Task/Task3/td/al_ip/FM_ADC.v
** Date : 2022 04 29
** TD version : 5.0.30786
\************************************************************/
module ADC_Sample_debug(
output wire eoc,
output reg [11:0] dout,
input RSTn,
input clk,
input [2:0] channel
);
clkADC_debug_pwm simEOC
(
.bps_en(1),
.clk(clk),
.RSTn(RSTn),
.clk_ADC_debug(eoc)
);
reg [7:0] I_data;
reg [7:0] Q_data;
reg [7:0] rand;
always@(posedge eoc or negedge RSTn ) begin
I_data <= $random %255;
Q_data <= $random %255;
end
always@(posedge eoc or negedge RSTn ) begin
//dout <= {channel[2:0], channel[2:0],channel[2:0],channel[2:0]};
dout[11:4] <= (channel==3'b110)?I_data:Q_data;
dout[3:0] <=4'b0;
end
endmodule