add license info on traversal.tcl
This commit is contained in:
parent
c99282e463
commit
bd5cb7b9df
|
|
@ -1,3 +1,27 @@
|
||||||
|
#
|
||||||
|
# File: traversal.tcl
|
||||||
|
#
|
||||||
|
# This file is part of XSCHEM,
|
||||||
|
# a schematic capture and Spice/Vhdl/Verilog netlisting tool for circuit
|
||||||
|
# simulation.
|
||||||
|
# Copyright (C) 1998-2022 Stefan Frederik Schippers
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
# This script traverses the hierarchy and prints all instances in design.
|
||||||
|
|
||||||
proc traversal {file} {
|
proc traversal {file} {
|
||||||
if { $file eq {} || [file exists $file] } {
|
if { $file eq {} || [file exists $file] } {
|
||||||
puts stderr "empty or existing file..."
|
puts stderr "empty or existing file..."
|
||||||
|
|
@ -34,6 +58,7 @@ proc hier_traversal {fd {level 0}} {
|
||||||
set ninst [lindex [split [xschem expandlabel $instname] { }] 1]
|
set ninst [lindex [split [xschem expandlabel $instname] { }] 1]
|
||||||
for {set n 1} {$n <= $ninst} { incr n} {
|
for {set n 1} {$n <= $ninst} { incr n} {
|
||||||
xschem select instance $i
|
xschem select instance $i
|
||||||
|
# descending ninst times is extremely inefficient --FIXME--
|
||||||
xschem descend $n
|
xschem descend $n
|
||||||
# ensure previous descend was successful
|
# ensure previous descend was successful
|
||||||
if {[xschem get currsch] == $current_level + 1} {
|
if {[xschem get currsch] == $current_level + 1} {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue