Hi All,
I am a newbie in OVM, can any one help me to solve this problem.
-
I want to use macros in my test, which is not under “src” directory.
-
So i have to import only"ovm_pkg"(import ovm_pkg::)* in my test (As ovm_pkg includes “ovm.svh” and “ovm.svh” includes “ovm_macros.svh”). No needs to include “ovm_macros.svh” in the test.
-
But I am getting following erros, If i didn’t include ovm_macros.svh.
================================================== =========================================
QuestaSim vlog 6.4 Compiler 2008.06 Jun 18 2008
– Compiling package ovm_pkg
– Compiling module test
– Importing package ovm_pkg
** Error: hierarchy.sv(58): (vlog-2163) Macro ovm_object_utils_begin is undefined. ** Error: hierarchy.sv(58): near "(": syntax error, unexpected '(', expecting "function" or "task" ** Error: hierarchy.sv(59): (vlog-2163) Macro
ovm_field_int is undefined.
** Error: hierarchy.sv(60): (vlog-2163) Macro ovm_field_int is undefined. ** Error: hierarchy.sv(61): (vlog-2163) Macro
ovm_object_utils_end is undefined.
** Error: hierarchy.sv(89): near “$display”: syntax error, unexpected “SYSTEM_IDENTIFIER”
================================================== =========================================
Here is the program code :
================================================== =========================
49 module test;
50 import ovm_pkg::*;
**51 // include "ovm_macros.svh";** 52 53 class transaction extends ovm_transaction; 54 55 rand int data; 56 rand int addr; 57 58
ovm_object_utils_begin(transaction)
59 ovm_field_int(addr, OVM_ALL_ON) 60
ovm_field_int(data, OVM_ALL_ON)
61 `ovm_object_utils_end
62
63 constraint c { addr >= 0 && addr < 'd100; }
64 constraint c1 { data >= 'd10 && data < 'd20; }
…
…
endclass
…
…
endmodule
================================================== =========================
Note : This test is working fine if i include “ovm_macros.svh” in the test (line#51).
So can anyone tell me,
- Whether we have to include ovm_macros.svh,enven though we are importingovm_pkg. ?
- If yes, then please explain why ?
Thanks in advance,
HS.