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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [actel_m1a3pl_dev_kit/] [synthesis/] [actel/] [prepare_implementation.tcl] - Blame information for rev 107

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

Line No. Rev Author Line
1 82 olivier.gi
#!/usr/bin/tclsh
2
#------------------------------------------------------------------------------
3
# Copyright (C) 2001 Authors
4
#
5
# This source file may be used and distributed without restriction provided
6
# that this copyright statement is not removed from the file and that any
7
# derivative work contains the original copyright notice and the associated
8
# disclaimer.
9
#
10
# This source file is free software; you can redistribute it and/or modify
11
# it under the terms of the GNU Lesser General Public License as published
12
# by the Free Software Foundation; either version 2.1 of the License, or
13
# (at your option) any later version.
14
#
15
# This source is distributed in the hope that it will be useful, but WITHOUT
16
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18
# License for more details.
19
#
20
# You should have received a copy of the GNU Lesser General Public License
21
# along with this source; if not, write to the Free Software Foundation,
22
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23
#
24
#------------------------------------------------------------------------------
25
# 
26
# File Name:   prepare_implementation.tcl
27
#
28
# Description: This script will prepare the Synplify and Libero Designer
29
#              working directories and scripts.
30
#
31
#                1 - The synthesis can be first started from the "work_synplify"
32
#                   directory by executing the "synplify.tcl" script from Synplify.
33
#
34
#                2 - The Place & Route step can be then started from the
35
#                   "work_designer" directory by executing the "libero_designer.tcl"
36
#                   script from the Libero Designer program.
37
# 
38
# Author(s):
39
#             - Olivier Girard,    olgirard@gmail.com
40
#
41
#------------------------------------------------------------------------------
42
# $Rev: 17 $
43
# $LastChangedBy: olivier.girard $
44
# $LastChangedDate: 2009-08-04 23:15:39 +0200 (Tue, 04 Aug 2009) $
45
#------------------------------------------------------------------------------
46
 
47
###############################################################################
48
#                         SET SOME GLOBAL VARIABLES                           #
49
###############################################################################
50
 
51
# Set the FPGA:  architecture,    model,   package_syn  package_libero, speed-grade
52
set fpgaConfig {  ProASIC3L     M1A3P1000L  FBGA484     "484 FBGA"        Std}
53
 
54
# RTL Top Level module
55
set designTop "openMSP430_fpga"
56
 
57
# RTL include files
58 107 olivier.gi
set rtlIncludeFiles "../../../rtl/verilog/openmsp430/timescale.v                     \
59
                     ../../../rtl/verilog/openmsp430/openMSP430_defines.v            \
60
                     ../../../rtl/verilog/openmsp430/openMSP430_undefines.v          \
61
                     ../../../rtl/verilog/openmsp430/periph/omsp_timerA_defines.v    \
62
                     ../../../rtl/verilog/openmsp430/periph/omsp_timerA_undefines.v"
63 82 olivier.gi
 
64
###############################################################################
65
#                                 CLEANUP                                     #
66
###############################################################################
67
 
68
# Cleanup
69
file delete -force ./work_synplify
70
file delete -force ./work_designer
71
file mkdir ./work_synplify
72
file mkdir ./work_designer
73
cd ./work_synplify
74
 
75
# Copy RTL include files
76
foreach rtlFile $rtlIncludeFiles {
77
        file copy $rtlFile .
78
}
79
 
80
###############################################################################
81
#                         GENERATE SYNTHESIS SCRIPT                           #
82
###############################################################################
83
 
84
# Copy Synplify tcl command files
85
if [catch {open "../synplify.tcl" r} f_synplify_tcl] {
86
    puts "ERROR: Cannot open Synplify command file file ../synplify.tcl"
87
    exit 1
88
}
89
 
90
set synplify_tcl [read $f_synplify_tcl]
91
close $f_synplify_tcl
92
 
93
regsub -all {<DEVICE_FAMILY>}  $synplify_tcl "[string toupper [lindex $fpgaConfig 0]]" synplify_tcl
94
regsub -all {<DEVICE_NAME>}    $synplify_tcl "[string toupper [lindex $fpgaConfig 1]]" synplify_tcl
95
regsub -all {<DEVICE_PACKAGE>} $synplify_tcl "[string toupper [lindex $fpgaConfig 2]]" synplify_tcl
96
regsub -all {<SPEED_GRADE>}    $synplify_tcl "[string toupper [lindex $fpgaConfig 4]]" synplify_tcl
97
regsub -all {<TOP_LEVEL>}      $synplify_tcl $designTop                                synplify_tcl
98
 
99
set f_synplify_tcl [open "synplify.tcl" w]
100
puts $f_synplify_tcl $synplify_tcl
101
close $f_synplify_tcl
102
 
103
###############################################################################
104
#                      GENERATE PLACE & ROUTE SCRIPT                          #
105
###############################################################################
106
 
107
cd ../work_designer
108
 
109
# Copy Libero Designer tcl command files
110
if [catch {open "../libero_designer.tcl" r} f_libero_designer_tcl] {
111
    puts "ERROR: Cannot open Libero Designer command file file ../libero_designer.tcl"
112
    exit 1
113
}
114
set libero_designer_tcl [read $f_libero_designer_tcl]
115
close $f_libero_designer_tcl
116
 
117
regsub -all {<DEVICE_FAMILY>}  $libero_designer_tcl "[lindex $fpgaConfig 0]" libero_designer_tcl
118
regsub -all {<DEVICE_NAME>}    $libero_designer_tcl "[lindex $fpgaConfig 1]" libero_designer_tcl
119
regsub -all {<DEVICE_PACKAGE>} $libero_designer_tcl "[lindex $fpgaConfig 3]" libero_designer_tcl
120
regsub -all {<SPEED_GRADE>}    $libero_designer_tcl "[lindex $fpgaConfig 4]" libero_designer_tcl
121
 
122
set f_libero_designer_tcl [open "libero_designer.tcl" w]
123
puts $f_libero_designer_tcl $libero_designer_tcl
124
close $f_libero_designer_tcl
125
 
126
 
127
exit 0

powered by: WebSVN 2.1.0

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