OpenCores
URL https://opencores.org/ocsvn/sv_dir_tb/sv_dir_tb/trunk

Subversion Repositories sv_dir_tb

[/] [sv_dir_tb/] [trunk/] [tb_gen/] [tb_gen.tcl] - Diff between revs 2 and 3

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 3
Line 30... Line 30...
 
 
## package requires
## package requires
package require Iwidgets 4.0
package require Iwidgets 4.0
 
 
## set the current version info
## set the current version info
set version "Beta 1.0"
set version "Beta 1.1"
## 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 600... Line 600...
    puts $tfh "  tb_mod prg_inst\(theif\)\;"
    puts $tfh "  tb_mod prg_inst\(theif\)\;"
    puts $tfh ""
    puts $tfh ""
    puts $tfh "endmodule"
    puts $tfh "endmodule"
 
 
    close $tfh
    close $tfh
 
    $p_view step
############################################################################
############################################################################
##  generate the interface file.
##  generate the interface file.
    set ifn $destin_text
    set ifn $destin_text
    append ifn "/dut_if.sv"
    append ifn "/dut_if.sv"
    set ifh [open $ifn w]
    set ifh [open $ifn w]
Line 653... Line 654...
    puts $ifh "  \)\;"
    puts $ifh "  \)\;"
    puts $ifh ""
    puts $ifh ""
    puts $ifh "endinterface"
    puts $ifh "endinterface"
    close $ifh
    close $ifh
 
 
 
    $p_view step
##########################################################################
##########################################################################
##   generate the tb_prg  file from template.
##   generate the tb_prg  file from template.
    set prg_gen [$mo_sel get]
    set prg_gen [$mo_sel get]
    if {$prg_gen == "No mod"} {
    if {$prg_gen == "No mod"} {
 
        $p_view step
 
        $p_view step
                    return
                    return
                }
                }
    set tpl_fh [open $template r]
    set tpl_fh [open $template r]
    set tpl_lst {}
    set tpl_lst {}
    set hfound 0
    set hfound 0
Line 696... Line 700...
            break
            break
        }
        }
        incr idx
        incr idx
    }
    }
 
 
 
    #foreach l $tpl_lst {
 
    #    puts  $l
 
    #}
 
 
 
 
 
    $p_view step
    set idx 0
    set idx 0
    foreach l $tpl_lst {
    foreach l $tpl_lst {
        set ent_pt [string first ">>drive sigs" $l]
        set ent_pt [string first ">>drive sigs" $l]
        if {$ent_pt == 0} {
        if {$ent_pt == 0} {
            set tpl_lst [lreplace $tpl_lst $idx $idx]
            set tpl_lst [lreplace $tpl_lst $idx $idx]
Line 724... Line 734...
        }
        }
        incr idx
        incr idx
    }
    }
 
 
    write_header $pfh
    write_header $pfh
    #foreach l $tpl_lst {
    foreach l $tpl_lst {
    #    puts $pfh $l
        puts $pfh $l
    #}
    }
 
 
 
    $p_view step
    close $pfh
    close $pfh
}
}
## end ttb_gen
## end ttb_gen
#################################################
#################################################
##  show  about message
##  show  about message

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.