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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [rtl/] [Makefile] - Blame information for rev 209

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dgisselq
################################################################################
2 209 dgisselq
##
3
## Filename:    Makefile
4
##
5
## Project:     Zip CPU -- a small, lightweight, RISC CPU soft core
6
##
7
## Purpose:     This makefile builds a verilator simulation of the zipsystem.
8
##              It does not make the system within Vivado or Quartus.
9
##
10
##
11
## Creator:     Dan Gisselquist, Ph.D.
12
##              Gisselquist Technology, LLC
13
##
14 2 dgisselq
################################################################################
15 209 dgisselq
##
16
## Copyright (C) 2015-2017, Gisselquist Technology, LLC
17
##
18
## This program is free software (firmware): you can redistribute it and/or
19
## modify it under the terms of  the GNU General Public License as published
20
## by the Free Software Foundation, either version 3 of the License, or (at
21
## your option) any later version.
22
##
23
## This program is distributed in the hope that it will be useful, but WITHOUT
24
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
25
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26
## for more details.
27
##
28
## You should have received a copy of the GNU General Public License along
29
## with this program.  (It's in the $(ROOT)/doc directory.  Run make with no
30
## target there if the PDF file isn't present.)  If not, see
31
##  for a copy.
32
##
33
## License:     GPL, v3, as defined and found on www.gnu.org,
34
##              http://www.gnu.org/licenses/gpl.html
35
##
36
##
37 2 dgisselq
################################################################################
38 209 dgisselq
##
39
##
40 2 dgisselq
.PHONY: all
41 201 dgisselq
all: zipsystem zipbones cpudefs.h div zipmmu cpuops pfcache
42 2 dgisselq
 
43
CORED:= core
44
PRPHD:= peripherals
45 209 dgisselq
EXD  := ex
46 56 dgisselq
VSRC := zipsystem.v cpudefs.v                                   \
47 36 dgisselq
                $(PRPHD)/wbdmac.v $(PRPHD)/icontrol.v           \
48 2 dgisselq
                $(PRPHD)/zipcounter.v $(PRPHD)/zipjiffies.v     \
49 193 dgisselq
                $(PRPHD)/ziptimer.v                             \
50 69 dgisselq
        $(CORED)/zipcpu.v $(CORED)/cpuops.v $(CORED)/idecode.v  \
51 2 dgisselq
                $(CORED)/pipefetch.v $(CORED)/prefetch.v        \
52 69 dgisselq
                $(CORED)/pfcache.v                              \
53 38 dgisselq
                $(CORED)/memops.v $(CORED)/pipemem.v            \
54 157 dgisselq
                $(CORED)/div.v                                  \
55 209 dgisselq
        $(EXD)/busdelay.v                                       \
56
                $(EXD)/wbdblpriarb.v $(EXD)/wbpriarbiter.v      \
57 69 dgisselq
        $(CORED)/idecode.v $(CORED)/cpuops.v
58 56 dgisselq
VZIP := zipbones.v cpudefs.v                                    \
59 69 dgisselq
        $(CORED)/zipcpu.v $(CORED)/cpuops.v $(CORED)/idecode.v  \
60 38 dgisselq
                $(CORED)/pipefetch.v $(CORED)/prefetch.v        \
61 69 dgisselq
                $(CORED)/pfcache.v                              \
62 38 dgisselq
                $(CORED)/memops.v $(CORED)/pipemem.v            \
63 157 dgisselq
                $(CORED)/div.v                                  \
64 209 dgisselq
        $(EXD)/busdelay.v $(EXD)/wbdblpriarb.v          \
65 69 dgisselq
        $(CORED)/idecode.v $(CORED)/cpuops.v
66 2 dgisselq
VOBJ := obj_dir
67 201 dgisselq
SUBMAKE := $(MAKE) --no-print-directory --directory=$(VOBJ) -f
68 209 dgisselq
ifeq ($(VERILATOR_ROOT),)
69
VERILATOR := verilator
70
else
71
VERILATOR := $(VERILATOR_ROOT)/bin/verilator
72
endif
73
# VFLAGS := -Wall -MMD -D__WORDSIZE=64 --trace -cc -y $(CORED) -y $(PRPHD) -y $(EXD)
74
VFLAGS := -Wall -MMD --trace -cc -y $(CORED) -y $(PRPHD) -y $(EXD)
75 2 dgisselq
 
76 201 dgisselq
 
77 209 dgisselq
VERILATE=$(VERILATOR) $(VFLAGS)
78 201 dgisselq
 
79 2 dgisselq
$(VOBJ)/Vzipsystem.cpp: $(VSRC)
80 201 dgisselq
        $(VERILATE) zipsystem.v
81 56 dgisselq
$(VOBJ)/Vzipsystem.h: $(VOBJ)/Vzipsystem.cpp
82 2 dgisselq
 
83 38 dgisselq
$(VOBJ)/Vzipbones.cpp: $(VZIP)
84 201 dgisselq
        $(VERILATE) zipbones.v
85 56 dgisselq
$(VOBJ)/Vzipbones.h: $(VOBJ)/Vzipbones.cpp
86 38 dgisselq
 
87 69 dgisselq
$(VOBJ)/Vdiv.cpp: $(CORED)/div.v
88 201 dgisselq
        $(VERILATE) $(CORED)/div.v
89 69 dgisselq
$(VOBJ)/Vdiv.h: $(VOBJ)/Vdiv.cpp
90
 
91 193 dgisselq
$(VOBJ)/Vcpuops.cpp: $(CORED)/cpuops.v cpudefs.v
92 201 dgisselq
        $(VERILATE) $(CORED)/cpuops.v
93 193 dgisselq
$(VOBJ)/Vcpuops.h: $(VOBJ)/Vcpuops.cpp
94
 
95
$(VOBJ)/Vzipmmu.cpp: $(PRPHD)/zipmmu.v
96 201 dgisselq
        $(VERILATE) $(PRPHD)/zipmmu.v
97 193 dgisselq
$(VOBJ)/Vzipmmu.h: $(VOBJ)/Vzipmmu.cpp
98
 
99 201 dgisselq
$(VOBJ)/Vpfcache.cpp: $(CORED)/pfcache.v
100
        $(VERILATE) $(CORED)/pfcache.v
101
$(VOBJ)/Vpfcache.h: $(VOBJ)/Vpfcache.cpp
102
 
103 2 dgisselq
$(VOBJ)/Vzipsystem__ALL.a: $(VOBJ)/Vzipsystem.cpp $(VOBJ)/Vzipsystem.h
104 201 dgisselq
        $(SUBMAKE) Vzipsystem.mk
105 2 dgisselq
 
106 38 dgisselq
$(VOBJ)/Vzipbones__ALL.a: $(VOBJ)/Vzipbones.cpp $(VOBJ)/Vzipbones.h
107 201 dgisselq
        $(SUBMAKE) Vzipbones.mk
108 38 dgisselq
 
109 69 dgisselq
$(VOBJ)/Vdiv__ALL.a: $(VOBJ)/Vdiv.cpp $(VOBJ)/Vdiv.h
110 201 dgisselq
        $(SUBMAKE) Vdiv.mk
111 69 dgisselq
 
112 193 dgisselq
$(VOBJ)/Vcpuops__ALL.a: $(VOBJ)/Vcpuops.cpp $(VOBJ)/Vcpuops.h
113 201 dgisselq
        $(SUBMAKE) Vcpuops.mk
114 193 dgisselq
 
115
$(VOBJ)/Vzipmmu__ALL.a: $(VOBJ)/Vzipmmu.cpp $(VOBJ)/Vzipmmu.h
116 201 dgisselq
        $(SUBMAKE) Vzipmmu.mk
117 193 dgisselq
 
118 201 dgisselq
$(VOBJ)/Vpfcache__ALL.a: $(VOBJ)/Vpfcache.cpp $(VOBJ)/Vpfcache.h
119
        $(SUBMAKE) Vpfcache.mk
120
 
121 193 dgisselq
# $(VOBJ)/V%__ALL.a: $(VOBJ)/V%.cpp $(VOBJ)/V%.h
122 201 dgisselq
#       $(SUBMAKE) V%.mk
123 193 dgisselq
 
124 56 dgisselq
cpudefs.h: cpudefs.v
125 69 dgisselq
        @echo "Building cpudefs.h"
126
        @echo "// " > $@
127
        @echo "// Do not edit this file, it is automatically generated!" >> $@
128 105 dgisselq
        @echo "// To generate this file, \"make cpudefs.h\" in the rtl directory." >> $@
129 69 dgisselq
        @echo "// " >> $@
130
        @grep "^\`" $^ | sed -e '{ s/^`/#/ }' >> $@
131 38 dgisselq
 
132 2 dgisselq
.PHONY: zipsystem
133 193 dgisselq
zipsystem: $(VOBJ)/Vzipsystem__ALL.a cpudefs.h
134 2 dgisselq
 
135 38 dgisselq
.PHONY: zipbones
136 193 dgisselq
zipbones: $(VOBJ)/Vzipbones__ALL.a cpudefs.h
137 38 dgisselq
 
138 69 dgisselq
.PHONY: div
139
div: $(VOBJ)/Vdiv__ALL.a
140
 
141 193 dgisselq
.PHONY: cpuops
142
cpuops: $(VOBJ)/Vcpuops__ALL.a cpudefs.h
143
 
144
.PHONY: zipmmu
145
zipmmu: $(VOBJ)/Vzipmmu__ALL.a
146
 
147 201 dgisselq
.PHONY: pfcache
148
pfcache: $(VOBJ)/Vpfcache__ALL.a
149
 
150 2 dgisselq
.PHONY: clean
151
clean:
152 38 dgisselq
        rm -rf $(VOBJ) cpudefs.h
153 209 dgisselq
 
154
#
155
# Note Verilator's dependency created information, and include it here if we
156
# can
157
DEPS := $(wildcard $(VOBJ)/*.d)
158
 
159
ifneq ($(DEPS),)
160
include $(DEPS)
161
endif

powered by: WebSVN 2.1.0

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