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

Subversion Repositories zipcpu

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

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

Line No. Rev Author Line
1 2 dgisselq
################################################################################
2
#
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 69 dgisselq
#               Gisselquist Technology, LLC
13 2 dgisselq
#
14
################################################################################
15
#
16 201 dgisselq
# Copyright (C) 2015-2017, Gisselquist Technology, LLC
17 2 dgisselq
#
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
# License:      GPL, v3, as defined and found on www.gnu.org,
29
#               http://www.gnu.org/licenses/gpl.html
30
#
31
#
32
################################################################################
33
#
34
.PHONY: all
35 201 dgisselq
all: zipsystem zipbones cpudefs.h div zipmmu cpuops pfcache
36 2 dgisselq
 
37
CORED:= core
38
PRPHD:= peripherals
39
AUXD := aux
40 56 dgisselq
VSRC := zipsystem.v cpudefs.v                                   \
41 36 dgisselq
                $(PRPHD)/wbdmac.v $(PRPHD)/icontrol.v           \
42 2 dgisselq
                $(PRPHD)/zipcounter.v $(PRPHD)/zipjiffies.v     \
43 193 dgisselq
                $(PRPHD)/ziptimer.v                             \
44 69 dgisselq
        $(CORED)/zipcpu.v $(CORED)/cpuops.v $(CORED)/idecode.v  \
45 2 dgisselq
                $(CORED)/pipefetch.v $(CORED)/prefetch.v        \
46 69 dgisselq
                $(CORED)/pfcache.v                              \
47 38 dgisselq
                $(CORED)/memops.v $(CORED)/pipemem.v            \
48 157 dgisselq
                $(CORED)/div.v                                  \
49 38 dgisselq
        $(AUXD)/busdelay.v                                      \
50 69 dgisselq
                $(AUXD)/wbdblpriarb.v $(AUXD)/wbpriarbiter.v    \
51
        $(CORED)/idecode.v $(CORED)/cpuops.v
52 56 dgisselq
VZIP := zipbones.v cpudefs.v                                    \
53 69 dgisselq
        $(CORED)/zipcpu.v $(CORED)/cpuops.v $(CORED)/idecode.v  \
54 38 dgisselq
                $(CORED)/pipefetch.v $(CORED)/prefetch.v        \
55 69 dgisselq
                $(CORED)/pfcache.v                              \
56 38 dgisselq
                $(CORED)/memops.v $(CORED)/pipemem.v            \
57 157 dgisselq
                $(CORED)/div.v                                  \
58 69 dgisselq
        $(AUXD)/busdelay.v $(AUXD)/wbdblpriarb.v                \
59
        $(CORED)/idecode.v $(CORED)/cpuops.v
60 2 dgisselq
VOBJ := obj_dir
61 201 dgisselq
SUBMAKE := $(MAKE) --no-print-directory --directory=$(VOBJ) -f
62 2 dgisselq
 
63 201 dgisselq
 
64
VERILATE=verilator --trace -cc -y $(CORED) -y $(PRPHD) -y $(AUXD)
65
 
66 2 dgisselq
$(VOBJ)/Vzipsystem.cpp: $(VSRC)
67 201 dgisselq
        $(VERILATE) zipsystem.v
68 56 dgisselq
$(VOBJ)/Vzipsystem.h: $(VOBJ)/Vzipsystem.cpp
69 2 dgisselq
 
70 38 dgisselq
$(VOBJ)/Vzipbones.cpp: $(VZIP)
71 201 dgisselq
        $(VERILATE) zipbones.v
72 56 dgisselq
$(VOBJ)/Vzipbones.h: $(VOBJ)/Vzipbones.cpp
73 38 dgisselq
 
74 69 dgisselq
$(VOBJ)/Vdiv.cpp: $(CORED)/div.v
75 201 dgisselq
        $(VERILATE) $(CORED)/div.v
76 69 dgisselq
$(VOBJ)/Vdiv.h: $(VOBJ)/Vdiv.cpp
77
 
78 193 dgisselq
$(VOBJ)/Vcpuops.cpp: $(CORED)/cpuops.v cpudefs.v
79 201 dgisselq
        $(VERILATE) $(CORED)/cpuops.v
80 193 dgisselq
$(VOBJ)/Vcpuops.h: $(VOBJ)/Vcpuops.cpp
81
 
82
$(VOBJ)/Vzipmmu.cpp: $(PRPHD)/zipmmu.v
83 201 dgisselq
        $(VERILATE) $(PRPHD)/zipmmu.v
84 193 dgisselq
$(VOBJ)/Vzipmmu.h: $(VOBJ)/Vzipmmu.cpp
85
 
86 201 dgisselq
$(VOBJ)/Vpfcache.cpp: $(CORED)/pfcache.v
87
        $(VERILATE) $(CORED)/pfcache.v
88
$(VOBJ)/Vpfcache.h: $(VOBJ)/Vpfcache.cpp
89
 
90 2 dgisselq
$(VOBJ)/Vzipsystem__ALL.a: $(VOBJ)/Vzipsystem.cpp $(VOBJ)/Vzipsystem.h
91 201 dgisselq
        $(SUBMAKE) Vzipsystem.mk
92 2 dgisselq
 
93 38 dgisselq
$(VOBJ)/Vzipbones__ALL.a: $(VOBJ)/Vzipbones.cpp $(VOBJ)/Vzipbones.h
94 201 dgisselq
        $(SUBMAKE) Vzipbones.mk
95 38 dgisselq
 
96 69 dgisselq
$(VOBJ)/Vdiv__ALL.a: $(VOBJ)/Vdiv.cpp $(VOBJ)/Vdiv.h
97 201 dgisselq
        $(SUBMAKE) Vdiv.mk
98 69 dgisselq
 
99 193 dgisselq
$(VOBJ)/Vcpuops__ALL.a: $(VOBJ)/Vcpuops.cpp $(VOBJ)/Vcpuops.h
100 201 dgisselq
        $(SUBMAKE) Vcpuops.mk
101 193 dgisselq
 
102
$(VOBJ)/Vzipmmu__ALL.a: $(VOBJ)/Vzipmmu.cpp $(VOBJ)/Vzipmmu.h
103 201 dgisselq
        $(SUBMAKE) Vzipmmu.mk
104 193 dgisselq
 
105 201 dgisselq
$(VOBJ)/Vpfcache__ALL.a: $(VOBJ)/Vpfcache.cpp $(VOBJ)/Vpfcache.h
106
        $(SUBMAKE) Vpfcache.mk
107
 
108 193 dgisselq
# $(VOBJ)/V%__ALL.a: $(VOBJ)/V%.cpp $(VOBJ)/V%.h
109 201 dgisselq
#       $(SUBMAKE) V%.mk
110 193 dgisselq
 
111 56 dgisselq
cpudefs.h: cpudefs.v
112 69 dgisselq
        @echo "Building cpudefs.h"
113
        @echo "// " > $@
114
        @echo "// Do not edit this file, it is automatically generated!" >> $@
115 105 dgisselq
        @echo "// To generate this file, \"make cpudefs.h\" in the rtl directory." >> $@
116 69 dgisselq
        @echo "// " >> $@
117
        @grep "^\`" $^ | sed -e '{ s/^`/#/ }' >> $@
118 38 dgisselq
 
119 2 dgisselq
.PHONY: zipsystem
120 193 dgisselq
zipsystem: $(VOBJ)/Vzipsystem__ALL.a cpudefs.h
121 2 dgisselq
 
122 38 dgisselq
.PHONY: zipbones
123 193 dgisselq
zipbones: $(VOBJ)/Vzipbones__ALL.a cpudefs.h
124 38 dgisselq
 
125 69 dgisselq
.PHONY: div
126
div: $(VOBJ)/Vdiv__ALL.a
127
 
128 193 dgisselq
.PHONY: cpuops
129
cpuops: $(VOBJ)/Vcpuops__ALL.a cpudefs.h
130
 
131
.PHONY: zipmmu
132
zipmmu: $(VOBJ)/Vzipmmu__ALL.a
133
 
134 201 dgisselq
.PHONY: pfcache
135
pfcache: $(VOBJ)/Vpfcache__ALL.a
136
 
137 2 dgisselq
.PHONY: clean
138
clean:
139 38 dgisselq
        rm -rf $(VOBJ) cpudefs.h

powered by: WebSVN 2.1.0

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