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

Subversion Repositories mcu8

[/] [mcu8/] [trunk/] [Makefile] - Blame information for rev 24

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 12 dimo
TOP=processor_E#change to the name of the TOP-Entity
8 21 dimo
DEVICE=3s50tq144-4
9
#DEVICE=xc3s4000-fg676-4#change to the device id found on the chip
10
#VHDLSYNFILES=src/cpu_types.vhd src/components.vhd src/processor_E.vhd src/processor.model.vhd src/ram.vhd src/rom.vhd #reference model for simulation
11
#VHDLSYNFILES=src/cpu_types.vhd src/components.vhd src/processor_E.vhd src/processor_E_backan.vhd src/ram.vhd src/rom.vhd#backannotated simulation after synthesis with Precision
12
#VHDLSYNFILES=src/cpu_types.vhd src/components.vhd src/processor_E.vhd src/processor_E_backannotated.vhd src/ram.vhd src/rom.vhd#backannotated simulation after synthesis with XST
13
VHDLSYNFILES=src/cpu_types.vhd src/alu.vhd src/control.vhd src/pc.vhd src/ram_control.vhd src/reg.vhd src/components.vhd src/processor_E.vhd src/ram.vhd src/rom.vhd #synthesis and pre-synthesis simulation
14 2 dimo
 
15
OPTMODE=Speed
16
OPTLEVEL=1
17
EFFORT=high
18
UCF=src/$(TOP).ucf
19
SCRIPTFILE=$(TOP).scr
20
PROJECTFILE=$(TOP).prj
21
LOGFILE=$(TOP).log
22
TOPSIM=$(TOP)_tb
23
DOFILE=src/$(TOP).do
24
BITGEN=src/$(TOP).ut
25
ALLFILES=$(VHDLSYNFILES) src/$(TOPSIM).vhd
26
SHELL=/bin/bash
27
 
28
all: help
29
 
30
help:
31
        @echo
32
        @echo " make help                       : prints this help menu "
33
        @echo " make use-vsim                   : simulate with Modelsim in batch mode, use >>do it<< to reload"
34
        @echo " make use-vsim-gui               : simulate with Modelsim and GUI"
35
        @echo " make use-xst                    : synthesize with xst "
36
        @echo " make implement                  : final step"
37
        @echo " make ml                 : prints loaded modules. Use source bin/load_modules if modules are not loaded "
38
        @echo " make files                      : prints info about the used files "
39
        @echo " make vsim-help                  : prints appropriate steps for simulation"
40
        @echo " make warnings-xst               : prints warnings and info from the XST log file"
41
        @echo " make warnings-implement         : prints warnings and info from the PAR log file"
42
        @echo " make clear                      : clears all XST output files"
43
        @echo
44
 
45
use-xst: $(VHDLSYNFILES)
46
        @rm -f $(SCRIPTFILE)
47
        @rm -f $(LOGFILE)
48
        @rm -f $(PROJECTFILE)
49
        @for i in $(VHDLSYNFILES); do bin/xstvhdl $$i >> $(PROJECTFILE); done
50
        @echo run -ifn $(PROJECTFILE) -ifmt vhdl -ofn $(TOP).ngc -ofmt NGC -p $(DEVICE) -opt_mode $(OPTMODE) -opt_level $(OPTLEVEL) -top $(TOP) -rtlview yes > $(SCRIPTFILE)
51
        @xst -ifn $(SCRIPTFILE) -ofn $(LOGFILE)
52
 
53
implement: $(TOP).ngc
54
        @mv -f src/*.ucf $(UCF)TMP
55
        @mv -f $(UCF)TMP $(UCF)
56
        @mv -f src/*.ut $(BITGEN)TMP
57
        @mv -f $(BITGEN)TMP $(BITGEN)
58
        bin/route_ngc $(TOP) $(UCF) $(DEVICE) $(EFFORT) $(BITGEN)
59
 
60
ml:
61
        @/home/4all/packages/modules-2.0/sun5/bin/modulecmd tcsh list
62
 
63
use-vsim: it $(ALLFILES)
64
        @rm -f it
65
        @for i in $(ALLFILES); do bin/vscript $$i >> it0; done
66
        @echo restart > it1
67
        @echo run -all > it2
68
        @cat it0 it1 it2 > it
69
        @rm -f it0 it1 it2
70
        @vmap -del work
71
        @rm -rf modelsim/
72
        @mkdir modelsim
73
        @vlib modelsim/work
74
        @vmap work modelsim/work
75
        @vcom -93 -check_synthesis -work work $(VHDLSYNFILES)
76
        @vcom -93 -work work src/$(TOPSIM).vhd
77
        @mv -f src/*.do $(DOFILE)TMP
78
        @mv -f $(DOFILE)TMP $(DOFILE)
79
        vsim -c work.$(TOPSIM) -do $(DOFILE)
80
 
81
use-vsim-gui: $(ALLFILES)
82
        @rm -f it
83
        @for i in $(ALLFILES); do bin/vscript $$i >> it0; done
84
        @echo restart > it1
85
        @echo run 1000 ns > it2
86
        @cat it0 it1 it2 > it
87
        @rm -f it0 it1 it2
88
        @vmap -del work
89
        @rm -rf modelsim/
90
        @mkdir modelsim
91
        @vlib modelsim/work
92
        @vmap work modelsim/work
93
        @vcom -93 -check_synthesis -work work $(VHDLSYNFILES)
94
        @vcom -93 -work work src/$(TOPSIM).vhd
95
        @mv -f src/*.do $(DOFILE)TMP
96
        @mv -f $(DOFILE)TMP $(DOFILE)
97
        vsim -gui work.$(TOPSIM) -do it &
98 21 dimo
#       vsim -sdftyp /processor_e_tb/u_cpu=src/processor_E_backan.sdf -gui work.$(TOPSIM) -do it &
99 2 dimo
 
100 21 dimo
use-vsim-cov: $(ALLFILES)
101
        vmap -del work
102
        rm -rf modelsim
103
        mkdir modelsim
104
        vlib modelsim/work
105
        vmap work modelsim/work
106
        vcom -cover bcst -f coverage.file
107
        vsim -coverage -gui work.$(TOPSIM)
108
# load the rtl_a architecture in the tb file
109
 
110 2 dimo
clear:
111
        @rm -f $(TOP).ngr $(TOP).msd $(TOP).msk $(TOP).rbt $(TOP).twr $(TOP).xpi $(TOP)_pad.csv $(TOP)_pad.txt $(TOP).bld
112
        @rm -f $(TOP).ngc $(TOP).ncd $(TOP).ngd $(TOP).rba $(TOP).rbd $(TOP).rbb netlist.lst $(TOP).mrp $(TOP).ll $(TOP).bit
113
        @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
114
        @rm -f $(SCRIPTFILE)
115
        @rm -f $(LOGFILE)
116
        @rm -f $(PROJECTFILE)
117
 
118
files:
119
        @echo
120
        @echo $(TOP)".ngc       : netlist output from XST"
121
        @echo $(TOP)".ngr       : netlist output from XST for RTL and Technology viewers"
122
        @echo $(TOP)".scr       : script file for XST, generated by Makefile"
123
        @echo $(TOP)".prj       : contains the vhdl source files, generated by Makefile."
124
        @echo $(TOP)".log       : log file, output from XST"
125
        @echo $(TOP)".ucf       : user constraints file with pins description, write yourself"
126
        @echo $(TOP)".ut        : config. script for BITGEN, write yourself"
127
        @echo "it               : do-script for Modelsim in batchmode, write yourself"
128
        @echo $(TOP)".do        : do-script for Modelsim in GUI-mode, write yourself"
129
        @echo $(TOP)".par       : PAR report file, generated by make implement"
130
        @echo
131
 
132
vsim-help:
133
        @echo
134
        @echo " mkdir modelsim                                          : create main directoriy for simulation"
135
        @echo " vlib modelsim/work                                      : create work library for simulation"
136
        @echo " vmap                                                    : prints all logical mapped librarys"
137
        @echo " vmap -del work                                          : delete actual mapping for work library"
138
        @echo " vmap work modelsim/work                         : map logical library work to modelsim/work"
139
        @echo " vcom -93 -check_synthesis  -work work   : compile source vhdl files"
140
        @echo " vcom -93 -work work                     : compile top level testbench"
141
        @echo " do it           : use in batch mode to recompile the testbench and the top entity and to restart the simulation"
142
        @echo
143
 
144
warnings-xst:
145
        @grep -n -i warning *.log
146
        @grep -n -i info *.log
147 21 dimo
 
148 2 dimo
warnings-implement:
149
        @grep -n -i warning *.par *.twr
150
        @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.