| Login | | Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name. | |
| Who's Online | There are currently, 38 guest(s) and 0 member(s) that are online.
You are Anonymous user. You can register for free by clicking here | |
 | |
|
Verification Guild: Forums |
|
| View previous topic :: View next topic |
| Author |
Message |
tzar Senior


Joined: Nov 28, 2007 Posts: 69
|
Posted: Mon Sep 05, 2011 7:53 am Post subject: How to use packages sensibly |
|
|
Hi,
I often see it recommended that one should group related c;ass definitions into a single package. For example I have seen it recommended that all components of a UVM agent be defined in a single package. In one sense this seems reasonable in that if you want to make use of the agent you have a single source for all components. However this would make the package file a long,complex and difficult to edit file. If a revision control mechanism is being used only one person can work on any element of the agent (assuming only single checkouts are allowed).
In the past I have always preferred to keep each component in a separate file as I have found this easier to work with.
Is it all down to a matter of personal preference or am I missing the big picture?
Thanks |
|
| Back to top |
|
 |
vhdlcohen Industry Expert


Joined: Jan 05, 2004 Posts: 1237 Location: Los Angeles, CA
|
Posted: Mon Sep 05, 2011 8:41 am Post subject: Re: How to use packages sensibly |
|
|
| tzar wrote: | Hi,
I often see it recommended that one should group related c;ass definitions into a single package. For example I have seen it recommended that all components of a UVM agent be defined in a single package. In one sense this seems reasonable in that if you want to make use of the agent you have a single source for all components. However this would make the package file a long,complex and difficult to edit file. If a revision control mechanism is being used only one person can work on any element of the agent (assuming only single checkouts are allowed).
In the past I have always preferred to keep each component in a separate file as I have found this easier to work with.
Is it all down to a matter of personal preference or am I missing the big picture?
Thanks |
Mentor recommends the use of separate files, but using the `include of files in packages. Below are examples from code that was generated using the Certe templates http://www.mentor.com/products/fv/certe/
| Code: | package agent_pkg;
`include "ovm_macros.svh"
import ovm_pkg::*;
import ovm_container_pkg::*;
import fifo_pkg::*;
`include "trans.svh"
`include "driver.svh"
`include "monitor.svh"
`include "agent_config.svh"
`include "agent.svh"
endpackage: agent_pkg
package env_pkg;
`include "ovm_macros.svh"
import ovm_pkg::*;
import agent_pkg::*;
`include "env_config.svh"
`include "coverage.svh"
`include "scoreboard.svh"
`include "env.svh"
endpackage: env_pkg
package test_pkg;
`include "ovm_macros.svh"
import ovm_pkg::*;
import ovm_container_pkg::*;
import sequences_pkg::*;
import agent_pkg::*;
import env_pkg::*;
`include "test_base.svh"
`include "test1.svh"
endpackage: test_pkg
|
_________________ Ben Cohen http://www.systemverilog.us/
* SystemVerilog Assertions Handbook, 3rd Edition, 2013
* A Pragmatic Approach to VMM Adoption
* Using PSL/SUGAR ... 2nd Edition
* Real Chip Design and Verification
* Cmpt Design by Example
* VHDL books
Last edited by vhdlcohen on Mon Sep 05, 2011 9:05 am; edited 1 time in total |
|
| Back to top |
|
 |
tzar Senior


Joined: Nov 28, 2007 Posts: 69
|
Posted: Mon Sep 05, 2011 9:00 am Post subject: |
|
|
Ah, that makes sense.
Thanks |
|
| Back to top |
|
 |
dave_59 Senior


Joined: Jun 22, 2004 Posts: 974 Location: Fremont, CA
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|