Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reuse fpga-flow #64

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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