summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-12 21:00:52 +0800
committerruki <[email protected]>2023-01-13 20:50:56 +0800
commit48180268bf262c80f5b43af5f496236023259613 (patch)
tree1402e24e11be3bc3147beb60d9019225ba31a76e
parent6b830187bc5feb14a2390aa20e448137a71dd012 (diff)
support .vhd
-rw-r--r--xmake/rules/iverilog/xmake.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/rules/iverilog/xmake.lua b/xmake/rules/iverilog/xmake.lua
index 955c8f762..dfedb530e 100644
--- a/xmake/rules/iverilog/xmake.lua
+++ b/xmake/rules/iverilog/xmake.lua
@@ -39,7 +39,12 @@ rule("iverilog.binary")
local targetdir = path.directory(targetfile)
local argv = {"-o", targetfile}
local sourcebatch = target:sourcebatches()["iverilog.binary"]
- local sourcefiles = sourcebatch.sourcefiles
+ local sourcefiles = table.wrap(sourcebatch.sourcefiles)
+ assert(#sourcefiles > 0, "no source files!")
+ local extension = path.extension(sourcefiles[1])
+ if extension == ".vhd" then
+ table.insert(argv, "-g2012")
+ end
table.join2(argv, sourcefiles)
batchcmds:show_progress(opt.progress, "${color.build.target}linking.iverilog %s", path.filename(targetfile))
batchcmds:mkdir(targetdir)