Open mithro opened 6 years ago
I can work on this. I'm a little busy at the moment so my progress would be steady but slow.
Do we have a corpus of BLIF files to test against?
@nturley
We don't really have a good corpus but some sources of BLIF files are;
You can also easily generate them with Yosys and the write_blif
command.
GitHubvtr-verilog-to-routing - Verilog to Routing -- Open Source CAD Flow for FPGA Research
GitHubarachne-pnr - Place and route tool for FPGAs
I've been making BLIFs to exercise different parts of the grammar for my Rust BLIF parser at https://github.com/gaffe-logic/blif/tree/master/examples . Feel free to use them.
any objections to a parser generator like antlr4? The grammar would then be reusable for other languages.
@nturley Only requirement is we need a pure Python library. Looks like antlr4 might support that? https://github.com/antlr/antlr4/blob/master/doc/python-target.md
GitHubantlr4 - ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
I started on a new BLIF parser using GitHub's recently released Tree Sitter incremental parser framework.
Nice! Not sure where our BLIF roadmap is, but we'll take a look if we start poking around there
Create a Python library for parsing / producing BLIF (and eBLIF) files
BLIF is the preferred method of design entry for many designers. The Berkeley Logic Interchange Format (BLIF) is a simple file format for exchanging sequential logic between programs.
eBLIF is an extension of the BLIF format to add features needed for using BLIF as part of an FPGA PnR flow created by Clifford Wolf. The best format is the Verilog to Routing docs here.
BLIF is used by Yosys, Arachne-pnr and Verilog to Routing.
There might be a starting library here.
Expected results
A Python library published on PyPi which makes it easy to read and write BLIF files.
Knowledge Prerequisites