Skip to content

Commit 2d34013

Browse files
authored
Merge pull request #184 from proppy/bump-iverilog
dependency_support/com_icarus_iverilog: bump version
2 parents c3f696c + 7a3e124 commit 2d34013

File tree

7 files changed

+233
-537
lines changed

7 files changed

+233
-537
lines changed

dependency_support/com_icarus_iverilog/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
licenses(["restricted"]) # GPLv2
1616

1717
exports_files([
18-
"dummy.sh",
1918
"hello.v",
2019
"hello_verilog_test.sh",
2120
"hello_vpi.c",

dependency_support/com_icarus_iverilog/build-plugins.bzl

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,23 @@
1515
"""BUILD helpers for using iverilog.
1616
"""
1717

18-
load("@rules_cc//cc:defs.bzl", "cc_binary")
19-
20-
def iverilog_compile(srcs, flags = "", name = ""):
21-
"""Compiles the first .v files given in srcs into a .vvp file.
22-
23-
Passes the flags to iverilog.
24-
"""
25-
vvp_file = srcs[0] + "vp" # Changes .v to .vvp
26-
native.genrule(
27-
name = "gen_" + vvp_file,
28-
srcs = srcs,
29-
outs = [vvp_file],
30-
cmd = (
31-
"$(location @com_icarus_iverilog//:iverilog) " +
32-
flags + " " +
33-
"-o $@ " +
34-
"$(location " + srcs[0] + ")"
35-
),
36-
tools = ["@com_icarus_iverilog//:iverilog"],
37-
)
38-
39-
# Creates a dummy test which will force the .vvp file production.
40-
native.sh_test(
41-
name = "dummy_iverilog_compile_test_" + name + "_" + vvp_file,
42-
srcs = ["@rules_hdl//dependency_support/com_icarus_iverilog:dummy.sh"],
43-
data = [vvp_file],
44-
)
45-
46-
def vpi_binary(name, srcs, **kwargs):
18+
def vpi_binary(name, out, srcs, **kwargs):
4719
"""Creates a .vpi file with the given name from the given sources.
4820
4921
All the extra arguments are passed directly to cc_binary.
5022
"""
51-
so_name = name + ".so"
52-
cc_binary(
53-
name = so_name,
23+
cc_target = name + "_shared"
24+
native.cc_binary(
25+
name = cc_target,
5426
srcs = srcs,
5527
linkshared = 1,
5628
**kwargs
5729
)
5830

5931
native.genrule(
60-
name = "gen_" + name,
61-
srcs = [so_name],
62-
outs = [name],
32+
name = name,
33+
srcs = [":" + cc_target],
34+
outs = [out],
6335
cmd = "cp $< $@",
6436
output_to_bindir = 1,
6537
executable = 1,

0 commit comments

Comments
 (0)