Created
October 1, 2019 12:25
-
-
Save gregdavill/16c92c5f4fc674e16e58bd4aee4de99f to your computer and use it in GitHub Desktop.
Script for use with prjtrellis to swap the IDCODE of a ECP5 bitstream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
This simple example uses PyTrellis to unpack, change the IDCODE, and pack a bitstream | |
""" | |
import pytrellis | |
pytrellis.load_database("/usr/share/trellis/database") | |
bs = pytrellis.Bitstream.read_bit("build/gateware/impl/top_impl.bit") | |
chip = bs.deserialise_chip() | |
chip.info.idcode = 0x81113043 | |
repack = pytrellis.Bitstream.serialise_chip(chip) | |
repack.write_bit("repack.bit") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment