Line 1... |
Line 1... |
#! /usr/bin/env wish
|
#! /usr/bin/env wish
|
##-------------------------------------------------------------------------------
|
##-------------------------------------------------------------------------------
|
## Copyright 2018 Ken Campbell
|
## Copyright 2019 Ken Campbell
|
##
|
##
|
## Licensed under the Apache License, Version 2.0 (the "License");
|
## Licensed under the Apache License, Version 2.0 (the "License");
|
## you may not use this file except in compliance with the License.
|
## you may not use this file except in compliance with the License.
|
## You may obtain a copy of the License at
|
## You may obtain a copy of the License at
|
##
|
##
|
Line 14... |
Line 14... |
## See the License for the specific language governing permissions and
|
## See the License for the specific language governing permissions and
|
## limitations under the License.
|
## limitations under the License.
|
##-------------------------------------------------------------------------------
|
##-------------------------------------------------------------------------------
|
##-- $Author: $ Ken Campbell
|
##-- $Author: $ Ken Campbell
|
##--
|
##--
|
##-- $Date: $ August 2018
|
##-- $Date: $ April 2019
|
##--
|
##--
|
##-- $Id: $
|
##-- $Id: $
|
##--
|
##--
|
##-- $Source: $
|
##-- $Source: $
|
##--
|
##--
|
Line 31... |
Line 31... |
## package requires
|
## package requires
|
package require Ttk
|
package require Ttk
|
package require Tk
|
package require Tk
|
|
|
## set the current version info
|
## set the current version info
|
set version "Version 1.0"
|
set version "Version 1.2"
|
## put up a title on the main window boarder
|
## put up a title on the main window boarder
|
wm title . "SV TB Gen $version"
|
wm title . "SV TB Gen $version"
|
|
|
## the location of the template by default
|
## the location of the template by default
|
set template "./tb_mod_template.sv"
|
set template "./tb_mod_template.sv"
|
Line 76... |
Line 76... |
$tdir configure -state readonly
|
$tdir configure -state readonly
|
|
|
## type spec
|
## type spec
|
set tsf [frame .tsfr]
|
set tsf [frame .tsfr]
|
set load_but [button $tsf.bt1 -text "Generate" -command ttb_gen]
|
set load_but [button $tsf.bt1 -text "Generate" -command ttb_gen]
|
|
## this button enables quicker development of the parser. If
|
set test_but [button $tsf.bt2 -text "Source" -command {source tb_gen_parser.tcl}]
|
set test_but [button $tsf.bt2 -text "Source" -command {source tb_gen_parser.tcl}]
|
set comb_vals {"No mod" "Gen mod"}
|
set comb_vals {"No mod" "Gen mod"}
|
set comb_val "No mod"
|
set comb_val "No mod"
|
set mo_sel [ttk::combobox $tsf.mode -textvariable comb_val -values $comb_vals -state readonly]
|
set mo_sel [ttk::combobox $tsf.mode -textvariable comb_val -values $comb_vals -state readonly]
|
set gbatv 0
|
set gbatv 0
|
Line 88... |
Line 89... |
$mo_sel insert end "Gen mod"
|
$mo_sel insert end "Gen mod"
|
#"Gen mod"
|
#"Gen mod"
|
set gen_prog 0.0
|
set gen_prog 0.0
|
set p_view [ttk::progressbar $tsf.fb1 -variable gen_prog]
|
set p_view [ttk::progressbar $tsf.fb1 -variable gen_prog]
|
set statsVar ""
|
set statsVar ""
|
##set stat_txt [label $tsf.lb1 -textvariable statsVar]
|
|
set stat_txt [label .lb1 -textvariable statsVar]
|
set stat_txt [label .lb1 -textvariable statsVar]
|
|
|
## about button
|
## about button
|
button $tsf.bout1 -text "About" -command show_about
|
button $tsf.bout1 -text "About" -command show_about
|
|
|
#pack $cpak -side left
|
|
#pack $gbat -side left
|
|
pack $mo_sel -side left
|
pack $mo_sel -side left
|
pack $load_but -side left -padx 20
|
pack $load_but -side left -padx 20
|
pack $test_but -side left -padx 20
|
pack $test_but -side left -padx 20
|
pack $p_view -side left
|
pack $p_view -side left
|
pack $tsf.bout1 -side right
|
pack $tsf.bout1 -side right
|
Line 117... |
Line 115... |
## create two object boxes
|
## create two object boxes
|
set sel_lst {}
|
set sel_lst {}
|
set m_select ""
|
set m_select ""
|
set list_win [listbox $wtop.sb -listvariable sel_lst -height 16]
|
set list_win [listbox $wtop.sb -listvariable sel_lst -height 16]
|
set list_ent [entry $wtop.lent -textvariable m_select]
|
set list_ent [entry $wtop.lent -textvariable m_select]
|
#set view_win [iwidgets::scrolledtext $wbot.rts -borderwidth 2 -wrap none]
|
|
set view_win [text $wmid.rts -borderwidth 2 -wrap none]
|
set view_win [text $wmid.rts -borderwidth 2 -wrap none]
|
pack $list_win -fill both -expand yes
|
pack $list_win -fill both -expand yes
|
pack $list_ent -anchor s -fill x -expand yes
|
pack $list_ent -anchor s -fill x -expand yes
|
pack $view_win -fill both -expand yes
|
pack $view_win -fill both -expand yes
|
|
|
## some tags for the view window
|
## tag for the view window
|
##$view_win tag configure highlite -background #a0b7ce
|
|
$view_win tag configure highlite -background grey80
|
$view_win tag configure highlite -background grey80
|
|
|
###########################################################################
|
###########################################################################
|
## some debug and help procs
|
## some debug and help procs
|
## Message Error, terminate
|
## Message Error, terminate
|
Line 145... |
Line 141... |
## browse and get directory
|
## browse and get directory
|
## Using extfileselectiondialog get a directory and update the
|
## Using extfileselectiondialog get a directory and update the
|
## field passed to it
|
## field passed to it
|
proc browsed_from_set { src dest } {
|
proc browsed_from_set { src dest } {
|
set wdir [$src get]
|
set wdir [$src get]
|
puts $wdir
|
#puts $wdir
|
if {$wdir == ""} {
|
if {$wdir == ""} {
|
set curd [pwd]
|
set curd [pwd]
|
puts $curd
|
#puts $curd
|
set fn [tk_chooseDirectory -title "Choose a directory" -initialdir $curd]
|
set fn [tk_chooseDirectory -title "Choose a directory" -initialdir $curd]
|
} else {
|
} else {
|
set fn [tk_chooseDirectory -initialdir $wdir -title "Choose a directory"]
|
set fn [tk_chooseDirectory -initialdir $wdir -title "Choose a directory"]
|
}
|
}
|
|
|
Line 200... |
Line 196... |
dbg_msg $msg
|
dbg_msg $msg
|
}
|
}
|
|
|
## enable pop up console for debug
|
## enable pop up console for debug
|
bind . <F12> {catch {console show}}
|
bind . <F12> {catch {console show}}
|
#bind $list_win <<ListboxSelect>> {load_ent_file}
|
|
#bind $list_win <<ListboxSelect>> {set m_select [$list_win curselection]}
|
|
bind $list_win <<ListboxSelect>> {set sel_dx [$list_win curselection]; set m_select [$list_win get $sel_dx]; load_ent_file}
|
|
No newline at end of file
|
No newline at end of file
|
|
bind $list_win <<ListboxSelect>> {process_selected}
|
|
|
No newline at end of file
|
No newline at end of file
|