Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document provides examples for the NX testcase template Testcase Template using the argparser feature.

This template is used in the TrainingPackage testcases.

You can download the template using the following link/Version 22.1.0.1-v0:

...

https://files.nanoxplore.com/f/defc884200414b059150/?dl=1//Author : K.CHOPIER
//Company: NanoXplore
//Contact: support@nanoxplore.com

...

//Description

...

The aim of this package is to provide to NanoXplore user This package provides NanoXplore users with a script template in order to implement a design in a standard format.
The objective of the template is made to ease facilitate user implementation and ease help NX support to debug a project.

...

//Commands to launch test:

Code Block
nxpython nxmapnxpython_script.py --variant NG-LARGE                                                        : Launch the script for NG-LARGE variant
nxpython nxmapnxpython_script.py --variant NG-LARGE --argument USE_DSP                                     : Launch the script for NG-LARGE variant with argument "USE_DSP" which is used in sub_scripts
nxpython nxmapnxpython_script.py --variant NG-LARGE --progress_start synthesized2 --progress_stop placed5  : Launch the script for NG-LARGE variant reloading synthesizing 2nd step project from previous run and stop at placing 5th step
nxpython nxmapnxpython_script.py --variant NG-LARGE --suffix try_1                                         : Launch the script for NG-LARGE variant adding a suffix in the project name. Useful in case of multiple tries changing scripts.
nxpython nxmapnxpython_script.py --variant NG-LARGE --topcellname switch_counter --topcelllib work         : Launch the script for NG-LARGE variant for a different top cell than the default one. Useful in case of unitary run before top run
nxpython nxmapnxpython_script.py --variant NG-LARGE --timingdriven Yes                                     : Launch the script for NG-LARGE variant with TimingDriven enabled
nxpython nxmapnxpython_script.py --variant NG-LARGE --seed 3557                                            : Launch the script for NG-LARGE variant with a different seed 
nxpython nxmapnxpython_script.py --variant NG-LARGE --sta placed1_routed3 --stacondition typical_worstcase : Launch the script for NG-LARGE variant generating sta after Prepared and Routed steps in typical and worstcase conditions
nxpython nxmapnxpython_script.py --variant NG-LARGE --bitstream Yes                                        : Launch the script for NG-LARGE variant generating a bitstream at the end
nxpython nxmapnxpython_script.py --variant NG-LARGE --options RoutingEffort.Low_MappingEffort.Medium       : Launch the script for NG-LARGE variant with nxmap options RoutingEffort set to Low and MappingEffort set to Medium
nxpython nxmapnxpython_script.py --variant NG-LARGE --constraints No                                       : Launch the script for NG-LARGE variant without any synthesis, placing or routing constraints defined in project.constraints.py
nxpython nxpython_script.py --variant NG-LARGE --save_inputs Yes                                      : Launch the script for NG-LARGE variant copying src/ and sub_scripts/ in project directory

//Tree

...

//Input folders and files

Code Block
nxmapnxpython_script.py     : script to launch by nxpython nxmapnxpython_script.py <options>
project_variables.py: all variables used for the test are defined.
src                 : all needed RTL sources.
sub_scripts         : all needed python files to create the project.
    project_ios.py          : defined banks voltages and pads configurations.
    project_files.py        : defined RTL files.
    project_parameters.py   : defined top generic parameters.
    project_options.py      : defined NxmapNxPython options.
    project_constraints.py  : defined constraints for synthesis or P&R.
    project_class.py        : chip class.
    script.py               : main script.
[top_cell]_[variant](_[options]): created project once launched.
    logsPython      : all logs and reports.
    *.nym           : nxmapnxpython project files.
    *.vhd/*.v           : netlists.
    *.sdf           : Backannoted SDF files.
    bitstream.nxb   : bitstream binary file.

Multi Seed

Hereafter Here below is a shell script in order to launch a test with multiple seed seeds (random or user list)

Code Block
#!/bin/bash

#1st arg: number of tests
#2nd arg: "random"/"list"  

#Example 1: ./multi_seed.sh 3 random  => Generates 3 tests with random values in range [1;10000]
#Example 2: ./multi_seed.sh 5 list    => Generates 2 tests with values in list seed_list  
#To
generate a CSV report launch the following command:
#Example: python compare_sta.py switch_NG-MEDIUM_ Routed worstcase => Generates a CSV report for all folders containing "switch_NG-MEDIUM_" parsing STA files generated at Routed step in worstcase conditions

nxpython_path=/home/groups/soft/nxdesignsuite/integration/nxmap-dbg/lastdevversion/lastdevbuild/bin/nxpython

seed_list="13 19"

for (( i=0; i< $1; i++)) 
do
    if [[ $2 == "random" ]]
    then
        seed=$(( RANDOM % 10000 ))
        $nxpython_path nxmapnxpython_script.py --seed $seed --suffix $seed
    elif [[ $2 == "list" ]]
    then
        seed_list_split=($seed_list)
        seed=${seed_list_split[$i]}
        $nxpython_path nxmap_script.py --seed $seed --suffix $seed
    else
        echo "Unrecognized mode $2. It must be random or list"
    fi 
done

...