Pages:
Author

Topic: Klondike - 16 chip ASIC Open Source Board - Preliminary - page 71. (Read 435369 times)

hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Sorry if I am going on about this. May I suggest:
Create a tiny interrupt handling routine that gets and stores one byte in a buffer and increment the store memory pointer and returns from the interrupt again. Mean and lean!
something like:
Code:
constant int dataBufferLength=32;
byte interruptDataBuffer[dataBufferLength];
byte* interruptDataBufferAddress=&interruptDataBuffer;
byte* lastReadBufferAddress=&interruptDataBuffer;
handleInterrupt:
    reg a = getDataByteFromInterrupt();
    get ix from interruptDataBufferAddress;
    store a at ix;
    increment ix;
    if (ix == &interruptDataBuffer+dataBufferLength) ix=interruptDataBufferAddress;
    store ix at interruptDataBufferAddress;
    returnFromInterrupt;

And in your main program you can then compare lastReadBufferAddress with interruptDataBufferAddress to see if byte(s) have been received.

I know I am simplifying things, but interrupt handlers should be as short as possible.

I also have a question:
It is possible, although unlikely, that more than one chip has a result at the same time. Do you know from which chip the data is coming ? If so, this should be taken into account in the above pseudo code. If not, could it be the reason for your data issue?

Good luck solving the issue at hand!
I don't want to sound mean but what do you think I do in my handler? I read a byte and store it in a queue. In the past it returns asap, but that just means that it has to respond to 4 separate interrupts in a timely manner. Since the bytes arrive in a burst sequentially non-stop, it works better to interrupt on the first and loop to grab all four. Otherwise you have four cases where it needs to respond fast enough via IRQ latency instead of one. Now that I have removed all interrupt code except for the Result handler (even USB is now in polling mode) it just makes it clear that the interrupt response is not the problem. There is nothing to block the interrupt handler and it polls the FIFO for 4 bytes without any chance of being delayed. I never see FIFO Over Run errors now but it doesn't improve the long term error rate.

My biggest score today was realizing that since the data is inverted I need to initialize the FIFO with 0xFF instead of 0x00 so that any missed bits are shifted as inverted zeros not ones. Once I added a reset init of xFF after every result the error rate dropped way down. But even after all this it's still running around 3-5%. When I scoped the bad result cases I saw that the data appeared shifted by 1 bit - so a single bit was being left over from one result to another, or captured sometime in the space between results (noise?). By resetting to 0xFF after each capture it primes the FIFO and ensures that one error bit doesn't create a long string of error results by staying out of sync.

The case of two results happening at once is sufficiently rare that it doesn't matter. Either the ASIC has circuitry to detect busy (which I doubt given how they've gone minimal on anything related to comm.) or the collision just nukes both results. The probability of that happening is so low that it has no bearing on error rates in the > 0.1% range. If the ASICs are actually in sync due to being driven by the same clock source (which I doubt) then it is possible that one result has priority over the other and succeeds. Anyway, the probabilty right now with 4 chips is about 128/(nonce range size), or 1:8388608. (128 because the result clock appears to be hashclock/128, so 1 result takes the time of 128 hashes).

I believe something else is at work here to create the errors. Either PLL noise, instability, or some error on shifting data into the ASIC. Remember that any corruption on data in is going to give error results out when the host tries to verify back to the correct original data. I've spent a lot of time looking at scope traces. The only thing I've definitely been able to detect that way so far is that sometimes a result is captured one bit out of sync, ie. it had an extra first bit that pushed all the consequent bits off. But visually that first bit doesn't look different than cases where it captured fine. There is no extra clock bit and it's not out of position. I only know it's one bit off by writing down the scoped bits pattern and comparing to the result captured. There isn't even noise, and it doesn't happen during a capture but sometime before a capture starts, or after it ends, corrupting the next one. Are my antenna like wires connecting the red board causing spurious clk edges?

Writing this just gave me an idea.
hero member
Activity: 826
Merit: 1001
Once it gets triggered it doesn't let go until it has all 4 bytes. I hope today goes better, as the crunch is really on now, and believe me I feel the pressure to get everything finalized enough to make final boards.
Sorry if I am going on about this. May I suggest:
Create a tiny interrupt handling routine that gets and stores one byte in a buffer and increment the store memory pointer and returns from the interrupt again. Mean and lean!
something like:
Code:
constant int dataBufferLength=32;
byte interruptDataBuffer[dataBufferLength];
byte* interruptDataBufferAddress=&interruptDataBuffer;
byte* lastReadBufferAddress=&interruptDataBuffer;
handleInterrupt:
    reg a = getDataByteFromInterrupt();
    get ix from interruptDataBufferAddress;
    store a at ix;
    increment ix;
    if (ix == &interruptDataBuffer+dataBufferLength) ix=interruptDataBufferAddress;
    store ix at interruptDataBufferAddress;
    returnFromInterrupt;

And in your main program you can then compare lastReadBufferAddress with interruptDataBufferAddress to see if byte(s) have been received.

I know I am simplifying things, but interrupt handlers should be as short as possible.

I also have a question:
It is possible, although unlikely, that more than one chip has a result at the same time. Do you know from which chip the data is coming ? If so, this should be taken into account in the above pseudo code. If not, could it be the reason for your data issue?

Good luck solving the issue at hand!
member
Activity: 86
Merit: 10
Just to let you know, the reason for no nonces coming back was that during the assembly they missed a resistor (R47), which basically connects Res_CK to the PIC. After soldering it on, we started getting nonces back but all were marked as "BAD". We then used your trick of passing the clock through two NOR gates, and now all the nonces are coming back as "GOOD" with the clock set as 128 or 256. Anything more than 256, we stop getting the nonces back. The boards is hashing with clock set at 256 MHz. It stops hashing if the clock is increased. We are also seeing a lot of HW errors.
hero member
Activity: 924
Merit: 1000
Grin Grin Grin  I'm having a terrible day here.


Was your etch a sketch broken?

sr. member
Activity: 378
Merit: 250
Grin Grin Grin  I'm having a terrible day here.


Ha, Kicad is worse than I thought.

Oh, where is the +1 funny button.
That is good for a laugh Smiley
And thanks to BkkCoins for explaining the delay circuit.
Looks like he's clocking data into the PIC on the falling edge of the clock.
sr. member
Activity: 448
Merit: 250
Grin Grin Grin  I'm having a terrible day here.


Ha, Kicad is worse than I thought.

Oh, where is the +1 funny button.
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Grin Grin Grin  I'm having a terrible day here.

I suppose you are...



lol
Hello
This is not correct.
The second NOR gate both inputs should be connected together.
The resistor should go from the output of the first NOR gate to the inputs of the second NOR gate.
The 30pf capacitor should connect from the second NOR gate inputs to ground.
This works as well - it just delays one edge instead of both.

I'm not sure what you mean by this. But Terrahash haven't exactly endeared themselves to this community...
I don't have a problem with TerraHash, other than maybe they don't communicate much. I hope they can get good results and do well with the board, and will help, time depending, if I can.

My terrible day yesterday was to do with revising the code to get better timing and throwing everything else out of whack. It started giving me 50% error rates and crap like that. I've solved part of that now but it's still higher than before. It doesn't make much sense as I didn't change any hardware at all, and the code should be helping not hindering. Anyway, this morning I'm starting out again and I've got everything except ResultRx out of the interrupt servicing allowing for it to have primary control. Once it gets triggered it doesn't let go until it has all 4 bytes. I hope today goes better, as the crunch is really on now, and believe me I feel the pressure to get everything finalized enough to make final boards.
sr. member
Activity: 378
Merit: 250
Grin Grin Grin  I'm having a terrible day here.

I suppose you are...



lol
Hello
This is not correct.
The second NOR gate both inputs should be connected together.
The resistor should go from the output of the first NOR gate to the inputs of the second NOR gate.
The 30pf capacitor should connect from the second NOR gate inputs to ground.
sr. member
Activity: 336
Merit: 250


I'm not sure what you mean by this. But Terrahash haven't exactly endeared themselves to this community...

Speak for yourself.  I don't have an issue with TH unless they don't deliver as promised.  I choose not drink the kool-aid the trolls are serving.  Wink
sr. member
Activity: 294
Merit: 250
Grin Grin Grin  I'm having a terrible day here.

Great drawing! Smiley

Just try and relax and have fun with this. We're all behind you. And please don't get distracted by people asking you to troubleshoot their boards. We know you need to concentrate on getting yours working to your satisfaction Smiley

Agreed card.  BKK u are making huge progress.  I woulden't worry about helping terrahash troubleshooting..... but that is another story.

Keep up the good work cant wait to see what u do next!
Im sure that is EXACTLY why he is having a bad day...dont bring your sour grapes here because you have issues with TH.

I'm not sure what you mean by this. But Terrahash haven't exactly endeared themselves to this community...
cp1
hero member
Activity: 616
Merit: 500
Stop using branwallets
Grin Grin Grin  I'm having a terrible day here.


Ha, Kicad is worse than I thought.
hero member
Activity: 728
Merit: 500

I see a heatsink on the board slathered in thermal paste. Grin


Of course with heat sink

And... getting valid results @450 ?

(sorry too n00b to make sense of scope data)
Yes
Also we implemented in th 16 bit PIC USB boot loader
sr. member
Activity: 322
Merit: 250
Supersonic

I see a heatsink on the board slathered in thermal paste. Grin


Of course with heat sink

And... getting valid results @450 ?

(sorry too n00b to make sense of scope data)
hero member
Activity: 728
Merit: 500
sr. member
Activity: 336
Merit: 250

I see a black heatsink on the K-1 board slathered in thermal paste. Grin

sr. member
Activity: 476
Merit: 250
hero member
Activity: 728
Merit: 500
full member
Activity: 232
Merit: 100
Grin Grin Grin  I'm having a terrible day here.

Great drawing! Smiley

Just try and relax and have fun with this. We're all behind you. And please don't get distracted by people asking you to troubleshoot their boards. We know you need to concentrate on getting yours working to your satisfaction Smiley

Agreed card.  BKK u are making huge progress.  I woulden't worry about helping terrahash troubleshooting..... but that is another story.

Keep up the good work cant wait to see what u do next!
Im sure that is EXACTLY why he is having a bad day...dont bring your sour grapes here because you have issues with TH.
legendary
Activity: 1456
Merit: 1000
Grin Grin Grin  I'm having a terrible day here.

Great drawing! Smiley

Just try and relax and have fun with this. We're all behind you. And please don't get distracted by people asking you to troubleshoot their boards. We know you need to concentrate on getting yours working to your satisfaction Smiley

Agreed card.  BKK u are making huge progress.  I woulden't worry about helping terrahash troubleshooting..... but that is another story.

Keep up the good work cant wait to see what u do next!
sr. member
Activity: 294
Merit: 250
Grin Grin Grin  I'm having a terrible day here.

Great drawing! Smiley

Just try and relax and have fun with this. We're all behind you. And please don't get distracted by people asking you to troubleshoot their boards. We know you need to concentrate on getting yours working to your satisfaction Smiley
Pages:
Jump to: