Example first:
- Assume a testbench for a DUT has an environment class called env.
- Assume I have multiple testbenches for multiple DUTs, each having an env class name.
- Now I create a 'multi-device' testbench that includes these DUTs together.
- There will be three classes named 'env'
Question: What is a preferred strategy to prevent 'collisions' or one env getting replaced by another?
I've brainstormed some possible answers:
1) best to make the names unique in case you decide to make a multi-device testbench in the future. E.g., dut1_env, dut2_env...
2) Package and compile them individually to preserve the scope of each env within the package (I'm really guessing here, so is this possible and what's the high level concept of how this would be done?)
3) keep everything with simple names (env) in each DUT testbench. Then compile them into separate libraries so they don't collide. (would this really help? The compiled libraries are still all included when the simulator is invoked anyway and the tool may just use the first 'env' that it finds)
4) I'll need to write code using a 'config' constructs to specify which libraries are associated with each dut, etc...
Bottom line: If you knew you may have a multi-device testbench in the future, what method/strategy would you use to avoid these collision problems?
Thanks in advance for your insights,
Brian