Skip to content

Commit

Permalink
Yosys: add possibility to pass read options
Browse files Browse the repository at this point in the history
Signed-off-by: Karol Gugala <[email protected]>
  • Loading branch information
kgugala committed Dec 22, 2020
1 parent 54310df commit 26a9d20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions edalize/yosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def get_doc(cls, api_ver):
'desc' : 'Generated tcl script filename, defaults to $name.mk'},
],
'lists' : [
{'name' : 'yosys_read_options',
'type' : 'String',
'desc' : 'Addtional options for the read_* command (e.g. read_verlog or read_uhdm)'},
{'name' : 'yosys_synth_options',
'type' : 'String',
'desc' : 'Additional options for the synth command'},
Expand All @@ -46,6 +49,7 @@ def configure_main(self):
(src_files, incdirs) = self._get_fileset_files()
part_of_toolchain = self.tool_options.get('yosys_as_subtool', False)

yosys_read_options = " ".join(self.tool_options.get('yosys_read_options', []))
file_table = []
yosys_synth_options = self.tool_options.get('yosys_synth_options', [])
use_surelog = False
Expand All @@ -67,7 +71,7 @@ def configure_main(self):
surelog = getattr(import_module("edalize.surelog"), 'Surelog')(surelog_edam, self.work_root)
surelog.configure()
self.vlogparam.clear() # vlogparams are handled by Surelog
file_table.append('read_uhdm {' + os.path.abspath(self.work_root + '/' + self.toplevel + '.uhdm') + '}')
file_table.append('read_uhdm ' + yosys_read_options + ' {' + os.path.abspath(self.work_root + '/' + self.toplevel + '.uhdm') + '}')
else:
for f in src_files:
cmd = ""
Expand All @@ -80,7 +84,7 @@ def configure_main(self):
else:
continue

file_table.append(cmd + ' {' + f.name + '}')
file_table.append(cmd + ' ' + yosys_read_options + ' {' + f.name + '}')

verilog_defines = []
for key, value in self.vlogdefine.items():
Expand Down

0 comments on commit 26a9d20

Please sign in to comment.