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

Export fasm2frames and bitstream generation in a separate package #1384

Closed
acomodi opened this issue Jul 2, 2020 · 5 comments
Closed

Export fasm2frames and bitstream generation in a separate package #1384

acomodi opened this issue Jul 2, 2020 · 5 comments

Comments

@acomodi
Copy link
Contributor

acomodi commented Jul 2, 2020

Problem statement

The current implementation of fasm2frames and frames2bit does not allow for an easy portability of the bitstream generation step.

There are two main issues:

  1. fasm2frames needs to be installed via pip, and it is currently located in the prjxray/utils directory. Given that this is a relevant step in the SymbiFlow toolchain, it should deserve a standalone location.
  2. there is no direct fasm2bit tool as the only tool to write bitstreams is frames2bit and it is currently written in C++. For an end-user point of view, the frames file is actually not needed apart from debugging reasons, therefore the fasm2frames and frames2bit steps could be merged in one step only, also making it easier to perform the bitstream generation step.
    • The problem is that we have only a C++ implementation of the frames2bit tool. Given that most of the runtime spent by the tool should be a Disk I/O time, it would be convenient to port everything to python and easily merge the fasm2frames and frames2bit step.

Goal

Have a standalone bitstream generation tool that, taken a fasm file as input, generates a bitstream, all wrapped in one command only.
This would also be compatible with the way QuickLogic bitstream generation is performed.

Solution

This goal can be achieved in two separate steps:

  1. Extract the fasm2frames script into a separate repository (e.g. xc7-fasm) with all the relative tests and add a step that calls frames2bit as a subprocess. (This requires having frames2bit binary on the local machine).
    • All the tools that rely on fasm2frames will just install it via pip.
  2. Convert frames2bit into python and integrate that into the existing fasm2frames code.
@acomodi
Copy link
Contributor Author

acomodi commented Jul 2, 2020

@litghost @mithro @kgugala FYI

@kgugala
Copy link
Contributor

kgugala commented Jul 2, 2020

the first step (from the proposed ones) seems to relatively easy to do and will simplify the flow a bit.
Reimplementing frames2bit into python will remove the necessity of writing and reading back the frames file.

We have a pure python bitstream writer (fasm -> bit) in the QuickLogic flow.

@acomodi
Copy link
Contributor Author

acomodi commented Jul 6, 2020

I have created a repository here https://github.com/SymbiFlow/xc-fasm.

What is needed is a wrapper around fasm2frames and frames2bit, so we can have a single command invocation to get from fasm to bit

GitHub
Contribute to SymbiFlow/xc-fasm development by creating an account on GitHub.

@litghost
Copy link
Contributor

This has been done, yes?

@acomodi
Copy link
Contributor Author

acomodi commented Oct 1, 2020

Yes, this is done. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants