Skip to content

Commit 4067731

Browse files
committed
Moving template to python file, cleaner
1 parent 9399292 commit 4067731

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

tests/template.ys.j2

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/test_yosys.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
import common
22
import subprocess
3-
from jinja2 import Environment, FileSystemLoader
3+
from jinja2 import Template
44

55
def run_yosys(dlist):
66

7-
env = Environment(loader=FileSystemLoader('.'))
8-
template = env.get_template('template.ys.j2')
7+
yosys_template = """
8+
# Read the Verilog source file
9+
read_verilog_file_list -f {{ cmdfile }}
10+
11+
# Set the top module
12+
hierarchy -top {{ topmodule }}
13+
14+
# Generic synthesis
15+
proc; opt; flatten; opt
16+
17+
# Write synthesized netlist in Verilog
18+
write_verilog {{ netlist }}
19+
"""
20+
21+
template = Template(yosys_template)
922

1023
for item in dlist:
1124
name = item.name()

0 commit comments

Comments
 (0)