PT groups paths into different groups. There are PT that can group paths as per our choice.

Timing Paths:

Whenever we use a timing tool to report timing for all paths in design, the tool internally builds a graph of all paths. For purpose of STA, one path is defined as one that starts from a start_point and ends at a end_point. Start point is usually  i/p port or clk pin(of seq cell) and end point is usually o/p port or data pin(of seq cell). There may be other types of start/end points too, that we;ll discuss later. Once all such paths are identified, delays from combinatorial cells in b/w the path are put in the graph, and delays calculated for each path.

As discussed above, clk/data paths are most common paths that PT analyzes. These paths start at i/p port or clk pin(of seq cell) and end at o/p port or data pin(of seq cell). There are other kinds of paths too besides these clk/data paths. Pt analyzes 4 types of paths:

  • data path, 
  • clk path (thru Clk tree),
  • clk gating paths,
  • Async paths (on async set/reset pins of flops as recovery/removal checks).

NOTE: clk and data paths are combined for data setup/hold checks. So, in essence we have only 3 kind of paths when analyzing.

PT automatically creates path groups for these paths (each of these path groups have 2 path types: setup(max) and hold(min)):

  1. clk/data path (path group has the name of the clk associated with capture flop/latch, if there are multiple "create_clock" or "create_generated_clock" cmds, then separate path group created for each created/generated clock). Latch may be normal or SR latch. When considering check b/w set/reset pins (non-seq arc), the path group is assigned to the clk, which drives the end_point set/reset pin. Clk/data paths also have other path groups as flop_to_io, io_to_io and io_to_flop.
  2. clkgating paths (clk_gating_default for paths that end on combinational element used for clk gating, EN pin wrt clk)
  3. async paths (async_default for paths that end on asyn set/clr i/p of FF, checks for recovery/removal checks wrt clk). set/clr pins may be driven by o/p of flops, but they are still async wrt capturing clk.
  4. default paths (default) that don't fall into any category.
  5. none (unconstrained paths). => These paths do not have any timing requirement to meet (may be because they do not have any clocks at the end point). We should not have any unconstrained paths in design, except ones that we explicitly set as false path, etc. These are not really a path group.

PT group cmds:

1. path groups: These groups clk/data paths into different groups

group_path ( cmd added in sdc 1.7, cmd is named group_path and NOT path_group, keep that in mind) => As we saw above, there are 4 path groups created by default. These are "default", "clock_gating_default", "async_default" and then 1 path group for each separate clk. We can also have user defined path groups. These are created using group_path cmd. It's used in both synthesis tool and timing tool. In DC, these path groups affect design opt, as they affect max delay cost calculation. We can assign diff weights to each path groups to prioritize opt of one path group over another. In PT, we use it for reporting purpose. By default, PT report_timing reports worst path from each group, so this cmd gives us control over how we want these paths reported (report_timing -group allows us to report worst paths for only the group specified). We may use same sdc file from synthesis, but it's usually beneficial to create new path groups in PT solely for better reporting. Most of the times default path groups are good enough for reporting, so we don't use this cmd in PT (unless we have custom paths that we wan't to report separately).

NOTE: In PT, this cmd has no effect on paths and timing arcs, it's purely for reporting purposes.

syntax: group_path -name <group-name> -default <-options> => -name specifies name for the group and adds paths to that group (if group with that name doesn't exist, it creates a new group). If instead of providing -name, we provide -default, then the specified set of paths is removed from current group and moved to default group.  other options are:

-weight assigns a cost func weight to prioritize opt. Value can range from 0 to 100 (1.0 is the default). 0 implies no weight or equiv to removing the path from cost calc func. Useful only when used in Synthesis tool. This has no meaning in PT, but left in there, since usually same sdc file from synthesis gets used in PT.

-from, -through, -to with rise/fall options are allowed. These specify the paths passing thru these objects. (i.e -from A1 -through {B1 B2} -rise_throghh C1 -fall_to D1 => specifies path starting from A1, passing thru B1 or B2, -then rising thru C1 and fall ending at D1). If clocks are specified as -from objects then all paths with startpoint clocked by that clock are included in group. Similarly for clocks specified as -to objects,  all paths with endpoint clocked by that clock are included in group.

ex: group_path -name "grp1" -to {clk1 clk2} => groups all endpoints clocked by clk1 and clk2 into new grp called "grp1". These paths are removed from their default group of clk1 and clk2.

ex: group_path -from {I1 I2} -through {mod1/Y} -to {O1 O2} => groups all paths starting from I1,I2, going thru Y pin, and ending at O1,O2 into default path group (since name of group not provided, they are removed from existing group and put into default group}

NOTE: sometimes we may see that a path put in 1 path group, shows up in other path group. This may happen due to paths being put in multiple path groups, and some parts of the paths may overlap in multiple groups. In this case, PT cmd precedence criteria figures out to which path group that particular path should belong to. Look under "PT CMD PRECEDENCE" in "PT cmds" section.

report_path_group: report_path_group <pattern> -nosplit => reports all path groups with "weight, from, through and to" info for each path group. We will note following path groups: 1 clock_gating_default path group, 1 async_default path group, 1 default path group and then bunch of clk/data path groups associated with diff clks. These clk/data path groups have all paths in 1 group which have -to to that clk (i.e paths with capture clk named clk1 will be in path group clk1). There are also flop_to_io, io_to_flop and io_to_io paths which comprise of all remaining paths which either originate or end at IO ports. As with most synopsys cmds, we can provide an optional pattern and an optional -nosplit option (which prevents lines from spliting, so it's all in 1 line, makes it easy to be parsed by other scripts).

remove_path_group: remove_path_group <list>=> removes path groups specified in list. Each element in list is either  collection of path groups or a pattern matching path group names. ex: remove_path_group in2out => removes path group in2out and assigns it to default path group. NOTE: removed path group doesn't go back to where it came from, it just goes into the "default" bucket.

2. clock groups:

set_clock_groups (added in sdc 1.7):This cmd has real effect on timing, as it's a timing exception cmd. It's used heavily in PT to mass FP paths b/w multiple clocks. See in "primetime clock commands" section for details.

SPI and QSPI

 


 

SPI = Serial Peripheral interface. It is very popular 4 wire interface, and is supported in many tiny chips because of it's simplicity.

SPI has a master and slave. 

Master drives these 3 pins:

  • CLK
  • MOSI (Dataout pin) along with 
  • CSn (Chip Select pin) to select slave. We can multiple of these and pull only one of them low to have that particular slave drive the MISO pin (see below)

Slave drives this 1 pin:

  • MISO (Datain pin)

Wikipedia article with basics: https://en.wikipedia.org/wiki/Serial_Peripheral_Interface

SPI timing diagram with waveform => spi_diagram.jpg

 


 

QSPI: Quad SPI

A very good tutorial here: https://embeddedinventor.com/quad-spi-everything-you-need-to-know/

 


 

Jinja:

Jinja is template making module in Python. It's a template engine or template processor. that takes a template and processes it to produce documents. We can specify various fields of template using variables, then substitute these var with different set of values when passed thru Jinja, resulting in document for 100's of different data. So, Jinja is basically a template to document converter tool.

A very good link for tutorial is here: https://zetcode.com/python/jinja/

Installation:

Just like other python modules, Jinja is not installed by default, and we have to install the Jinja module

We use the pip3 tool to install Jinja. Type below cmd on Terminal prompt.

$ sudo pip3 install jinja2

Basics:

I had seen Jinja being used in a lot of Verilog testcases, where you want to update a section of testcases based on some other text file, say signals.txt. You use Jinja to generate the testcase document based on a template that you write manually. We use signals.txt file as our data, and based on this data, the document is created from the template.

 

ElectroMagnetism:

Both Electric and Magnetic fields go hand in hand. Although them seem very different from each other, one can be generated from the other. They appear as Electric or magnetic field depending on the frame of reference of the observer. We first look at Electric field and then at Magentic field.

Electric field/force:

 This force is between charged particle at rest. Coulomb's Law for Electrostatic Force is exactly similar in form to Newton's Gravitational Force. It was published in 1785 by Charles Coulomb and is given by below formula

  1. Coulomb's Law: F=q1*q2/(4*Π*ε*R^2). It's similar to the formula for Newton's Gravitational law. Here instead of G, we replace it by other constant (1/4*Π*ε). q1 and q2 are 2 charges present, similar to masses m1 and m2 in Newton's Gravitational law.
  2. Electric Field is defined as field due to presence of charge q and is given as E = F/q2 = q/(4*Π*ε*R^2). Electric field is measured in V/m. ε is the permittivity of the material. It measures as to how well the material itself polarizes in response to the Electric Field. This happens due to natural tendency of outside charges to rearrange themselves so that the Field is reduced. If we put the charge Q in a vacuum, then there's nothing in vacuum to neutralize the field, so vacuum will have the lowest permittivity possible. For vacuum, permittivity is ε0 = 8.85*10^-12 F/m. Unit is F/m as ε=Q/E.1/R^2 = Cap.m/m^2=Cap/m=F/m.We take out the constant part (1/4*Π*ε) and call it the Coulomb Constant (ke) = 1/4*Π*ε0 = 9*10^9 N-m^2/C^2  where F =  ke*q1*q2/R^2. Thus it can be seen that force is lot stronger than gravitational force (as ke is very large number). 
  3. Relative Permittivity: Since everything has higher permittivity than vacuum, we talk in terms of relative permittivity εr which is the ratio of the absolute permittivity of medium to permittivity of vacuum. i.e εr= ε/ε0. A metal doesn't allow any Electric field to exist within itself, as any resultant Electric field will make electrons move (as electrons are very loosely bound), and they will keep moving until the Electric Field within the metal is no more there. So, if we put a charge surrounded by metal, metal will have no resultant Electric field, implying infinite ε. (NOTE: ε.appears in the denominator, implying higher ε.will reduce Electric field). Basically electrons will move to one end making that end -ve charged, while leaving the other end +ve charged. Thus a really big dipole is created in the metal which neutralizes the applied Electric field completely. For any material which is a perfect insulator, electrons can't freely roam whenever there's an Electric field. They are stuck in their positions bound to the nucleus. At an atomic level, the electron cloud in an atom might still get distorted. Electrons might get pushed away a little from the Electric Field creating a dipole. All such atomic dipoles will create an internal electric field in opposite direction to applied Electric field. How strong of the dipole is created is dependent on the material's ability to form such dipoles. Perfect Conductors may be thought of as an extreme case where such dipoles are created along the full length of the material, i.e electrons go on one side and nucleus goes to the opposite side. Polarizing insulators make limited length dipoles. Electrons are still held in place but just shifted a little. So, there is some net Electric field left. More the dipole electric field formed, less is the net electric field and higher is the permittivity of the material. Higher permittivity means you have to apply more charge to hold same potential difference, as some of the applied field will get neutralized. Permittivity is the capacitive ability of a material, and totally different than resistivity (see in Passive elements section). Silicon has εr=12, while SiO2 has εr=4. This means Si will have less Electric field and hence higher ability to retain charge for same Voltage than SiO2. Capacitors have materials known as dielectric with high εr so that they can hold more charge and hence more energy per unit of applied voltage.

 

Magnetic field/force:

This force is counterpart of Electric force. It's caused by magnetic charges instead of electric charges. The only thing unique to magnetic charges is that they always appear in pair, i.e +ve and -ve magnetic charges will appear together, and can never be separated. Usually Magnetic force or magnetic field is associated with magnets, but anything else can also behave as a magnet under right conditions. A magnet's North and South pole can be thought of as 2 magnetic charges, one at N and other at S, with opposite polarity. A moving electric charge behaves as a magnetic charge and causes magnetic field. Thus a stationary charge generates an electric field, while moving charge generates a magnetic field. However, moving is a relative term, and depends on the frame of reference of the observer. To 2 different observers in different frame of reference, the same charge can appear as moving or stationary, causing one to believe that the charge has an electric field, while to the other to believe that the charge has a magnetic field.

The equation for Magnetic field are slightly complicated, due to the fact that magnetic charges exist only in pairs. If we really had magnetic charges that could exist by themselves, then Magnetic forces would be similar to Coulomb's law. Infact, in was referred to as "Magnetic Coulombs Law".

F=qm1*qm2/(4*Π*(1/μ)*R^2). It's similar to the formula for Coulomb's law for electric charges, except that the 2 electric charges have been replaced by magnetic charges, and permittivity  ε.has been replaced by 1/μ, where μ is the permeability of the medium.

Until 1800's, this theory of magnetic charges was held. All work in early 1800's believed in the theory of magnetic dipoles (i.e magnetic charges exist in pair, creating a dipole). These dipoles gave rise to electric field. But in 1820's, it was found that magnetic field is not generated due to magnetic charges, but rather due to current, which is generated by moving electrical charges. In 1825 Andre Ampere proposed that magnetism is due to perpetually flowing loops of current instead of the dipoles of magnetic charge in Poisson's mode.

Then how do magnets generate Magnetic field, since they don't have any current thru them?

Electomagnetism:

Maxwell's Equations.

 

Wave Equation:

Derivation of Wave equation (Electromagetic field) from Maxwell's equations:

Very good paper here: Wave Equation derivation