Zip CPU (@zipcpu) profile picture

FPGA design engineer and blogger, placing particular emphasis on test and formal verification

Gisselquist Technology, LLC,
Joined January 2017
Photo by Zip CPU (@zipcpu)Photo by Zip CPU (@zipcpu)Photo by Zip CPU (@zipcpu)Photo by Zip CPU (@zipcpu)Photo by Zip CPU (@zipcpu)Photo by Zip CPU (@zipcpu)Photo by Zip CPU (@zipcpu)Photo by Zip CPU (@zipcpu)Photo by Zip CPU (@zipcpu)Photo by Zip CPU (@zipcpu)
Wow, lots of new twitter followers just joined. Welcome! Just to give you an opportunity to get to know me and the ZipCPU blog, here's a bit about me and what you can expect here: zipcpu.com/blog/2018/10/04/w… Again, welcome!
6
4
1
64
Let us all give thanks go God for his wonderful blessings of the past year. I am personally thankful for the power of His words. For in them "is the power of God unto salvation to every one that believeth; to the Jew first, and also to the Greek." (Rom 1:16) His power has changed my life, and accomplished within me what I could not do on my own. So I am thankful to God, and thankful for His words.
10
649
Here's a trace from a NAND SPI system. Note that you can speed up the transfer rate, but there comes a point where no matter how fast you speed the transfer rate, the operation just doesn't go significantly faster.
1
21
1,223
I've asked another engineer working with me to run some memory testing. I suggested he use my memory testing function, but I had apparently forgotten how optimized the function was. This led to a long discussion about software optimizations. github.com/ZipCPU/kimos/blob…
27
921
One of the challenges of digital signal processing is knowing whether or not your chosen algorithm is "good enough." This morning, I was remembering this challenge from decades ago. It's a fun problem, requiring some good old fashioned of numerical analysis ...
3
53
2,673
The real trick to this problem is guaranteeing that the chosen interpolation method will be "good enough."
1
8
409
Perhaps a picture would do a better job explaining what happened ... The good news is that regressions are now passing (again) following a simple fix (S/W change only) to move the sample clock earlier.
Today's bug: two simulators (XCelium, Icarus), same logic, one test case passes, one doesn't. Why? It's a race condition. The model sets its data on the same cycle as it gets sampled. One simulator samples the data before it gets set by the model, the other afterwards.
1
1
30
1,595
Today's bug: two simulators (XCelium, Icarus), same logic, one test case passes, one doesn't. Why? It's a race condition. The model sets its data on the same cycle as it gets sampled. One simulator samples the data before it gets set by the model, the other afterwards.
5
1
1
29
3,562
Today's bug of the week is a story. It starts with a commercial memory controller (built by yours truly), that passes all of its simulation tests. Reads tested, writes tested, WRAP tested, Exclusive access checked, etc. Many, but not all components were formally verified.
1
2
63
2,661
Two key blocks are the downsizers. These are designed to downsize beats from the bus width to the memory width, while also aggressively merging transactions together to avoid the need to restart any memory transactions. Again, everything was working in the test bench.
1
4
382
I can't say I've never made this mistake before Note that TFR_WRITE != TFR_TXPARITY ... otherwise this might've worked accidentally ...
4
1
15
989
Just for context, r_transfer is the name of the state variable -- although the bug would still be a bug either way.
246
This weeks design puzzle has been to build an AXI cache: AXI in, AXI out with all WSTRB bits set. I've been a bit surprised at the requirements of such a controller, and the more I've dug into it, the more challenging and complex it becomes.
2
1
12
1,046
One subtle reality, is that the two streams (read/write) of such a cache cannot be independent. If nothing else, they will need arbitration to access tag memory. This is in contrast to most of my AXI work, where I try to keep the read/write FSMs as independent as possible.
1
3
366
This stack exchange post has a good description of the problems with using AES-CTR for memory encryption. I love the included pictures. They tell the story well. crypto.stackexchange.com/que…
19
1,596
Whoever thought AES-CTR could be used to secure memory ... is offering an expensive encryption that looks good but offers zero security.
1
11
698
One of the differences between ASIC and FPGA design is the initial statement. ASICs don't support them. To build IP that works across technologies, I've had to be very careful where, when, and how I use such statements. In many cases, I've had to remove them over time when my FPGA designs later become ASIC designs.
Replying to @zipcpu
They don't, as long as you define their initial state in register declaration to avoid X's in simulation, and of course to get the initial state that you want, whether 0 or 1.
8
3
1
40
4,123
It is frustrating to build and sell an IP to an ASIC customer, only to have the customer come back with, "See! We found a bug! You used an initial statement!" -- even if the initial statement, when dropped from the design, would have no impact.
1
3
344
Some time ago, I posted an article on how to move values and strobes across clock domains. The module was powerful, very versatile, and easy to work with. It had one flaw: it required a reset that would active in both clock domains at the same time, then synchronously release.
1
15
1,051
I love the technique. I use it often. It's become a go-to approach for moving everything across clock domains slowly. As a result, the logic quietly moves from one project to another. It's now been in a couple ASIC projects as well. Here's the post for reference: zipcpu.com/blog/2020/10/03/t…
1
1
8
540
The issue is the missing reset. 2FF synchronizers need asynchronous reset. The reset must have a source, common to both clock domains, and it needs to have a synchronized release in each domain.
What do you think, anyone see a bug here? It's a basic 2FF CDC crossing, from one clock to another ...
3
5
25
2,197
Without such a reset synchronizer, I've seen: 1. A bus request crosses clock domains 2. One (or both) domains gets reset, just not the 2FF synchronizer(s). (The reset doesn't last long enough to clear the 2FF synchronizers either ...) 3. The result is a bus ACK, with no prior request -- a clear violation of all bus protocols.
1
3
504
What do you think, anyone see a bug here? It's a basic 2FF CDC crossing, from one clock to another ...
5
3
1
31
5,801
Fun story ... A customer was complaining about IO's coming out of a chip they had produced, using a design I had worked with. The IO's worked well, and had the right output voltage (1.8v IIRC), unless they were driven with a 250MHz pattern--at which point the waveforms only measured 1.5v. Customer: What's wrong with your design? After a lot of debugging, the "bug" was isolated to the bandwidth in their test probe.
4
3
76
4,850
May God be praised.
5
559
"Righteous lips are the delight of kings; and they love him that speaketh right." Prov 16:13 There's a cost to telling the truth--even when it's not convenient. There's a greater cost to not speaking.
Elon Musk was asked how he handles employees who disagree with him publicly. His answer contradicts every leadership book written in the last 30 years. "I'd rather have someone who argues with me and is right than someone who agrees with me and is wrong." The room expected the diplomatic answer. That he values diverse perspectives. That healthy debate makes the team stronger. The standard CEO answer about psychological safety. He went further. He said the most dangerous person in any company is the one who agrees with you to protect their job. Because that person will let you drive the company off a cliff rather than risk being fired for telling you the cliff is there. The yes-man isn't loyal. He's selfish. He's trading the company's survival for his own comfort. He said SpaceX has a rule. If an engineer sees a problem and doesn't speak up, and the problem later causes a failure, the silence is treated as more serious than the mistake itself. The person who made the error was trying. The person who watched the error and said nothing was protecting themselves at the cost of the mission. Think about what that inverts. In most companies, the person who stays quiet and avoids conflict is rewarded with job security. At SpaceX, silence is the fireable offense and disagreement is the job requirement. Most leaders say they want honesty. Then they punish the first person who delivers it. He built a system where dishonesty through silence is the thing that gets punished. The culture didn't happen by accident. It was engineered to make agreement more dangerous than disagreement.
3
888
This deserves a discussion within every business community. The boss needs to make his priorities known. I remember my Dad was surprised, year after year, that he was never let go from Cray Research even after they downsized many times (and changed ownership, and names, and ...)--especially because he felt he had been quite vocal whenever he had disagreements with management and company choices. Perhaps the reason is because well reasoned disagreement is so absolutely valuable to corporate decision makers.
Elon Musk was asked how he handles employees who disagree with him publicly. His answer contradicts every leadership book written in the last 30 years. "I'd rather have someone who argues with me and is right than someone who agrees with me and is wrong." The room expected the diplomatic answer. That he values diverse perspectives. That healthy debate makes the team stronger. The standard CEO answer about psychological safety. He went further. He said the most dangerous person in any company is the one who agrees with you to protect their job. Because that person will let you drive the company off a cliff rather than risk being fired for telling you the cliff is there. The yes-man isn't loyal. He's selfish. He's trading the company's survival for his own comfort. He said SpaceX has a rule. If an engineer sees a problem and doesn't speak up, and the problem later causes a failure, the silence is treated as more serious than the mistake itself. The person who made the error was trying. The person who watched the error and said nothing was protecting themselves at the cost of the mission. Think about what that inverts. In most companies, the person who stays quiet and avoids conflict is rewarded with job security. At SpaceX, silence is the fireable offense and disagreement is the job requirement. Most leaders say they want honesty. Then they punish the first person who delivers it. He built a system where dishonesty through silence is the thing that gets punished. The culture didn't happen by accident. It was engineered to make agreement more dangerous than disagreement.
1
17
2,745