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>MemPro mem1;//// Start of DWMM_test ////// Create an instance of the model with model_id = 5mem1 = new(5);if (mem1.showStatus()!= SLM_TESTBENCH_SUCCESS){printf (“Error: failure instantiating Model/n”);exit (1);}// Retrieve the instance infomem1.instance_info( data_width, addr_width, instance_name,class_name, status);printf( "instance_info status = %d\n", status);if (status == SIM TESTBENCH_SUCCESS) {printf( "Data_width = %d\n", data_width);printf( "Addr_width = %d\n", addr_width);printf( "Instance_name = %s\n", instance_name);printf( "Class_name = %s\n", class_name);}else {printf ("Error: Could not set info <strong>for</strong> mem1\n");exit();}// Set the message levelmem1.set_message_level( SLM_ALL_MSGS, status); }printf(" Set msg level status = %d\n", status);// Retrieve the message levelmem1.get_message_level( msgLevel, status);printf(" Get msg level status = %d\n", status);printf(" msg level = %d\n", msgLevel);if ( msgLevel != SLM_ALL_MSGS) {printf("Error: incorrect message level returned - %d\n",msgLevel);}// Poke some values into memorymem1.poke( 128'h00, 66'h1f, status);mem1.poke( 128'hFF, 66'hff, status);// Load a memory image filemem1.load( "./memory_images/sram1.mif", status);232 <strong>Synopsys</strong>, Inc. October 6, 2003

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

Saved successfully!

Ooh no, something went wrong!