To start - if you haven't heard of it please go check out the Tiny Tapeout project. It's a phenomenal project that has allowed me, an undergrad, to tape out my own ASIC twice without any funding or supervision from my university. Now on to the project!
Around February this year I noticed that the next Tiny Tapeout shuttle (Tiny Tapeout 6) was going to be the first to support analog designs. Having spent the last year working as an analog design intern - I knew I needed to submit something. Fast forward to April I still didn't have a solid idea - with about a week and a half before the deadline I settled on a distortion pedal and got to work!
A few months into my job as an analog intern I fell into the world of guitar pedals - I quickly realized that the circuits we used at work to process signals were the same circuits as popular guitar effects!
As I was thinking about what I wanted to tapeout I decided I wanted to work on an opamp - I have seen them used in just about every circuit I've worked on and having done a lot of layout but not much schematic design I decided it would be a good place to start. I also wanted the ASIC I tapeout to be useful to me - so why not make a distortion pedal? I figured even if the circuit doesn't work as expected if the output signal is different from the input signal in some way, it should sound interesting and I can count it a success.
I had no idea where to start - I know an operational amplifier begins with a differential pair, and I've copied other designs on breadboards using discrete transistors, but where to start when designing my own? I decided to start with the opamp chapter of Design of Analog CMOS Integrated Circuits by Behzad Razavi. After reading this I had a better idea of what I was trying to do - this should be possible! I then watched Ali Hajimiri's lecture on opamp design. Both Razavi and Hajimiri provided an example of what they called the simplest opamp - this is what I decided to tapeout.
After finishing the schematic I decided it was time to put together the layout - most of my experience until now had been on full custom layout in 12nm and 7nm technodes - so the layout of an opamp in a 130nm technode should be easy right? Not quite - learning to work in Magic VLSI was more of a struggle than I expected, but it's not like the paid software is any more intuitive.
Putting together the layout actually wasn't that bad - I did notice when looking through tutorials done in the SKY130 technode that the choices I made in my layout are a little unusual, so I'll try and explain them here:
Why so many fingers? In most SKY130 layouts I've seen the transistors are single fingered devices with guard rings - I didn't do this. My devices are split between many fingers - this is to keep devices smaller. Larger devices are more prone to manufacturing variations that can break a circuit, as a result wider devices can be split into multiple smaller fingers.
Why do I see fewer banks of fingers than transistors in the circuit? In the opamp design I am implementing the transistors in the differential pair and the current mirrors need to be matched - meaning they have to have the exact same, or the correct ratio of widths. To ensure this fingers from these devices are interleaved with each other. This ensures that should some manufacturing variation impact only half of a bank of transistors it will impact each of the transistors in a matched pair evenly - and hopefully allow the opamp to continue to function.
Okay, but why are the fingers on the edge of the banks of transistors shorted? You may have noticed the sources, drains, and gates of the transistors on the ends are shorted to power and ground - this is because these are dummy devices. When you have a bank of fingers the ones on the edge are most prone to manufacturing variations, so it is common practice to put dummy devices on the edges as sacrificial devices so that should the devices on the edges become damaged, the critical devices will not be damaged and the opamp will continue to function.
Most of the design choices I made above are important when designing circuits that yield. When a chip is manufactured at scale not every chip is perfect, a wide variety of manufacturing variations may occur. Designing circuits that yield is the art of maximizing the number usable chips in spite of these variations. In other words - these design choices probably aren't important for a one-off distortion pedal submitted to Tiny Tapeout.
Uh oh... that doesn't look like it should. Like at all? Where's my output? I spent an unfortunate amount of time on this problem. I went through everything, of course my first thought was that there was some problem with my design, but it worked in schematic so that shouldn't be it. Then I questioned everything I thought I knew about layout, but that wasn't it, turns out my layout was fine.
The real problem is that Xschem tends to rearrange pins in the netlist it generates when running simulations with an extracted view so the circuit wasn't being hooked up to the test bench properly. The fix is easy, just open the netlist and manually change the order of the pins. You can see the opamp actually works just fine! And just as well as the schematic too - that's a surprise! I am used to working in smaller technodes where your gain is halved when simulating the extracted view.
Now that I have an opamp - it's time to come up with a distortion pedal circuit. I spent a bunch of time looking at different circuits but ultimately decided I didn't think any would work particularly well in an integrated circuit so I decided to come up with my own. The premise of a distortion pedal is simple - all you need to do is operate an amplifier outside of its acceptable range so that the output distorts. Most distortion pedals also have some kind of control on them that allow you to tune the amount of distortion - so my circuit needs to have some kind of control.
In the end I decided on a very simple circuit - cascaded opamps. I ended up with 8 opamps in series each with a pair of transmission gates that allowed me to select between either the output of the opamp or the input. This means I can use the digital inputs to select how many opamps I want on at a time - which will determine how much my signal distorts.
I placed the first opamp in the chain in a unity gain configuration - this is so we can turn off distortion in the pedal completely without attenuating the signal too much. The rest are in a non-inverting amplifier configuration set to have about 4dB of gain each.
Now that I have an idea for the final circuit - I need to build it in layout. The first step is to make a transmission gate, this process was pretty easy! Then I needed to build a distortion "unit" - essentially just the opamp and transmission gates with pins and power sorted out between them so that I could then copy and paste this unit 8 times over in the final design. Once the distortion unit instance was done I placed 8 of them in the Tiny Tapeout Template and hooked them up according to my schematic. Now it's time to extract and see if it works!
Once my layout was done I extracted it and simulated it and it worked surprisingly well! You can see the 8 control pins being turned on and as they are turned on the sine wave on the input becoming more and more distorted (in this case, more square). By the end the signal is already so distorted the last two stages don't do much, I left them in as an experiment to see if this is also the case when the chip is manufactured, or if even if we don't see much in the simulation we can still hear a difference in the sound of the output. It will be interesting for sure!
Now that the design is done it is time to submit it! This should be easy right? Wrong - I ran into all kinds of problems. Probably the most frustrating was that upon submission of my design I realized that Magic generates some layers based on the layers I drew - and some of the layers it generated violated the SKY130 DRC. Luckily this was a pretty easy fix - but I would advise against super dense designs unless you have a lot of time for trial and error because this little surprise could have been a lot worse! After a few more issues, and some help from the Tiny Tapeout team my design was submitted and is now in being manufactured. The current estimate for when I will get the chip back is sometime in November - so I will be back to write a testing section around then. If you want to see my submission - you can check out the github repository .
I made use of a lot of different resources for the information I needed to tapeout my design - I tried to summarize them all below:
Tiny Tapeout - The Tiny Tapeout team have put together an excellent set of resources, and are the reason I was able to tapeout in the first place! Definitely check out their website, Matt's courses, and their discord server. None of this would have been possible without them.
Design of Analog CMOS Integrated Circuits - A phenomenal analog design textbook written by Behzad Razavi. This book is the one I have been recommended the most by more experienced designers. I have found it very helpful!
The Stomp Box Cookbook - This is an excellent book by Nicholas Boscorelli. It was perfect for my unusual situation of wanting to learn how a wide range of guitar effects pedals work, but already having a decent foundation in analog electronics.
Ali Hajimiri's Youtube Channel - Professor Ali Hajimiri from Caltech has posted a series of analog design lectures on his youtube channel, I learned quite a bit from his videos on opamp design.
Bminch's Youtube Channel - Bminch's youtube channel has an excellent set of videos that teach the open source silicon design tool chain I used for my project.