OpenCores
URL https://opencores.org/ocsvn/single-14-segment-display-driver-w-decoder/single-14-segment-display-driver-w-decoder/trunk

Subversion Repositories single-14-segment-display-driver-w-decoder

[/] [single-14-segment-display-driver-w-decoder/] [trunk/] [Project/] [Sources/] [Decoding_Table/] [ROM_ASCII_Decoder/] [decoder_table_dist_rom_impl/] [decoder_table_dist_rom/] [generate_core.tcl] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 liubenoff
#!/usr/local/bin/wish
2
 
3
proc GetPlatform {} {
4
        global tcl_platform
5
 
6
        set cpu  $tcl_platform(machine)
7
 
8
        switch $cpu {
9
                intel -
10
                i*86* {
11
                        set cpu ix86
12
                }
13
                x86_64 {
14
                        if {$tcl_platform(wordSize) == 4} {
15
                                set cpu ix86
16
                        }
17
                }
18
        }
19
 
20
        switch $tcl_platform(platform) {
21
                windows {
22
                        if {$cpu == "amd64"} {
23
                                # Do not check wordSize, win32-x64 is an IL32P64 platform.
24
                                set cpu x86_64
25
                        }
26
                        if {$cpu == "x86_64"} {
27
                                return "nt64"
28
                        } else {
29
                                return "nt"
30
                        }
31
                }
32
                unix {
33
                        if {$tcl_platform(os) == "Linux"}  {
34
                                if {$cpu == "x86_64"} {
35
                                        return "lin64"
36
                                } else {
37
                                        return "lin"
38
                                }
39
                        } else  {
40
                                return "sol"
41
                        }
42
                }
43
        }
44
        return "nt"
45
}
46
 
47
proc GetCmdLine {lpcfile} {
48
        global Para
49
 
50
        if [catch {open $lpcfile r} fileid] {
51
                puts "Cannot open $para_file file!"
52
                exit -1
53
        }
54
 
55
        seek $fileid 0 start
56
        set default_match 0
57
        while {[gets $fileid line] >= 0} {
58
                if {[string first "\[Command\]" $line] == 0} {
59
                        set default_match 1
60
                        continue
61
                }
62
                if {[string first "\[" $line] == 0} {
63
                        set default_match 0
64
                }
65
                if {$default_match == 1} {
66
                        if [regexp {([^=]*)=(.*)} $line match parameter value] {
67
                                if [regexp {([ |\t]*;)} $parameter match] {continue}
68
                                if [regexp {(.*)[ |\t]*;} $value match temp] {
69
                                        set Para($parameter) $temp
70
                                } else {
71
                                        set Para($parameter) $value
72
                                }
73
                        }
74
                }
75
        }
76
        set default_match 0
77
        close $fileid
78
 
79
        return $Para(cmd_line)
80
}
81
 
82
set platformpath [GetPlatform]
83
set Para(sbp_path) [file dirname [info script]]
84
set Para(install_dir) $env(TOOLRTF)
85
set Para(FPGAPath) "[file join $Para(install_dir) ispfpga bin $platformpath]"
86
 
87
set scuba "$Para(FPGAPath)/scuba"
88
set modulename "decoder_table_dist_rom"
89
set lang "vhdl"
90
set lpcfile "$Para(sbp_path)/$modulename.lpc"
91
set arch "sa5p00g"
92
set cmd_line [GetCmdLine $lpcfile]
93
set fdcfile "$Para(sbp_path)/$modulename.fdc"
94
if {[file exists $fdcfile] == 0} {
95
        append scuba " " $cmd_line
96
} else {
97
        append scuba " " $cmd_line " " -fdc " " \"$fdcfile\"
98
}
99
set Para(result) [catch {eval exec "$scuba"} msg]
100
#puts $msg

powered by: WebSVN 2.1.0

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