File: unpack_repack.py

package info (click to toggle)
prjtrellis 1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 83,000 kB
  • sloc: cpp: 20,813; python: 16,246; sh: 375; makefile: 262; asm: 80; ansic: 58
file content (11 lines) | stat: -rwxr-xr-x 340 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env python3
"""
This simple example uses PyTrellis to unpack and pack a bitstream
"""
import pytrellis

pytrellis.load_database("../../../prjtrellis-db")
bs = pytrellis.Bitstream.read_bit("../../minitests/lut/lut.bit")
chip = bs.deserialise_chip()
repack = pytrellis.Bitstream.serialise_chip(chip)
repack.write_bit("repack.bit")