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.
-
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.
This page describes how APB transaction are done.
-
The test-bench is build of a few blocks. The verilog test-bench contains a
BFM and requests item from a c code generator. The bench also collects data
and send them to the c code. The c code passes it on to a scoreboard, which is
implemented in c++.
-
In this page I show my first steps in calling a function from c to c++.
To check the concept, I created small c++ function, a header file and main in
c, which calls the c++ function.
-
The c++ code is listed below:
#include
extern "C" int print(int i, double d)
{
std::cout << "i = " << i << ", d = " << d << " \n";
}
-
The header is also simple:
extern "C" int print(int i, double d);
-
The main is written in c:
#include "l.h"
int main() {
int i;
double d;
i=2;
d=5.0;
print(i, d);
}
-
Use the following commands to compile and run:
g++ f.cpp m.c
./a.out
-
My next step in this self study project was to implement a simple
scoreboard
in c++.
|