12.07.2015 Views

Simulator Configuration Guide for Synopsys Models

Simulator Configuration Guide for Synopsys Models

Simulator Configuration Guide for Synopsys Models

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 9: Using VERA with <strong>Synopsys</strong> <strong>Models</strong><strong>Simulator</strong> <strong>Configuration</strong> <strong>Guide</strong>Adding DesignWare Memory Model Commands to theVERA TestbenchThe following steps describe how to add DWMM model commands to a VERAtestbench so that you can use it with DWMM models.1. Open your VERA testbench in a text editor.2. To include the MemPro class in the mempromodel.vrh file, add the line:#include "mempromodel.vrh"after the line:#include 3. Create an instance of the MemPro class <strong>for</strong> each model in your design.To use the MemPro class methods, you must use the “new” constructor to create aMemPro object that maps to a DWMM model instance in your HDL design. The“new” constructor expects one integer argument, and the DWMM model instanceID, which is the numeric instance ID given to the DWMM model (in the Verilog orVHDL testbench). The constructor uses this argument to get an instance handle <strong>for</strong>the DWMM model. If the instance ID passed is invalid, the model issues an errormessage and sets a flag in the class indicating the severity of the error.NoteAlways call inst.showStatus() after inst = new (inst_id); to ensure that theMemPro class constructor worked properly and that you provided the ID ofa DWMM model.The following example creates an instance of the VERA object connected to theHDL model with an instance ID of 67, and checks <strong>for</strong> errors.// 67 is the model instance id, defined in the// top-level HDL testbench.MemPro mem1 = new( 67 );if (mem1.showStatus()!= SLM_TESTBENCH_SUCCESS){//Error handlingexit(1);}You can then call DWMM testbench methods <strong>for</strong> object “mem1”.230 <strong>Synopsys</strong>, Inc. October 6, 2003

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!