forked from chipsalliance/VeeR-ISS
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBUILD.bazel
49 lines (44 loc) · 1.44 KB
/
BUILD.bazel
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
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension", "pybind_library")
hdrs = [
"HartConfig.hpp",
"WhisperMessage.h",
"Hart.hpp",
"Core.hpp",
"System.hpp",
"Server.hpp",
"Interactive.hpp",
"DecodedInst.hpp",
"Decoder.hpp",
"InstEntry.hpp",
"InstId.hpp",
"Isa.hpp",
]
cc_library(
name = "rvcore",
srcs = glob(include = ["*.cpp", "*.hpp"], exclude = ["whisper.cpp", "py-bindings.cpp"] + hdrs),
hdrs = hdrs,
local_defines = ["SOFT_FLOAT", "MEM_CALLBACKS", "LZ4_COMPRESS"],
deps = ["//third_party:nlohmann", "//third_party:elfio", "//third_party:softfloat", "//third_party:linenoise", "//pci:pci"],
linkopts = ["-lpthread", "-lz", "-ldl", "-lrt", "-llz4"],
visibility = ["//visibility:public"],
)
cc_binary(
name = "whisper",
srcs = ["whisper.cpp"],
deps = [":rvcore"],
local_defines = ["SOFT_FLOAT", "MEM_CALLBACKS", "LZ4_COMPRESS"],
linkopts = ["-lboost_program_options", "-rdynamic"],
visibility = ["//visibility:public"],
)
pybind_extension(
name = "pywhisper",
srcs = ["py-bindings.cpp"],
deps = [":rvcore"],
local_defines = ["SOFT_FLOAT", "MEM_CALLBACKS"],
visibility = ["//visibility:__pkg__"],
)
py_library(
name = "pywhisper_lib",
data = ["pywhisper.so"],
visibility = ["//visibility:public"],
)