📄 protect.tcl
字号:
########## Tcl recorder starts at 08/14/06 19:03:33 ##########
set version "5.0"
set proj_dir "E:/lfg/gal16v8"
cd $proj_dir
# Get directory paths
set pver $version
regsub -all {\.} $pver {_} pver
set lscfile "lsc_"
append lscfile $pver ".ini"
set lsvini_dir [lindex [array get env LSC_INI_PATH] 1]
set lsvini_path [file join $lsvini_dir $lscfile]
if {[catch {set fid [open $lsvini_path]} msg]} {
puts "File Open Error: $lsvini_path"
return false
} else {set data [read $fid]; close $fid }
foreach line [split $data '\n'] {
set lline [string tolower $line]
set lline [string trim $lline]
if {[string compare $lline "\[paths\]"] == 0} { set path 1; continue}
if {$path && [regexp {^\[} $lline]} {set path 0; break}
if {$path && [regexp {^bin} $lline]} {set cpld_bin $line; continue}
if {$path && [regexp {^fpgapath} $lline]} {set fpga_dir $line}}
set cpld_bin [string range $cpld_bin [expr [string first "=" $cpld_bin]+1] end]
regsub -all "\"" $cpld_bin "" cpld_bin
set cpld_bin [file join $cpld_bin]
set install_dir [string range $cpld_bin 0 [expr [string first "ispcpld" $cpld_bin]-2]]
regsub -all "\"" $install_dir "" install_dir
set install_dir [file join $install_dir]
set fpga_dir [string range $fpga_dir [expr [string first "=" $fpga_dir]+1] end]
regsub -all "\"" $fpga_dir "" fpga_dir
set fpga_dir [file join $fpga_dir]
switch $tcl_platform(platform) {
windows {
set fpga_bin [file join $fpga_dir "bin" "nt"]
if {[string match "*$fpga_bin;*" $env(PATH)] == 0 } {
set env(PATH) "$fpga_bin;$env(PATH)" } }
unix {
set fpga_bin [file join $fpga_dir "bin" "sol"]
if {[string match "*$fpga_bin;*" $env(PATH)] == 0 } {
set env(PATH) "$fpga_bin;$env(PATH)"}}}
if {[string match "*$cpld_bin;*" $env(PATH)] == 0 } {
set env(PATH) "$cpld_bin;$env(PATH)" }
lappend auto_path [file join $install_dir "ispcpld" "tcltk" "lib" "ispwidget" "runproc"]
package require runcmd
# Commands to make the Process:
# Functional Simulation
if [runCmd "\"$cpld_bin/exp\" -lhdl -ext=.ltv -testpt protect1.wdl -network=protect"] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/sch2tf\" -template \"$install_dir/ispcpld/plsi/latsim/plsi.tft\" -prj protect -ext .lsi protect.sch "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/sch2blf\" -sup \"protect.sch\" -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblflink\" \"protect.bls\" -o \"protect.bl0\" -ipo -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblifopt\" -i \"protect.bl0\" -o \"protect.blo\" -red bypin choose -sweep -collapse none -pterms 8 -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/sch2blf\" -sup \"rs.sch\" -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblflink\" \"rs.bls\" -o \"rs.bl0\" -ipo -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblifopt\" -i \"rs.bl0\" -o \"rs.blo\" -red bypin choose -sweep -collapse none -pterms 8 -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/sch2blf\" -sup \"3rs.sch\" -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblflink\" \"3rs.bls\" -o \"3rs.bl0\" -ipo -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblifopt\" -i \"3rs.bl0\" -o \"3rs.blo\" -red bypin choose -sweep -collapse none -pterms 8 -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblflink\" \"protect.blo\" -o \"protect.blh\" -omod protect -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblifopt\" \"protect.blh\" -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/idiofft\" -i \"protect.bli\" -o \"protect.blj\" -idev plsi -propadd -dev pla_basic -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
# Application to view the Process:
# Functional Simulation
if [catch {open simcp._sp w} rspFile] {
puts stderr "Cannot create response file simcp._sp: $rspFile"
} else {
puts $rspFile "simcp.pre1 -ini simcpls.ini -unit simcp.pre1
-cfg oaipldtg.fdk \"protect1.ltv\" -map \"protect.lsi\"
"
close $rspFile
}
if [runCmd "\"$cpld_bin/simcp\" @simcp._sp"] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
########## Tcl recorder end at 08/14/06 19:03:33 ###########
########## Tcl recorder starts at 08/14/06 19:36:20 ##########
# Commands to make the Process:
# Simulate JEDEC File
if [runCmd "\"$cpld_bin/ahdl2blf\" \"protect.abv\" -vec -ovec \"protect.tmv\" -def _plsi_ _lattice_ -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblifopt\" -i \"protect.bl0\" -o \"protect.bl1\" -red bypin choose -sweep -collapse none -pterms 8 -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblifopt\" -i \"rs.bl0\" -o \"rs.bl1\" -red bypin choose -sweep -collapse none -pterms 8 -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblifopt\" -i \"3rs.bl0\" -o \"3rs.bl1\" -red bypin choose -sweep -collapse none -pterms 8 -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblflink\" \"protect.bl1\" -o \"protect.bl2\" -omod protect -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblifopt\" protect.bl2 -red bypin choose -sweep -collapse all -pterms 8 -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/idiofft\" protect.bl3 -pla -o protect.tt2 -dev p16v8 -define n -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/fit\" protect.tt2 -dev p16v8 -str -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/fuseasm\" protect.tt3 -dev p16v8 -o protect.jed -ivec protect.tmv -rep protect.rpt -doc brief -con ptblown -for brief -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/jedsim\" protect.jed -o protect.smj -ostatus protect.sts -tra table detail -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
########## Tcl recorder end at 08/14/06 19:36:20 ###########
########## Tcl recorder starts at 08/14/06 19:38:31 ##########
# Commands to make the Process:
# JEDEC Simulation Waveform
# - none -
# Application to view the Process:
# JEDEC Simulation Waveform
if [runCmd "\"$cpld_bin/waves\" -hst jedec.hst"] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
########## Tcl recorder end at 08/14/06 19:38:31 ###########
########## Tcl recorder starts at 08/16/06 14:23:20 ##########
# Commands to make the Process:
# Functional Simulation
# - none -
# Application to view the Process:
# Functional Simulation
if [catch {open simcp._sp w} rspFile] {
puts stderr "Cannot create response file simcp._sp: $rspFile"
} else {
puts $rspFile "simcp.pre1 -ini simcpls.ini -unit simcp.pre1
-cfg oaipldtg.fdk \"protect1.ltv\" -map \"protect.lsi\"
"
close $rspFile
}
if [runCmd "\"$cpld_bin/simcp\" @simcp._sp"] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
########## Tcl recorder end at 08/16/06 14:23:20 ###########
########## Tcl recorder starts at 08/16/06 14:33:02 ##########
# Commands to make the Process:
# Hierarchy
if [runCmd "\"$cpld_bin/sch2jhd\" \"protect.sch\" "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
########## Tcl recorder end at 08/16/06 14:33:02 ###########
########## Tcl recorder starts at 08/16/06 14:33:11 ##########
# Commands to make the Process:
# Compile Schematic
if [runCmd "\"$cpld_bin/sch2blf\" -sup \"protect.sch\" -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblflink\" \"protect.bls\" -o \"protect.bl0\" -ipo -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
########## Tcl recorder end at 08/16/06 14:33:11 ###########
########## Tcl recorder starts at 08/16/06 14:33:17 ##########
# Commands to make the Process:
# Functional Simulation
if [runCmd "\"$cpld_bin/sch2tf\" -template \"$install_dir/ispcpld/plsi/latsim/plsi.tft\" -prj protect -ext .lsi protect.sch "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblifopt\" -i \"protect.bl0\" -o \"protect.blo\" -red bypin choose -sweep -collapse none -pterms 8 -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblflink\" \"protect.blo\" -o \"protect.blh\" -omod protect -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/iblifopt\" \"protect.blh\" -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
if [runCmd "\"$cpld_bin/idiofft\" -i \"protect.bli\" -o \"protect.blj\" -idev plsi -propadd -dev pla_basic -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
# Application to view the Process:
# Functional Simulation
if [catch {open simcp._sp w} rspFile] {
puts stderr "Cannot create response file simcp._sp: $rspFile"
} else {
puts $rspFile "simcp.pre1 -ini simcpls.ini -unit simcp.pre1
-cfg oaipldtg.fdk \"protect1.ltv\" -map \"protect.lsi\"
"
close $rspFile
}
if [runCmd "\"$cpld_bin/simcp\" @simcp._sp"] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
########## Tcl recorder end at 08/16/06 14:33:17 ###########
########## Tcl recorder starts at 08/16/06 14:34:31 ##########
# Commands to make the Process:
# Reduce Schematic Logic
if [runCmd "\"$cpld_bin/iblifopt\" -i \"protect.bl0\" -o \"protect.bl1\" -red bypin choose -sweep -collapse none -pterms 8 -family -err automake.err "] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
########## Tcl recorder end at 08/16/06 14:34:32 ###########
########## Tcl recorder starts at 08/16/06 14:34:36 ##########
# Commands to make the Process:
# Reduced Equations
if [runCmd "\"$cpld_bin/blif2eqn\" \"protect.bl1\" -o \"protect.eq1\" -err automake.err"] {
return
} else {
vwait done
if [checkResult $done] {
return
}
}
########## Tcl recorder end at 08/16/06 14:34:36 ###########
########## Tcl recorder starts at 08/16/06 14:35:06 ##########
# Commands to make the Process:
# Functional Simulation
# - none -
# Application to view the Process:
# Functional Simulation
if [catch {open simcp._sp w} rspFile] {
puts stderr "Cannot create response file simcp._sp: $rspFile"
} else {
puts $rspFile "simcp.pre1 -ini simcpls.ini -unit simcp.pre1
-cfg oaipldtg.fdk \"protect1.ltv\" -map \"protect.lsi\"
"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -