Update: Chip Bring-up mini-Howto
Driver UpdateI cleaned up the cgminer driver sources and pushed today to github. It is running now quite stable (so far tested with chains of up to 16 chips for 48h continuously) and gives you a ready to use tool to test your design long term after the bring-up. Among minor fixes it adds support for command line parameters to configure the PLL and SPI clocks - please take a look at ASIC-README for a short info.
Visual mini-HowtoI was supplied with visual representation of the points addressed here by the chip designer (
Innosilicon) that I find quite handy and want to share:
Step-by-Step Bring-up Process1) Physical
Most is depicted in the above figure, this is the prose version:
- chip is 1.8V only => use level shifter for all signals from/to host SPI interface
- VDD needs to be ~820-850mV with a max. ripple of 70mV (pilot run chips do not support undervolting)
- AVDD needs to be 1.8V with a max. ripple of 200mV
- power-up PLL settings are based on 12MHz reference clock; if you use a higher value do not start hashing without reducing system clock via PLL or you risk bricking the chip by overclocking it
- if you have a multi-chip board, use a clock distribution device to drive them with a single oscillator
- heat-sinks on both sides of the chip needed, monitor and ensure surface temperature does not exceed 50°C
- HW reset is mandatory; RSTN needs to be pulled low for at least one second; ensure it was released for at least one second before the first command is issued
2) SPI Interface
If you use the provided cgminer driver, it will run from an SPI host as is - like we are using a RasPi. If your system is uC based, the required SPI parameters are
- SPI_MODE_1
- low-active CS
- 16bit access only
- clock must be lower than A1 SPI master clock, which is sys_clk / 64 (e.g. if you set sys_clk to 100MHz, keep your host SPI clock below 1.5MHz)
- the last chip in the chain needs to close the SPI loop by connecting SDI_L with SDO_L
3) Command Sequence
After a HW-reset as described above issue the following command sequence stages:
a) initialize chain
- RESET_BCAST: send 0x0400, poll for 0x0400 response
- BIST_START_BCAST: send 0x0100, poll for 0x01nn, where nn is the number of chips found in chain
- BIST_FIX_BCAST: send 0x0300, poll for 0x0300
b) set PLL
- while you scope SCK_L from the first chip, issue READ_REG: send 0x0a01, poll for 0x1a01 xxxx yyyy zzzz
- you should read the power-on values of 0x46c8, 0x2184, 0x00nn
- the SCK_L you scoped should have a frequency of ref_clk * 66.6 / 64 (with 12MHz ref clock SCK_L should be 12.5MHz)
- configure the PLL for a system clock at ~200MHz: calculate pll_prediv, pll_postdiv and pll_fbdiv, or take one of the following multipliers:
- 7.5: 0x883c
- 10.0: 0x8850
- 12.5: 0x8864
- 15.0: 0x8878
- 20.0: 0x88a0
- 40.0: 0x8940
- 50.0: 0x8990
- 60.0: 0x89e0
- with the selected divider value for xxxx, issue WRITE_REG: send 0x0900 xxxx 0x2184 0x0000, poll for 0x0900
- busy issue READ_REG and wait for pll_lock bit (register[24]) to be set
- issue another READ_REG and ensure that clock at SCL_L equals sys_clk / 64
c) hash
Now that chip is set to a secure low sys_clock, we can feed it a work item. For that, you could use the following reference job:
job[]={
/* midstate */
0x8D, 0x1F, 0xA3, 0x18, 0xD8, 0x0A, 0x25, 0x2C, 0xE4, 0xB7, 0xCD, 0x6D, 0x12, 0x2F, 0x80, 0x8F,
0x17, 0xDC, 0xD8, 0x10, 0x04, 0x17, 0xEA, 0x3F, 0xE8, 0xF3, 0x71, 0x41, 0x70, 0xF3, 0x4B, 0x49,
/* wdata */
0xD6, 0x98, 0x8E, 0x01, 0x27, 0x1F, 0x66, 0x52, 0xB6, 0x0A, 0x10, 0x19,
/* start-nonce, difficulty 1, end-nonce */
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x1D, 0xFF, 0xFF, 0xFF, 0xFF
}
This work item has 5 winning nonces: 99b18d18, 0cb2a63a, de648f3f, 09c79cb9, b3587bbe
Now it is time to see it hashing:
- queue the work as job_id 1 for first chip by issuing WRITE_JOB: send 0x1701 , poll for 0x1701
- get results busy looping while chip is hashing
- issue READ_REG, exit loop if register[16]==0
- issue READ_RESULT: send 0x0800, poll for 0xY8NN
- if NN!=0, the next 2 words are a winning nonce
You should have received those 5 results and that's basically it. Rest is trivial (like my math prof used to say and left you working for weeks to get the trivia
), as can be seen in the cgminer driver on how to streamline input and output queues for continuous hashing.
Good Luck,
zefir