1 |
12 |
dgisselq |
################################################################################
|
2 |
|
|
##
|
3 |
13 |
dgisselq |
## Filename: bench/cpp/Makefile
|
4 |
12 |
dgisselq |
##
|
5 |
|
|
## Project: WBScope, a wishbone hosted scope
|
6 |
|
|
##
|
7 |
13 |
dgisselq |
## Purpose: This file directs the build of a Verilator-based test bench to
|
8 |
|
|
## prove that the wbscope and wbscopc work. This build must be
|
9 |
|
|
## called after building in bench/rtl, since it depends upon the products
|
10 |
|
|
## of that build.
|
11 |
12 |
dgisselq |
##
|
12 |
13 |
dgisselq |
## Targets:
|
13 |
|
|
##
|
14 |
|
|
## all: Builds both wbscope_tb and wbscopc_tb
|
15 |
|
|
##
|
16 |
|
|
## clean: Cleans up all of the build products, together with the .vcd
|
17 |
|
|
## files, so you can start over from scratch.
|
18 |
|
|
##
|
19 |
|
|
## wbscope_tb: A test bench for the basic wishbone scope.
|
20 |
|
|
## Prints success or failure on the last line.
|
21 |
|
|
##
|
22 |
|
|
## wbscopc_tb: A test bench for the compressed wishbone scope.
|
23 |
|
|
## Prints success or failure on the last line.
|
24 |
|
|
##
|
25 |
|
|
## test: Runs both testbenches, printing success if both succeed, or
|
26 |
|
|
## failure if one of the two does not.
|
27 |
|
|
##
|
28 |
12 |
dgisselq |
## Creator: Dan Gisselquist, Ph.D.
|
29 |
|
|
## Gisselquist Technology, LLC
|
30 |
|
|
##
|
31 |
|
|
################################################################################
|
32 |
|
|
##
|
33 |
|
|
## Copyright (C) 2015-2017, Gisselquist Technology, LLC
|
34 |
|
|
##
|
35 |
|
|
## This program is free software (firmware): you can redistribute it and/or
|
36 |
|
|
## modify it under the terms of the GNU General Public License as published
|
37 |
|
|
## by the Free Software Foundation, either version 3 of the License, or (at
|
38 |
|
|
## your option) any later version.
|
39 |
|
|
##
|
40 |
|
|
## This program is distributed in the hope that it will be useful, but WITHOUT
|
41 |
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
42 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
43 |
|
|
## for more details.
|
44 |
|
|
##
|
45 |
|
|
## You should have received a copy of the GNU General Public License along
|
46 |
|
|
## with this program. (It's in the $(ROOT)/doc directory. Run make with no
|
47 |
|
|
## target there if the PDF file isn't present.) If not, see
|
48 |
|
|
## for a copy.
|
49 |
|
|
##
|
50 |
|
|
## License: GPL, v3, as defined and found on www.gnu.org,
|
51 |
|
|
## http://www.gnu.org/licenses/gpl.html
|
52 |
|
|
##
|
53 |
|
|
################################################################################
|
54 |
|
|
##
|
55 |
|
|
##
|
56 |
13 |
dgisselq |
all: wbscope_tb wbscopc_tb
|
57 |
12 |
dgisselq |
CXX := g++
|
58 |
|
|
RTLD := ../rtl
|
59 |
|
|
ROBJD:= $(RTLD)/obj_dir
|
60 |
13 |
dgisselq |
VERILATOR_ROOT ?= $(shell bash -c 'verilator -V|grep VERILATOR_ROOT| head -1|sed -e " s/^.*=\s*//"')
|
61 |
|
|
VROOT:= $(VERILATOR_ROOT)
|
62 |
12 |
dgisselq |
INCS := -I$(VROOT)/include -I$(ROBJD)
|
63 |
|
|
VSRCS:= $(VROOT)/include/verilated.cpp $(VROOT)/include/verilated_vcd_c.cpp
|
64 |
|
|
TBOBJ:= $(ROBJD)/Vwbscope_tb__ALL.a
|
65 |
13 |
dgisselq |
TCOBJ:= $(ROBJD)/Vwbscopc_tb__ALL.a
|
66 |
12 |
dgisselq |
|
67 |
13 |
dgisselq |
wbscope_tb: wbscope_tb.cpp $(TBOBJ) $(ROBJD)/Vwbscope_tb.h wb_tb.h testb.h
|
68 |
12 |
dgisselq |
$(CXX) $(INCS) wbscope_tb.cpp $(VSRCS) $(TBOBJ) -o $@
|
69 |
13 |
dgisselq |
|
70 |
|
|
wbscopc_tb: wbscopc_tb.cpp $(TCOBJ) $(ROBJD)/Vwbscopc_tb.h wb_tb.h testb.h
|
71 |
|
|
$(CXX) $(INCS) wbscopc_tb.cpp $(VSRCS) $(TCOBJ) -o $@
|
72 |
|
|
|
73 |
|
|
test: wbscope_tb wbscopc_tb
|
74 |
|
|
./wbscope_tb
|
75 |
|
|
./wbscopc_tb
|
76 |
|
|
|
77 |
|
|
clean:
|
78 |
|
|
rm -f wbscope_tb wbscopc_tb
|
79 |
|
|
rm -f wbscope_tb.vcd wbscopc_tb.vcd
|