-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadderTransactor.cpp
66 lines (40 loc) · 969 Bytes
/
adderTransactor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Created by Bill.Zhang in 2023;
*/
#include "adderTransactor.h"
#include "svdpi.h"
// ------------------------------ dpi apis ------------------------------------------------
void dpi_import_function()
{
printf("import func.\n");
}
extern "C" void dpi_export_function(int test_clk);
// ------------------------------ transactor apis -----------------------------------------
void AdderGetVersion()
{
printf("Ver:1.0.0\n");
}
class BillTestClass
{
private:
public:
void TestPrint();
};
void BillTestClass::TestPrint()
{
printf("BillTestClass.\n");
svSetScope (svGetScopeFromName ("dut_wrapper.inst"));
dpi_export_function(10);
}
adder_transactor* adder_transactor::m_pInstance=0;
adder_transactor* adder_transactor::GetInstance()
{
m_pInstance=new adder_transactor();
return m_pInstance;
}
void adder_transactor::TestPrint()
{
pBillTestClass=new BillTestClass();
pBillTestClass->TestPrint();
delete pBillTestClass;
}