Repository navigation
Conversation
Xilinx: parse the .bit header fields (design, part, date/time, length) and require the 0xAA995566 sync word; raw bitstreams via the bus-width pattern, 0xFF padding and the sync word. Lattice iCE40: 0x7EAA997E preamble, then walk the command stream to the wakeup command to report the exact size. No extractors. Refs ReFirmLabs#829. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restores Xilinx bitstream detection from the Python version (listed in #829) and adds Lattice iCE40.
Xilinx
.bitfiles: parses the header fields (design, part, date/time, length) and checks for the sync word0xAA995566within the first 256 data bytes; reports design, part, date and the exact size.00 00 00 BB 11 22 00 44, followed only by0xFFpadding and the sync word within 64 bytes (size unknown, so medium confidence).Lattice iCE40
0x7EAA997Epreamble and walks the command stream to the wakeup command to report the exact size (truncated streams get low confidence).Tests
tests/fpga.rs, with two inputs: the iCE40 input is a real icepack UP5K image embedded at an offset; the Xilinx input is a minimal synthetic.bit(no Vivado here; happy to swap in a small real.bit, e.g. from openXC7)..bittest also checks that the raw bus-width pattern inside a.bit(at0xE9) is not reported a second time.Checked locally on 2671397 (Rust 1.96):
cargo test --test fpgapasses.cargo testpasses, exceptintegration_test_valid_arj, which fails the same way on unpatched master here (noarjbinary installed).cargo clippy --all-targetsis clean, andcargo fmt --checkis clean./usr/binand/usr/lib.No extractors yet; happy to add a carver if wanted.
🤖 Generated with Claude Code