Machine Learning (ML):

ML is a particular subset of AI. ML itself has many branches. One such particular algorithmic approach of machine learning is called artificial neural networks (ANN) which was loosely based on how human brains work. In this section, we'll learn very basic concepts of ML.

 

 

 

Maths:

This section deals with basic maths.

I've divided Maths section into multiple parts. I'll mostly be discussing maths curriculum as it's organized in USA schools and universities. USA schools have grades from Kindergarten (KG) to Grade1 (i.e class 1 in India) to Grade 12 (i.e class 12 in India). Then after grade 12, you go to colleges of your choice.

Best place to learn school level Maths is from www.khanacademy.org

It's free as it's non profit, and has videos which are very easy for kids to understand. It's one of the best resources for any educative material.

Then there is this wonderful fun website to learn everything related to Maths: https://www.mathsisfun.com/

One more website with lots of free sample exercise and theory is: https://www.math-only-math.com/

Other website similar to math-only-math with lots of practice questions is: https://www.mathopolis.com/questions/course.php

Interesting Maths Questions:

This is a list of very elegant Maths question, kind of which don't require anything more than elementary or basic high school Maths. These are the types asked in Maths Olympiad:

  • Finding radius of a semicircle inside a right angled triangle: https://www.youtube.com/watch?v=_o79ngJ0TI4
    • Soln: on link above
  • Find the number of distinct pairs of integers (x,y) such that 0<x<y √1984 = √x + √y.
    • Soln: 1984=16*4*31. So, √1984 = 8*√31. So,  8*√31 =  √x + √y => 8*√31-√x = √y => sq both sides => 1984 - x - 16√(31*x) = y => 16√(31*x) = 1984 - x - y => So, RHS is integer as all numbers are integers, so, LHS also need to be an itger. That means (31*x) needs to be a perfect sq root. => x=31*a^2 where a is an integer. Possible values of a=1,2,
    • x=31,31*4,31*9,31*16,31*25,31*36,31*49 => √x=1*√31,2*√31,3*√31,4*√31,5*√31,6*√31,7*√31
    • y=31*49,31*36,31*25,31*16,31*9,31*4,31 =>  √y=7*√31,6*√31,5*√31,4*√31,3*√31,2*√31,1*√31
  • Elementary School Q:
    • Averages: Find the avg speed of a person who drives from Austin to Dallas at a speed of 40mph and drives back at 60 mph. It's not 50mph as avg speed = total distance/ total time. Avg of total is not the avg of partials. Answer = 48mph.
    • Area: given area of circle is pi*R^2, could you find the circumference. Or given Circumference=2*pi*R, find formula for it's area. Trick is to cut circle into small triangles (From the center to the edge forming a very narrow isosceles triangle), and make a rectangle out of it, the length of which is pi*R and width is R, so area=L*W=pi*R*R=pi*R^2 
  • Middle School Q:
    • The eqn of straight line is y=mx+c. So why is x=a a straight line, as it doesn't fit the straight line eqn. Answer => It does fit straight line eqn if we take m=-c/a (-ve sign since slope is b/w points (0,c) and (a,0) which gives (c-0)/(0-a)=c/-a). Now we substitute for m, and then take limit of c approaching to ∞. We get x=a. The problem of why it doesn't seem to fit the eqn is because both m and c are ∞.
    • 2 cars at s distance of 200 miles, travel towards each other, one at 40mph and the other at 60mph. A bid travels at 50mph starts from the 1st car, flies towards the 2nd car, as soon as it touches 2nd car, it flies back to 1st car and so on, until the cars collide.What is the total distance covered by the bird? => It's total time * speed of bird = 50mph*2hr = 100 miles
  • High School Q: This appeared as Problem 25 in AMC 8, 2015. I've generalized it as follows: Given a sq of length n, one cuts squares of length "m" from each corner. What's the max square that can be fit in remaining area?
    • There are various ways to solve it. the question is not hard. However, there is one solution which is a one line solution and really smart. See link:
    • Solution 2 (Contest Soln) is the smartest way to solve it. Area will be n*(n-2*m). To convince ourselves, we can also solve it other way, where we find the ratio of sides of the 2 similar triangles that will form the side of the new square that can fit in. Once we find the ratios, it's easy to solve. But this will be a longer soln.

  

Modulo questions:

Modulo questions are very popular in Maths olympiad, because they involve applying a new trick to solve such problems. A very interesting set of modulo questions is finding "n mod m" where n and m are some integers. You have to apply some basic pattern finding skill to solve such problems. These are easier, and that is why I'll tackle these :)

ex: Find 2^101 mod 5 => Here we try to find repeating pattern. Let's try few values of n=1,2,3,....

n 2^n ones digit 2^n mod 5
1 2 2 2
2 4 4 4
3 8 8 3
4 16 6 1
5 32 2 2
6 64 4 4
7 128 8 3
8 256 6 1

From above table, we see that ones digit can only be 2,4,8,6. Since mod 5 will only depend on ones digit, we can ignore other digits as tens, hundreds, etc. The ones digit follows a pattern as follows:

For any whole number k=0,1,2,3...

when n=4k (i.e n=4,8,12,...) => ones digit=6, so 2^n mod 5 = 1 (exclude k=0)

when n=4k+1 (i.e n=1,5,9,...) => ones digit=2, so 2^n mod 5 = 2

when n=4k+2 (i.e n=2,6,10,...) => ones digit=4, so 2^n mod 5 = 4

when n=4k+3 (i.e n=3,7,11,...) => ones digit=8, so 2^n mod 5 = 3

Since 101 is of form 4k+1 => 2^101 mod 5 = 2

 


 

Interesting Maths Tricks:

Some of these tricks will look like magic even to sophisticated Maths folks. A lot of them here: https://puzzling.stackexchange.com

  • A five card trick (aka Fitch Cheney trick): Alice and Bob perform a magic as a team. Alice shuffled a pack of cards, and then asked someone from Audience (Charlie) to pick 5 cards out of this pack.  Charlie looks at 5 cards and returns the 5 cards back to Alice. Alice hands over 4 cards to Bob, and 1 card back to Charlie. Bob looks at the 4 cards, looks at Charlie and then is able to tell which card Cjharlie is holding. This looks impossible, as there are 52 random cards, and figuring 1 out of 48 based on 4 cards is just insane. However, the trick is in arranging the 4 cards in a pattern, and then using that pattern to figure out the 5th card. To narrow down the choice to 1 unique card, Alice also uses fixed algo to decide which card to return back. This all works out to give a unique card that is always returned back. Details here: https://puzzling.stackexchange.com/questions/6569/a-five-card-trick-how-does-it-work

 


 

Biology:

This section deals with Biology, which is basically study of all forms of life. The first place to start learning about life is our own human body.

We'll learn about Human body as well as about forms of life. A good deal will be spent on human cells, as they are the power house and the building blocks of human body.

Then we'll learn about all human parts.

We'll also briefly cover other forms of life.

MCAT (Medical College Admission Test) =>  MCAT is a standardized test administered by the Association of American Medical Colleges (AAMC). This is to get into a medical school when graduating from a 4 year College. Students take it in their Junior or Senior year of college. The topics covered in MCAT are in general advanced concepts in Biology, Physics, Chemistry, etc and are a good starting point for anyone wanting to get into details, and not just superficial knowledge.

Khan Academy (KA) MCAT link => https://www.khanacademy.org/test-prep/mcat

Biology AP Course: Full AP Biology course taught in High Schools is again very nicely covered on Khan Academy. It has a lot of overlap with topics under MCAT, but the AP course is more basic than MCAT course. High Schools also offer "Biology Honors" which is more basic than AP course, and I would recommend to do AP Biology instead of Honors Biology to get better understanding.

KA AP Biology link=> https://www.khanacademy.org/science/ap-biology

I've also included notes from Biology High School Course. This is a Honors Biology course, so the material is much more basic.

  1. Basics of Life => talks about very basic concepts:  Unit 1 => Chemistry of Life
    1. Human body is mostly composed of C,H and O (carbohydrates). oxygen=65%, carbon=20%, hydrogen=10%, Nitrogen=3% (by weight). In earth's crust, 50% is oxygen, 25% is silicon, with miniscule amounts of C, H and N. So, basically our body is made up of same elements that are found in earth's crust. It's just that the molecules they form from these are different in living beings, than what is there in non living things.
    2. Water is a polar molecule (with oxygen being slightly -ve charged, and hyrdogen being slightly +ve charged). So, water causes ionic compounds or polar solutes to dissociate by breaking their bonds. Most chemical reactions in our body takes place in the watery environment in our cells.
  2. Biomolecules => These are biological molecules, or molecules that make life. Khan Academy video on biomolecules => https://www.youtube.com/watch?v=j5VA6YrqTNs
    1. Organic compounds are carbon containing compounds. A monomer is small such unit of compound, while polymer are many such units/molecules connected together. Macro molecules (macro means large) are even larger polymers made up of more parts. Biomolecules are the macromolecules of these organic compounds and are the ones that eventually make cells of living things. Biomolecules are divided into 4 groups and all 4 are required in all living organisms.
      1. Carbohydrates (carbs) => They contain C,H,O. There is 1 carbon atom for every water molecule (H2O). So, formula is Cn(H2O)n or CnH2nOn. This composition gives carbohydrates their name: they are made up of carbon (carbo-) plus water (-hydrate). Carbs are used by mitochondria in cells to generate immediate energy or can be stored for later use. Carbohydrate chains come in different lengths, and biologically important carbohydrates belong to three categories: monosaccharides, disaccharides, and polysaccharides. Saccharides are sugar (CHO in ring form). Momo, di and poly refer to 1, 2 or many of such rings connected to each other. All saccharides end in -ose meaning sugar.
        1. Monosaccharides (mono- = “one”; sacchar- = “sugar”) are simple sugars, the most common of which is glucose. Monosaccharides typically contain three to seven carbon atoms.
          1. Common monosaccharide: One important monosaccharide is glucose, a six-carbon sugar with the formula C6H12O6. Other common monosaccharides include galactose (which forms part of lactose, the sugar found in milk) and fructose (found in fruit). All 3 are the simplest forms of carbs, and are isomers. Glucose and galactose are stereoisomers of each other (differing only in 3D orientation), while Fructose is a structural isomer of glucose and galactose, meaning that its atoms are actually bonded together in a different order. Glucose is broken down into H2O and CO2 by taking O2 as additional input, and generating energy in the process (in form of ATP). All other forms of carbs will need to be broken down into glucose before it can be used by cell to generate energy.
        2. Disaccharides (di- = “two”) form when two monosaccharides join together via a dehydration reaction (see below). In this process, the hydroxyl group of one monosaccharide combines with the hydrogen of another, releasing a molecule of water and forming a covalent bond known as a glycosidic linkage.
          1. Common disaccharides: include lactose, maltose, and sucrose. Lactose is a disaccharide consisting of glucose and galactose and is found naturally in milk. Many people can't digest lactose as adults, resulting in lactose intolerance (which you or your friends may be all too familiar with). Maltose, or malt sugar, is a disaccharide made up of two glucose molecules. The most common disaccharide is sucrose (table sugar), which is made of glucose and fructose.
        3. Polysaccharide (poly- = “many” is a  long chain of monosaccharides linked by glycosidic bonds. Polysaccharides are used for storing energy as well as for providing structure
          1. Common polysaccharides: Starch, glycogen, cellulose, and chitin are some major examples of polysaccharides important in living organisms.
            1. Starch: is the stored form of sugars in plants and is made up of a mixture of two polysaccharides, amylose and amylopectin (both polymers of glucose). Plants are able to synthesize glucose using light energy gathered in photosynthesis, and the excess glucose, beyond the plant’s immediate energy needs, is stored as starch in different plant parts, including roots and seeds. The starch in the seeds provides food for the embryo as it germinates and can also serve as a food source for humans and animals, who will break it down into glucose monomers using digestive enzymes. Starch usually has a branched structure.
            2. Glycogen: is the storage form of glucose in humans and other vertebrates (as opposed to Starch which is stored energy in plants). Like starch, glycogen is a polymer of glucose monomers. Glycogen is usually stored in liver and muscle cells. Whenever blood glucose levels decrease, glycogen is broken down via hydrolysis to release glucose monomers that cells can absorb and use.
            3. Cellulose, is the structural form of glucose and is a major component of plant cell walls, which are rigid structures that enclose the cells (and help make lettuce and other veggies crunchy). Wood and paper are mostly made of cellulose, and cellulose itself is made up of unbranched chains of glucose monomers linked by glycosidic bonds (straight rigid structure). The β glycosidic linkages in cellulose can't be broken by human digestive enzymes, so humans are not able to digest cellulose. (That’s not to say that cellulose isn’t found in our diets, it just passes through us as undigested, insoluble fiber.) However, some herbivores, such as cows, koalas, buffalos, and horses, have specialized microbes that help them process cellulose. Cellulose is the most abundant organic material on earth (as it's found in all plants), and still we can't digest it !!
            4. Chitin: is similar to cellulose in that the chains are long rigid structure. They are found in animal's shells/wings, exoskeleton of insects,  etc to provide rigidity.
      2. Lipids (Fats) => They also contain C,H,O, (similar to carbs) but end up creating different compounds. They may sometimes contain P. Lipids are not strictly macromolecules as they are not polymers, and are much smaller than other 3 biomolecules. Lipids are nonpolar and so insoluble in water. Lipds are long term energy source, which are stored in body. Ex: Triglyceride. Cell membranes are made of lipids. Lipids create waxy covering for moisture retention. Lipids also provide insulation to keep body warm. Lipids don't have true monomers, and instead are long chains of C and H. They mainly use Fatty acid and glycerol to form long chains.
        1. Fatty Acids: These are long chain of C and H. They can be considered as a base unit which attach to others. Fatty acids can be of 2 types depending on carbon bond.
          1. Saturated Fatty acid: Carbon atoms with single bonds b/w them (single covalent bond with each other) form a straight chain and are called Saturated,
          2. Unsaturated Fatty acid: Carbon atoms with double bonds b/w them causes a bend anyhwere there is a double bond and are called unsaturated. Double bonds have a bend, so they can't be nicely stacked on top of each other. That is why saturated fat (like butter) are solid at room temp as they have saturated carbon bonds, while unsaturated fat (like oil) is liquid at room temp.
        2. Triglyceride. It's a lipid which is long term energy source for animals. It's formed by dehydration synthesis of 1 glycerol with 3 fatty acids. Glycerol has formula C3H8O3.
        3. Phospholipd: It is used to make cell membrane. It consists of 2 fatty acids, 1 glycerol and 1 Phosphate group (PO4 -ve) . Each phospholipd molecule has a head (made of Phosphate) and 2 tails (made of fatty acids). Heads have Phosphate group and so are hydrophilic (water loving as polar). Tails are hydrophobic (water hating as fatty acids are non polar). The 2 tails are different = one is saturated forming straight chain, while other is unsaturated forming bent chain. These helps the structure to be flexible. These phospholipid molecules go together in pair with the tails connecting to each other and the heads exposed (one to the outside of cell and other to the inside of cell, both have watery environment so this helps as the heads are hydrophilic). This is called phospholipd Bilayer. The bent structure of one of the tails keeps membrane fluid and flexible. More details under cells section.
        4. Steroid lipid: Chloesterol is a steroid lipd. Steroid hormones regulate functions in body (ex: testosterone)
      3. Proteins => They contain N in addition to C,H,O. They sometimes contain S too. Proteins provide structural support. They build up bones, muscles, hairs, nails, etc. They are also present in cell membrane as Transport proteins. Simplest unit of proteins are amino acids, which is a monomer.
        1. Amino Acids (monomer): In amino acids, there's always a central carbon attached to hydrogen, which is called alpha carbon. On the left of this we have an amine group (NH2), while to the right, we have an carboxyl group (COOH). Another carbon group attached to the bottom of alpha carbon is different for different amino aids, and is called R-group. There are 20 essential amino acids that our body needs. Glycine is the simplest Amino Acid and has just a single H in the R group.
        2. Polypeptides (polymer): These amino acids are stitched together to form proteins by forming bonds called as peptide bonds. The polymers formed are called polypeptides. These bonds are formed by "Dehydraton synthesis" and involves removal of H from NH2 and OH from COOH. There are 4 layers of structures that proteins may have:
          1. Primary: The linear structure formed by stitching of amino acids is called Primary structure. It may contain 100's of diff amino acids stitched together. It's NOT a functional protein, as it needs to be folded into a definite structure to become a functional protein. Exception: insulin (it regulates blood sugar). Even though Primary st don't form protein, insulin is an exception
          2. Secondary: Primary st folds into helices (spiral structure) and is called a secondary structure. The spiral structure comes due to Hydrogen bonds formed between different amino acids (between H of NH2 and O of C=O,OH), which helps it get that shape and maintain it.There are 2 possible st here => The alpha helix and the beta pleated sheet.
          3. Tertiary: 3 of these secondary structure combine together to form tertiary structure, which becomes a functional Protein. Lots of interactions happen to make this Functional protein. It has more bonds than just H bonds to give this 3D shape of protein.
          4. Quarternary: If a protein has more than 1 polypeptide chain, the way they are arranged is it's quarternary st. In collagen, we have 3 of these polypeptide chains combine, while in hemoglobin, we have 4 of the secondary structure combine to form a Quarternary protein.
        3. Enzymes: These are proteins that help speed up metabolic reactions. Enzymes lower the activation energy needed for any reaction. Enzymes end in -ase, ex: lipase. Enzymes don't get used up. They act on the substrate only if the substrate fits the active site of enzyme perfectly. Active site s the area of an enzyme that binds to the substrate during the reaction. Each enzyme's active site has a shape that is specific to only that type of substrate, so that that enzyme can only act on that substrate and nothing else. This is like a key-lock mechanism, where there is only 1 key for a given lock, where enzyme is the lock and substrate is the key. There may be multiple active sites in a given enzyme, meaning it can act on multiple substrates, but each site is specific to only 1 type of substrate.
          1. Enzymes can either break substrate into parts (catabolic reaction), or it can make substrate combine into another molecule (anabolic reaction).
          2. Enzymes can both activate or inhibit a reaction. We saw how key-lock mechanism allows enzymes to speed up reaction for a given substrate. However, we may also have an antibiotic or another substrate bind to an active site so that the shape of the active site is altered. Then the original substrate on which this enzyme was supposed to act on, can no longer fit on the active site, and hence can no longer react. This inhibits the enzyme from working properly, and is called competitive inhibition. There may also be non competitive inhibition, where the new substrate binds to other active site on the enzyme, w/o interfering with the original active site (ex: cyanide poison)
          3. Denature is the changing of shape of active site of enzyme due to temperature, or pH of medium. This may cause the substrate to no longer fit in the active site, thus rendering the enzyme useless. This change is permanent. At a temperature of 40 degrees and a pH of 8, enzymes are most effective.
        4. Antibodies: Antibodies are proteins produced by immune system to neutralize foreign invaders as viruses. Antigens which are themselves proteins are an integral part of any virus. Virus use these antigens to attach to cell. Antibodies prevent this from happening by attaching to antigens, so that they are blocked and can't attach to cell anymore.
        5. Peptide hormones: are hormones made of proteins which act on the surface of target cells to send msg around the body. Ex: insulin.
      4. Nucleic acids => They contain P in addition to C,H,O, N. They are the most important ones as they instruct what happens inside our cells, and pass that hereditary info to offsprings, They are considered most fundamental macromolecules to life. These were first observed in Nucleus of cells, and are acidic in nature, that's where the name comes from. Khan academy link (intro to nucleic acids) => https://www.youtube.com/watch?v=hI4v7v8AdfI
        1. Nucleotides (monomer): Building blocks of Nucleic acids are called Nucleotides. It consists of a 5 carbon sugar (pentose sugar) ring in the center, with a phosphate on the left and a nitrogenous base (NB) on the right.  for:
        2. RNA (Ribonucleic acid): RNA molecules were the ones that evolved first and were unstable. The Phosphate group in one nucleotide attaches to carbon ring of another forming long chains. There are 4 kinds of NB that we have for RNA.
          1. Guanine (G):
          2. Adinine (A)
          3. Cytosine (C)
          4. Uracil (U):
        3. DNA (Deoxyribonucleic acid): DNA molecules eveolved from RNA molecules. They formed by combining 2 strands of RNA molecules via hydrogen bonds. This provided them stability. G always bonded with C via 3 hydrogen bonds, while A always bonded with T via 2 hydrogen bonds
          1. Guanine (G):
          2. Adinine (A)
          3. Cytosine (C)
          4. Thymine (T)
    2. 2 kinds of chemical reactions => make larger chains from smaller chains or vice versa
      1.  Dehydration Synthesis => here smaller units attach to form bigger units. It is also called condensation reaction. It generally requires energy (think of as building something like a house from bricks requires energy). Dehydration synthesis is where H and OH bonds at the ends of shorter polymer attach to each other releasing H2O and combining to form a larger polymer.
      2. Hydrolysis => here a larger polymer breaks into smaller polymers. -lysis means breaking, while hydro is water, so breaking by water is hdrolysis.  It's exactly reverse of Synthesis, where it needs H2O to form H and OH bonds at the ends of smaller polymer, and thus separates them. This process generally releases energy.

DFT: Design for Testatbility

Any chip that is fabricated is going to have some defects during fabrication, which will cause some of the transistors or wires on the chip to not function properly. This may cause the chip to fail. One way to check if the chip manufactured is good or not, is to run thru the same functional patterns on the chip pins that the chip is going to go thru when it's in operation.

For small chips this method may work, but for large chips, it's practically not feasible for 2 reasons. First, there may be billions of such possible patterns on chip pins that we may have to aplly, which is time prohibitive. Secondly, it may still not find out all bad devices or bad connections in chip, since those patterns may not target 100% of the chip devices.

Without having 100% check to test each and every transistor and each and every connection, we can never be sure if the chip being shipped is 100% functional or not. This is where DFT comes. DFT simply means adding extra logic on chip so as to allow us to test the whole chip. DFT is a broad field by itself, an you will usually see thousands of job postings just for DFT engineers.

In this section, we will go thru the basics of DFT,

 

ECO Flow in Synopsys Design Compiler (DC):

ECO can be done by using Synopsys DC to manually add/remove cells or wires by using DC cmds.

DC cmds for ECO:

In all of below cmds, we need to set current design using "current_design" cmd before running any of below cmds, since these cmds work on current design.

1. create_cell => Creates leaf or hierarchical cells in the current design or its subdesigns. The created cells are unplaced. To place them use "set_cell_location" cmd. cell can be removed by using cmd remove_cell.

ex: create_cell {mid1/cell1} my_lib/AND2 => creates a cell named cell1 under the subdesign corresponding to the mid1 cell. This new cell references lib cell my_lib/AND2. Ports on the reference determine the name, number, and direction of pins on the new cell. The actual reference library cell to be used is determined by the current link library settings (i.e not necessarily from my_lib). Reference cell is needed unless we are using "-logic 0" or "-logic 1"  which specifies cell is logic0 or logic1 cell (tie-off cells).

ex: create_cell eco121_inv [get_lib_cells */INV1_LVT] => creates leaf cell named "eco121_inv" which references INV1_LVT

2. create_net => Creates nets in the current design or its subdesign.

ex: create_net {eco121_net1 eco121_net2} => creates these 2 nets. By default, it creates signal net. To create power or ground net, use option -power or -ground

3. create_port => Creates ports in the current design or its subdesign. Default direction for port is "in" or input port (possible values are in, out, inout)

ex: create_port -direction "out" {A1 A2 A3 A4} => creates 4 o/p ports

4. disconnect_net => it breaks the connections between a net or a net instance and its pins or ports. The net, pins, and ports are not removed.

ex: disconnect_net NET0 [get_pins U1/A] => Disconnectes net 'NET0' from pin 'U1/A'.

ex: disconnect_net MY_NET_1 -all => -all option causes all pins and ports connected to this net to be disconnected.

5. connect_net => Connects the specified net to the specified pins or ports. There are 2 rules for connect_net cmd to work:

  1. Connection can't be done across hierarchical bdry. The net can be at any level of hierarchy (by providing full hier of the net) but the pins or ports must be at the same level.Since ports are only at top level, that implies that to connect to ports, your net has to be at top level.
  2. You can't connect net to a pin/port that is already connected. I believe this is because the net will get connected to another net with different name, i.e same net with 2 different names. You should first disconnect existing net from the pin/port, and then connect to your new net. NOTE: A net can be connected to many pins or ports; however, you cannot connect a pin or port to more than one net.

syntax: connect_net  <net_name> <pins_or_ports_list>

ex: connect_net  [get_net net_eco1] [get_pin eco1_and_gate/A*] => connects net to i/p pins (A1 and A2) of and gate

6. connect_pin => Connects pins or ports at any level of hierarchy. This cmd can punch thru ports automatically across hier (make new ports and nets in submodules if needed), so useful since "connect_pin" cmd doesn't allow the pin or port to be at different hier. New nets are created to make connections. Name of new net is name of connecting port or new name is generated.

NOTE: This cmd is avilable in DC, but NOT in PT.

ex: connect_pin -from [get_pins U1/Z] -to [get_pins mid1/bot1/U3/A] => connects specified pins.

ex: connect_pin -from [get_pins U1/Z] -to [get_pins mod1/U2/A]  -port_name mod1_port1 => creates a port named mod1_port1 on "mod1" module, and connects the o/p and i/p pins they this port

 

ECO flow:

Above 6 cmds used extensively during ECO process. To view and make sure that all connections are as intended, we can use following cmds to help us view connections:

Finding all connections on a net => To display pins and ports on a net, use either the all_connected or get_nets -of $net command. This is needed when doing connect/disconnect nets for an eco, as many times it's not easy to see all the places the net is connected to. So, connect/disconnect cmds may leave nets in incorrect state. "report_net -connections" and "report_cell -connections" are also useful cmds to view connections.

Finding pins/nets of objects => Sometimes, we may not want to put exact net name connected to pin of a gate in eco script, as name of that net may be prone to change from netlist to netlist. Also, sometimes it may just be too time consuming trying to find net name connected to some cell by tracing the netlist. In such cases, it's easier to use get_net cmd with -of_objects option, i.e "get_net -of_objects mod1/cell1/A1". This will give the net name correctly all the times, so can be used in eco.tcl script below, instead of using "get_net mod1/net1".

Below is a sample of cmds that can be added to a tcl file to be sourced in DC.

ex: eco.tcl: Adds an inverter to flop i/p

current_design mod1
create_cell         eco_inv_I0 [get_lib_cells */INV_D1]
create_net         eco_net1_bar


connect_net      [get_net -of [get_pin my_reg/D]]   [get_pin eco_inv_I0/A] #connect net from i/p pin of flop to i/p pin of new inverter

disconnect_net  [get_net -of [get_pin my_reg/D]]  [get_pin my_reg/D]      #now disconnect net from i/p pin of flop. Thus D pin to net connection is broken. This disconnect needs to come to come after connect cmd above, order can't be reversed.
connect_net      [get_net eco_net1_bar]         [get_pin eco_inv_I0/Y]        #connect o/p pin of new inverter to new net
connect_net      [get_net eco_net1_bar]         [get_pin my_reg/D]            #now connect this new net to i/p pin of flop