//`include "fsm.v" module testbench; wire displayCoin, outputWater, outputOrange, outputCoin; reg coinInserted, clearPressed, waterChosen, orangeChosen, waterEmpty, orangeEmpty; reg clk; // create waveform file initial begin $display("start simulation"); $dumpfile("wave.vcd"); $dumpvars(0,displayCoin); $dumpvars(0,outputWater); $dumpvars(0,outputOrange); $dumpvars(0,outputCoin); $dumpvars(0,coinInserted); $dumpvars(0,clearPressed); $dumpvars(0,waterChosen); $dumpvars(0,orangeChosen); $dumpvars(0,waterEmpty); $dumpvars(0,orangeEmpty); $dumpvars(0,f); #10000 $finish; end fsm f (.clk(clk), .dc(displayCoin), .ow(outputWater), .oo(outputOrange), .oc(outputCoin), .coin(coinInserted), .clear(clearPressed), .w(waterChosen), .o(orangeChosen), .we(waterEmpty), .oe(orangeEmpty)); initial begin clk = 0; forever begin #50 clk = 1; #50 clk = 0; end end initial begin coinInserted = 0; clearPressed = 0; waterChosen = 0; orangeChosen = 0; waterEmpty = 0; orangeEmpty = 0; #500 coinInserted = 1; #100 coinInserted = 0; #400 waterChosen = 1; #100 waterChosen = 0; #500 coinInserted = 1; #100 coinInserted = 0; #400 clearPressed = 1; #200 clearPressed = 0; end endmodule // testbench