OpenCores
URL https://opencores.org/ocsvn/socgen/socgen/trunk

Subversion Repositories socgen

[/] [socgen/] [trunk/] [Projects/] [opencores.org/] [logic/] [ip/] [ps2_interface/] [sim/] [icarus/] [default/] [test_define] - Rev 131

Compare with Previous | Blame | View Log




initial
 begin
 $display("              ");
 $display("          ===================================================");
 $display("%8d  Test Start",$realtime );
 $display("          ===================================================");
 $display("              ");


 fork
 begin
 test.cg.next(12);
 
 test.cg.next(1000);

// test host to device
 test.ps2_host.send_byte   (8'h00);
 test.cg.next(10);

 test.ps2_host.send_byte   (8'h81);
 test.cg.next(10);

 test.ps2_host.send_byte   (8'h74);
 test.cg.next(10);

 test.ps2_host.send_byte   (8'hf7);
 test.cg.next(10);

 // test host to device no ack
 test.ps2_model.device_ack            = 1'b0;
 test.ps2_host.exp_tx_ack_err          = 1'b1;
 test.ps2_host.send_byte   (8'hff);
 test.cg.next(10);

 // test host to device with ack
 test.ps2_model.device_ack            = 1'b1;
 test.ps2_host.exp_tx_ack_err          = 1'b0;
 test.ps2_host.send_byte   (8'haa);
 test.cg.next(1000);


 // test device to host
 test.ps2_host.clear_rx_host;
 test.ps2_host.rcv_byte(8'h00);
 test.cg.next(100);


 test.ps2_host.clear_rx_host;
 test.ps2_host.rcv_byte(8'h81);
 test.cg.next(100);

 test.ps2_host.clear_rx_host;
 test.ps2_host.rcv_byte(8'h7e); 
 test.cg.next(100);

 test.ps2_host.clear_rx_host;
 test.ps2_host.rcv_byte(8'hff);  
 test.cg.next(100);

 //  parity error
 test.ps2_host.clear_rx_host;
 test.ps2_host.rcv_byte(8'haa);
 test.cg.next(100);

 //  framing error

 test.ps2_host.clear_rx_host;
 test.ps2_host.rcv_byte(8'h55);
 test.cg.next(100);
 end


  begin
  test.cg.next(12);
  test.ps2_model.rcv_byte(8'h00,1'b1);
  test.ps2_model.rcv_byte(8'h81,1'b1);
  test.ps2_model.rcv_byte(8'h74,1'b1); 
  test.ps2_model.rcv_byte(8'hf7,1'b0); 
  test.ps2_model.rcv_byte(8'hff,1'b1); 
  test.ps2_model.rcv_byte(8'haa,1'b1);
  test.cg.next(10000);
  test.ps2_model.device_tx_parity = 1'b0;
  test.ps2_model.send_byte(8'h00);
  test.cg.next(100);
  test.ps2_model.send_byte(8'h81);
  test.cg.next(100);
  test.ps2_model.send_byte(8'h7e);
  test.cg.next(100);
  test.ps2_model.send_byte(8'hff);
  test.cg.next(100);
  test.ps2_model.device_tx_parity = 1'b1;
  test.ps2_model.send_byte(8'haa);
  test.cg.next(100);
  test.ps2_model.device_tx_parity = 1'b0;
  test.ps2_model.device_stop    = 1'b0;
  test.ps2_model.send_byte(8'h55);

  end
  join

 test.cg.exit;
end




Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.