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 43

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

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

powered by: WebSVN 2.1.0

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