1 |
12 |
alfik |
help:
|
2 |
|
|
@echo -e "Select operation to perform. Type 'make' followed by the name of the operation."
|
3 |
|
|
@echo
|
4 |
|
|
@echo -e "Available operations:"
|
5 |
|
|
@echo -e "doxygen - run the doxygen tool on the ao68000 project."
|
6 |
|
|
@echo -e " Doxverilog version required."
|
7 |
13 |
alfik |
@echo -e "microcode - generate ao68000 microcode from Java sources."
|
8 |
12 |
alfik |
@echo -e "spec_extract - generate the specification.odt file from the Doxygen HTML docs."
|
9 |
|
|
@echo -e "soc_for_linux - synthesise soc_for_linux SoC with ao68000 processor for"
|
10 |
|
|
@echo -e " the Terasic DE2-70 board."
|
11 |
|
|
@echo -e "test_bcd - test BCD opcode algorithms."
|
12 |
|
|
@echo -e "compare_with_winuae - compare ao68000 processor with WinUAE MC68000 emulator (www.winuae.net)."
|
13 |
|
|
@echo -e "clean - clean all."
|
14 |
|
|
@echo
|
15 |
|
|
@exit 0
|
16 |
|
|
|
17 |
|
|
doxygen: ./doc/doxygen/doxygen.cfg
|
18 |
|
|
ifndef DOXVERILOG
|
19 |
|
|
@echo "DOXVERILOG environment variable not set. Set it to a Doxverilog executable."
|
20 |
|
|
@exit 1
|
21 |
|
|
endif
|
22 |
|
|
$(DOXVERILOG) ./doc/doxygen/doxygen.cfg
|
23 |
|
|
|
24 |
|
|
ao68000_tool:
|
25 |
|
|
javac -d ./tmp ./sw/ao68000_tool/*.java
|
26 |
|
|
|
27 |
|
|
microcode: ao68000_tool
|
28 |
|
|
java -cp ./tmp ao68000_tool.Main parser ./rtl/ao68000.v ./sw/ao68000_tool/Parser.java
|
29 |
|
|
javac -d ./tmp ./sw/ao68000_tool/*.java
|
30 |
|
|
java -cp ./tmp ao68000_tool.Main microcode ./rtl/ao68000.v ./rtl/ao68000_microcode.mif
|
31 |
|
|
|
32 |
|
|
test_bcd:
|
33 |
|
|
gcc -o ./tmp/test_bcd ./tests/nbcd_abcd_sbcd/nbcd_abcd_sbcd.c
|
34 |
|
|
./tmp/test_bcd
|
35 |
|
|
|
36 |
|
|
soc_for_linux:
|
37 |
|
|
mkdir -p ./tmp/soc_for_linux_on_terasic_de2_70
|
38 |
|
|
cp ./rtl/* ./tmp/soc_for_linux_on_terasic_de2_70
|
39 |
|
|
cp ./tests/soc_for_linux_on_terasic_de2_70/verilog/* ./tmp/soc_for_linux_on_terasic_de2_70
|
40 |
|
|
cp ./tests/soc_for_linux_on_terasic_de2_70/quartus_project/* ./tmp/soc_for_linux_on_terasic_de2_70
|
41 |
|
|
cd ./tmp/soc_for_linux_on_terasic_de2_70 && quartus_sh --flow compile soc_for_linux
|
42 |
|
|
|
43 |
|
|
spec_extract: ao68000_tool
|
44 |
|
|
mkdir -p ./tmp/spec_extract
|
45 |
|
|
java -cp ./tmp ao68000_tool.Main spec_extract ./doc/doxygen/html/page_spec_references.html ./tmp/spec_extract/references.html
|
46 |
|
|
java -cp ./tmp ao68000_tool.Main spec_extract ./doc/doxygen/html/page_spec_ports.html ./tmp/spec_extract/ports.html
|
47 |
|
|
java -cp ./tmp ao68000_tool.Main spec_extract ./doc/doxygen/html/page_spec_clocks.html ./tmp/spec_extract/clocks.html
|
48 |
|
|
java -cp ./tmp ao68000_tool.Main spec_extract ./doc/doxygen/html/page_spec_registers.html ./tmp/spec_extract/registers.html
|
49 |
|
|
java -cp ./tmp ao68000_tool.Main spec_extract ./doc/doxygen/html/page_spec_operation.html ./tmp/spec_extract/operation.html
|
50 |
|
|
java -cp ./tmp ao68000_tool.Main spec_extract ./doc/doxygen/html/page_spec_architecture.html ./tmp/spec_extract/architecture.html
|
51 |
|
|
java -cp ./tmp ao68000_tool.Main spec_extract ./doc/doxygen/html/page_spec_introduction.html ./tmp/spec_extract/introduction.html
|
52 |
|
|
java -cp ./tmp ao68000_tool.Main spec_extract ./doc/doxygen/html/page_spec_revisions.html ./tmp/spec_extract/revisions.html
|
53 |
|
|
soffice "macro:///Standard.Module1.Main(file://$(CURDIR)/doc/src/specification_template.odt,file://$(CURDIR)/tmp/spec_extract/specification.odt,,file://$(CURDIR)/tmp/spec_extract/references.html,True)"
|
54 |
|
|
soffice "macro:///Standard.Module1.Main(file://$(CURDIR)/tmp/spec_extract/specification.odt,file://$(CURDIR)/tmp/spec_extract/specification.odt,,file://$(CURDIR)/tmp/spec_extract/ports.html,True)"
|
55 |
|
|
soffice "macro:///Standard.Module1.Main(file://$(CURDIR)/tmp/spec_extract/specification.odt,file://$(CURDIR)/tmp/spec_extract/specification.odt,,file://$(CURDIR)/tmp/spec_extract/clocks.html,True)"
|
56 |
|
|
soffice "macro:///Standard.Module1.Main(file://$(CURDIR)/tmp/spec_extract/specification.odt,file://$(CURDIR)/tmp/spec_extract/specification.odt,,file://$(CURDIR)/tmp/spec_extract/registers.html,True)"
|
57 |
|
|
soffice "macro:///Standard.Module1.Main(file://$(CURDIR)/tmp/spec_extract/specification.odt,file://$(CURDIR)/tmp/spec_extract/specification.odt,,file://$(CURDIR)/tmp/spec_extract/operation.html,True)"
|
58 |
|
|
soffice "macro:///Standard.Module1.Main(file://$(CURDIR)/tmp/spec_extract/specification.odt,file://$(CURDIR)/tmp/spec_extract/specification.odt,,file://$(CURDIR)/tmp/spec_extract/architecture.html,True)"
|
59 |
|
|
soffice "macro:///Standard.Module1.Main(file://$(CURDIR)/tmp/spec_extract/specification.odt,file://$(CURDIR)/tmp/spec_extract/specification.odt,,file://$(CURDIR)/tmp/spec_extract/introduction.html,True)"
|
60 |
|
|
soffice "macro:///Standard.Module1.Main(file://$(CURDIR)/tmp/spec_extract/specification.odt,file://$(CURDIR)/tmp/spec_extract/specification.odt,,file://$(CURDIR)/tmp/spec_extract/revisions.html,False)"
|
61 |
|
|
|
62 |
|
|
winuae:
|
63 |
|
|
mkdir -p ./tmp/compare_with_winuae/winuae
|
64 |
|
|
cd ./tmp/compare_with_winuae/winuae && gcc -DCPUEMU_68000_ONLY -DCPUEMU_11 -I./../../../tests/compare_with_winuae/winuae -o build68k ./../../../tests/compare_with_winuae/winuae/build68k.c
|
65 |
|
|
cd ./tmp/compare_with_winuae/winuae && ./build68k < ./../../../tests/compare_with_winuae/winuae/table68k > table68k.c
|
66 |
|
|
cd ./tmp/compare_with_winuae/winuae && gcc -DCPUEMU_68000_ONLY -DCPUEMU_11 -I./../../../tests/compare_with_winuae/winuae -c ./../../../tests/compare_with_winuae/winuae/gencpu.c
|
67 |
|
|
cd ./tmp/compare_with_winuae/winuae && gcc -DCPUEMU_68000_ONLY -DCPUEMU_11 -I./../../../tests/compare_with_winuae/winuae -c ./../../../tests/compare_with_winuae/winuae/readcpu.c
|
68 |
|
|
cd ./tmp/compare_with_winuae/winuae && gcc -DCPUEMU_68000_ONLY -DCPUEMU_11 -I./../../../tests/compare_with_winuae/winuae -c table68k.c
|
69 |
|
|
cd ./tmp/compare_with_winuae/winuae && gcc -DCPUEMU_68000_ONLY -DCPUEMU_11 -I./../../../tests/compare_with_winuae/winuae -o gencpu gencpu.o readcpu.o table68k.o
|
70 |
|
|
cd ./tmp/compare_with_winuae/winuae && ./gencpu
|
71 |
|
|
cd ./tmp/compare_with_winuae/winuae && gcc -DCPUEMU_68000_ONLY -DCPUEMU_11 -I./../../../tests/compare_with_winuae/winuae -c ./../../../tests/compare_with_winuae/winuae/ao.c
|
72 |
|
|
cd ./tmp/compare_with_winuae/winuae && gcc -DCPUEMU_68000_ONLY -DCPUEMU_11 -I./../../../tests/compare_with_winuae/winuae -c cpustbl.c
|
73 |
|
|
cd ./tmp/compare_with_winuae/winuae && gcc -DCPUEMU_68000_ONLY -DCPUEMU_11 -I./../../../tests/compare_with_winuae/winuae -c cpuemu_11.c
|
74 |
|
|
cd ./tmp/compare_with_winuae/winuae && gcc -o ao ao.o cpustbl.o cpuemu_11.o table68k.o readcpu.o
|
75 |
|
|
|
76 |
|
|
tb_ao68000:
|
77 |
|
|
ifndef QUARTUS_ROOTDIR
|
78 |
|
|
@echo "Environment variable QUARTUS_ROOTDIR not set. Please set it to point to Altera Quartus II rootdir."
|
79 |
|
|
@exit 1
|
80 |
|
|
endif
|
81 |
|
|
mkdir -p ./tmp/compare_with_winuae/verilog
|
82 |
|
|
cd ./tmp/compare_with_winuae/verilog && ln -s -f $(QUARTUS_ROOTDIR)/eda/sim_lib/altera_mf.v altsyncram.v
|
83 |
|
|
cd ./tmp/compare_with_winuae/verilog && ln -s -f $(QUARTUS_ROOTDIR)/eda/sim_lib/220model.v lpm_mult.v
|
84 |
|
|
cd ./tmp/compare_with_winuae/verilog && ln -s -f $(QUARTUS_ROOTDIR)/eda/sim_lib/220model.v lpm_divide.v
|
85 |
|
|
cd ./tmp/compare_with_winuae/verilog && iverilog -y. -y./../../../rtl -y./../../../tests/compare_with_winuae/verilog -o tb_ao68000 ./../../../tests/compare_with_winuae/verilog/tb_ao68000.v
|
86 |
|
|
cp ./rtl/ao68000_microcode.mif ./tmp/compare_with_winuae/verilog
|
87 |
|
|
|
88 |
13 |
alfik |
START_IR_DEC := 32960
|
89 |
|
|
END_IR_DEC := 36864
|
90 |
12 |
alfik |
TERM_PROGRAM := xterm
|
91 |
13 |
alfik |
COUNT := 4
|
92 |
12 |
alfik |
COUNT_LIST := $(wordlist 1,$(COUNT),0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)
|
93 |
|
|
STEP := `expr \( $(END_IR_DEC) - $(START_IR_DEC) \) / $(COUNT)`
|
94 |
|
|
|
95 |
|
|
compare_with_winuae: ao68000_tool winuae tb_ao68000
|
96 |
|
|
$(foreach i,$(COUNT_LIST), mkdir -p ./tmp/compare_with_winuae/run_$(i); )
|
97 |
|
|
$(foreach i,$(COUNT_LIST), cp ./rtl/ao68000_microcode.mif ./tmp/compare_with_winuae/run_$(i); )
|
98 |
|
|
$(foreach i,$(COUNT_LIST), echo -e "#!/bin/bash\n./../verilog/tb_ao68000 \$$@" \
|
99 |
|
|
> ./tmp/compare_with_winuae/run_$(i)/run.sh; \
|
100 |
|
|
)
|
101 |
|
|
$(foreach i,$(COUNT_LIST), chmod +x ./tmp/compare_with_winuae/run_$(i)/run.sh; )
|
102 |
|
|
$(foreach i,$(COUNT_LIST), $(TERM_PROGRAM) -e java -cp ./tmp ao68000_tool.Main test \
|
103 |
|
|
./tmp/compare_with_winuae/winuae/ao \
|
104 |
|
|
./tmp/compare_with_winuae/run_$(i)/run.sh \
|
105 |
13 |
alfik |
`expr $(START_IR_DEC) + $(i) \* \( \( $(END_IR_DEC) - $(START_IR_DEC) \) / $(COUNT) \)` \
|
106 |
|
|
`expr $(START_IR_DEC) + \( $(i) + 1 \) \* \( \( $(END_IR_DEC) - $(START_IR_DEC) \) / $(COUNT) \)` \
|
107 |
12 |
alfik |
& \
|
108 |
|
|
)
|
109 |
|
|
|
110 |
|
|
clean:
|
111 |
|
|
rm -R -f ./tmp/*
|