//---------------------------------------------------------------------------------- 11/17/2011 Dear EE457 students We have been using the modelsim/6.3f/ version on UNIX to run our UNIX scripts. EE457 students in this semester are using the Modelsim PE student edition 10.0a or 10.0b or 10.0c version on their PCs. Recently we noted that these versions differ in producing results in the case of undesirable coding. So what are these undesirable coding situations? An example of an undesirable coding is producing WB_RD in the subpart 3 (where the R2_mux has been moved to the WB stage) using a blocking assignment in one clocked block and referring to that as an input data in another clocked block. Synthesis tools will provide a registered version of the WB_RD to the consuming clocked block. Modesim 10.0c seems to produce results which are sensitive to the specific order of executing the always block in the case of objects such as WB_RD which was assigned using a blocking assignment. This creates the unfortunate differences between post-synthesis and presynthesis simulations. Please see the proof below. One student's design was copied into a directory called "Modelsim_Version_differences" on my unix account I also brought the testbench file that was given to you, the expected results from my solution project, and a run.do that we use in our unix scripts. I compiled and simulated his design using the Modelsim SE 6.3f version first and checked the register file contents. I again compiled and simulated his design using the Modelsim SE 10.0b version next and checked the register file contents. As you see the differences are different in both cases. Then I transferred (by ftp) the student file to my PC and simulated using Modelsim PE 10.0a students edition. And now the results are good (and perhaps that is why the student submitted his file). So what should you or that student do? Check your code for any undesirable coding instances. Take your code to your unix account into some directory. Also take the testbench given to you. Create a run.do file on your PC with the following contents and take it to your unix directory: run 1us mem save UUT/reg_file -format hex -wordsperline 8 -outfile reg_file.txt quit -sim vdel ee457_lab7_P3 quit Execute the following command once to set up for the Unix Modelsim license. aludra> below represents the Unix prompt. aludra> source ~eeview/modelsim.setup Check to see that your LM_LICENSE_FILE environment variable includes 1800@license29.usc.edu aludra> env | grep LM_LICENSE_FILE On mine it returns the following response: LM_LICENSE_FILE=1900@license29.usc.edu:1800@license29.usc.edu:1900@license.usc.edu:1800@license.usc.edu What is important is that it includes 1800@license29.usc.edu so that you get license to run modelsim on Unix. Now execute the following four commands (one at a time) at unix prompt (shown below as aludra> ). aludra> vlib work aludra> /usr/usc/modelsim/6.3f/modeltech/bin/vlog ee457_lab7_P3_RTL_Coding_Style_tb.v aludra> /usr/usc/modelsim/6.3f/modeltech/bin/vlog ee457_lab7_P3_RTL_Coding_Style_R2_Mux_in_WB.v aludra> /usr/usc/modelsim/6.3f/modeltech/bin/vsim -c -quiet -t 1ps +nowarnTSCALE -lib work ee457_lab7_P3_tb -do run.do Check your results by comparing them with your PC produced results. Since I have been using Modelsim 6.3f in my unix script, if I (or the TAs) did not send an email stating that your results are wrong, you do not have to worry. Cheers Gandhi //---------------------------------------------------------------------------------- //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{48} ls -l total 44 -rw------- 1 ee457lab 20019 Nov 17 20:15 ee457_lab7_P3_RTL_Coding_Style_R2_Mux_in_WB.v -rwxr-xr-x 1 ee457lab 10260 Dec 17 2010 ee457_lab7_P3_RTL_Coding_Style_tb.v -rw-r--r-- 1 ee457lab 10500 Nov 17 08:01 golden_TimeSpace.txt -rw-r--r-- 1 ee457lab 278 Nov 17 08:01 golden_reg_file.txt -rw------- 1 ee457lab 118 Nov 12 21:33 run.do //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{49} vlib work //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{50} /usr/usc/modelsim/6.3f/modeltech/bin/vlog ee457_lab7_P3_RTL_Coding_Style_tb.v Model Technology ModelSim SE-64 vlog 6.3f Compiler 2008.02 Feb 28 2008 -- Compiling module ee457_lab7_P3_tb Top level modules: ee457_lab7_P3_tb //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{51} /usr/usc/modelsim/6.3f/modeltech/bin/vlog ee457_lab7_P3_RTL_Coding_Style_R2_Mux_in_WB.v Model Technology ModelSim SE-64 vlog 6.3f Compiler 2008.02 Feb 28 2008 -- Compiling module ee457_lab7_P3 Top level modules: ee457_lab7_P3 //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{52} more run.do run 1us mem save UUT/reg_file -format hex -wordsperline 8 -outfile reg_file.txt quit -sim vdel ee457_lab7_P3 quit //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{53} /usr/usc/modelsim/6.3f/modeltech/bin/vsim -c -quiet -t 1ps +nowarnTSCALE -lib work ee457_lab7_P3_tb -do run.do Reading /auto/modelsim/6.3f/modeltech/tcl/vsim/pref.tcl # 6.3f # vsim +nowarnTSCALE -do run.do -lib work -c -quiet -t 1ps ee457_lab7_P3_tb # ** Note: (vsim-3812) Design is being optimized... # // ModelSim SE-64 6.3f Feb 28 2008 SunOS 5.10 # // # // Copyright 1991-2008 Mentor Graphics Corporation # // All Rights Reserved. # // # // THIS WORK CONTAINS TRADE SECRET AND # // PROPRIETARY INFORMATION WHICH IS THE PROPERTY # // OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS # // AND IS SUBJECT TO LICENSE TERMS. # // # do run.do //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{54} ls -lt total 74 drwxr-xr-x 5 ee457lab 512 Nov 17 22:11 work -rw-r--r-- 1 ee457lab 10500 Nov 17 22:11 TimeSpace.txt -rw-r--r-- 1 ee457lab 487 Nov 17 22:11 transcript -rw-r--r-- 1 ee457lab 16384 Nov 17 22:11 vsim.wlf -rw-r--r-- 1 ee457lab 278 Nov 17 22:11 reg_file.txt -rw------- 1 ee457lab 20019 Nov 17 20:15 ee457_lab7_P3_RTL_Coding_Style_R2_Mux_in_WB.v -rw-r--r-- 1 ee457lab 10500 Nov 17 08:01 golden_TimeSpace.txt -rw-r--r-- 1 ee457lab 278 Nov 17 08:01 golden_reg_file.txt -rw------- 1 ee457lab 118 Nov 12 21:33 run.do -rwxr-xr-x 1 ee457lab 10260 Dec 17 2010 ee457_lab7_P3_RTL_Coding_Style_tb.v aludra-Modelsim_Version_differences{55} mv reg_file.txt Modelsim_SE_6.3f_reg_file.txt aludra-Modelsim_Version_differences{56} mv TimeSpace.txt Modelsim_SE_6.3f_TimeSpace.txt //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{57} diff Modelsim_SE_6.3f_reg_file.txt golden_reg_file.txt 4,5c4,5 < @0 0008 0009 000c 000b 000a 000d 0043 0080 < @8 0202 0043 0043 0044 0044 0041 fff8 ffff --- > @0 0008 0009 000c 0025 000a 000d 0043 0080 > @8 0102 0043 0043 0044 0044 0041 fff8 ffff //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{58} diff Modelsim_SE_6.3f_TimeSpace.txt golden_TimeSpace.txt //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{59} /usr/usc/modelsim/10.0b/modeltech/bin/vlog ee457_lab7_P3_RTL_Coding_Style_tb.v Model Technology ModelSim SE vlog 10.0b Compiler 2011.05 May 5 2011 -- Compiling module ee457_lab7_P3_tb Top level modules: ee457_lab7_P3_tb //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{60} /usr/usc/modelsim/10.0b/modeltech/bin/vlog ee457_lab7_P3_RTL_Coding_Style_R2_Mux_in_WB.v Model Technology ModelSim SE vlog 10.0b Compiler 2011.05 May 5 2011 -- Compiling module ee457_lab7_P3 Top level modules: ee457_lab7_P3 //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{61} /usr/usc/modelsim/10.0b/modeltech/bin/vsim -c -quiet -t 1ps +nowarnTSCALE -lib work ee457_lab7_P3_tb -do run.do Reading /auto/modelsim/10.0b/modeltech/tcl/vsim/pref.tcl # 10.0b # vsim +nowarnTSCALE -do run.do -lib work -c -quiet -t 1ps ee457_lab7_P3_tb # ** Note: (vsim-3812) Design is being optimized... # // ModelSim SE 10.0b May 5 2011 SunOS 5.10 # // # // Copyright 1991-2011 Mentor Graphics Corporation # // All Rights Reserved. # // # // THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION # // WHICH IS THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS # // LICENSORS AND IS SUBJECT TO LICENSE TERMS. # // # do run.do //---------------------------------------------------------------------------------- aludra-Modelsim_Version_differences{62} mv reg_file.txt Modelsim_SE_10.0b_reg_file.txt aludra-Modelsim_Version_differences{63} mv TimeSpace.txt Modelsim_SE_10.0b_TimeSpace.txt aludra-Modelsim_Version_differences{64} diff Modelsim_SE_10.0b_reg_file.txt golden_reg_file.txt 4c4 < @0 0008 0000 000c 000b 0001 0004 0043 0080 --- > @0 0008 0009 000c 0025 000a 000d 0043 0080 aludra-Modelsim_Version_differences{65} diff Modelsim_SE_10.0b_TimeSpace.txt golden_TimeSpace.txt //---------------------------------------------------------------------------------- nunki-Modelsim_Version_differences{19} dos2unix Modelsim_PE_StudentEdition_10.0a_reg_file.txt cleaned_Modelsim_PE_StudentEdition_10.0a_reg_file.txt could not open /dev/kbd to get keyboard type US keyboard assumed could not get keyboard type US keyboard assumed //---------------------------------------------------------------------------------- nunki-Modelsim_Version_differences{20} diff cleaned_Modelsim_PE_StudentEdition_10.0a_reg_file.txt golden_reg_file.txt //---------------------------------------------------------------------------------- nunki-Modelsim_Version_differences{21} dos2unix Modelsim_PE_StudentEdition_10.0a_TimeSpace.txt cleaned_Modelsim_PE_StudentEdition_10.0a_TimeSpace.txt could not open /dev/kbd to get keyboard type US keyboard assumed could not get keyboard type US keyboard assumed //---------------------------------------------------------------------------------- nunki-Modelsim_Version_differences{22} diff cleaned_Modelsim_PE_StudentEdition_10.0a_TimeSpace.txt golden_TimeSpace.txt //---------------------------------------------------------------------------------- nunki-Modelsim_Version_differences{25} mv cleaned_Modelsim_PE_StudentEdition_10.0a_TimeSpace.txt Modelsim_PE_StudentEdition_10.0a_TimeSpace.txt mv: overwrite Modelsim_PE_StudentEdition_10.0a_TimeSpace.txt (yes/no)? yes nunki-Modelsim_Version_differences{26} mv cleaned_Modelsim_PE_StudentEdition_10.0a_reg_file.txt Modelsim_PE_StudentEdition_10.0a_reg_file.txt mv: overwrite Modelsim_PE_StudentEdition_10.0a_reg_file.txt (yes/no)? yes //---------------------------------------------------------------------------------- nunki-Modelsim_Version_differences{32} ls -l total 130 -rw-r--r-- 1 ee457lab 10500 Nov 17 23:09 Modelsim_PE_StudentEdition_10.0a_TimeSpace.txt -rw-r--r-- 1 ee457lab 278 Nov 17 23:08 Modelsim_PE_StudentEdition_10.0a_reg_file.txt -rw-r--r-- 1 ee457lab 10500 Nov 17 22:14 Modelsim_SE_10.0b_TimeSpace.txt -rw-r--r-- 1 ee457lab 278 Nov 17 22:14 Modelsim_SE_10.0b_reg_file.txt -rw-r--r-- 1 ee457lab 10500 Nov 17 22:11 Modelsim_SE_6.3f_TimeSpace.txt -rw-r--r-- 1 ee457lab 278 Nov 17 22:11 Modelsim_SE_6.3f_reg_file.txt -rw------- 1 ee457lab 20019 Nov 17 20:15 ee457_lab7_P3_RTL_Coding_Style_R2_Mux_in_WB.v -rwxr-xr-x 1 ee457lab 10260 Dec 17 2010 ee457_lab7_P3_RTL_Coding_Style_tb.v -rw-r--r-- 1 ee457lab 10500 Nov 17 08:01 golden_TimeSpace.txt -rw-r--r-- 1 ee457lab 278 Nov 17 08:01 golden_reg_file.txt -rw------- 1 ee457lab 118 Nov 12 21:33 run.do -rw-r--r-- 1 ee457lab 466 Nov 17 22:14 transcript -rw-r--r-- 1 ee457lab 49152 Nov 17 22:14 vsim.wlf drwxr-xr-x 6 ee457lab 512 Nov 17 22:14 work //----------------------------------------------------------------------------------