// assign statements (if any)
fenpin i1 (
// port map - connection between master ports and signals/registers
.clk_i(clk_i),
.div2_o(div2_o),
.div3_o(div3_o),
.div4_o(div4_o),
.div8_o(div8_o),
.rst_n_i(rst_n_i)
);
initial
begin
rst_n_i=0;
clk_i=0;
#1000;
@(posedge clk_i);
rst_n_i=1;
#100000000;
$stop;
$display("Running testbench");
end
always
// optional sensitivity list
// @(event1 or event2 or .... eventn)
begin
// code executes for every event on sensitivity list
// insert code here --> begin
@eachvec;
// --> end
end
always #20 clk_i=~clk_i;
endmodule
最后进行仿真观察波形!