File tree Expand file tree Collapse file tree 4 files changed +40
-10
lines changed Expand file tree Collapse file tree 4 files changed +40
-10
lines changed Original file line number Diff line number Diff line change
1
+ # Parameters:
2
+ #
3
+ # circuit_list - list of circuits passed into the flow
4
+ # file_list - text file being written to that will contain
5
+ # the names of circuits from circuit list.
6
+ #
7
+ # Function:
8
+ #
9
+ # Validates file extensions of input files and writes the names
10
+ # of input files to the file list to be read by yosys-slang.
11
+
12
+ proc build_filelist { circuit_list file_list } {
13
+ set fh [open $file_list " w" ]
14
+ foreach f $circuit_list {
15
+ set ext [string tolower [file extension $f ]]
16
+ if {$ext == " .sv" || $ext == " .svh" || $ext == " .v" || $ext == " .vh" } {
17
+ puts $fh $f
18
+ } else {
19
+ close $fh
20
+ error " Unsupported file type. Yosys-Slang accepts .sv .svh .v .vh. File {$f }"
21
+ }
22
+ }
23
+ close $fh
24
+ }
Original file line number Diff line number Diff line change @@ -36,17 +36,10 @@ parmys_arch -a QQQ
36
36
if {$env(PARSER) == " slang" } {
37
37
# Create a file list containing the name(s) of file(s) \
38
38
# to read together with read_slang
39
+ source [file join [pwd ] " slang_filelist.tcl" ]
39
40
set readfile [file join [pwd ] " filelist.txt" ]
40
- set fh [open $readfile " w" ]
41
- foreach f {XXX} {
42
- set ext [string tolower [file extension $f ]]
43
- if {$ext == " .sv" || $ext == " .svh" || $ext == " .v" || $ext == " .vh" } {
44
- puts $fh $f
45
- } else {
46
- error " Unsupported file type. Yosys-Slang accepts .sv .svh .v .vh"
47
- }
48
- }
49
- close $fh
41
+ # Writing names of circuit files to file list
42
+ build_filelist {XXX} $readfile
50
43
puts " Using Yosys read_slang command"
51
44
read_slang -C $readfile
52
45
} elseif {$env(PARSER) == " default" } {
Original file line number Diff line number Diff line change @@ -191,8 +191,14 @@ def run(
191
191
if yosys_exec is None :
192
192
yosys_exec = str (vtr .paths .yosys_exe_path )
193
193
194
+ yosys_helper_base_script = None
194
195
if yosys_script is None :
195
196
yosys_base_script = str (vtr .paths .yosys_script_path )
197
+ try :
198
+ yosys_slang_exec = str (vtr .paths .yosys_slang_path )
199
+ yosys_helper_base_script = str (vtr .paths .yosys_helper_script_path )
200
+ except KeyError :
201
+ yosys_helper_base_script = None
196
202
else :
197
203
yosys_base_script = str (Path (yosys_script ).resolve ())
198
204
@@ -201,6 +207,12 @@ def run(
201
207
yosys_script_full_path = str (temp_dir / yosys_script )
202
208
shutil .copyfile (yosys_base_script , yosys_script_full_path )
203
209
210
+ if yosys_helper_base_script is not None :
211
+ # Copy the yosys-slang helper script file
212
+ yosys_helper_script = "slang_filelist.tcl"
213
+ yosys_helper_script_full_path = str (temp_dir / yosys_helper_script )
214
+ shutil .copyfile (yosys_helper_base_script , yosys_helper_script_full_path )
215
+
204
216
# Copy the VTR memory blocks file
205
217
206
218
architecture_file_path = str (vtr .paths .scripts_path / architecture_file )
Original file line number Diff line number Diff line change 21
21
yosys_exe_path = yosys_path / "yosys"
22
22
yosys_tcl_path = vtr_flow_path / "misc" / "yosys"
23
23
yosys_script_path = yosys_tcl_path / "synthesis.tcl"
24
+ yosys_helper_script_path = yosys_tcl_path / "slang_filelist.tcl"
24
25
yosys_slang_path = root_path / "build" / "share" / "yosys" / "plugins" / "slang.so"
25
26
26
27
# Synlig paths
You can’t perform that action at this time.
0 commit comments