/*********************************************************************************
*Copyright(C), IC Design
*FileName: PCM_ENCODER_TEST_2.v
*Author: Yue Shipeng
*Version: 9.0
*Date: 2023.01.18 02:00
*Description: TESTBENCH FOR PCM_ENCODER
*History: Notepad++ version
**********************************************************************************//*********************************************************************************
PCM ENCODER TEST 2
**********************************************************************************/
`timescale 10ns/1ns
modulePCM_ENCODER_TEST_2;
reg clk;
reg rst;
reg [7:0] din;
reg [3:0] N;
reg INE;
wire dout;
parameter half_cycle =10;
PCM_ENCODER ut2(.clk(clk),.rst(rst),.din(din),.N(N),.INE(INE),.dout(dout));
initial begin
clk =0;
forever begin
clk = # half_cycle ~ clk;
end
end
initial begin
rst =1;
# (1* half_cycle) rst =0;
# (2* half_cycle) rst =1;
end
initial
// the initial set of input signal;
din <=0;
N <=0;
INE <=0;// the 2 Byte data is received;// 3C, 0011_1100;repeat(5) @ (posedge clk);
din <=8'h3C;
N <=4'd1;
INE <=1;// 4D, 0100_1101;repeat(1) @ (posedge clk);
din <=8'h4D;
N <=0;
INE <=0;repeat(1) @ (posedge clk);
din <=0;repeat(2000) @ (posedge clk);
$finish;
end
initial begin
$fsdbDumpfile("./verdiFsdb/PCM_ENCODER_TEST_2.fsdb");
$fsdbDumpvars(0);
$fsdbDumpMDA;
end
endmodule