



































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




































Architecting Testbenches
For the components to be reusable, must define procedural interfaces that are independent of the detailed implementation This way as the interfaces change, the testcases do not. Provide flexibility through thin layers. This gives the ability to have fine control or greater abstraction (byte access vs.. packet access) Do not try to implement all functionality at one level Preserve the procedural interfaces
This way you don’t spend time on unnecessary functions Use the verification plan to determine what is functions are necessary When you need more complex functions, build upon already verified functions.
VHDL Implementation – Packaging
Bus Functional Procedures
BFM’s can be located in a package to be re-used. Driven/monitored signals are passed as signal-class arguments BFM procedure’s are cumbersome to use. All signals involved in the transaction must be passed to the procedure Duplication across testbenches, each testbench: Declares all interface signals Instantiates the DUV Properly connects everything
VHDL Implementation – Creating a
test harness
Instead – add some abstraction, use a test harness. In contains declarations and functionality common to all testbenches Reduces amount of duplicated information Determine common elements Declaration of the component Declaration of the interface signals Instantiation of the DUV Mapping of Interface signals to the ports on the design Mapping of interface signals to the signal class arguments of the bus-functional procedures
VHDL Implementation – Creating a
test harness – (cont)
Control signals: Server signals – signals used in the local (test harness) process Client signals – signals used in the testcase These signals have to be visible to both the client and server (these are located in different architectures) Pass as ports in the test harness Global signals in a package
VHDL Implementation – Creating a
test harness – (cont)
Global signals eliminate need for each testbench architecture to declare them Use ‘transaction to synchronize operations Won’t miss two consecutive operations (compared to using ‘event) Control signals utilize records Minimize maintenance if signals change Minimizes impact on client/server processes
VHDL Implementation – Abstracting
the Client/Server Protocol (cont)
Encapsulate by placing server procedures into a package Client processes are now free from knowing the details of the protocol between the client and server To perform an operation, use the appropriate procedure Pass the control signals in the procedure Use the package to get access to the global signals and procedures Simply need 2 signals (records) One used in communications to the server process One used in communications from the server process
VHDL Implementation – Abstracting
the Client/Server Protocol (cont)
What has been gained – signals are still passed from the bus-functional access procedures Testcase need not declare all the interface signals to the DUV Testcase need not instantiate and connect the design Reduction of duplication Regardless of number of signals involved in physical interface, only 2 need to be passed Testcase is completely removed from the physical interface of the DUV Pins can be removed or added, polarities changed, etc – no effect on existing testcases
VHDL Implementation – Multiple
Server Instances
If using one BFM instantiated multiple times, need a way to differentiate which instance to use to perform an operation Use an array of control signals One pair for each server Can use a generate statement to instantiate the BFM’s
VHDL Implementation – Utility
Packages
Composed of procedures Encapsulated in separate packages using lower-level access packages Example Use the read/write access functions to perform packet read/write access functions
Protocols may require more data than is relevant for the testcase ATM protocol – when not active cell, must send “dummy” cell A procedure (send_cell) would inject the cell, but what about the other cycles. Don’t want the testcase to worry about it Add Autonomous stimulus to BFM Now send_cell would inject the cell at the appropriate time (after current dummy cell is sent) and then return back to the testcase
Blocking – procedure does not return control back to testcase until BFM is done with function Non-blocking – procedure returns control back to testcase immediately For this, actions must be queued. Used to control constraints on the fly