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

Subversion Repositories wbuart32

[/] [wbuart32/] [trunk/] [bench/] [verilog/] [Makefile] - Blame information for rev 19

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:     wbuart32, a full featured UART with simulator
6
##
7
## Purpose:     To direct the Verilator build of the Verilog portion of the
8
##              bench test.  The result is C++ code (built by Verilator), that
9
##      is then built (herein) into a library.
10
##
11 5 dgisselq
## ALTERNATE_PURPOSE:
12
##      All of the Verilog files within this directory may be made top level
13
##      files in their own right for the purpose of testing the UART capability
14
##      of your board.  Should you wish to test these as toplevel files, you
15
##      will need to remove the i_setup from the input, and set it to something
16
##      like:
17
##              wire    [29:0]  i_setup;
18 2 dgisselq
##
19 5 dgisselq
##              // If we have a 100MHz clock, then we can set up for a 115,200
20
##              // baud clock by setting i_setup to (100MHz / 115200) ~= 868.
21 18 dgisselq
##              // The upper bits of this number also set the protocol to
22 5 dgisselq
##              // one stop bit, no parity, and 8 data  bits.
23
##              assign  i_setup = 30'd868;      // 115,200 Baud 8N1
24
##
25
##      Using this purpose, the UART ports of a new piece of hardware may be
26
##      proven.  To do this,
27
##              1. get BLINKY working first--to prove that the clock works like
28
##                      you think it does.  Then, once BLINKY is running,
29
##              2. get helloworld working.  This requires only the clock and
30
##                      the output UART pin to work.
31
##              (Aside) 3. Once helloworld works, you should be able to get
32
##                      speechfifo to work with no further hassles.
33
##              4. After helloworld works, switch to getting linetest running on
34
##                      your hardware.  This will prove that you have not only
35
##                      the clock and output UART pin working, but that you also
36
##                      have the input UART pin working as well.
37
##
38
## Targets:     The default target of this makefile, all, builds the target
39
##              test, which includes the linetest Verilator library, the
40
##      helloworld Verilator library, and the speechfifo Verilator library--all
41
##      necessary for bench testing using the C++ files in bench/cpp.
42
##
43 2 dgisselq
## Creator:     Dan Gisselquist, Ph.D.
44
##              Gisselquist Technology, LLC
45
##
46
################################################################################
47
##
48
## Copyright (C) 2015-2016, Gisselquist Technology, LLC
49
##
50
## This program is free software (firmware): you can redistribute it and/or
51
## modify it under the terms of  the GNU General Public License as published
52
## by the Free Software Foundation, either version 3 of the License, or (at
53
## your option) any later version.
54
##
55
## This program is distributed in the hope that it will be useful, but WITHOUT
56
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
57
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
58
## for more details.
59
##
60
## You should have received a copy of the GNU General Public License along
61 18 dgisselq
## with this program.  (It's in the $(ROOT)/doc directory.  Run make with no
62 2 dgisselq
## target there if the PDF file isn't present.)  If not, see
63
##  for a copy.
64
##
65
## License:     GPL, v3, as defined and found on www.gnu.org,
66
##              http://www.gnu.org/licenses/gpl.html
67
##
68
################################################################################
69
##
70
##
71
all:    test
72
YYMMDD=`date +%Y%m%d`
73
CXX   := g++
74
FBDIR := .
75
VDIRFB:= $(FBDIR)/obj_dir
76
RTLDR := ../../rtl
77 18 dgisselq
VERILATOR := verilator
78
VFLAGS := -Wall --MMD --trace -y ../../rtl -cc
79 2 dgisselq
 
80 5 dgisselq
.PHONY: test testline testhello speechfifo
81
test: testline testhello speechfifo
82
testline:  $(VDIRFB)/Vlinetest__ALL.a
83
testhello: $(VDIRFB)/Vhelloworld__ALL.a
84
speechfifo: $(VDIRFB)/Vspeechfifo__ALL.a
85 2 dgisselq
 
86
$(VDIRFB)/Vlinetest__ALL.a: $(VDIRFB)/Vlinetest.h $(VDIRFB)/Vlinetest.cpp
87
$(VDIRFB)/Vlinetest__ALL.a: $(VDIRFB)/Vlinetest.mk
88
$(VDIRFB)/Vlinetest.h $(VDIRFB)/Vlinetest.cpp $(VDIRFB)/Vlinetest.mk: linetest.v
89
$(VDIRFB)/Vlinetest.h $(VDIRFB)/Vlinetest.cpp $(VDIRFB)/Vlinetest.mk: $(RTLDR)/rxuart.v $(RTLDR)/txuart.v
90 15 dgisselq
$(VDIRFB)/Vlinetest.h $(VDIRFB)/Vlinetest.cpp $(VDIRFB)/Vlinetest.mk: $(RTLDR)/rxuartlite.v $(RTLDR)/txuartlite.v
91 2 dgisselq
 
92 5 dgisselq
$(VDIRFB)/Vhelloworld__ALL.a: $(VDIRFB)/Vhelloworld.h $(VDIRFB)/Vhelloworld.cpp
93
$(VDIRFB)/Vhelloworld__ALL.a: $(VDIRFB)/Vhelloworld.mk
94
$(VDIRFB)/Vhelloworld.h $(VDIRFB)/Vhelloworld.cpp $(VDIRFB)/Vhelloworld.mk: helloworld.v
95 15 dgisselq
$(VDIRFB)/Vhelloworld.h $(VDIRFB)/Vhelloworld.cpp $(VDIRFB)/Vhelloworld.mk: $(RTLDR)/txuartlite.v $(RTLDR)/txuart.v
96 5 dgisselq
 
97 15 dgisselq
SPEECHSRCS := $(addprefix $(RTLDR)/,rxuart.v txuart.v rxuartlite.v txuartlite.v ufifo.v wbuart.v)
98 5 dgisselq
SPEECHVFILES:= $(addprefix $(VDIRFB)/,Vspeechfifo.h Vspeechfifo.cpp Vspeechfifo.mk)
99
$(VDIRFB)/Vspeechfifo__ALL.a: $(VDIRFB)/Vspeechfifo.h $(VDIRFB)/Vspeechfifo.cpp
100
$(VDIRFB)/Vspeechfifo__ALL.a: $(VDIRFB)/Vspeechfifo.mk
101
$(SPEECHVFILES): speechfifo.v $(SPEECHSRCS)
102
 
103 2 dgisselq
$(VDIRFB)/V%.cpp $(VDIRFB)/V%.h $(VDIRFB)/V%.mk: $(FBDIR)/%.v
104 18 dgisselq
        $(VERILATOR) $(VFLAGS) $*.v
105 2 dgisselq
 
106
$(VDIRFB)/V%__ALL.a: $(VDIRFB)/V%.mk
107
        cd $(VDIRFB); make -f V$*.mk
108
 
109
.PHONY: clean
110
clean:
111
        rm -rf $(VDIRFB)/*.mk
112
        rm -rf $(VDIRFB)/*.cpp
113
        rm -rf $(VDIRFB)/*.h
114
        rm -rf $(VDIRFB)/
115
 
116 18 dgisselq
DIRS := $(wildcard $(VDIRFB)/*.d)
117
ifneq ($(DIRS),)
118
-include $(DIRS)
119
endif

powered by: WebSVN 2.1.0

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