Line 56... |
Line 56... |
# rest of the CPU. This test will fail with a failed assert()
|
# rest of the CPU. This test will fail with a failed assert()
|
# if unsuccessful, or complete with no error (but lots of
|
# if unsuccessful, or complete with no error (but lots of
|
# debugging output) if successful. To actually run this test,
|
# debugging output) if successful. To actually run this test,
|
# you'll need to run ./div_tb (no arguments necessary).
|
# you'll need to run ./div_tb (no arguments necessary).
|
#
|
#
|
|
# mpy_tb
|
|
# A raw test bench to test the multiply instructions within the
|
|
# cpuops (ALU) unit separate from the rest of the CPU. For more
|
|
# details, look at the usage statement wtihin mpy_tb.
|
|
#
|
|
# zipmmu_tb
|
|
# Like div_tb, this is another raw component test bench. In this
|
|
# case, zipmmu_tb tests whether or not the MMU works when
|
|
# separated from the rest of the CPU.
|
|
#
|
# pdump
|
# pdump
|
# zippy_tb can be configured to produce a profile output that is
|
# zippy_tb can be configured to produce a profile output that is
|
# very useful when debugging the Dhrystone benchmark. (It is
|
# very useful when debugging the Dhrystone benchmark. (It is
|
# so configured by default.) This file will be name pfile.bin.
|
# so configured by default.) This file will be name pfile.bin.
|
# pdump is a very simple program designed to read this file and
|
# pdump is a very simple program designed to read this file and
|
Line 95... |
Line 105... |
# http://www.gnu.org/licenses/gpl.html
|
# http://www.gnu.org/licenses/gpl.html
|
#
|
#
|
#
|
#
|
################################################################################
|
################################################################################
|
#
|
#
|
all: zippy_tb pdump div_tb
|
all: zippy_tb pdump div_tb mpy_tb
|
|
|
CXX := g++
|
CXX := g++
|
FLAGS := -Wall -Og -g
|
FLAGS := -Wall -Og -g
|
ZASM := ../../sw/zasm
|
ZASM := ../../sw/zasm
|
RTLD := ../../rtl
|
RTLD := ../../rtl
|
INCS := -I$(RTLD)/obj_dir/ -I$(RTLD) -I/usr/share/verilator/include -I$(ZASM)
|
VERILATOR_ROOT ?= $(shell bash -c 'verilator -V|grep VERILATOR_ROOT | head -1 | sed -e " s/^.*=\s*//"')
|
|
VROOT := $(VERILATOR_ROOT)
|
|
INCS := -I$(RTLD)/obj_dir/ -I$(RTLD) -I$(VROOT)/include -I$(ZASM)
|
SOURCES := zippy_tb.cpp memsim.cpp twoc.cpp $(ZASM)/zopcodes.cpp $(ZASM)/zparser.cpp
|
SOURCES := zippy_tb.cpp memsim.cpp twoc.cpp $(ZASM)/zopcodes.cpp $(ZASM)/zparser.cpp
|
VLIB := /usr/share/verilator/include/verilated.cpp
|
VLIB := $(VROOT)/include/verilated.cpp
|
RAWLIB := $(VLIB) $(RTLD)/obj_dir/Vzipsystem__ALL.a
|
RAWLIB := $(VLIB) $(RTLD)/obj_dir/Vzipsystem__ALL.a
|
LIBS := $(RAWLIB) -lncurses -lelf
|
LIBS := $(RAWLIB) -lncurses -lelf
|
TESTF := $(ZASM)/z.out
|
TESTF := $(ZASM)/z.out
|
DHRYSTONEF := ../asm/zipdhry.z
|
DHRYSTONEF := ../asm/zipdhry.z
|
|
|
Line 116... |
Line 128... |
$(CXX) $(FLAGS) $(INCS) $(SOURCES) $(LIBS) -o $@
|
$(CXX) $(FLAGS) $(INCS) $(SOURCES) $(LIBS) -o $@
|
|
|
div_tb: div_tb.cpp twoc.cpp $(VLIB) $(RTLD)/obj_dir/Vdiv__ALL.a testb.h
|
div_tb: div_tb.cpp twoc.cpp $(VLIB) $(RTLD)/obj_dir/Vdiv__ALL.a testb.h
|
$(CXX) $(FLAGS) $(INCS) div_tb.cpp twoc.cpp $(VLIB) $(RTLD)/obj_dir/Vdiv__ALL.a -o $@
|
$(CXX) $(FLAGS) $(INCS) div_tb.cpp twoc.cpp $(VLIB) $(RTLD)/obj_dir/Vdiv__ALL.a -o $@
|
|
|
|
mpy_tb: mpy_tb.cpp twoc.cpp $(VLIB) $(RTLD)/obj_dir/Vcpuops__ALL.a testb.h
|
|
$(CXX) $(FLAGS) $(INCS) mpy_tb.cpp twoc.cpp $(VLIB) $(RTLD)/obj_dir/Vcpuops__ALL.a -o $@
|
|
|
|
zipmmu_tb: zipmmu_tb.cpp $(VLIB) ../rtl/obj_dir/Vzipmmu_tb__ALL.a
|
|
$(CXX) $(FLAGS) $(INCS) -I ../rtl/obj_dir zipmmu_tb.cpp $(VLIB) ../rtl/obj_dir/Vzipmmu_tb__ALL.a -o $@
|
|
|
pdump: pdump.cpp $(ZASM)/zopcodes.cpp $(ZASM)/zparser.cpp
|
pdump: pdump.cpp $(ZASM)/zopcodes.cpp $(ZASM)/zparser.cpp
|
pdump: $(ZASM)/zopcodes.h $(ZASM)/zparser.h testb.h twoc.cpp
|
pdump: $(ZASM)/zopcodes.h $(ZASM)/zparser.h testb.h twoc.cpp
|
$(CXX) $(FLAGS) $(INCS) pdump.cpp $(ZASM)/zopcodes.cpp $(ZASM)/zparser.cpp twoc.cpp -lelf -o $@
|
$(CXX) $(FLAGS) $(INCS) pdump.cpp $(ZASM)/zopcodes.cpp $(ZASM)/zparser.cpp twoc.cpp -lelf -o $@
|
|
|
.PHONY: stest
|
.PHONY: stest
|
Line 138... |
Line 156... |
dhrystone: zippy_tb
|
dhrystone: zippy_tb
|
./zippy_tb -a $(DHRYSTONEF)
|
./zippy_tb -a $(DHRYSTONEF)
|
|
|
.PHONY: clean
|
.PHONY: clean
|
clean:
|
clean:
|
rm ./zippy_tb pdump div_tb
|
rm ./zippy_tb pdump div_tb mpy_tb
|
rm ./zippy_tb pdump div_tb mpy_tb
|
rm ./zippy_tb pdump div_tb mpy_tb
|