|
Download bit_accelerator/IMPLEMENTATION_REPORT.md from Snapkitty/rust-opencl-gpu: direct link, hf CLI and curl.
- Browser
- Download file 2.83 kB
-
https://huggingface.co/Snapkitty/rust-opencl-gpu/resolve/main/bit_accelerator/IMPLEMENTATION_REPORT.md
- Command line
-
hf download hf://Snapkitty/rust-opencl-gpu/bit_accelerator/IMPLEMENTATION_REPORT.md
-
curl -L -o IMPLEMENTATION_REPORT.md https://huggingface.co/Snapkitty/rust-opencl-gpu/resolve/main/bit_accelerator/IMPLEMENTATION_REPORT.md
2.83 kB
bit_accelerator_v2 - Verified Status
Everything below was measured by running make test (Verilator 5.020, Icarus Verilog 12.0,
Why3 1.6.0 with Z3 4.8.12).
Result
- Simulation:
checks=182 fails=0under both Verilator and Icarus. - Lint:
verilator --lint-only -Wallclean. - Formal: 33/33 Why3 goals valid with Z3.
Observed cycle timing (1-cycle-latency memory, no stalls)
a = cycle in which op_valid && op_ready is sampled.
| Op | Timeline |
|---|---|
| BIT_GET | READ_REQUEST a+1, READ_RESPONSE a+2, RESULT_VALID a+3 (one cycle) |
| SET/CLEAR/TOGGLE | READ_REQUEST a+1, READ_RESPONSE a+2, MODIFY a+3, WRITE accepted a+4, RESULT_VALID a+6 |
Write stalled (mem_ready=0 a+4..a+6) |
request and wdata held, accepted a+7, RESULT_VALID a+9 |
Read stalled (mem_ready=0 a+1..a+2) |
accepted a+3, response a+4, RESULT_VALID a+5 |
Covered by the testbench
- Result value for GET (set/clear bits, cross-word offsets, non-zero base).
- Memory contents after SET/CLEAR/TOGGLE, including word 1 targets.
- Exactly one
result_validpulse per op;op_readylow while busy. - Write and read backpressure: signals held stable, no early result, write committed once.
- Reset asserted in each of READ_REQUEST, READ_WAIT, MODIFY, WRITE_REQUEST, WRITE_WAIT:
no
result_valid, no write after reset, DUT idle, and a fresh op completes normally.
Defects found by simulation and fixed
result_validwas registered, so it appeared one cycle later than specified (a+4 instead of a+3). It is now combinational fromST_RESULT.- A reset in the same cycle as a write handshake let the memory commit the write.
mem_valid/mem_write/mem_wstrb/mem_wdataare now forced low whileresetis asserted. errorwas set on anymem_fault; it is now cleared on accept and set only inST_READ_WAIT.- Read-fault tests were added (GET/SET/TOGGLE):
erroris high in the result cycle, no write is issued, and the next operation clears it. The testbench now exits non-zero on failure. - Lint fixes: explicit zero-extension of
mem_addr, bit extraction readsread_word[bit_index]directly. - The previous testbench did not compile, sampled after the clock edge (racy), and modeled 2-cycle read latency. It was rewritten to log pre-edge values per cycle.
Not verified / known limits
- Only read faults exist; there is no write-fault input path.
BIT_TEST(3'b001) behaves like GET; no flag output exists.base_address << 3truncates the top 3 bits ofbase_address, andmem_addris 61 significant bits.- The Why3 proofs cover the specification; RTL-to-specification agreement is checked by simulation only.
- Undefined opcodes (101-111) execute as a read with no write and no error.
- No synthesis was run; area/power/frequency numbers elsewhere in this repo are estimates.