Initial commit
This commit is contained in:
51
Exp5-3/Exp5-3.srcs/sim_1/new/Register32_tb.v
Normal file
51
Exp5-3/Exp5-3.srcs/sim_1/new/Register32_tb.v
Normal file
@@ -0,0 +1,51 @@
|
||||
`timescale 1ns / 1ps
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// Company:
|
||||
// Engineer:
|
||||
//
|
||||
// Create Date: 2024/11/27 04:03:49
|
||||
// Design Name:
|
||||
// Module Name: Register32_tb
|
||||
// Project Name:
|
||||
// Target Devices:
|
||||
// Tool Versions:
|
||||
// Description:
|
||||
//
|
||||
// Dependencies:
|
||||
//
|
||||
// Revision:
|
||||
// Revision 0.01 - File Created
|
||||
// Additional Comments:
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
module Register32_tb;
|
||||
reg [31:0] D;
|
||||
reg clk, rst, set;
|
||||
wire [31:0] Q;
|
||||
Register32 uut (
|
||||
.D(D),
|
||||
.clk(clk),
|
||||
.rst(rst),
|
||||
.set(set),
|
||||
.Q(Q)
|
||||
);
|
||||
initial begin
|
||||
clk = 0;
|
||||
forever #10 clk = ~clk;
|
||||
end
|
||||
initial begin
|
||||
D = 32'b0; rst = 0; set = 0; #15;
|
||||
// Reset test
|
||||
rst = 1; #20;
|
||||
rst = 0; #20;
|
||||
// Set test
|
||||
set = 1; #20;
|
||||
set = 0; #20;
|
||||
// Data input test
|
||||
D = 32'hA5A5A5A5; #30;
|
||||
D = 32'h5A5A5A5A; #30;
|
||||
$stop;
|
||||
end
|
||||
endmodule
|
||||
Reference in New Issue
Block a user