Skip to content

Commit 81b7ee4

Browse files
committed
Fixing regression test run failures due to yosys-slang plugin being loaded in when not enabled.
1 parent f7ae912 commit 81b7ee4

File tree

3 files changed

+39
-10
lines changed

3 files changed

+39
-10
lines changed

vtr_flow/misc/yosys/synthesis.tcl

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,32 @@ setattr -mod -set keep_hierarchy 1 single_port_ram
66
setattr -mod -set keep_hierarchy 1 dual_port_ram
77
setattr -mod -set keep 1 dual_port_ram
88

9-
plugin -i slang
10-
yosys -import
11-
129
# synlig path error handling
13-
if {[catch {set synlig $::env(synlig_exe_path)} err]} {
14-
puts "Error: $err"
15-
puts "synlig_exe_path is not set"
10+
#if {[catch {set synlig $::env(synlig_exe_path)} err]} {
11+
# puts "Error: $err"
12+
# puts "synlig_exe_path is not set"
13+
#} else {
14+
# set synlig $::env(synlig_exe_path)
15+
# puts "Using parmys as partial mapper"
16+
#}
17+
18+
# yosys-slang plugin error handling
19+
if {$env(PARSER) == "slang" } {
20+
if {![info exists ::env(yosys_slang_path)]} {
21+
puts "Error: $err"
22+
puts "yosys_slang_path is not set"
23+
} elseif {![file exists $::env(yosys_slang_path)]} {
24+
error "Error: cannot find plugin at '$::env(yosys_slang_path)'. Run make with CMake param -DSLANG_SYSTEMVERILOG=ON to enable yosys-slang plugin."
25+
} else {
26+
plugin -i slang
27+
yosys -import
28+
puts "Using yosys-slang as yosys frontend"
29+
}
30+
} elseif {$env(PARSER) == "default" } {
31+
yosys -import
32+
puts "Using Yosys read_verilog as yosys frontend"
1633
} else {
17-
set synlig $::env(synlig_exe_path)
18-
puts "Using parmys as partial mapper"
34+
error "Invalid PARSER"
1935
}
2036

2137

@@ -50,9 +66,16 @@ if {$env(PARSER) == "slang" } {
5066
lappend $sv_files $f
5167
puts $fh $f
5268
}
69+
.svh {
70+
lappend $sv_files $f
71+
puts $fh $f
72+
}
5373
.v {
5474
error "Use default parser to parse .v files."
5575
}
76+
.vh {
77+
error "Use default parser to parse .v files."
78+
}
5679
}
5780
}
5881
close $fh

vtr_flow/scripts/python_libs/vtr/parmys/parmys.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,15 @@ def run(
236236

237237
# Set the synlig exe script path in the environment variable
238238
# (handle if it is not set or system-verilog OFF)
239+
# try:
240+
# os.environ["synlig_exe_path"] = str(vtr.paths.synlig_exe_path)
241+
# except KeyError:
242+
# os.environ["synlig_exe_path"] = "/dummy/path"
243+
239244
try:
240-
os.environ["synlig_exe_path"] = str(vtr.paths.synlig_exe_path)
245+
os.environ["yosys_slang_path"] = str(vtr.paths.yosys_slang_path)
241246
except KeyError:
242-
os.environ["synlig_exe_path"] = "/dummy/path"
247+
os.environ["yosys_slang_path"] = "/dummy/path"
243248

244249
# set the parser
245250
if parmys_args["parser"] in YOSYS_PARSERS:

vtr_flow/scripts/python_libs/vtr/paths.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
yosys_exe_path = yosys_path / "yosys"
2222
yosys_tcl_path = vtr_flow_path / "misc" / "yosys"
2323
yosys_script_path = yosys_tcl_path / "synthesis.tcl"
24+
yosys_slang_path = root_path / "build" / "share" / "yosys" / "plugins" / "slang.so"
2425

2526
# Synlig paths
2627
synlig_path = root_path / "build" / "bin" / "synlig_install"

0 commit comments

Comments
 (0)