Skip to content

Port cleanup: dead bistream-writer.h, broken packet operator<<, dropped reader test, unused BUILD dep #43

Description

@lromor

Small dead/broken leftovers from the prjxray port, none affecting generated bitstreams today:

  1. Dead duplicate header: fpga/xilinx/bistream-writer.h (note the bistream typo) is an older revision of bitstream-writer.h (file-path-based writeBitstream). It is referenced by no BUILD target and no #include. Safe to delete. It is the only orphaned file in fpga/xilinx/.

  2. Packet operator<< cannot compile if instantiated: fpga/xilinx/configuration-packet.h:78-91 still switches on the old enumerator names Opcode::NOP / Opcode::Read / Opcode::Write, but the port renamed them to kNOP / kRead / kWrite. Being a function template, it only errors on first use — nothing currently instantiates it, so the packet debug printer is effectively dropped functionality.

  3. Dropped reader test: prjxray's InitWithSyncAfterNonWordSizedPaddingReturnsObject (bitstream_reader_test.cc upstream) has no equivalent in bitstream-reader-xc7_test.cc; the other reader tests were all ported. The behavior (byte-wise std::search for the sync word) appears preserved, just untested.

  4. Unused BUILD dep: arch-xc7-part's dependency on //fpga:memory-mapped-file (fpga/xilinx/BUILD:136) is not used by its sources.

  5. Fragile ASCII-parity trick: FindPUDCBTileSite / GetIOBSites in fpga/assembler.cc compute site parity via std::to_string(site[site.size() - 1]), which converts the trailing char to its ASCII code (e.g. "49" for '1'). The subsequent % 2 is only correct because ASCII digit parity equals digit parity. Worth rewriting as (site.back() - '0') % 2 with a digit check.

Found during a port audit against prjxray @ 7557c7cc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions