Exemplo n.º 1
0
VHDL GENERICS
In case constants are to be parsed as VHDL generics to ModelSim the first test case file 
in COMMANDS should have them listed. The constants must be placed between pragma's as 
follows: 

# START_VHDL_GENERICS
c_nof_inputs       = 8              
c_nof_outputs      = 16             # The number of outputs 
c_pipeline_in      = 1              # pipeline in_data                     
c_pipeline_out     = 1              # pipeline out_data                    
# END_VHDL_GENERICS

The auto_sim scripts will change the 'c_' to 'g_'. 

"""
import sys, os
sys.path.append(os.environ['UNB']+'/Firmware/sim/python')
from auto_sim import *

LIBRARY_NAME = 'ss'
TB_NAME      = 'tb_mmf_ss_parallel'
TARGET_NODES = ' --unb 0 --bn 0 '
COMMANDS     = ['tc_ss_parallel.py' + TARGET_NODES + ' --hold']

# Define an inital delay between start of the simulation and the start of the COMMANDS scripts
INIT_DELAY_NS = 500
    
# Run the sim and return its result using sys.exit([return_value])
sys.exit(auto_sim(os.environ['UNB'], LIBRARY_NAME, TB_NAME, COMMANDS, INIT_DELAY_NS))
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
"""
On execution, this script will start ModelSim, compile and run DESIGN_NAME and
run COMMANDS against the running simulation. If --hold is not passed, the running
simulation will be killed after completion.
"""
import sys, os
sys.path.append(os.environ['UNB']+'/Firmware/sim/python')
from auto_sim import *

LIBRARY_NAME = 'unb_ddr3_transpose'
TB_NAME      = 'tb_unb_ddr3_transpose'   
TARGET_NODES = ' --unb 0 --bn 3 '
COMMANDS     = ['$UPE/peripherals/util_system_info.py' +TARGET_NODES+ '-n 2',
                '$UPE/peripherals/util_system_info.py' +TARGET_NODES+ '-n 4',
                '$UPE/peripherals/util_unb_sens.py'    +TARGET_NODES+ '-n 0'
               ]

# Give sim some time until the sensors have been read
INIT_DELAY_NS = 5000

GENERICS = {}
OTHER = ''
    
# Run the sim and return its result using sys.exit([return_value])
sys.exit(auto_sim(os.environ['UNB'], LIBRARY_NAME, TB_NAME, COMMANDS, INIT_DELAY_NS, GENERICS, OTHER))
Exemplo n.º 3
0
###############################################################################

# Purpose:
# . Automatic loading, running and verification of correlator test bench
# Description:
# . 
# Usage:
# . $ python correlator.py

import sys, os
sys.path.append(os.environ['UNB']+'/Firmware/sim/python')
from auto_sim import *
#import tc_correlator

INIT_DELAY_NS = None
LIBRARY_NAME = 'correlator'
TB_NAME      = 'tb_correlator'
GENERICS     = {'g_nof_inputs'         : 8,
                'g_nof_channels'       : 8,
                'g_nof_pre_mult_folds' : 1,
                'g_nof_input_folds'    : 1}
TARGET_NODES = ' --unb 0 --fn 0'        
COMMANDS     = ['tc_correlator.py' + TARGET_NODES + ' --gen ' +  '"' + str(GENERICS) + '"' ]  

# Generate .hex files before ModelSim starts
#tc_correlator.gen_filter_hex_files(GENERICS['g_nof_taps'], GENERICS['g_wb_factor'], GENERICS['g_nof_points'])
        
# Run the sim and return its result using sys.exit([return_value])                             
#sys.exit(auto_sim(os.environ['UNB'], LIBRARY_NAME, TB_NAME, COMMANDS, INIT_DELAY_NS, GENERICS))
auto_sim(os.environ['UNB'], LIBRARY_NAME, TB_NAME, COMMANDS, INIT_DELAY_NS, GENERICS)
LIBRARY_NAME = 'unb_dp_offload'
TB_NAME      = 'tb_unb_dp_offload'
TARGET_NODES = ' --unb 0 --fn 0 '
STREAMS      = ' -r 0:2'
COMMANDS     = ['tc_unb_dp_offload.py' + TARGET_NODES + STREAMS]

# Define an inital delay between start of the simulation and the start of the COMMANDS scripts
INIT_DELAY_NS = 0 

# Generics: design name
DESIGN_NAMES = ["unb_dp_offload", "unb_dp_offload_1GbE", "fn_dp_offload_10GbE"] 

# Sequentially run the test case against the 3 design revisions
generics = {}
results = []
for design_name in DESIGN_NAMES:
    generics['g_design_name'] = design_name
    other=None
    if design_name=='fn_dp_offload_10GbE':
        # Designs that include xaui/10GbE require the following explicitely passed libraries for reasons unknown.
        other = " -L lpm_ver -L sgate_ver -L stratixiv_hssi_ver -L stratixiv_ver"
    results.append( auto_sim(os.environ['UNB'], LIBRARY_NAME, TB_NAME, COMMANDS, INIT_DELAY_NS, generics, other) )  

# Return the result
if all_equal_to(results, 'PASSED')==True:
    result = 'PASSED'
else:
    result = 'FAILED'

sys.exit(result)