Lungs:

Lungs are the largest part involved in respiration. It takes in clean air from outside (containing oxygen) and expels out dirty air (containing carbon dioxide). Oxygen in lungs is taken in by blood and transported to cells of the body. There's hemoglobin cells in blood which do this job of taking that oxygen in. The cells use oxygen to burn carbs, generate energy but generate Carbon dioxide as a by product. This Carbon dioxide is transferred back to blood which is carried to lungs. It's here that lungs take that CO2 and expel it out.

Khan Academy video (nice introductory video) => https://www.youtube.com/watch?v=qGiPZf7njqY

Dr John Campbell Video on youtube showing hand diagram of lungs =>

 

Sam video:

CDC = Clock Domain Crossing

In a single clock design, all paths have same launch and Capture clock. Timing tools are able to time all such paths for setup and hold. When we have more than one clock, then what happens to paths in diff clks? Well, timing tools can still time all paths within a clock domain, i.e all paths launched and Captured by same clk are still timed. What happens to paths that are launched from one clk and captured by other clock? Well, such paths are still timed by timing tools, as all paths are considered synchronous, unless told otherwise. However the question to ask is => Should these paths even be timed? Since the 2 clks are async, the capture clk can come at any time wrt launch clk, so there's really no timing that we can meet here. It's not like a regular clk->clk path that needs to meet setup/hold timing. So, in timing tools, we define all such paths crossing 2 clks as false path (FP) (to be precise, we use SDC cmd "set_clock_groups -async -group <clk1> -group <clk2>" to set all paths b/w clk1 and clk2 to be async, meaning they are all FP).

However, do we need to do anything in design to make sure signals can transmit correctly from clk1 to clk2? Well, turns out that that signal transmitting from clk1 to clk2 will violate setup/hold of the capturing flop in clk2 domain some of the times randomly, depending on the exact arrival time of clk2 wrt clk1. We have no control over the relative arrival time of clk1 and clk2, as they might be coming from 2 diff PLLs. Three possible scenarios:

  1. signal from clk1 meets setup time of clk2 (i.e signal from clk1 comes way before clk2 capture) => New value of Signal will be captured correctly at end of current cycle of clk2.
  2. signal from clk1 violates setup/hold time of clk2: Here 2 scenarios are possible here:
    1. signal from clk1 comes in the setup/hold violation window of clk2 capture (i.e signal comes right close to the clk2 capture edge)=> Since Signal is in the violation window, we don't know what is going to get captured- Is it the old value or the new value? In this situation, actually the signal remains meta stable (i.e an intermediate value b/w 0 and 1) for a little while (may be for a few 10-100 ps), before it makes it's decision to remain at old value or move to new value. Either old value or new value of Signal will be captured correctly at end of current cycle of clk2.
    2. signal from clk1 comes after the setup/hold violation window of clk2 capture (i.e signal from clk1 comes way after clk2 capture)  => Since Signal comes after the violation window, it missed getting captured at the end of current cycle of clk2. So, at the end of current cycle of clk2, it will have old value of signal, and then in next cycle, it'll have the new value of signal.

Depending on which scenario we end up in, we can either have old value or new value at the end of current cycle of clk2. But in next cycle of clk2, we are guaranteed to have new value of signal. Thus there exists a 1 cycle uncertainty, where the value may be old value or new value. This is shown in diagram below (See Async clk section in middle)

 

There's an excellent paper on CDC by Clifford Cummings at SNUG 2008: CummingsSNUG2008Boston_CDC.pdf

Based on the above paper, I found this nice 3 part series on CDC explaining it in further detail: https://www.verilogpro.com/clock-domain-crossing-part-1/

 

Metastability, MTBF and Synchronizers:

Once we capture the signal in clk2 domain (with a flop), can we just allow it to flow freely to other flops in clk2 domain? If we look at case 2.1 above, where the signal comes in the setup/hold window of clk2 domain, the signal being captured has the possibility of going meta stable for a small time. If this signal is passed to other flops, then there are 2 problems:

  1. The first is a timing problem. From this 1st capture flop (we'll call it synchronizer flop) to other flops, we have only clk2 domain (no clk1 domain). That means all flops must meet setup/hold in clk2 domain. When STA tools analyze timing for paths, they assume no metastate for any signal, i.e they go with assumption that signal coming out of previous flop has met timing and is either 0 or 1 and start timing the path from launch flop to capture flop. They check for timing based on that assumption. In our example, metastable state has eaten into the timing of the path from the very first flop to the next flop, so when STA tool reports a particular path has met timing, there's no guarantee that it has indeed met timing. As an ex: if meta state lasted for 1/2 cycle of clk2, and the path delay of the path is 3/4 cycle of clk2 (from synchronizer flop to some other connecting flop), then STA tool will say that the path met timing with a slack of 1/4 clk, but in reality the path failed timing with slack of -1/4 clk.
  2. The second problem is that being metstable is a probabilistic phenomenon. We can never say that metastability will resolve 100% within a given time. It falls down exponentially with time, but there's still a non zero probability that flop output will be metastable even after infinite time. So, our other capture flops may still be prone to getting meta stable value, and hence capture metastable value. These will get resolved to 0 or 1 in each capturing flop. But if there are multiple capturing flop, not all of them will resolve to same value. Now, we have the possibility that same signal will get captured as different values in different flops, while in RTL we assumed them all to be the same value. This may result in incorrect functionality of the gate level circuit even though RTL may work fine. This is unacceptable failure.

Metastability is measured as failure rate or MTBF (Mean time b/w failures). Here's a good paper from TI on measuring MTBF for flops => https://www.ti.com/lit/an/scza004a/scza004a.pdf

How long the flop o/p remains metastable depends on a flop time constant, known as "tau".  Formula for probablility that metastable state is unresolved at time tr is:

f(r) = e^(-tr/tau) where function f(r) is the probability of nonresolution as a function of resolve time allowed, tr, and the metastability decay time constant, tau (value dependent on electrical characteristic of flop). As an ex, if tau=0.2ns, then at time=1ns, the probability that the metastable state is still present = e^-(1/0.2) = 0.007 or 0.7%.

Probability of generation of metastable event = Probability of incoming signal being in setup/hold window of capturing flop = t0/Td where t0=setup/hold window of capturing flop, and Td= time period of data transition (dependent on launch freq of clk1 and how many times data transitions per clk period of clk1).

Failure within time tr = f(r) * probability of generation of metastable event = f(r)*t0/Td

From Probability eqns:

  • If failure rate = λ, then cummulative failures since time=0 is λ*t (this is from derivation of probability desnsity function as shown in MTBF doc). So, failure rate (λ) = cummulative failures / t

Using above eqn, we come with Failure rate (λ) = Failure within time tr / tr = f(r)*t0/Td *(1/tr)

MTBF = 1/(λ) = e^(tr/tau)/(t0*Fd*Fc) where Fc=clk freq of capturing clk assuming we are capturing this metastable value in a flop running at Fc.

Thus we can get MTBF for a 1 flop synchronizer, which gives us the probability of failure if we try to use the output of first synchronizer flop into any other flop in clk2 domain. However, if we add 1 more flop to capture the output of 1st sync flop, then net MTBF = MTBF1 * e^(tr2/tau) = e^(tr1/tau)/(t0*Fd*Fc) * e^(tr2/tau)

Thus MTBF for 2 flop synchronizer goes up exponentially by just adding 2nd stage. If we add n stages, and assume tr is same for all, then MTBF = e^(N*tr/tau)/(t0*Fd*Fc) 

So, if MTBF for 1 flop sync was A*e^6 sec, then MTBF for 2 flop sync is A*e^12 sec (i.e MTBF goes from 400 sec to 200K seconds).

So we almost always have a 2 stage synchronizer to transfer any signal from one clk to another clk. We may still have metastable signal at output of 2nd stage sync, but probability of that happening is so low (once in 10000 years or so), that we consider it as 0 probability event. There's still timing path from 1st flop to 2nd flop that may not meet timing (due to metastability). But we already know that and assume that probability of that timing not resolved within 1 period is very low. To further help us, we don't put any logic delay in this path, so that the whole cycle time is avilabe for the meta value to settle.

Transferring single signal from one clk to other clk:

We saw above that by having a 2 stage synchronizer, we can capture the signal and fan it out to all the logic in clk2 domain without any timing issues (i.e STA will time paths correctly). Is that all we need or is there something else that's needed? Let's explore.

When we transfer signals from 1 clk to other clk, our main objective is to preserve the shape of the signal waveform. i.e if signal was going from 0->1->1->0->0->1 in clk1 domain, then this exact waveform should be seen in clk2 domain. However, as saw above this is not always possible. There will be always be 1 cycle uncertainty in clk2 domain. Luckily this is not a problem as long as ALL the signal transitions are captured in clk2 domain. In other words, the signal intent should be maintained in clk2 domain - i.e if signal was supposed to be 0 in 1st clk, then 1 in the 2nd clk, then 1 in the 3rd clk (all in clk1 domain), then this exact sequence of 0->1->1 should be captured in clk2. NOTE: clk2 freq may be very diff than clk1 freq, so signal may need to be elongated in clk1 domain to make sure they are captured in clk2 domain. Let's look at 3 freq scenarios separately:

  1. Launch clk freq = Capture clk freq => Here depending on relative arrival time of capture clk, the signal may either get captured correctly every cycle of clk2, or may get missed every cycle, or may be a mix of the two.
  2. Launch clk freq > Capture clk freq => Here since capture clk is slower, few of the transition of signal in clk1 domain may get missed in clk2 domain.
  3. Launch clk freq < Capture clk freq => Here since capture clk is faster, all transitions of signal in clk1 domain will get captured correctly in clk2 domain.

These 3 scenarios are also shown at the bottom of the page in the link above. As we can see that signal in clk1 domain should be at least as long as 1 cycle of clk2, otherwise it may not get captured in clk2. However, even 1 cycle of clk2 is not enough, since there's some setup/hold time requirement. So, we need to add a "delta" margin. The requirement for signals transferred from clk1 to clk2 boils down to this:

Src signal length > (1 cycle of dest clk + ε)  where ε= delta margin. Usually we take it 1/2 a cycle of clk2 as "delta margin", so that it's easy for tools to verify it (as all sims/checkers etc are based on clk edges).

If we don't want to introduce half cycle paths, we can just have the signals crossing clk domains to be at least as wide as 2 cycles of destination clk. This works well in practice. We can achieve it in 2 ways:

  1. We know the freq of clk2 in advance from spec. We code the RTL so that the signal crossing into dest clk is held constant for that many cycles of clk1 as needed (i.e signal held stable for cycles=round(2*Tdest/Tsrc))
  2. However if the dest clk or src clk freq are not unique values, but may change based on settings, then above approach may not work. Or we may have to design cumbersome logic to take care of all the cases. In such cases, a feedback loop is employed where signal in clk1 domain is not allowed to change until clk2 domain acks that it received the signal. This is a very robust solution, as it guarantees that signal will be captured corretly no matter what. This is what is usually employed.

CDC rules for transferring single signal from one clk to other clk:

  1. The signal needs to go to a single synchronizer with at least 2 flops in the synchronizer. 1 flop synchronizer may also work for slow clk speed on capture side. There should be no logic in between the 2 flops of synchronizer so as to give full clk cycle to allow meta stable signal to settle down. The same signal can't go to more than 1 synchronizer in capture clk domain, as then the values in the synchronizer may be off by a clk cycle(due to 1 cycle uncertainty). This may cause same signal to have 2 different values at a given time, which is not what is RTL intended and will cause gate sim failures.
  2. The signal needs to be at least 1.5 clk cycle wide, so as to allow the signal to be captured on the receiving side. Most of the time feedback logic on receiving side sends an ACK signal back to the source indicating that the signal has been captured.
  3. There shouldn't be any combo logic on the data path crossing clk domain. This is because combo logic may cause short glitches, which may get captured by synchronizer of receiving clk domain, which may pass this incorrect pulse to all other logic on receiving side.

Transferring multiple signals from one clk to other clk:

Above we looked at transferring one signal from clk1 to clk2. An example of this would be an "interrupt" signals. As long as each of these interrupt signals got captured correctly, our function in clk2 will work fine. But let's assume that these multiple signals have relation between them, where we need to maintain that relation in clk2 domain. An ex of this would be a 2 bit binary counter counting from 0 to 3. The 2 bits cnt[1] and cnt[0] go from 00->01->10->11. If we have 2 stage synchronizers for each of them, then they may get time shifted by 1 cycle wrt each other depending on which got new value in next cycle while which got old value. This is shown in diagram below.

FIXME

The problem happened because here we needed to transfer a group of signals as 1 entity which needs to maintain the waveform relation amongst each other at all times. Separate synchronizers isn't going to solve this issue. So, we need to come up with other solutions. There are multiple solution as listed below:

  1. Combine signals: Combine multiple signals into one signal, and then transfer it. As an ex, if we have a 2 bit counter that we want to xfer from one clk to other clk, we can have counters in both clk domains, and then just use a signal called cntr_inc or something that goes high whenever the counter increments in clk1 domain. We can use this signal to increment counter in clk2 domain, and that way both counters will be in sync, without transferring the counter values from
  2. Gray Coding: Make only one of the signals toggle at a time, if it's possible to do so. Gray counters are an ex.
  3. MCP Formulation (aka load ctrl structure): Make a MCP (multi cycle path) formulation, as known as load-ctrl structure. Here we make a separate signal that acts as a ctrl signal for the set of signals that we want to pass across to other clk domain.
  4. Stabilize Using XOR: Wait for all signals to be stable before capturing them. In this technique we capture each signal independently thru independent synchronizers, but then we don't pass it on to subsequent logic. We generate an enable signal which is XOR of each synchronizer value (after the synchronizer, we put an extra flop to capture the toggle), and then we OR all these values. An OR value of 0 implies that there is no change occuring in any synchronizer, implying all of them are stable. So, in next cycle, we capture all of this data bus into a subsequent set of flops, and from here on the data values are passed to subsequent logic. This is very expensive technique. We needed 2 extra flops after the synchronizer for each data bit, on top of bunch of XOR/OR gates. Not used in practice.
  5. FIFO: Make a FIFO which will allow signals to be passed continuously without waiting for each of them to be consumed. We can think of a "MCP formulation" as a "1 deep" FIFO. If we put an extra flop, we can have a very simple "2 deep" FIFO. To make a "n deep" FIFO, we need complicated scheme. Here we need multiple ctrl signals (which are addr of FIFO which indicate next entry to be read or written). They all need to be synced. FIXME. Put a diagram.

 

CDC tools:

Spyglass was the most popular tool for CDC analysis.

RDC tools:

 

 

 

Eyes, Ears and Nose:

These are one of the vital parts of body, especially the eyes. Eyes re also the most fascinating organ.

Eyes:

Nice introductory video: https://www.youtube.com/watch?v=eySkNWTI03Q

Here's multiple diagrams showing internal parts of eye: https://kunnediagram.blogspot.com/2021/06/11-anatomy-of-human-eye-png.html

Main parts of Eyes:

  • Front: The front of the eye is cornea, the bulging part that you can see and feel. The black/brown circle that you see is called the Iris and is actually muscles that relax or contract. The color of the eye that we talk about is the color of the irs, as the color of these muscles depends on a color pigment. The Iris has a hole in the center which is called the pupil. If you look at someone's eye,you will see the big black/brown circle (Iris) and within it the smaller black circle (pupil). This hole is always black in color, as there's no light inside the hole. Just behind this hole is the lens of the eye. This lens is connected to ciliary muscles which change the shape of the lens to focus light rays on the back of our eyes, which is called the retina. The Sclera is the visible white part of the eye. The bulge in front of the iris is the cornea: sclera doesn't have this bulge, bulge is only for the part of the eye that is involved in vision.
  • Back: All of the back surface of the eyeball is retina where there are special light cells called rods and cones which get excited on receiving light rays. These rods/cones are connected to optic nerves, which take the signal from here to the brain for processing. The place where all the optic nerves from the eyes leaves the eyeball is called optic disc.There's no retina here, as that space is needed to bundle all the optic nerves and sendit out of the eyeball. As no picture is formed here, it's the blind spot of the eye. The brain finally makes an image, that remains well in our brain and in our thoughts. If the rays enetring the eyes don't converge exactly onto the retina, then the image will be blurred. It's the job of ciliary muscles to contract/expand to make sure light rays focus on the retina.
  • Liquid: The white thing that we seen in the front is small part of our eyeball. The space between the cornea and the lens is filled with a watery liquid called Aqueous humour. The space between the lens and the back of the eye is filled with a glassy kind of liquid called "Vitreous humour", which helps to maintain the shape of the eyeball.

 

Ears:

Nice introductory video (from Khan Academy, India): https://www.youtube.com/watch?v=98-6WfdumZY

Another video with 3D model of Middle Ear: https://www.youtube.com/watch?v=9fdO9x_Ej2M

Here's multiple diagrams showing internal parts of ear: https://www.researchgate.net/figure/shows-the-basic-anatomy-of-the-human-ear-It-consists-of-three-main-sections-the-outer_fig1_281726806

Main parts of Ears:

  • Outer Ear: The outside of the ear is called the outer ear. The opening in the ear leads to the eardrum.
  • Middle Ear: The eardrum is a very thin layer of skin, mostly translucent, and is called the tympanic membrane. Tympanic membrane needs to carry sound waves from the membrane to the internal ear, which is done via a connection of bones. There are 3 bones that connect this membrane to the inner ear. These are the 3 smallest bones in the human body, and are collectively called ossicles. The 3 bones are named Malleus, Incus and Stapes. Stapes amplify the sound vibrations from eardrum to inner ear by 20X. This is needed as there's liquid inside the inner ear to which it needs to transmit the vibrations. Liquids are denser and so it needs more forceful vibrations to get transmitted.
  • Inner Ear: The inner ear consists of 3 semicircular rings, which helps us with maintaining balance. It has nothing to do with hearing. Cochlea is another structure in inner ear, which is the main part associated with hearing. It has liquid inside it which receives the vibrations from the Stapes and transfers those as electrical signals via the auditory nerves which carry these sound signals to the brain.

There's a Eustachean tube in middle ear, which goes all the way to Pharynx, and has a opeing inside the nose. This means that any bacteria/mucus due to infection in upper nose, will get carried to the eardrum and can be seen from the outer ear when seen via enough light (as the ear drum is translucent). This is the ear infection that little kids generally have. It's frequent in kids but never happens in adults because this tube is small in kids, so it's easy for these bacteria to get carried all the way to the ears, but the long length of tube in adults prevents that from happening.

 

Nose:

Nice video: https://www.youtube.com/watch?v=e3gsndH9q1s

Dr John Campbell's video showing all parts from nose to throat: https://www.youtube.com/watch?v=IrZ3LZqrV7w

 

 

Brain:

Brain is the most vital part of your body. Your brain defines who you are. All other organs of your body may be replaced by artificial equivalent, and you will still remain "you", as long as your brain is not replaced.

Good video showing internals of brsain with a model: https://www.youtube.com/watch?v=xQ6-e0sF7Yk

 

FPGA = Field Programmable Gate Array

As an electrical engineer, you should try to learn "How to build a digital circuit on FPGA". FPGA are compact chip, that have millions of gates on it. You can build any custom digital logic with FPGA. FPGA are an essential device for any Electrical Engineer to have fun with.

If you are a VLSI designer, you probably know how to write RTL in Verilog. In an FPGA too, we write RTL, and then the tools that come with FPGA, build a custom digital circuit based off that RTL. This allows us to quickly test our digital circuit, as well as build prototypes, without going thru expensive time consuming process of having a fab fabricate your digital design. FPGA also allow you to learn how to code in Verilog, and test your logic without writing any testbenches. Nowadays, FPGA have millions of gates on them, which you can use to make a full blown microprocessor on an FPGA.

One good video series on FPGA by DigiKey (total 12 videos): https://www.youtube.com/playlist?list=PLEBQazB0HUyT1WmMONxRZn9NmQ_9CIKhb

Early FPGA started in 1983 with Altera and then with Xilinx in 1985. Later Actel and Lattice Semiconductor joined the FPGA race. Xilinx was later bought by AMD, Altera was bought by Intel while Actel was bought by Microsemi, which was itself bought by MicroChip Tech. By 2015, Xilinx (50%), Altera (35%) and Actel (10%) and Lattice (3%) captured almost all of the FPGA market. As of 2020, 100's of millions of gates are being put on a single FPGA chip in 5nm nodes, with FPGA revenue exceeding $8B. FPGA are being increasingly used in low end embedded devices, and expected to grow at a CAGR of 10%.

Main FPGA product lines of these 3 companies are:

  1. Xilinx: They provide low cost Spartan family (made in higher nm tech as 28nm), as well as high perf Virtex family (made in lower nm tech as 16nm as of 2020). They have multiple generations, with Xilinx 7 series introduced in 2010, which is the most popular one.
    1. Spartan: Spartan family is the oldest and lowest cost FPGA. Spartan 7 intoduced in 2017 lacks high BW transceivers.
    2. Artix: Artix family is similar to Spartan, as it's low cost. However, Artix-7 have high BW transceivers, and that's what we'll be using for our training.
    3. Kinetx: Kinetix family delivers mid range performance at much lower cost than Virtex.
    4. Virtex: Virtex family is most advanced and highest performance. Several gen from Virtex-E to Virtex UltraScale+. It has lot of prebuilt logic for commonly used functions as multiplication, etc to improve performance.
    5. Zynq: Zynq 7000 were developed as SoC (System on chip). Zynq-7000 integrate a complete ARM Cortex A9 MPCore-processor-based 28 nm system. It made FPGA processor centric, which could boot at start up, and load OS.
  2. Altera:
    1. Startix: Startix series were Alter'a highest BW devices with up to 1 Million logic elements.
  3. Altec: Actel's portfolio of FPGAs is based on two types of technologies:
    1. Antifuse-based FPGAs: Axcelerator, SX-A, eX, and MX families
    2. Flash-based FPGAs:  Fusion, PolarFire, IGLOO, and ProASIC3 families

 


 

Training on Digilent BASYS3 Board with Artix 7 FPGA using Xilinx Vivado Tools:

"Digilent BASYS3 Board" is the recommended Board for Introductory users wanting to learn FPGA basics. It has Xilinx "Artix 7 FPGA" chip on it. I have this Board, and all my tutorials are based off it.

Buying the Board. ouple of options:

Steps on Linux OS (Ubuntu Cinnamon 22.04.2 LTS) for Installing Vivado 2023.1:

  1. Once you have the Board, download and install Vivldo from Xilinx website. You will need to make an AMD a/c (as Xilinx is now part of AMD). Provide your personal details accurately for Export Control Requirements. Once you do that, you can download any of the 3 "Vivalo ML edition" provided. The self extracting option for Window/Linux are more suitable, since they don't require huge files to be downloaded in 1 go. The 3rd option of downloading tar.gz file has 110G of file to be downloaded, which errors out almost all the time after downloading part of the file. Details here => https://digilent.com/reference/programmable-logic/guides/installing-vivado-and-vitis. Steps are:
    1. Download AMD Linux bin file => https://www.xilinx.com/support/download.html. Since we are doing it on Linux, we'll choose 3rd from top which is "Linux Self Extracting Web installer" => Xilinx_Unified_2023.1_0507_1903_Lin64.bin (~265 MB)
    2. Open a Linux Terminal and Go to Dir where Installer was downloaded. Most likely in /home/<user/Downloads dir. Run these 3 cmds:
      1. sudo apt install libtinfo5 libncurses5 => We need to install these 2, else we get stuck at "Generating installed device list" later during installation. Thread: https://support.xilinx.com/s/article/63794?language=en_US
      2. chmod +x Xilinx_Unified_2023.1_0507_1903_Lin64.bin;
      3. sudo ./Xilinx_Unified_2023.1_0507_1903_Lin64.bin
    3. A new gui will appear which will guide thru installation process. Enter amd login/password. Choose "Vivado" as "Product to install" and NOT "Vitis", as "Vitis" is too large. Choose "Vivado 2023.1 ML free Edition". This takes up abot 40GB of space. It will go thru 3 step process of downloading a 20GB file, installing and then "Final processing for device". Downloading a 20GB filw will easily take an hour, installing is couple of minutes, and Final processsing is also a few minutes. It will get stuck on final processing if we haven't done step 2.1 above. If it does get stuck, cancel,then run this on any terminal (sudo apt install libtinfo5 libncurses5), and then reexecute the binary (step 2.3). Once installation is done, the software will be installed in /tools/Xilinx/Vivado dir.
  2. Once Vivado software is installed, install cable drivers (need only for Linux0 as it doesn't come with the drivers. Run below cmds on terminal
    1. cd /tools/Xilinx/Vivado/2023.1/data/xicom/cable_drivers/lin64/install_script/install_drivers
    2. ./install_drivers => This should show "INFO: Driver installation successful." at the end, along with a warning. Ignore the warning.
  3. Install Digilent's Board files.
    1. Download from github: https://github.com/Digilent/vivado-boards/archive/master.zip
    2. Go to the dir where downloaded, and Extract it by right clicking on file (in Files window, NOt on terminal). It will extract files.
    3. On terminal. run cmd => cp -rf /home/kagrawal/Downloads/vivado-boards-master/new/board_files  /tools/Xilinx/Vivado/2023.1/data/boards/board_files => This copies all files.
    4. sudo chmod -R 777 /tools/Xilinx/ => For now set all permissions to all subdir and files for Vivado.That way, we avoid getting "Permission denied' errors later. Or you can login as root as shown below in step 4.1.
  4. Launch Vivado. Follow the instructions provided here: https://digilent.com/reference/programmable-logic/guides/getting-started-with-vivado
    1. Open a terminal, and login as root (may not be needed if all permissions are set up for all vivado dir) : sudo -i => logs in as root
    2. mkdir /home/<user>/Vivado_training
    3. cd /home/<user>/Vivado_training
    4. source /tools/Xilinx/Vivado/2023.1/settings64.sh (Or can also use dot space (i.e . ) instead of source to execute)
    5. vivado => (use sudo vivado if you aren't logged in as root). This will launch Vivado. If it shows error as "permission denied", then you need to login as root. Vivado gui will open up. Choose Tasks->Open Hardware manager. It will show "Hardware Manager" as not connected on the new pop up.
    6. Now connect your FPGA to your laptop via the USB cable provided. Flip SW16 on Digilent Board (switch near the mini usb cable). It should turn lights on, and will start counting from 0000 to 9999. "Hardware Manager" will show Digilent Board name. So, everything working at this point. Few Troubleshooting Tips:
      1. If Board doesn't power on, it may be due to power switch jumper on top left (JP2) not set to usb. Make sure the bottom 2 pins of the 3 pins are connected via jumper. If the top 2 pin of jumper re connected, that imples that the power is coming from an external source, which is not true in our case. We are powering via micro USB.
      2. If Programming our own verilog code, we have 3 options via switch jumper on top right (JP1) = QSPI, JTAG (via micro usb) and USB (which is not micro usb, but regular USB right next to JP1). We'll user jumper to connect middle 2 pins of JP1 that will allow us to use JTAG for programming.
  5. Now we can try a new project. Follow instructions on link above to create a new project.
    1. There are many videos on xilix website with all code provided.

 

 


 

Project 1 on designing a simple inverter to flip LED:

The simplest circuit that you can build on an FPGA is a simple inverter. There's a very good series on this. Just follow the instruction to get the implement the inverter to flip switches.

Series of Videos to by "ENGRTUTOR Channel"=> https://www.youtube.com/@ENGRTUTOR

Basically, this is what you do in above project is this:

  • Connect an inverter between 2 pins of FPGA. One input pin of FPGA is connected to the switch, while other output pin of FPGA is connected to the LED. We implement an inverter in FPGA and connect it b/w these 2 pins. Now, the output will be inverse of the input. So, when switch is turned on (i.e connected to 3.3V supply or binary 1), the LED turns off (or binary 0), and vice versa.

Follow below 4 videos for FPGA tutorial (The project is using Vivado 2020, but we are using Vivado 2023, so not everything on GUI of below videos will be the same as yours, but that doesn't matter, it will still work):

 


 

Project 2 on designing a MicroBlaze Processor and run C programs on it:

The most advanced circuit that you can build on an FPGA is a microcontroller. It's very satisfying to be able to build a processor and run C program on it.

AMD's MicroBlaze Microcontroller is provided with Xilinx repository. It has all the Verilog code that you can look at and then synthesize it and generate a bitstream. Then compile a simple C program, and run it on FPGA on this MicroBlaze processor. Really easy and fun.

There's a good series on this on youtube Channel (drselim) => https://www.youtube.com/playlist?list=PLbFgDf51ZkCEJb9MvxKIs-0q2obouwf-f

This playlist has videos starting with an adder, mux and then then going on with Micro Blaze Micro controller, with the last tutorial on VGA connector.

There's also a video on Xilinx website for building MicroBlaze Microcontroller on FPGA => https://www.xilinx.com/video/software/microblaze-quickstart-video.html