forked from SonalPinto/kronos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
76 lines (59 loc) · 1.91 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright (c) 2020 Sonal Pinto
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.10)
project(kronos)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(UTILS "${CMAKE_CURRENT_LIST_DIR}/utils")
# Setup output dirs
set(BIN_OUTPUT_DIR "${CMAKE_BINARY_DIR}/output/bin")
set(LIB_OUTPUT_DIR "${CMAKE_BINARY_DIR}/output/lib")
set(TESTDATA_OUTPUT_DIR "${CMAKE_BINARY_DIR}/output/data")
set(LINT_OUTPUT_DIR "${CMAKE_BINARY_DIR}/output/lint")
set(VERILATOR_OUTPUT_DIR "${CMAKE_BINARY_DIR}/output/verilator")
set(UNITTEST_OUTPUT_DIR "${CMAKE_BINARY_DIR}/output/tests")
file(MAKE_DIRECTORY ${BIN_OUTPUT_DIR})
file(MAKE_DIRECTORY ${LIB_OUTPUT_DIR})
file(MAKE_DIRECTORY ${TESTDATA_OUTPUT_DIR})
file(MAKE_DIRECTORY ${LINT_OUTPUT_DIR})
file(MAKE_DIRECTORY ${VERILATOR_OUTPUT_DIR})
file(MAKE_DIRECTORY ${UNITTEST_OUTPUT_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR})
# =============================================================
if (${CMAKE_BUILD_TYPE} MATCHES "Dev")
#
# Development Environment
#
set(LATTICE_LIBRARY $ENV{LATTICE_LIBRARY})
enable_testing()
find_package(RISCV REQUIRED)
find_package(Verilator REQUIRED)
find_package(Python3 REQUIRED)
find_package(VUnit REQUIRED)
include(macros)
include(AddHDL)
include(AddRISCV)
include(AddVUnit)
add_subdirectory(rtl)
add_subdirectory(src)
add_subdirectory(impl)
add_subdirectory(riscv-compliance)
add_subdirectory(riscv-tests)
add_subdirectory(tests)
else()
#
# Release/Compliance Testing Environment
#
find_package(RISCV REQUIRED)
find_package(Python3 REQUIRED)
find_package(Verilator)
include(macros)
include(AddHDL)
include(AddRISCV)
add_subdirectory(rtl)
add_subdirectory(src)
add_subdirectory(impl)
add_subdirectory(riscv-compliance)
add_subdirectory(riscv-tests)
endif()