📄 netedit
字号:
#!/usr/bin/wish################################################################################ Copyright (c) 2001, Alexander Gnusin, alexg@ottawa.com ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are met: ## Redistributions of source code must retain the above copyright notice, this ## list of conditions and the following disclaimer. ## ## Redistributions in binary form must reproduce the above copyright notice, ## this list of conditions and the following disclaimer in the documentation ## and/or other materials provided with the distribution. ## ## Neither the name of the TCLforEDA nor the names of its contributors may ## be used to endorse or promote products derived from this software without ## specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ## ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ## ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ## SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ## CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE ## USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ################################################################################set Bwidget_path "bwidget"#source lib/tree.tclsource lib/net.tclsource lib/funcs.tclglobal curset cur 1.0#========================================================namespace eval Netman { global help_file global my_editor variable notebook variable mainframe variable status variable prgindic variable font variable instance_name}#=======================proc Netman::create { } { global tcl_platform my_editor tk_patchLevel lfiles variable notebook variable mainframe variable font variable prgindic set my_editor "" SelectFont::loadfont # Menu description set descmenu { "Design" all tree 0 { {command "Load Design" {} "Load design" {} -command "Netman::load_design"} {command "Load Library" {} "Load Library" {} -command "Netman::load_lib"} {separator} {command "Load DB" {} "Load Design in DB format" {} -command "Netman::load_db"} {separator} {command "&Help" {} "Get Help" {} -command "Netman::get_help $help_file"} } "Netlist" all view 0 { {command "&Print Window" {} "Print netlist window" {} -command "Net::print_window"} {command "&Clear Screen" {} "Delete All" {} -command "Net::delete_all"} {separator} {command "&Help" {} "Get Help" {} -command "Netman::get_help $help_file"} } "Exit" all exit 0 { {command "Exit" {} "Exit Pman" {} -command exit} } } set mainframe [MainFrame .mainframe \ -menu $descmenu \ -textvariable Netman::status \ -progressvar Netman::prgindic] $mainframe addindicator -textvariable Netman::instance_name # NoteBook creation set frame [$mainframe getframe] set notebook [NoteBook $frame.nb] Tree::create $notebook Net::create $notebook $notebook compute_size pack $notebook -fill both -expand yes -padx 4 -pady 4 $notebook raise [$notebook page 0] pack $mainframe -fill both -expand yes}#=======================proc Netman::load_design {} { global command set load_file [tk_getOpenFile -filetypes {{"Verilog files" *.v}} -parent .mainframe] if {$load_file != ""} { read_verilog $load_file $Tree::mcombo configure -values [get_modules *] }}#=======================proc Netman::load_lib {} { global command set load_file [tk_getOpenFile -filetypes {{"Verilog files" *.v}} -parent .mainframe] if {$load_file != ""} { read_lib $load_file }}#=======================proc Netman::load_db {} { global command set load_file [tk_getOpenFile -filetypes {{"DB files" *.db}} -parent .mainframe] if {$load_file != ""} { read_db $load_file $Tree::mcombo configure -values [get_modules *] }}#======================= proc Netman::get_help { help_file } { set w .helpdlg toplevel $w wm title $w "Help" frame $w.buttons pack $w.buttons -side bottom -fill x -pady 2m button $w.buttons.dismiss -text Dismiss -command "destroy $w" pack $w.buttons.dismiss -side left -expand 1 text $w.text -relief sunken -bd 2 -bg grey80 -yscrollcommand "$w.scroll set" -setgrid 1 \ -height 30 scrollbar $w.scroll -command "$w.text yview" pack $w.scroll -side right -fill y pack $w.text -expand yes -fill both set HF [open $help_file r] while {[gets $HF line] >= 0} { $w.text insert end $line\n }}#=======================proc main {} { global tcl_platform global auto_path global Bwidget_path lappend auto_path $Bwidget_path package require BWidget option add *TitleFrame.font {helvetica 11 bold italic} wm withdraw . wm title . "Netlist Manager" Netman::create BWidget::place . 0 0 center wm deiconify . raise . focus -force .}#=======================mainwm geom . [wm geom .]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -