2023-02-16 01:46:22 +00:00
# This file is part of the 9086 project.
#
# Copyright (c) 2023 Efthymios Kritikos
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
2023-03-04 08:37:43 +00:00
TOP_LEVEL_SOURCE = system.v
SOURCES = processor.v memory.v registers.v alu.v decoder.v general.v
EVENT_SIM_TESTBENCH = testbench.v
VERILATOR_TESTBENCH = testbench.cpp
INCLUDES = proc_state_def.v alu_header.v config.v ucode_header.v
2023-02-16 01:46:22 +00:00
SYSTEM_VVP = system.vvp
2023-03-04 08:37:43 +00:00
VERILATOR_BIN = obj_dir/Vsystem
2023-02-16 01:46:22 +00:00
BOOT_CODE = boot_code.txt
GTKWSAVE = ../gtkwave_savefile.gtkw
2023-02-22 01:28:23 +00:00
MICROCODE = ucode.txt
2023-02-16 01:46:22 +00:00
2023-02-22 01:51:14 +00:00
NO_ASM = 0
2023-02-16 01:46:22 +00:00
i n c l u d e . . / c o m m o n . m k
# COMPILING
2023-03-04 08:37:43 +00:00
${SYSTEM_VVP} : ${TOP_LEVEL_SOURCE } ${SOURCES } ${INCLUDES } ${EVENT_SIM_TESTBENCH }
2023-02-16 01:46:22 +00:00
${ QUIET_IVERILOG }
2023-03-04 08:37:43 +00:00
${ Q } iverilog -g2012 -o " $@ " ${ TOP_LEVEL_SOURCE } ${ SOURCES } ${ EVENT_SIM_TESTBENCH }
2023-02-16 01:46:22 +00:00
2023-03-04 08:37:43 +00:00
${VERILATOR_BIN} : ${VERILATOR_TESTBENCH } ${TOP_LEVEL_SOURCE } ${SOURCES } ${INCLUDES }
${ QUIET_VERILATOR }
2023-03-05 00:10:55 +00:00
${ Q } verilator --trace-fst --cc --exe --build -j 0 $^ -Wall --Wno-DECLFILENAME -Wno-SYNCASYNCNET -Wno-MULTIDRIVEN 2>& 1 --threads 1 --autoflush >/dev/null #TODO: remove the silencing and make the generated Makefiles print quietly as well
2023-02-16 01:46:22 +00:00
.PHONY : clean
clean :
$( call QUIET_CLEAN,system)
2023-03-05 00:10:55 +00:00
${ Q } rm -rf ${ SYSTEM_VVP } *.fst boot_code.txt boot_code.bin *memdump *memdumptxt obj_dir