`timescale 1ns / 1ps
module traffic_light_tb;
parameter DELAY = 5;
logic sensor;
logic [15:0] green_cnt;
logic [15:0] yellow_cnt;
logic clk;
logic rst;
logic green_light;
logic yellow_light;
logic red_light;
traffic_light traffic_light_i (.*);
initial begin
clk = 1'b0;
forever begin
clk = #10 ~clk;
end
end
initial begin
rst = 1'b1;
#20 rst = 1'b0;
end
initial begin
sensor = 1'b0;
green_cnt = 5;
yellow_cnt = 10;
@(posedge clk); // 次のクロックへ
#DELAY;
@(posedge clk); // 次のクロックへ
#DELAY;
@(posedge clk); // 次のクロックへ
#DELAY;
sensor = 1'b1;
@(posedge clk); // 次のクロックへ
#DELAY;
green_cnt = 0;
@(posedge clk); // 次のクロックへ
#DELAY;
yellow_cnt = 0;
end
endmodule
日 | 月 | 火 | 水 | 木 | 金 | 土 |
---|---|---|---|---|---|---|
- | - | - | - | - | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | - | - | - | - | - | - |