Email: bknpk@hotmail.com Phone: +972-54-7649119


V

 

An I2C verification environment, which uses memories and VPI (c code) to drive and monitor data to/from DUT, will be described in this work.

  1. In this site many verification environments have been presented, using, specman , VHDL etc....
    The main page of this work is accessed with the following link.
    The verilog code of the project, contains a BFM and also controls the operation of c code.
    This page describes how the verilog test-bench communicates with the c code. The bench may request the c code to prepare buffers to initialize the I2C DUT, poll its data ready register or any other request for buffers. Those buffer are than used by the bench to perform APB bus transactions.

  2. The verilog test-bench simply sets a value in the address array, before requesting buffers from the c code. This is done in the following way:

      a_paddr[`RAM_SZ-1]=1;
      $mem_wrt(a_paddr);
      $mem_wrt(a_pwdata);
      $mem_wrt(a_ctrl);

  3. The c code checks for the message and acts appropriately.

    1. ...
    2. enum t_verilog_to_c {t_reg_init, t_poll};
    3. enum t_verilog_to_c verilog_to_c;
    4. ...
    5.   vpi_printf("C: the address range is 0x%x 0x%x\n", left_addr, right_addr);
    6.   h3 = vpi_handle_by_index(argh, right_addr);
    7.   ar_da.format = vpiIntVal;
    8.   data_to_a.format = vpiIntVal;
    9.   vpi_get_value (h3, &ar_da);
    10.   vpi_printf("C: a_paddr right value is %x field %d\n", ar_da.value.integer, (int)mem_field);
    11.   if(mem_field == t_addr && ar_da.value.integer == 1) {
    12.     verilog_to_c = t_reg_init;
    13. ...
    14.   }

    15. vpi_printf("C: current mem_field %d \n", (int)mem_field);
    16. if(verilog_to_c == t_reg_init) {

      1. The c-code environment also has a scoreboard to check that correct transactions are collected at the output.
        The first steps were simple and stand alone cpp programs called from within a c-code. The main verification program is c and uses VPI to communicate with the verilog bench. A scoreboard, however, is very simple to implement, using STD queues.

  ...


Search This Site


Feedback This Site




new pages on this site