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

Subversion Repositories tlc2

[/] [tlc2/] [trunk/] [Makefile] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimo
##############################################################################################
2
#  In order to create a new project, change the first three macros in this file, the content #
3
#               of the UCF file and the name and content of the VHD files in src             #
4
#       Don't forget to execute "source bin/load_modules" manual from the shell              #
5
##############################################################################################
6
 
7
TOP=tlc2#change to the name of the TOP-Entity
8
DEVICE=xc3s4000-fg676-4#change to the device id found on the chip
9
VHDLSYNFILES=src/$(TOP).vhd#list all vhdl files in the project that have to be synthesized
10
 
11
OPTMODE=Speed
12
OPTLEVEL=1
13
EFFORT=high
14
UCF=src/$(TOP).ucf
15
SCRIPTFILE=$(TOP).scr
16
PROJECTFILE=$(TOP).prj
17
LOGFILE=$(TOP).log
18
TOPSIM=$(TOP)_tb
19
DOFILE=src/$(TOP).do
20
BITGEN=src/$(TOP).ut
21
ALLFILES=$(VHDLSYNFILES) src/$(TOPSIM).vhd
22
SHELL=/bin/bash
23
 
24
all: help
25
 
26
help:
27
        @echo
28
        @echo " make help                       : prints this help menu "
29
        @echo " make use-vsim                   : simulate with Modelsim in batch mode, use >>do it<< to reload"
30
        @echo " make use-vsim-gui               : simulate with Modelsim and GUI"
31
        @echo " make use-xst                    : synthesize with xst "
32
        @echo " make implement                  : final step"
33
        @echo " make ml                 : prints loaded modules. Use source bin/load_modules if modules are not loaded "
34
        @echo " make files                      : prints info about the used files "
35
        @echo " make vsim-help                  : prints appropriate steps for simulation"
36
        @echo " make warnings-xst               : prints warnings and info from the XST log file"
37
        @echo " make warnings-implement         : prints warnings and info from the PAR log file"
38
        @echo " make clear                      : clears all XST output files"
39
        @echo
40
 
41
use-xst: $(VHDLSYNFILES)
42
        @rm -f $(SCRIPTFILE)
43
        @rm -f $(LOGFILE)
44
        @rm -f $(PROJECTFILE)
45
        @for i in $(VHDLSYNFILES); do bin/xstvhdl $$i >> $(PROJECTFILE); done
46
        @echo run -ifn $(PROJECTFILE) -ifmt vhdl -ofn $(TOP).ngc -ofmt NGC -p $(DEVICE) -opt_mode $(OPTMODE) -opt_level $(OPTLEVEL) -top $(TOP) -rtlview yes > $(SCRIPTFILE)
47
        @xst -ifn $(SCRIPTFILE) -ofn $(LOGFILE)
48
 
49
implement: $(TOP).ngc
50
        @mv -f src/*.ucf $(UCF)TMP
51
        @mv -f $(UCF)TMP $(UCF)
52
        @mv -f src/*.ut $(BITGEN)TMP
53
        @mv -f $(BITGEN)TMP $(BITGEN)
54
        bin/route_ngc $(TOP) $(UCF) $(DEVICE) $(EFFORT) $(BITGEN)
55
 
56
ml:
57
        @/home/4all/packages/modules-2.0/sun5/bin/modulecmd tcsh list
58
 
59
use-vsim: it $(ALLFILES)
60
        @rm -f it
61
        @for i in $(ALLFILES); do bin/vscript $$i >> it0; done
62
        @echo restart > it1
63
        @echo run -all > it2
64
        @cat it0 it1 it2 > it
65
        @rm -f it0 it1 it2
66
        @vmap -del work
67
        @rm -rf modelsim/
68
        @mkdir modelsim
69
        @vlib modelsim/work
70
        @vmap work modelsim/work
71
        @vcom -93 -check_synthesis -work work $(VHDLSYNFILES)
72
        @vcom -93 -work work src/$(TOPSIM).vhd
73
        @mv -f src/*.do $(DOFILE)TMP
74
        @mv -f $(DOFILE)TMP $(DOFILE)
75
        vsim -c work.$(TOPSIM) -do $(DOFILE)
76
 
77
use-vsim-gui: $(ALLFILES)
78
        @rm -f it
79
        @for i in $(ALLFILES); do bin/vscript $$i >> it0; done
80
        @echo restart > it1
81
        @echo run 1000 ns > it2
82
        @cat it0 it1 it2 > it
83
        @rm -f it0 it1 it2
84
        @vmap -del work
85
        @rm -rf modelsim/
86
        @mkdir modelsim
87
        @vlib modelsim/work
88
        @vmap work modelsim/work
89
        @vcom -93 -check_synthesis -work work $(VHDLSYNFILES)
90
        @vcom -93 -work work src/$(TOPSIM).vhd
91
        @mv -f src/*.do $(DOFILE)TMP
92
        @mv -f $(DOFILE)TMP $(DOFILE)
93
#       vsim -gui work.$(TOPSIM) -do $(DOFILE) &
94
        vsim -gui work.$(TOPSIM) -do it &
95
 
96
clear:
97
        @rm -f $(TOP).ngr $(TOP).msd $(TOP).msk $(TOP).rbt $(TOP).twr $(TOP).xpi $(TOP)_pad.csv $(TOP)_pad.txt $(TOP).bld
98
        @rm -f $(TOP).ngc $(TOP).ncd $(TOP).ngd $(TOP).rba $(TOP).rbd $(TOP).rbb netlist.lst $(TOP).mrp $(TOP).ll $(TOP).bit
99
        @rm -f $(TOP).lso $(TOP).ngm $(TOP).ngr $(TOP).pad $(TOP).par $(TOP).pcf transcript vsim.wlf $(TOP).log $(TOP).bgn *.twr *.xml *.map *.unroutes
100
        @rm -f $(SCRIPTFILE)
101
        @rm -f $(LOGFILE)
102
        @rm -f $(PROJECTFILE)
103
 
104
files:
105
        @echo
106
        @echo $(TOP)".ngc       : netlist output from XST"
107
        @echo $(TOP)".ngr       : netlist output from XST for RTL and Technology viewers"
108
        @echo $(TOP)".scr       : script file for XST, generated by Makefile"
109
        @echo $(TOP)".prj       : contains the vhdl source files, generated by Makefile."
110
        @echo $(TOP)".log       : log file, output from XST"
111
        @echo $(TOP)".ucf       : user constraints file with pins description, write yourself"
112
        @echo $(TOP)".ut        : config. script for BITGEN, write yourself"
113
        @echo "it               : do-script for Modelsim in batchmode, write yourself"
114
        @echo $(TOP)".do        : do-script for Modelsim in GUI-mode, write yourself"
115
        @echo $(TOP)".par       : PAR report file, generated by make implement"
116
        @echo
117
 
118
vsim-help:
119
        @echo
120
        @echo " mkdir modelsim                                          : create main directoriy for simulation"
121
        @echo " vlib modelsim/work                                      : create work library for simulation"
122
        @echo " vmap                                                    : prints all logical mapped librarys"
123
        @echo " vmap -del work                                          : delete actual mapping for work library"
124
        @echo " vmap work modelsim/work                         : map logical library work to modelsim/work"
125
        @echo " vcom -93 -check_synthesis  -work work   : compile source vhdl files"
126
        @echo " vcom -93 -work work                     : compile top level testbench"
127
        @echo " do it           : use in batch mode to recompile the testbench and the top entity and to restart the simulation"
128
        @echo
129
 
130
warnings-xst:
131
        @grep -n -i warning *.log
132
        @grep -n -i info *.log
133
 
134
warnings-implement:
135
        @grep -n -i warning *.par *.twr
136
        @grep -n -i info *.par *.twr

powered by: WebSVN 2.1.0

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