OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [script/] [model.tcl] - Blame information for rev 38

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 alirezamon
#!/usr/bin/tclsh
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
###################################################################
11
## Author      : Alireza Monemi
12
## Email       : 
13
## Description : Compile all verilog files inside the design folder 
14
##             : using modelsim
15
###################################################################
16
set text "###################################################################"
17
set text "##                Start Compilation Script "
18
set text "###################################################################"
19
 
20
###################################################################
21
##---- Specify variables
22
set text "###################################################################"
23
set text "##---- Specify variables"
24
 
25
##-- Project path variables
26
set path                        [pwd]/..
27
set src_noc_path                        $path/src_noc
28
set src_modelsim_path                   $path/src_modelsim
29
set comp_path                   $path/../mpsoc_work/modelsim
30
set work_path                   $comp_path/work
31
 
32
set file_list [glob -directory $src_noc_path *.v]
33
set modelsim_file_list [glob -directory $src_modelsim_path *.v]
34
 
35
 
36
##-- change directory
37
file mkdir $comp_path
38
 
39
cd $comp_path
40
exec rm -Rf *
41
proc r  {} {uplevel #0 source compile.tcl}
42
proc rr {} {global last_compile_time
43
            set last_compile_time 0
44
            r                            }
45
proc q  {} {quit -force                  }
46
 
47
proc sleep {N} {
48
    after [expr {int($N * 1000)}]
49
}
50
 
51
 
52
#Does this installation support Tk?
53
set tk_ok 1
54
if [catch {package require Tk}] {set tk_ok 0}
55
 
56
###################################################################
57
##---- 1. Creating working library
58
set text "###################################################################"
59
set text "##---- 1. Creating working library"
60
 
61
##-- Create work lib
62
vlib $work_path
63
 
64
##-- Mapping work lib
65
vmap work $work_path
66
 
67
 
68
 
69
###################################################################
70
##---- 3. Compile the Design
71
set text "###################################################################"
72
set text "##---- 3. Compile the Design"
73
 
74
 
75
# Compile out of date files
76
set time_now [clock seconds]
77
 
78
if {[file isfile start_time.txt] != 0} {
79
        set fp [open start_time.txt r]
80
        set line [gets $fp]
81
        close $fp
82
        regexp {\d+} $line last_compile_time
83
        puts "last compiled time is  $last_compile_time"
84
} else {
85
        set last_compile_time 0
86
}
87
 
88
set last_compile_time 0
89
 
90
foreach f $file_list {
91
 
92
                if { $last_compile_time < [file mtime $f] } {
93
                        vlog -work  $work_path  +incdir+$src_noc_path  $f
94
                         set last_compile_time 0
95
                } else {
96
                         puts "$f is uptodate"
97
                }
98
        }
99
 
100
foreach f $modelsim_file_list {
101
 
102
                if { $last_compile_time < [file mtime $f] } {
103
                        vlog -work  $work_path  +incdir+$src_modelsim_path  $f
104
                         set last_compile_time 0
105
                } else {
106
                         puts "$f is uptodate"
107
                }
108
        }
109
 
110
set last_compile_time $time_now
111
 
112
 
113
 
114
set text "###################################################################"
115
set text "##                       END OF COMPILATION"
116
set text "###################################################################"
117
 
118
 
119 38 alirezamon
#vsim -t ps work.testbench_router
120 16 alirezamon
vsim  -t ps  work.testbench_modelsim
121
 
122
run 100 ms
123
 
124
#save last compile time
125
 
126
  set fp [open start_time.txt w]
127
  puts $fp "Start time was [clock seconds]"
128
  close $fp
129
 
130
#q
131
 
132
 
133
#####################################################################################
134
 

powered by: WebSVN 2.1.0

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