Advertisement
regzarr

tb

Oct 24th, 2019
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module testbench(
  2.   output reg a, b, clk, rst_b,
  3.   output m, n, p
  4. );
  5.  
  6. fsm_3s Mealy(
  7.   .a(a),
  8.   .b(b),
  9.   .clk(clk),
  10.   .rst_b(rst_b),
  11.   .m(m),
  12.   .n(n),
  13.   .p(p)
  14.   );
  15.  
  16. initial begin
  17.   clk = 1'b0;
  18.   rst_b = 1'b1;
  19.   repeat(4) #10 clk = ~clk;
  20.   rst_b = 1'b0;
  21.   forever #10 clk = ~clk;
  22. end
  23.  
  24. initial begin
  25.   repeat(10)
  26.     begin
  27.       a = 1'd0;
  28.       b = 1'd0;
  29.       #50
  30.       a = 1'd1;
  31.       b = 1'd1;
  32.       #50
  33.       a = 1'd0;
  34.       #50
  35.       a = 1'd1;
  36.       #50
  37.       b = 1'd0;
  38.     end
  39. end
  40.  
  41. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement