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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2: Using VCS with <strong>Synopsys</strong> <strong>Models</strong><strong>Simulator</strong> <strong>Configuration</strong> <strong>Guide</strong>NoteThis script was developed <strong>for</strong> internal use and is made available <strong>for</strong> userconvenience. It is not actively maintained as part of the licensed software.#!/usr/local/bin/perl# $Revision$$output_file = "Example_<strong>Simulator</strong>_Run_Script";die "\nERROR running $0: ", "No FlexModel name given\n\n", unless($ARGV[0] );$LmcHome = $ENV{ LMC_HOME }; die "ERROR running $0: ", "The LMC_HOME environmentvariable must be set.\n" unless( $LmcHome );$VcsHome = $ENV{ VCS_HOME };die "ERROR running $0: ", "The VCS_HOME environment variable must be set.\n" unless($VcsHome );$VcsSwiftNotes = $ENV{ VCS_SWIFT_NOTES };die "ERROR running $0: ", "The VCS_SWIFT_NOTES environment variable must be set.\n","\nSet VCS_SWIFT_NOTES to the value 1\n\n", unless( $VcsSwiftNotes );require "$LmcHome/lib/bin/libmdl01003.pl";$Plat<strong>for</strong>m = GetPlat<strong>for</strong>m();$Plat<strong>for</strong>m_lib = Plat<strong>for</strong>mToLibDir($Plat<strong>for</strong>m);#%plat<strong>for</strong>m_suffix = ( hp700 => "o", solaris => "o");$suffix = $plat<strong>for</strong>m_suffix{ $Plat<strong>for</strong>m };$flexmodel_name = $ARGV[0];$model_path = $LmcHome . "/models/" . $flexmodel_name;if ( -e $model_path ) {}else { die "\nERROR running $0: ", "FlexModel $flexmodel_name Does not Exist inLibrary\n\n"; }$version_path = `$LmcHome/bin/flexm_setup $flexmodel_name`;chomp($version_path);if ( $flexmodel_name =~ /_fx/ ) { $flexmodel_name =~ s/_fx//g; $flex_or_c = "_fx";}elsif ($flexmodel_name =~ /_fz/ ) {$flexmodel_name =~ s/_fz//g;$flex_or_c = "_fz";}else { die "\nERROR running $0: ", "$flexmodel_name is not a FlexModel. Model musthave an _fx or _fz to be a FlexModel\n\n";}$execute_command = $VcsHome . "/bin/vcs -Mupdate -RI -l vcs_sim.log ". $version_path . "/examples/verilog/". $flexmodel_name . "_tst.v +incdir+". $version_path . "/src/verilog +libext+.inc ". $version_path . "/examples/verilog/" . $flexmodel_name . ".v ". $version_path . "/examples/verilog/". $flexmodel_name . $flex_or_c . "_vcs.v ";if ( $Plat<strong>for</strong>m eq "pcnt" ) {$execute_command = $execute_command . $LmcHome . $Plat<strong>for</strong>m_lib . "slm_pli_vcs." .$suffix;}else {$execute_command = $execute_command . $LmcHome . $Plat<strong>for</strong>m_lib . "slm_pli.o" .$suffix;}$execute_command = $execute_command . " -P " . $LmcHome . "/sim/pli/src/slm_pli.tab". " -lmc-swift +incdir+" . $LmcHome . "/sim/pli/src"; print "$execute_command\n";open(OFILE,"> $output_file") || die " Could not create file : $output_file\n";print OFILE ("# This is an example of VCS command line to run the\n");print OFILE ("# supplied FlexModel testbench.\n");print OFILE ("# Note: The model version was calculated using the flexm_setupcommand\n");print OFILE ("\n$execute_command\n");close(OFILE); system($execute_command);Figure 1: run_flex_examples_in_vcs.pl Script52 <strong>Synopsys</strong>, Inc. October 6, 2003

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

Saved successfully!

Ooh no, something went wrong!