178 points · by hsikka · 7y ago · 39 comments
I am a graduate student doing ML research, and lately I've been thinking a lot about designing learning systems from the hardware through the software layers.
I have no experience with what is going at the processor levels, and I was wondering what prerequisite subjects or general curricula I should follow to learn and reason at these lower levels of abstraction.
To be clear, I'm doing this to build intuitions about new computational systems and how different chips, from ASIC to neuromorphic, may be designed.
Any resources or advice telling me I'm a fool is welcome!
If you want to get really deep into the physics of IC Design, one of my favorites is "CMOS Design, Layout & Simulation (Baker). It covers spice modeling, physical transistor construction, and a variety of digital/analog/memory circuit concepts.
Finally: the link to this article was literally right underneath the link to yours when I opened HN news this morning: https://medium.com/@veedrac/to-reinvent-the-processor-671139...
Weste and Eshraghian was (and may still be) the Bible for a very long time: https://www.amazon.com/Principles-CMOS-VLSI-Design-Perspecti...
It's a lot newer (and nicer) than most other references.
I would avoid Mead and Conway because it's really dated. It's not wrong, but a beginner won't know which parts to skip.
If you're looking for something about VLSI layout design, "The Art of Analog Layout (2nd Edition)" by Hastings would be the choice: https://www.amazon.com/Art-Analog-Layout-2nd/dp/0131464108/r...
So my best advice is to find a group that has already setup most of that support infrastructure and obtained licenses for all the tools and design kits (We've got one person alone that handles licenses, software installation, and the ASIC cluster).
Ideally the group has permanent staff with plenty of hardware experience and a professor with a proven track record of successful chip tapeouts. The number of groups that are capable of this in the field you are interested in can be counted on two hands at best.
I can't talk much about analog design, because I've only witnessed people doing it and haven't done any design with them myself, but you need to be a very particular kind of person to enjoy it, especially if you have no-one to do the layout for you.
Oh and you should think long and hard if you really want to go into this direction, it involves a lot of really hard and tedious work and is not glamorous at all. A tapeout might fail because someone accidentally checked a box in the last step before sending the design to the manufacturer, removing all blackbox pins on the edge of the design. Or someone might have though that it is a good idea to put a latch in the PLL reset path, which causes the clock to never turn on, which you only discover in the back annotated simulation 5 days before tapeout.
First off, everyone says Hennessey & Patterson and Patterson & Hennessey and while I think those books are worth reading at some point, for me they concentrate on things that I don’t care about (like what the cutting edge is) and gloss over the finer details of actually how the processor works.
I’ve found that Mano’s Computer System Architecture is great for the higher level stuff. I have the 2nd edition from 1982.
I like Hauck and DeHon’s Reconfigurable Computing from 2007 for FPGAs.
I like Hill and Peterson’s Digital Systems: Hardware Organization and Design from 1973 for describing the design programmatically using an RTL, in this case they use an APL derivative rather than the more recent (and horrible) VHDL or Verilog. This is a dense text and I’m still working my way through but it’s super awesome in my opinion.
I’ve been working through the Visual ARM1 animated transistor-level simulator and have made my way to Bryant’s 1984 paper A Switch-Level Model and Simulator for MOS Digital Systems and recursively reading what I need to understand it thoroughly. I have Mead & Conway on the way.
I also have a copy of Sedra & Smith (2nd Edition) for understanding the actual electrical circuits but I rarely reference it.
- http://www.righto.com/2015/12/reverse-engineering-arm1-ances... - http://daveshacks.blogspot.com/2015/12/inside-armv1-register...
Most university libraries should have copies of "Introduction to VLSI Systems" or similar on their shelves.
It's well written and provides some context to otherwise pretty dry textbooks.
There is quite a bit of difference between how an FPGA works and is programmed versus a totally custom chip. You could also take a look at reverse engineering walkthroughs eg Ken Shirrif has a few on his blog.
Nand2tetris is another good thing to look at.
Finally, reverse engineering the MOS6502: https://m.youtube.com/watch?v=fWqBmmPQP40
Then once you get that down/understood. I would recommend looking at the papers and literature regarding the topics of interest and common architectures and structures. See what optimizations have been tried. The optimization targets are generally performance, power and space.
Also with ASICs the standard cell libraries make things much easier since generally they are characterized pretty well. If you have the funds to make an ASIC that is. Still because that you spend most your time just verifying and testing your designs.
-EDIT-
If your thinking custom analog circuits your going to have to learn a lot more. Starting with circuit fundamentals, but your also going to need solid understanding of semiconductor physics. There is also the problem that outside simulation testing ideas/designs is quite expensive. Unless what you have is something that could be constructed out of discrete components. So unless you got a company or university backing you it's unlikely you would be able to make any physical prototypes. Although prices have been getting cheaper for older processes, and there are services like MOSIS.
This is a very entry level book that covers a huge number of topics well and will serve as a launching point to more specific topics. It starts with basic transistors and works up through Op-amp design and digital VLSI touching on filter theory and clocks along the way.
Alternatively if you are interested in designing custom circuits which are merely used as accelerators then you could start off with an FPGA and a RISC V core to which you add your own designs.
Given your goal, your best bet is to buy an FPGA development board and learn an HDL (Verilog or VHDL), and start experimenting.
When you to deeper in the field and more over to ASICs, then you would have to learn the details of synthesis, placement, routing, DFT (design for test) and a whole bunch of other details, which usually exceeds the willpower of a hobbyist :-)
And then if you want to really go all the way into the latest and fastest transistor nodes, then you go into custom circuit design and custom gate layout, which is not fun at all.
[1] https://www.xilinx.com/products/boards-and-kits/arty.html
But Altera works equally well and feels much more natural to me!
Their entire toolchain is very unix-like, which can be seen from an example Makefile like [1] and I had no problems until now to move projects etc. from Windows to Linux and back.
Whereas for Xilinx there have to exist tools like [2] or [3] to be able to build your project on the console and I won't start with the problems I've had with moving projects around or the Xilinx Platform Cable under Linux which ended up in me doing only remote ILA'ing via a Windows box (at least that works w/o a problem).
Unfortunately since Intel bought Altera it seems that they are pulling more and more out of the normal FPGA market, which can make it harder to get support.
Regarding the free tooling, Altera also provides a "Quartus Lite" version which brings you basically the same feature-set than the Xilinx WebPack, for the Altera world.
The Altera toolchain is unfortunately harder bound to SuSe or Redhat than the one of Xilinx.
I haven't worked with lattice yet, but e.g. [4] looks super promising and their toolchain is said to be very linux friendly as well.
[1] https://github.com/cferr/dsp/blob/master/quartus/Makefile
[2] https://github.com/cambridgehackers/fpgamake
[3] https://github.com/slaclab/ruckus
[4] https://www.crowdsupply.com/1bitsquared/icebreaker-fpga
Edit formatting
https://blog.digilentinc.com/teaching-computer-architecture-...
The boards are from Digilent, whose "Analog Discovery 2" and "Digital Discovery" multi-tools are extremely useful for learning Embedded Systems Programming.
"Digital Circuit Design for Computer Science Students: An Introductory Textbook"
It is different from other standard texts and well worth studying.
Boolean Logic & Logic Gates: Crash Course Computer Science #3
https://www.youtube.com/watch?v=gI-qXk7XojA
It's a nice, simple, easily watchable and highly visual overview of what you're going to start learning.
From there, it's virtually guaranteed that YouTube will suggest more relevant videos, and you'll be on your way.
Then later, you might want some books on "Digital Logic" (that's the keyword to search for).
To go up from that level of abstraction, I recommend "The Personal Computer from the Inside Out: The Programmer's Guide to Low-Level PC Hardware and Software (3rd Edition)" By Murray Sargent III and Richard L. Shoemaker: https://www.amazon.com/gp/product/0201626462
To learn Assembly Language: Randall Hyde's Art Of Assembly Language http://www.plantation-productions.com/Webster/www.artofasm.c...
To learn Compilers: Compiler Construction, by Niklaus Wirth http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf
Let's Build A Compiler, Jack W. Crenshaw & Marco van de Voort: https://www.stack.nl/~marcov/compiler.pdf
A Small C Compiler, by James E. Hendrix (sorry, this one is behind a pay/registration wall) https://www.scribd.com/document/289762150/Small-C-compiler-v... https://en.wikipedia.org/wiki/Small-C
Tiny C Compiler https://bellard.org/tcc/
Wikipedia articles related to compilers: Compilers, General: https://en.wikipedia.org/wiki/Compiler BNF: https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form Shunting Yard Algorithm: https://en.wikipedia.org/wiki/Shunting-yard_algorithm Parse Trees: https://en.wikipedia.org/wiki/Parse_tree
Here's a great way to visually explore how various compilers create assembly language instructions: https://godbolt.org/
Up the abstraction level from all of that is LISP and LISPlike languages, Tensorflow, ML, and related high-level abstractions -- but you probably are more aware of those than the lower levels...
Anyway, good luck! It's a wonderful journey to undertake!