forked from fusesoc/fusesoc-generators
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathicepll.py
More file actions
23 lines (20 loc) · 745 Bytes
/
icepll.py
File metadata and controls
23 lines (20 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python
from fusesoc.capi2.generator import Generator
import subprocess
class IcepllGenerator(Generator):
def run(self):
fin = self.config.get('freq_in', 12)
fout = self.config.get('freq_out', 60)
module = self.config.get('module', False)
filename = self.config.get('filename', 'pll.v' if module else 'pll.vh')
args = ['icepll', '-f', filename, '-i', str(fin), '-o', str(fout)]
if module:
args.append('-m')
rc = subprocess.call(args)
if rc:
exit(1)
self.add_files([{filename : {'file_type' : 'verilogSource',
'is_include_file' : not module}}])
g = IcepllGenerator()
g.run()
g.write()