Reputation: 358
I am trying to use UVM-SystemC library in Eclipse and I managed to install it but I am having troubles connecting it. I try for example to write this piece of code:
template <typename REQ> class vip_driver : public uvm_driver<REQ>
{
public:
vip_if* vif;
vip_driver( uvm_component_name name )
: uvm_driver<REQ>(name), vif(NULL) {}
UVM_COMPONENT_PARAM_UTILS(vip_driver<REQ>);
...
}
};
but it does not recognize uvm_driver
and if I try to build it I get this error:
Building file: ../proba.cpp
Invoking: Cygwin C++ Compiler
g++ -I"C:/systemc-2.3.1/include" -I"C:/uvm-systemc-1.0-alpha1/include" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"proba.d" -MT"proba.d" -o "proba.o" "../proba.cpp"
../proba.cpp:9:1: error: 'vip_if' does not name a type
vip_if* vif;
^
../proba.cpp:84:10: error: explicit specialization in non-namespace scope 'class vip_driver<REQ>'
template<>
^
../proba.cpp:85:7: error: specialization of 'template<class T> class scv_extensions' must appear at namespace scope
class scv_extensions<packetT> : public scv_extensions_base<packetT> {
^
../proba.cpp:104:33: error: cannot define member function 'vip_driver<REQ>::sctop::sctop' within 'vip_driver<REQ>'
sctop::sctop(sc_module_name name) : sc_module(name)
^
../proba.cpp:165:1: error: expected '}' at end of input
}
^
../proba.cpp: In constructor 'vip_driver<REQ>::vip_driver(uvm::uvm_component_name)':
../proba.cpp:11:26: error: class 'vip_driver<REQ>' does not have any field named 'vif'
: uvm_driver<REQ>(name), vif(NULL) {}
^
../proba.cpp: In member function 'void vip_driver<REQ>::build_phase(uvm::uvm_phase&)':
../proba.cpp:16:20: error: 'vip_if' was not declared in this scope
if (!uvm_config_db<vip_if*>::get(this, "*", "vif", vif))
^
../proba.cpp:16:27: error: template argument 1 is invalid
if (!uvm_config_db<vip_if*>::get(this, "*", "vif", vif))
^
../proba.cpp:16:52: error: 'vif' was not declared in this scope
if (!uvm_config_db<vip_if*>::get(this, "*", "vif", vif))
^
../proba.cpp: In member function 'void vip_driver<REQ>::run_phase(uvm::uvm_phase&)':
../proba.cpp:27:1: error: 'rsp' was not declared in this scope
rsp.set_id_info(req);
^
../proba.cpp:31:1: error: a function-definition is not allowed here before '{' token
{
^
../proba.cpp: At global scope:
../proba.cpp:165:1: error: expected unqualified-id at end of input
}
^
make: *** [subdir.mk:26: proba.o] Error 1
I have included uvm library and it recognizes #include "uvm.h"
line.
Upvotes: 1
Views: 181
Reputation: 36
UVM-SystemC classes are part of the uvm namespace. Try to add uvm:: in front of the uvm library elements
Upvotes: 2