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

Subversion Repositories oms8051mini

[/] [oms8051mini/] [trunk/] [verif/] [tb/] [tb_tasks.v] - Diff between revs 11 and 29

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

Rev 11 Rev 29
Line 134... Line 134...
      @(posedge reg_ack);
      @(posedge reg_ack);
       #1 read_data[7:0] = reg_rdata[7:0];
       #1 read_data[7:0] = reg_rdata[7:0];
      @(posedge app_clk);
      @(posedge app_clk);
       reg_cs  = 0;
       reg_cs  = 0;
 
 
      //$display ("Config-Read: Id: %h Addr = %h, Data = %h", block_id,address, read_data);
      $display ("Config-Read: Id: %h Addr = %h, Data = %h", block_id,address, read_data);
  end
  end
endtask
endtask
 
 
 
task cpu_byte_read_cmp;
 
  input  [3:0]  block_id;
 
  input  [15:0] address;
 
  input [7:0]   exp_read_data;
 
  reg   [7:0]   read_data;
 
  begin
 
      @(posedge app_clk);
 
      reg_id  = block_id;
 
 
 
      // Byte-0
 
      reg_cs = 1;
 
      reg_wr = 0;
 
      reg_be = 1'h1;
 
      reg_addr = address;
 
      @(posedge reg_ack);
 
       #1 read_data[7:0] = reg_rdata[7:0];
 
      @(posedge app_clk);
 
       reg_cs  = 0;
 
 
 
      if(read_data !== exp_read_data) begin
 
          $display ("ERROR: REG READ : Id: %h Addr = %h, Data = %h", block_id,address, read_data);
 
          `TB_GLBL.test_err;
 
      end else
 
          $display ("Config-Read: Id: %h Addr = %h, Data = %h", block_id,address, read_data);
 
  end
 
endtask
task cpu_byte_write;
task cpu_byte_write;
  input  [3:0] block_id; // 0/1/2 --> ram/spi/uart 
  input  [3:0] block_id; // 0/1/2 --> ram/spi/uart 
  input  [15:0] address;
  input  [15:0] address;
  input  [7:0] write_data;
  input  [7:0] write_data;
  begin
  begin

powered by: WebSVN 2.1.0

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