Between cgminer and FPGA controller
Multiple FPGA controllers are daisy-chained together using TTL UART.
- HEAD: 'A' 'V'
- TYPE: Please read this head file: protocol.h
- IDX: This package index of the whole packages count.
- CNT: Packages count
- DATA: The real data
- CRC: CRC-16
Detect MM controller
- P_DETECT: send out this package, attach the modular id at the end of pakcage
- P_ACTDETECT: MM will send back this package, include The MM version in this package
Cgminer broadcasts the stratum information to all MM controllers
- P_STATIC: Send the length info first, the package like: coinbase length, nonce2 offset, nonce2 size, merkle offset, merkles count, pool diff, pool no. each variable using 32bits. the P_STATIC will make MM stop generate works. until a P_SET pkg send out.
- P_TARGET: Send out the package,
- P_JOB_ID: Send out the stratum package
- P_COINBASE: Send out the whole coinbase, split by 32Bytes, we using IDX/CNT here. max length: 6KB
- P_MERKLES: Send out the merkels one by one , we using IDX/CNT here. max count: 20
- P_HEADER: Send out the block header of the stratum message.
- P_SET: Send the MM configurations: fan pwm, chip voltage, chip frequency, nonce2 start, nonce2 range, each variable using 32bits. the P_SET will trigger MM to start generate works.
Cgminer will polling the MM controllers
The MM controller selects its own partition of extranonce in coinbase, base on own modular id and nonce2 start and nonce range. there are 2 type of packages send back
- P_NONCE: miner id, pool no, nonce2, nonce, job id, attach the modular id at the end of package.
- P_STATUS: temp, fan, frequency, voltage, local works, hardware error works, attach the modular id at the end of pakcage.
Each module have it's own ID. All ID was attach to the end of the data.