2016-09-26 21 views
1

我想在Eclipse中使用UVM-SystemC庫,並且設法安裝它,但我遇到了連接它的麻煩。我嘗試例如寫這篇文章的代碼:使用Eclipse和Cygwin編譯和鏈接UVM-SystemC

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>); 

... 
} 
}; 

,但它不承認uvm_driver,如果我嘗試建立它,我得到這個錯誤:

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 

我已經包含UVM庫,它識別#include "uvm.h"一行。

回答

2

UVM-SystemC類是uvm命名空間的一部分。嘗試添加uvm ::在uvm庫元素前面

+0

您可能想要擴展您的答案,或者使用您提到的行的示例代碼片段。 –