-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: David Shah <[email protected]>
- Loading branch information
Showing
2 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
This simple example uses PyTrellis to read TESTTILE tile bits, of tile R2C2 in a bitstream | ||
""" | ||
import pytrellis | ||
|
||
pytrellis.load_database("../../../prjtrellis-db") | ||
bs = pytrellis.Bitstream.read_bit("../../minitests/ncl/lut.bit") | ||
chip = bs.deserialise_chip() | ||
tile = chip.tiles["R2C2:PLC2"] | ||
tile_bits = tile.cram | ||
bit_offset = tile.info.bit_offset | ||
frame_offset = tile.info.frame_offset | ||
|
||
for bit in range(tile_bits.bits()): | ||
for frame in range(tile_bits.frames()): | ||
if tile_bits.bit(frame, bit): | ||
print("({}, {})\t({}, {})".format(bit, frame, bit + bit_offset, frame + frame_offset)) | ||
|