mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 12:46:08 +01:00
fix: yowasp-yosys chokes on complex verilog modules
reproduces with https://github.com/Lucaz97/tt06_RNG2 as a workaround, we first try to read the first verilog source file, and only if we can't find the top level verilog module there, we read the rest of the files.
This commit is contained in:
+6
-1
@@ -144,8 +144,13 @@ class Project:
|
||||
source_list = " ".join(sources)
|
||||
|
||||
json_file = "ports.json"
|
||||
yosys_cmd = f"yowasp-yosys -qp 'read_verilog -lib -sv {source_list}; hierarchy -top {top} ; proc; write_json {json_file}'"
|
||||
|
||||
# Heuristic - try reading just the first source file, if that fails, try all of them
|
||||
yosys_cmd = f"yowasp-yosys -qp 'read_verilog -lib -sv {sources[0]}; hierarchy -top {top} ; proc; write_json {json_file}' 2> /dev/null"
|
||||
p = subprocess.run(yosys_cmd, shell=True)
|
||||
if p.returncode != 0:
|
||||
yosys_cmd = f"yowasp-yosys -qp 'read_verilog -lib -sv {source_list}; hierarchy -top {top} ; proc; write_json {json_file}'"
|
||||
p = subprocess.run(yosys_cmd, shell=True)
|
||||
if p.returncode != 0:
|
||||
logging.error(f"yosys port read failed for {self}")
|
||||
exit(1)
|
||||
|
||||
Reference in New Issue
Block a user