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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [BFM/] [src/] [SPI/] [spi_driver.svh] - Diff between revs 47 and 48

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 47 Rev 48
Line 40... Line 40...
  endfunction: set_default
  endfunction: set_default
 
 
  //--------------------------------------------------------------------
  //--------------------------------------------------------------------
  virtual task run_phase(uvm_phase phase);
  virtual task run_phase(uvm_phase phase);
    spi_sequence_item item;
    spi_sequence_item item;
    int index = 0;
    int index;
 
 
    set_default();
    set_default();
 
 
    forever
    forever
    begin
    begin
 
      index = 0;
      seq_item_port.get_next_item(item);
      seq_item_port.get_next_item(item);
 
 
      vif.ss_n <= 0;
      vif.ss_n <= 0;
      vif.mosi <= item.mo_data[index];
      vif.mosi <= item.mosi_data[index];
      #(vif.period / 2);
      #(vif.period / 2);
 
 
      fork
      fork
        repeat(item.data_width)
        repeat(item.data_width)
        begin
        begin
Line 65... Line 66...
      join_none
      join_none
 
 
      repeat(item.data_width)
      repeat(item.data_width)
      begin
      begin
        @(vif.cb_rise);
        @(vif.cb_rise);
        item.mi_data[index] = vif.miso;
        item.miso_data[index] = vif.miso;
        index++;
        index++;
        @(vif.cb_fall);
        @(vif.cb_fall);
        vif.mosi <= item.mo_data[index];
        vif.mosi <= item.mosi_data[index];
      end
      end
 
 
      #(vif.period / 2);
      #(vif.period / 2);
      vif.ss_n <= 1;
      vif.ss_n <= 1;
 
 

powered by: WebSVN 2.1.0

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