ImpulseTestcase Template - Test Creation and Setup
Introduction
The aim of this document is to explain how to create a new test archive based on the NX testcase template in order to perform Impulse steps.
Testcase template archive are available on the following link with associated commands:
ImpulseTestcase Template - User Guide .
Steps
RTL sources import
The user must import all the RTL sources in the src directory.
Project Environment Variables
The 1st file to edit is project_variables.py defining all variables related to the testcase environment.
All available values for each variable are displayed when executing the following command:
nxpython nxpython_script.py -h
Top Cell
DefaultTopCellName: Top Cell Name of the design
DefaultTopCellLib: Top Cell Library of the design
Variant
DefaultVariant: NX chip target for the project
AllowedVariants: List of all NX chip targets compliant with the project
Argument
DefaultArgument: Argument used in sub scripts in order to launch Impulse steps with different options
AllowedArguments: List of all arguments that can be launch
Board
DefaultBoard: Board target for the potential output bitstream
AllowedBoards: List of all allowed boards for the project. A list must be set for each variant.
Progress
DefaultProgressStart: Impulse step the project must start. If not scratch,
DefaultProgressStop: Impulse step the project must stop
Project
DefaultSeed: Seed option for the Impulse placing algorithm
DefaultOptions: Options set to Impulse. Syntax is <name1>.<value1>_<name2>.<value2>_<…>
DefaultTimingDriven: Enable ('Yes') or Disable ('No') TimingDriven option for Impulse placing and routing
DefaultConstraints: Enable ('Yes') or Disable ('No') constraints set in sub_scripts/project_constraints.py
DefaultSta: Impulse steps to launch STA. Syntax is <step1>_<step2>_…
DefaultStaCondition: STA conditions. Last is kept for TimingDriven. Syntax is <cond1>_<cond2>_…
DefaultBitstream: Enable ('Yes') or Disable ('No') bitstream generation
Directory
DefaultSaveInputs: Enable ('Yes') or Disable ('No') scripts and sources in output project folder
Example
Hereafter an example:
#Top Cell
DefaultTopCellName = 'top'
DefaultTopCellLib = 'work'
#Variant
DefaultVariant = 'NG-MEDIUM'
AllowedVariants = ['NG-MEDIUM','NG-MEDIUM-EMBEDDED','NG-LARGE']
#Argument
DefaultArgument = ''
AllowedArguments = ['','debug']
#Board
DefaultBoard = 'DevKit'
AllowedBoards = [['DevKit'],[''],['DevKit']]
#Progress
DefaultProgressStart= 'scratch'
DefaultProgressStop = 'routed3'
#Project
DefaultSeed = '1789'
DefaultOptions = 'DensityEffort.Medium_CongestionEffort.Low'
DefaultTimingDriven = 'Yes'
DefaultConstraints = 'Yes'
DefaultSta = 'placed1_routed3'
DefaultStaCondition = 'typical_worstcase'
DefaultBitstream = 'Yes'
#Directory
DefaultSaveInputs = 'Yes'
Impulse project
Project Files
All design files with associate files must be defined in sub_scripts/project_files.py.
Method arguments
p: Impulse project variable
sources_files_directory: Pointer to src directory
variant: variant name
argument: script argument
Example
Hereafter an example:
from nxpython import *
def add_files(p,sources_files_directory,variant,argument):
p.addFile('work',sources_files_directory+'/switch_counter.vhd')
p.addFile('work',sources_files_directory+'/switch.vhd')
Example using arguments
Hereafter an example using method arguments:
from nxpython import *
def add_files(p,sources_files_directory,variant,argument):
p.addFile('work',sources_files_directory+'/sub_module0.vhd')
if variant=='NG-ULTRA':
if argument=='debug':
p.addFile('work',sources_files_directory+'/top_debug_ULTRA.vhd')
else:
p.addFile('work',sources_files_directory+'/top_ULTRA.vhd')
else:
p.addFile('work',sources_files_directory+'/top.vhd')
Project Parameters
All design top generics/parameters must be defined in sub_scripts/project_parameters.py.
Method arguments
p: Impulse project variable
variant: variant name
argument: script argument
Example
Hereafter an example:
from nxpython import *
def add_parameters(p,variant,argument):
p.addParameter('GENERIC_COUNTER','63')
Example using arguments
Hereafter an example using method arguments:
from nxpython import *
def add_parameters(p,variant,argument):
if variant=='NG-ULTRA':
if argument=='debug':
p.addParameter('GENERIC_COUNTER','2')
else:
p.addParameter('GENERIC_COUNTER','63')
else:
p.addParameter('GENERIC_COUNTER','31')
Project Options
All project options must be defined in sub_scripts/project_options.py.
Method arguments
p: Impulse project variable
variant: variant name
seed: Impulse seed for placing algorithm
options: Impulse options to be set
argument: script argument
Example
Hereafter an example:
from nxpython import *
def add_options(p,variant,timing_driven,seed,options,argument):
p.setOptions({
'DefaultFSMEncoding' : 'OneHot',
'DefaultRAMMapping' : 'AUTO',
'DefaultROMMapping' : 'AUTO',
'TimingDriven' : timing_driven,
'Seed' : seed
})
if not options== '':
options_split = options.split('_')
for elem in options_split:
options_name = elem.split('.')[0]
options_value = elem.split('.')[1]
p.setOption(options_name,options_value)
Last condition must not be changed.
Example using arguments
Hereafter an example using method arguments:
from nxpython import *
def add_options(p,variant,timing_driven,seed,options,argument):
p.setOptions({
'DefaultFSMEncoding' : 'OneHot',
'DefaultRAMMapping' : 'AUTO',
'DefaultROMMapping' : 'AUTO',
'TimingDriven' : timing_driven,
'Seed' : seed
})
if variant=='NG-ULTRA':
if argument=='debug':
p.setOption('MaxRegisterCount','20000')
if not options== '':
options_split = options.split('_')
for elem in options_split:
options_name = elem.split('.')[0]
options_value = elem.split('.')[1]
p.setOption(options_name,options_value)
Project Constraints
All project constraints must be defined in sub_scripts/project_options.py.
Method arguments
p: Impulse project variable
variant: variant name
argument: script argument
sub_step_nb: Impulse sub step index for Synthesizing([1;3]), Placing([1;5]) and Routing([1;3])
All constraints must be under sub_step_nb condition. Otherwise, constraint will be set at each sub step.
Example
Hereafter an example:
from nxpython import *
def synthesis_constraints(p,variant,argument,sub_step_nb):
if sub_step_nb==0:
p.setAperture(1,1,92,49)
def placing_constraints(p,variant,argument,sub_step_nb):
print("No placing common constraints")
def routing_constraints(p,variant,argument,sub_step_nb):
print("No routing common constraints")
def add_constraints(p,variant,argument,step,sub_step_nb):
if step == "Synthesize":
synthesis_constraints(p,variant,argument,sub_step_nb)
elif step == "Place":
placing_constraints(p,variant,argument,sub_step_nb)
elif step == "Route":
routing_constraints(p,variant,argument,sub_step_nb)
add_constraints method must not be changed.
Example using arguments
Hereafter an example using method arguments:
from nxpython import *
def synthesis_constraints(p,variant,argument,sub_step_nb):
if sub_step_nb==0:
if variant=='NG-ULTRA':
if argument=='debug':
p.setAperture(1,1,46,49)
else:
p.setAperture(1,1,92,49)
else:
p.setAperture(1,1,28,10)
def placing_constraints(p,variant,argument,sub_step_nb):
print("No placing common constraints")
def routing_constraints(p,variant,argument,sub_step_nb):
print("No routing common constraints")
def add_constraints(p,variant,argument,step,sub_step_nb):
if step == "Synthesize":
synthesis_constraints(p,variant,argument,sub_step_nb)
elif step == "Place":
placing_constraints(p,variant,argument,sub_step_nb)
elif step == "Route":
routing_constraints(p,variant,argument,sub_step_nb)
Project IOs
All project constraints must be defined in sub_scripts/project_ios.py.
Method arguments
p: Impulse project variable
variant: variant name
argument: script argument
board: target board to implement the bitstream
Example
Hereafter an example:
from nxpython import *
def add_ios(p,variant,argument='',board=''):
if not 'EMBEDDED' in variant:
add_banks(p,variant,argument)
add_pads(p,variant,argument)
else:
add_pins(p,variant,argument)
def add_banks(p,variant,argument='',board=''):
banks = {
'IOB01' : {'voltage': '1.8'},
'IOB02' : {'voltage': '3.3'}
}
p.addBanks(banks)
def add_pads(p,variant,argument='',board=''):
pads = {
'clk' : {'location':'IO_B01D01P', 'standard': 'LVCMOS'},
'rst' : {'location':'IO_B01D02P', 'standard': 'LVCMOS'},
'out0' : {'location':'IO_B02D01P', 'standard': 'LVCMOS'}
}
p.addPads(pads)
def add_pins(p,variant,argument='',board=''):
pins = {
}
p.addPins(pins)
add_pins method is dedicated to embedded NX targets.
add_banks and add_pads methods are dedicated to not embedded NX targets.
add_ios method must not be changed.
Example using arguments
Hereafter an example using method arguments:
from nxpython import *
def add_ios(p,variant,argument='',board=''):
if not 'EMBEDDED' in variant:
add_banks(p,variant,argument)
add_pads(p,variant,argument)
else:
add_pins(p,variant,argument)
def add_banks(p,variant,argument='',board=''):
if variant=='NG-ULTRA':
if argument=='debug':
banks = {
'IOB01' : {'voltage': '1.8'},
'IOB02' : {'voltage': '1.2'}
}
else:
banks = {
'IOB01' : {'voltage': '1.8'},
'IOB02' : {'voltage': '1.8'}
}
else:
banks = {
'IOB01' : {'voltage': '1.8'},
'IOB02' : {'voltage': '3.3'}
}
p.addBanks(banks)
def add_pads(p,variant,argument='',board=''):
pads = {
'clk' : {'location':'IO_B01D01P', 'standard': 'LVCMOS'},
'rst' : {'location':'IO_B01D02P', 'standard': 'LVCMOS'},
'out0' : {'location':'IO_B02D01P', 'standard': 'LVCMOS'}
}
p.addPads(pads)
def add_pins(p,variant,argument='',board=''):
pins = {
}
p.addPins(pins)
Â
© NanoXplore 2022