Skip to content

Commit

Permalink
Merge pull request #64 from zeroasiccorp/flow-reuse
Browse files Browse the repository at this point in the history
reuse fpga-flow
  • Loading branch information
gadfort authored Apr 2, 2024
2 parents bc2755c + 6ff7e17 commit d1a7d37
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 38 deletions.
Binary file removed images/fpga_flow.png
Binary file not shown.
Binary file added images/logik_flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 9 additions & 37 deletions logik/flows/logik_flow.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# Copyright 2024 Zero ASIC Corporation
# Licensed under the MIT License (see LICENSE for details)

from siliconcompiler import Flow, Chip
from siliconcompiler.flows._common import setup_frontend

from siliconcompiler.tools.yosys import syn_fpga as yosys_syn
from siliconcompiler.tools.vpr import place as vpr_place
from siliconcompiler.tools.vpr import route as vpr_route
from siliconcompiler.tools.genfasm import bitstream as genfasm_bitstream
from siliconcompiler import Chip
from siliconcompiler.flows import fpgaflow

from logik.tools.fasm_to_bitstream import bitstream_finish

Expand All @@ -26,41 +21,18 @@ def setup(chip, flowname='logik_flow'):
'''
'''

flow = Flow(chip, flowname)

flow_pipe = [
('syn', yosys_syn),
('place', vpr_place),
('route', vpr_route),
('genfasm', genfasm_bitstream),
('bitstream', bitstream_finish),
]

flowtools = setup_frontend(chip)
flowtools.extend(flow_pipe)
flow = fpgaflow.setup(chip,
flowname='logik_flow',
fpgaflow_type='vpr')

# Minimal setup
index = '0'
prevstep = None
for step, tool_module in flowtools:
# Flow
flow.node(flowname, step, tool_module)
if prevstep:
flow.edge(flowname, prevstep, step)
# Hard goals
for metric in ('errors', 'warnings', 'drvs', 'unconstrained',
'holdwns', 'holdtns', 'holdpaths',
'setupwns', 'setuptns', 'setuppaths'):
flow.set('flowgraph', flowname, step, index, 'goal', metric, 0)
# Metrics
for metric in ('luts', 'dsps', 'brams', 'registers', 'pins'):
flow.set('flowgraph', flowname, step, index, 'weight', metric, 1.0)
prevstep = step
# Add bitstream generation task
flow.node(flowname, 'convert_bitstream', bitstream_finish)
flow.edge(flowname, 'bitstream', 'convert_bitstream')

return flow


##################################################
if __name__ == "__main__":
flow = make_docs(Chip('<flow>'))
flow.write_flowgraph(f"{flow.top()}.png", flow=flow.top())
flow.write_flowgraph(f"{flow.top()}.png", flow=flow.top(), landscape=True)
2 changes: 1 addition & 1 deletion tests/examples/test_umi_fir_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _check_fir_filter(manifest):
chip = Chip('umi_fir_filter')
chip.read_manifest(manifest)

for step in ('syn', 'place', 'route', 'genfasm'):
for step in ('syn', 'place', 'route', 'bitstream'):
assert chip.get('metric', 'brams', step=step, index=0) == 2
assert chip.get('metric', 'dsps', step=step, index=0) == 8

Expand Down

0 comments on commit d1a7d37

Please sign in to comment.