xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("iverilog")
  2. set_kind("toolchain")
  3. set_homepage("https://steveicarus.github.io/iverilog/")
  4. set_description("Icarus Verilog")
  5. if is_plat("windows") then
  6. add_urls("https://github.com/xmake-mirror/iverilog-windows/releases/download/$(version)/iverilog-$(version).zip")
  7. add_versions("2022.6.11", "6ce9411bf9468c43df70ae777e6727d47ae4f56413e772455fa93356597b6b7b")
  8. else
  9. add_urls("https://github.com/steveicarus/iverilog.git")
  10. add_versions("2023.1.7", "45bd0968c3d6d5b96a7ac7c2c1b0557cc229e568")
  11. add_deps("autoconf", "automake", "libtool", "flex", "bison", "gperf")
  12. end
  13. on_install("windows", function (package)
  14. os.cp("*", package:installdir())
  15. end)
  16. on_install("macosx", "linux", function (package)
  17. local configs = {}
  18. os.vrunv("sh", {"./autoconf.sh"})
  19. import("package.tools.autoconf").install(package, configs)
  20. end)
  21. on_test(function (package)
  22. io.writefile("hello.vl", [[
  23. module main();
  24. initial
  25. begin
  26. $display("Hi there");
  27. $finish ;
  28. end
  29. endmodule]])
  30. os.vrunv("iverilog", {"hello.vl"})
  31. end)