Hi Prabhu,Originally posted in cdnusers.org by iraklis
From my experience, there is no need to change your VE design by implementing the monitor outside the environment. Sometimes it is even necessary, e.g. when creating an interface eVC that typically has a monitor instantiated within the environment and you want to check it by cross-connecting two instances and simulate them. This way you will end up with a monitor in each environment instance and it seems to me that this is exactly what you are doing.
If so, I would suggest the following:
1) Provide hooks in your monitor when a packet is received/transmitted
This provides the flexibility to change the behavior of scoreboarding when your environment is integrated in a larger environment (e.g. system-level) or when using layered verification environments. You may then choose to disable scoreboarding, change its behavior, or even use a system-level scoreboard according to your requirements. This behavior can be set by extending the monitor instance through the hooks provided.
2) Instantiatiate your scoreboards separately from the rest of the environment
This is helpful in system-level verification or layered environment where you may have multiple instances of your environment running and you may want to place scoreboards only in strategic locations or even use a totally different scoreboard. Of course, you will have to provide a basic scoreboard unit as part of your environment.
3) Use separate configuration files according to the verification scenario
Doing so will allow you to specify the scoreboarding instantiation and functionality you wish to have from a block-level up to a system-level verification scenario with the maximum level of code reuse and the least amount of changes.
4) Provide some sort of synchronization
There is a potential problem with this configuration, when the monitor from one end will see a packet transmitted and the monitor from the other end will see a packet received at the same time. For example:
At time X:
Env's BFM will start transmitting a frame
At time X+Y:
Env's monitor will detect a frame transmitted and try to push it on the scoreboard
Env's monitor will detect a frame received and try to compare it against the scoreboard
Depending on the order of execution, Env's compare might run first, resulting in an empty scoreboard compare. So it is a good idea to sometimes delay the compare by one cycle, if this is permissible by the specification, or provide some sort of syncronization between the two.
This of course is mostly the case when cross-connecting two environment instances together. Usually, there is a delay between when the packet is transmitted and when it is received on the other end.
The eRM Developer Manual offers quite a few guidelines on scoreboards, including the ones mentioned above at Section 9.3, "Adding Scoreboards".
Hope that helps!