Skip to content

Instantly share code, notes, and snippets.

@cmosguy
Last active March 17, 2016 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmosguy/2e85d453c57435ff52b5 to your computer and use it in GitHub Desktop.
Save cmosguy/2e85d453c57435ff52b5 to your computer and use it in GitHub Desktop.
#for debugging purposes use this command in the console
#array set test [parseB5evCsv "$::env(BHAB)/tests/fixtures/B5EV_TD_parameter_template_examplate.csv"]
proc validateB5evData {_parsedData sourceLibrary} {
#start validating if cells exist
# 1. first validate that top level cells exist for shit reg and corner cells
array set parsedData $_parsedData
#parray parsedData
#puts $parsedData(title)
set validationFailed 0
set errorMsg ""
set checkShiftRegRow [checkCellViewsExist $parsedData(shiftRegRow) layout $sourceLibrary]
set $errorMsg [lindex $checkShiftRegRow 1]
set $validationFailed [lindex $checkShiftRegRow 0]
puts $checkShiftRegRow
puts "validationfailed: [lindex $checkShiftRegRow 0]"
if {$validationFailed} {
puts "here"
return -code error $errorMsg
}
return 0
}
proc checkCellViewsExist {cell view sourceLibrary} {
set validationFailed 0
set errorMsg {}
if {[catch {dm::getCellViews $view -cellName $cell -libName $sourceLibrary}]} {
set errorMsg "Could not open $cell $view"
set validationFailed 1
}
return [list $validationFailed $errorMsg]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment