In reply to logie:
I have a similar issue and when I follow your solution, I get another error :
–Compiling package eth_env_pkg
** Error: ** while parsing file included at /home/user1/Vansh/1118asrt/eth_top.sv(6)
** while parsing file included at eth_env.sv(8)
** at eth_pkt_pkg.sv(1): near “package”: syntax error, unexpected package, expecting class
eth_top.sv(6): include "eth_env.sv" // Contains Top module and imports required files and packages eth_env.sv(8):
include “eth_pkt_pkg.sv” // Contains a package “eth_env_pkg” which contains the class “eth_env_c”
eth_pkt_pkg.sv(1): `include “eth_pkt.sv” // Contains just this line, eth_pkt.sv contains definition of the class “eth_pkt”
Same error even if I try declaring the class inside the package in the same file too.
What am I doing wrong?
Why does it expect a class when I want to define a package?
Even if I define the class inside the package, then also it expects a class. Why is it so?