liberty_sdk is a Python software develop kit for working with Synopsys Liberty standard.
- Parser: Parses Liberty files and converts them into a structured format.
- JSON Serialization: Converts parsed Liberty files into JSON format.
- Liberty File Generation: Generates Liberty files from the parsed data structure.
- Compare Lib: Compare cell/pin, measurement and project setup for LIB - TODO
- Abstract: For large lib summarize
main.py: The main script to run the parser and perform conversions.parser/liberty_parser.py: Contains the core parsing logic and data structures.test/test_cell.lib: Sample Liberty file used for testing.test/test_cell.json: JSON output generated from the sample Liberty file.test/output_cell.lib: Liberty file generated from the parsed data structure.
To install the SDK, use the following command:
pip install -r requirements.txt
make build
python3 -m venv venv # 创建venv虚拟机环境,可选
source venv/bin/activate
pip3 -m pip install dist/liberty_sdk-$version-py3-none-any.whl
- Clone the repository.
- Install the required dependencies using
pip.
pip install -r requirements.txtTo parse a Liberty file and convert it to JSON:
python main.pyThis will read the Liberty file test/test_cell.lib, parse it, and generate the JSON output in test/test_cell.json. It will also generate a new Liberty file test/output_cell.lib from the parsed data.
Logs are written to parser.log and provide detailed information about the parsing process.
The project includes several assertions in main.py to verify the correctness of the parsing and conversion processes. These assertions check the parsed data against expected values.
See the LICENSE file for details.