Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `timescale 1ns/1ns
- module TollGateFSM_tb;
- // Inputs
- reg clk;
- reg vehicleApproaches_tb, rfidDetected_tb, sufficientBalance_tb;
- // Outputs
- wire gateOpen_tb, tollCollected_tb, vehiclePasses_tb;
- // Instantiate the TollGateFSM module
- TollGateFSM toll_gate_fsm_inst (
- .vehicleApproaches(vehicleApproaches_tb),
- .rfidDetected(rfidDetected_tb),
- .sufficientBalance(sufficientBalance_tb),
- .vehiclePasses(vehiclePasses_tb),
- .gateOpen(gateOpen_tb),
- .tollCollected(tollCollected_tb)
- );
- // Clock generation
- always begin
- #10 clk = ~clk;
- end
- initial begin
- // Initial stimulus
- clk = 0;
- vehicleApproaches_tb = 0;
- rfidDetected_tb = 0;
- sufficientBalance_tb = 0;
- // Vehicle 1 is Cash-basis
- #10 vehicleApproaches_tb = 1; rfidDetected_tb = 0; sufficientBalance_tb = 0;
- // Vehicle 3 has RFID Sticker and has insufficient balance
- #10 vehicleApproaches_tb = 1; rfidDetected_tb = 1; sufficientBalance_tb = 0;
- // Vehicle 2 has RFID Sticker and has sufficient balance
- #10 vehicleApproaches_tb = 1; rfidDetected_tb = 1; sufficientBalance_tb = 1;
- end
- // End simulation
- always #100 $stop;
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement