Introduction
This tutorial will guide you through the process of creating a schematic in YCircuit. It assumes that you have YCircuit set up and are able to run
python top.py
from the YCircuit directory without errors. If you are unable to do this, please go back to the installation instructions and make sure you’ve followed them correctly.
Alternatively, make sure you have downloaded the appropriate binary zip file for your OS and are able to run the executable within that folder.
Navigation
Once you start the program, you should be able to see the grid. The grid is an extremely useful tool that serves to align and structure your schematic. You can toggle the grid on and off by pressing G
. By default, the mouse pointer’s position will snap to grid locations. You can turn this off from the View menu and then “Snap to grid” (Alt+V -> A
).
Navigation is primarily performed using the mouse. This tutorial assumes that you have a mouse with a scroll wheel (a trackpad with a scroll up/down gesture should also work). For anyone who has used Cadence’s Virtuoso Schematic editor, the navigation should feel natural. Scrolling with the mouse wheel zooms the schematic in and out - scroll up for zooming in and scroll down for zooming out. It is worth noting that the zooming is centered on the cursor’s current position. Holding down the Ctrl
key while scrolling will cause the view to pan horizontally while holding down the Shift
key while scrolling will cause the view to pan vertically. You can change the modifier keys for zooming and panning from the Options window (Ctrl+P
).
The Esc
key is extremely useful and can be used to cancel most actions. Ctrl+Z
and Ctrl+Y
provide undo/redo functionality. While most of the menus can be navigated using the mouse, memorizing the mnemonic keyboard shortcuts can greatly speed up the drawing process.
Our first inverter
- We are now ready to start placing components. Let’s begin by placing down an NFET. There are two predefined variants of the NFET. There are 3 ways to access these variants:
- Through the Symbols menu followed by Transistors, N-type MOSFET, with/without arrow (
Alt+S -> T -> N -> A
). - Through the load symbols dialog in the file menu (
Ctrl+Shift+L
). This dialog shows you the standard symbols that come along with YCircuit as well as any custom symbols you may have created. Navigate to the standard symbols and choose the NFET symbol with/without arrow. - You can press
Ctrl+F
to jump to the search filter, typenfet
and pick the appropriate symbol from the symbol viewer on the left.
- Through the Symbols menu followed by Transistors, N-type MOSFET, with/without arrow (
- Once you have loaded the symbol, the symbol is attached to the mouse pointer at its origin point (defined while creating the symbol). The symbol follows the mouse pointer’s position but is locked to the grid. A left click on the mouse then places the symbol. Create a PFET symbol similarly and place it a little above the NFET symbol but in the same vertical line while leaving some space between the two.
-
The thick black squares part of the symbols are the “pins” on the symbol. These are used to indicate locations where wires can snap automatically and are defined when the symbol is created. You can toggle their visibility on and off from the View menu and “Show pins” (
Shift+P
). -
Use the Wire symbol from the symbol menu (
W
) to start drawing wires. A left click starts drawing wires from the location of the click. Wires always appear as a right angle pair (unless you move horizontally or vertically with the mouse). The x-y or y-x nature of the right angle can be changed by right clicking while drawing the wire. Left clicking confirms the drawing. Further drawing is paused until you left click at a new start position again.Note that wires automatically snap to the pins on the symbols. If you do not wish for this to happen, press
S
. You should now be able to place the wires freely anywhere on the grid. -
Draw a wire connecting the drains of the two transistors. Draw a wire from the middle of the wire you drew in the previous step outwards to the right. Notice how a dot gets added automatically at the location where the horizontal wire meets the vertical wire. The vertical wire also gets split into 2 wires where it meets the horizontal wire.
- Draw another wire connecting the gates of the two transistors and then one more wire extending out to the left.
- Load a ground symbol from the symbol menu (
Alt+S -> G
, or pick from the symbol viewer to the left) and place it at the source of the NFET. - Load a fixed voltage symbol from the symbol menu (or from the symbol viewer to the left) and place it at the source of the PFET.
-
Create a text box from the shape menu (
Alt+A -> T
) and click near the fixed voltage symbol you just created. A new dialog pops up with a box where you can input text. Here, type inV
then select the subscript symbol (or pressCtrl+_
) and typeDD
. You should now have a V_DD. Press OK (Ctrl+Enter
) to accept the text. -
If you are not happy with the location of the V_DD you just created, click and drag the text to the desired location. Alternatively, select it with the left click and select move from the edit menu (mapped to the
M
key). Left clicking once now starts moving the V_DD relative to the position you clicked. Left clicking again places it at the new location. Position the V_DD text above the fixed voltage symbol.Note: You are always free to change the font settings from the Edit menu (
Alt+E -> F
) including the font family and size. The defaults are set to Arial and 10 respectively.
-
Select the V_DD text and select copy from the edit menu (mapped to the
C
key). Again, select a reference point for the copy with a left click and place the copied object at its new position - near the output node. Double click on this newly copied V_DD which should open up the text box again. Now change the V_DD so that it reads V_out instead. -
Press
V
to paste the text copied to the clipboard from the previous step. Modify the text to read V_in and place it at the input node.Note: Pasting from the clipboard is not limited to just text. You can paste symbols and any arbitary objects from the clipboard across YCircuit windows open in the same session.
-
Save the schematic from the file menu (
Ctrl+S
) and title it asinverter.sch
. Now, when you select load schematic from the file menu (Ctrl+L
), you can see a preview of the schematic that you just saved!
- The final step of this tutorial is to export the schematic you created to a PNG file. Make sure to disable pin visibility (
Shift+P
) before you export or the pins will continue to show up in the exported image. Select export file from the file menu (Ctrl+E
), choose PNG files from the filter and title your fileinverter.png
. Your output should look something like this:
Congratulations! You have now created your very first schematic! Check out the tutorial on how to create and use your own custom symbols.