Error-[SE] Syntax error
Following verilog source has syntax error :
Token ‘uvm_component’ should be a valid type. Please check whether
it is misspelled, not visible/valid in the current context, or not properly
imported/exported.
“sim/env/src/user_defined_pkg.sv”, 103: token is ‘;’
class global_checker extends uvm_component;
If you have imported the uvm_pkg inside another package, the scope of the uvm_pkg will be limited to that package only. In that case, you’d have to import the uvm_pkg again inside your env to let compiler include all the UVM library class within the score of your env.
Refer to the uvm_cookbook for further understanding of package import.
class seq_item extends uvm_sequence_item;
rand bit [3:0] a;
rand bit [3:0] b;
rand bit [1:0] mode;
bit [7:0] out; uvm_object_utils_begin(seq_item) uvm_field_int (a,UVM_ALL_ON) uvm_field_int (b,UVM_ALL_ON) uvm_field_int (mode,UVM_ALL_ON) uvm_field_int (out,UVM_ALL_ON) uvm_object_utils_end
function new (string name=“seq_item”);
super.new(name);
endfunction
endclass
Error-[SE] Syntax error
Following verilog source has syntax error :
Token ‘uvm_sequence_item’ should be a valid type. Please check
whether it is misspelled, not visible/valid in the current context, or not
properly imported/exported.
“seq_item.sv”, 1: token is ‘;’
class seq_item extends uvm_sequence_item;
^
Please help me identify the error the the reason.?
You did not import the uvm_pkg. I believe it is useless what you are doing.
Please watch the videos about UVM basics and how to package UVM code.and ask your tool provider how to compile UVM code.
Hello,
getting the error when my env ironment is compiled
Error-[SE] Syntax error
Following verilog source has syntax error :
Token ‘uvm_driver’ should be a valid type. Please check whether it
is misspelled, not visible/valid in the current context, or not properly
imported/exported.
“axi_driver.sv”,
3: token is ‘;’
class axi_driver extends uvm_driver;
I imported the package in top module and used packages for env and seq components
module top;
CODE:
import uvm_pkg::;
`include “uvm_macros.svh” //UVM Library Package
import seq_pkg::;
import env_pkg::*;
please suggest,not sure of reason
In reply to chr_sue:
Hello,
yes i had added the sequence_item to driver but as it was not taking uvm_sequence definition i tried to remove it and check.
when i manually added two lines for import uvm_pkg::*
`include “uvm_macros.svh”
it works, but is there any need to include these in every class, or only in top module and test class, thnks
The unm_pkg is adding all UVM base classes to your code and the include statement is providing all macros of the UVM.
If you compile a UVM-based class this is needed.
To avoid these import/include for each class you should packkage all your agent code files into a package and import and include then only for the package. This makes your code also reusable.