test bench for the train control.txt

test bench for the train control.txt - /test bench for the...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//test bench for the train control module tb; reg clock, reset, sen5, sen4, sen3, sen2, sen1; wire sw1, sw2, sw3; wire [1:0] DA, DB; parameter TRUE = 1'b1; parameter FALSE = 1'b0; parameter CLOCK_CYCLE = 20; parameter CLOCK_WIDTH = CLOCK_CYCLE/2; parameter IDLE_CLOCKS = 2; fsm fsm0(clock, reset, sen1, sen2, sen3, sen4, sen5, sw1, sw2, sw3, DA, DB); //set up monitor initial begin $display ("Time Reset Sensor_1 Sensor_2 Sensor_3 Sensor_4 Sensor_5 Switch_1 Switch_2 Switch_3 Train_A Train_B\n"); $monitor ($time,"%b %b %b %b %b %b %b %b %b %b %b %b", clock, reset, sen1, sen2, sen3, sen4, sen5, sw1, sw2, sw3, DA, DB); end //create the running clock initial begin clock = FALSE; forever #CLOCK_WIDTH clock = ~clock; end /* //generate reset signal for two cycles initial begin reset = TRUE; repeat (IDLE_CLOCKS) @ (negedge clock); reset = FALSE; end */ //generate stimulus after waiting for reset initial begin repeat (3) @(negedge clock) {reset,sen1,sen2,sen3,sen4,sen5} = 6'b100000;
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern