src/ztex/fpga-md5crypt/README.md
--------------+-------------+--------------
/ / / \
+--------+ +--------+ +--------+ |
| | | | | | |
| MD5 | | MD5 | | MD5 | |
| core | | core | | core | |
| #0 | | #1 | | #2 | |
| | | | | | |
+--------+ +--------+ +--------+ |
^ ^ ^ |
\ | / |
+----------+----------- |
| |
. . . . . | . . . . . . . . . . . . . . . . . . . . . |. .
| /
| /
+---------------+ ------------- /
| | / \ /
| process_bytes | / "main" \ <------
| |<--+--| memory |
+---------------+ | \ (12 x 128 B) / <------
| ^ | \ / \
+-------+ | / ------------- |
| procb | | / +------------+
| saved | | / +-------------------+ | unit_input |
| state | | / | thread_state(x12) | +------------+
+-------+ | | +-------------------+ ^
| | |
+-----------+ \ +-----------------------------+ |
| procb_buf | -->| C.P.U. | |
+-----------+ | +-----------------------+ | |
^ | | integer ops. incl. | | |
\ | |12x16 registers(x16bit)| | |
\ | +-----------------------+ | |
---------| | |
| +----------------------+ | |
| | thread switch (x12) | | |
+--------+ | +----------------------+ | |
| unit | | | instruction pointers | | |
| output |<-------| +----------------------+ | |
| buf | | | instruction memory | | |
+--------+ | +----------------------+ | |
| +-----------------------------+ |
| /
\ /
---> to arbiter_rx from arbiter_tx
fig.1. CPU based computing unit
md5ctx . md5core
.
+----+ +---+ +----+ +---+ +----------+
| C2 |---->| D |---->| D2 |----->| A | . | |
+----+ +---+ +----+ +---+ | K(t) |
^ | | . | |
| | | +----------+
+----+ \ +-----+ | . |
| C |---- -->| | +---+ | | +------+
+----+ \ | F | | + |<-+ . +---+ | | |
^ ------>| |-->| | | + |<-+ | mem1 |
| | | | |<---------| | | | din
+----+ ------>| | +---+ . | |<------| |<---
| B2 |- / +-----+ | | | | |
+----+ \ / | . | |<-+ | |
^ \ \ +---+ | | |
| / \ \ . | +------+
+----+/ \ | |
| B | \ +---------+ | . +------------+
+----+ \ | | | | |
^ | | <<< |<-+ . | mem2 |
| +---+ | | | | |
+---| + |<-+ +---------+ . +------------+
| | | ^
| | | . | dout
| |<-------------+------------------------+--------------->
+---+ .
fig.2. MD5 computing circuit ("core")
mem1.mem2, allow to use previously
stored result as IVs for subsequent block. Data in mem2 is stored
rotated by 16, when loaded as IVs it's rotated by 16 again.
That helps with optimization of rotator unit, which could take
substantially more space if it had ability for pass-through without rotation. ------------------+--------+--+--+--------+---------
/ / / / / / \
+-----------+ +-----------+ +-----------+ |
| | | | X X X | | |
| Computing | | Computing | | Computing | |
| Unit #0 | | Unit #1 | | Unit N | |
| | | | X X X | | |
+-----------+ +-----------+ +-----------+ |
^ ^ ^ ^ ^ ^ |
| | | | | / |
+---------------+---------+--+--+-------- |
| |
. . . | . . . . . . . . . . . . . . . . . . . . . . . . . .| .
| |
| |
+-----------------+ +----------------+ /
| Arbiter | | Arbiter |<---------
| (transmit part) |<-------->| (receive part) |
+-----------------+ +----------------+
^ |
| +------------+ | +------
| +---------+ | |<-+->| mode \
| | cmp. |-->| comparator | | cmp |--
| | config. | | |---->| ? / \
| +---------+ +------------+ +------ |
| ^ |
. . . | . . . . .|. . . . . . . . . . . . . . . . . . . . | .
| | Communication framework |
| | /
+-----------+ | /
| candidate | | /
| generator | | /
+-----------+---------+----------------------+ /
| input pkt. handling | output pkt. creation |<-----
+---------------------+----------------------+
| input FIFO | output FIFO |
+---------------------+----------------------+
| Prog. clocks | USB I/O | FPGA reset |
+--------------------------------------------+
fig.3. Overview, FPGA application
Each computing unit uses approximately 1,880 to 2,160 LUT. Here's a breakdown of resource usage by individual components in a unit:
Total resource utilization: 70% LUT, 71% BRAM, 33% FF.