From 4b0a359675c6e35a5472b9ae9f3bdf898bf00eeb Mon Sep 17 00:00:00 2001 From: Simon Thornington Date: Mon, 5 Apr 2021 10:37:17 -0400 Subject: [PATCH] Fix yosys read command for SystemVerilog sources --- litex/build/lattice/icestorm.py | 5 ++++- litex/build/lattice/oxide.py | 3 +++ litex/build/lattice/trellis.py | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/litex/build/lattice/icestorm.py b/litex/build/lattice/icestorm.py index 1336acb20..55b46692e 100644 --- a/litex/build/lattice/icestorm.py +++ b/litex/build/lattice/icestorm.py @@ -56,6 +56,9 @@ def _yosys_import_sources(platform): for path in platform.verilog_include_paths: includes += " -I" + path for filename, language, library in platform.sources: + # yosys has no such function read_systemverilog + if language == "systemverilog": + language = "verilog -sv" reads.append("read_{}{} {}".format( language, includes, filename)) return "\n".join(reads) @@ -235,4 +238,4 @@ def icestorm_argdict(args): "timingstrict": args.nextpnr_timingstrict, "ignoreloops": args.nextpnr_ignoreloops, "seed": args.nextpnr_seed, - } \ No newline at end of file + } diff --git a/litex/build/lattice/oxide.py b/litex/build/lattice/oxide.py index 145eca7d2..3c9a8cfb5 100644 --- a/litex/build/lattice/oxide.py +++ b/litex/build/lattice/oxide.py @@ -37,6 +37,9 @@ def _yosys_import_sources(platform): for path in platform.verilog_include_paths: includes += " -I" + path for filename, language, library in platform.sources: + # yosys has no such function read_systemverilog + if language == "systemverilog": + language = "verilog -sv" reads.append("read_{}{} {}".format( language, includes, filename)) return "\n".join(reads) diff --git a/litex/build/lattice/trellis.py b/litex/build/lattice/trellis.py index a3e5f9265..a239d774b 100644 --- a/litex/build/lattice/trellis.py +++ b/litex/build/lattice/trellis.py @@ -67,6 +67,9 @@ def _yosys_import_sources(platform): for path in platform.verilog_include_paths: includes += " -I" + path for filename, language, library in platform.sources: + # yosys has no such function read_systemverilog + if language == "systemverilog": + language = "verilog -sv" reads.append("read_{}{} {}".format( language, includes, filename)) return "\n".join(reads)