Week0 - Tools Installation
$ git clone https://github.com/YosysHQ/yosys.git
$ cd yosys
$ sudo apt install make (If make is not installed please install it)
$ sudo apt-get install build-essential clang bison flex \
libreadline-dev gawk tcl-dev libffi-dev git \
graphviz xdot pkg-config python3 libboost-system-dev \
libboost-python-dev libboost-filesystem-dev zlib1g-dev
$ make
$ sudo make install
✅ Yosys Successfully Installed
$ sudo apt-get install iverilog
✅ Iverilog Successfully Installed
$ sudo apt update
$ sudo apt install gtkwave
✅ GTKWave Successfully Installed
$ sudo apt update
$ sudo apt install ngspice
✅ Ngspice Successfully Installed
# Install required dependencies
sudo apt-get install m4
sudo apt-get install tcsh
sudo apt-get install csh
sudo apt-get install libx11-dev
sudo apt-get install tcl-dev tk-dev
sudo apt-get install libcairo2-dev
sudo apt-get install mesa-common-dev libglu1-mesa-dev
sudo apt-get install libncurses-dev
# Clone Magic repository
git clone https://github.com/RTimothyEdwards/magic
cd magic
# Configure build
./configure
# Build Magic
make
# Install system-wide
sudo make install
✅ Magic VLSI Successfully Installed
Week2
The VSDBabySoC is a simple SoC (System-on-Chip) design incorporating a RISC-V processor (rvmyth), a PLL (Phase-Locked Loop) module (pll), and a DAC (Digital-to-Analog Converter) module (dac). This project demonstrates integration of these IP cores and aims to simulate and verify the design behavior using pre-synthesis and post-synthesis simulations.
src/include/- Contains header files (*.vh) with necessary macros or parameter definitions.src/module/- Contains Verilog files for each module in the SoC design.output/- Directory where compiled outputs and simulation files will be generated.
Ensure you have Icarus Verilog installed for compilation and GTKWave for viewing waveform files. This project assumes a Unix-like environment (macOS/Linux).
Clone or set up the directory structure as follows:
VSDBabySoC/
├── src/
│ ├── include/
│ │ ├── sandpiper.vh
│ │ └── other header files...
│ ├── module/
│ │ ├── vsdbabysoc.v # Top-level module integrating all components
│ │ ├── rvmyth.v # RISC-V core module
│ │ ├── avsdpll.v # PLL module
│ │ ├── avsddac.v # DAC module
│ │ └── testbench.v # Testbench for simulation
└── output/
└── compiled_tlv/ # Holds compiled intermediate files if needed2.1 vsdbabysoc.v (Top-Level SoC Module)
This is the top-level module that integrates the rvmyth, pll, and dac modules.[VSDBabySoC](https://github.com/manili/VSDBabySoC.git)
- Inputs:
- reset: Resets the core processor.
- VCO_IN, ENb_CP, ENb_VCO, REF: PLL control signals.
- VREFH: DAC reference voltage.
- Outputs:
- OUT: Analog output from DAC.
- Connections:
- RV_TO_DAC - A 10-bit bus that connects the RISC-V core output to the DAC input.
- CLK - The clock signal generated by the PLL.
2.2 rvmyth.v (RISC-V Core)
The rvmyth module is a simple RISC-V based processor. It outputs a 10-bit digital signal (OUT) to be converted by the DAC.[rvmyth](https://github.com/kunalg123/rvmyth/)
Inputs:
- CLK: Clock signal generated by the PLL.
- reset: Initializes or resets the processor.
Outputs:
- OUT: A 10-bit digital signal representing processed data to be sent to the DAC.
2.3 avsdpll.v (PLL Module)
The pll module is a phase-locked loop that generates a stable clock (CLK) for the RISC-V core.[Introduction](https://github.com/ireneann713/PLL.git) [avsdpll](https://github.com/lakshmi-sathi/avsdpll_1v8.git)
Inputs:
- VCO_IN, ENb_CP, ENb_VCO, REF: Control and reference signals for PLL operation.
Output:
- CLK: A stable clock signal for synchronizing the core and other modules.
2.4 avsddac.v (DAC Module)
The dac module converts the 10-bit digital signal from the rvmyth core to an analog output.[avsddac](https://github.com/vsdip/rvmyth_avsddac_interface.git)
Inputs:
- D: A 10-bit digital input from the processor.
- VREFH: Reference voltage for the DAC.
Output:
- OUT: Analog output signal.
The testbench.v file is a test module to verify the functionality of vsdbabysoc. It includes signal initialization, clock generation, and waveform dumping for both pre-synthesis and post-synthesis simulations. Waveform Output:
- pre_synth_sim.vcd or post_synth_sim.vcd files generated based on simulation conditions.
Run the following command to perform a pre-synthesis simulation:
iverilog -o output/pre_synth_sim/pre_synth_sim.out -DPRE_SYNTH_SIM \
-I src/include -I src/module \
src/module/testbench.v src/module/vsdbabysoc.v
cd output/pre_synth_sim
./pre_synth_sim.out
Explanation:
- -DPRE_SYNTH_SIM: Defines the PRE_SYNTH_SIM macro for conditional compilation in the testbench.
- The resulting pre_synth_sim.vcd file can be viewed in GTKWave.
After running the simulation, open the VCD file in GTKWave:
gtkwave output/pre_synth_sim/pre_synth_sim.vcd
To run a post-synthesis simulation, use:
iverilog -o output/post_synth_sim/post_synth_sim.out -DPOST_SYNTH_SIM \
-I src/include -I src/module \
src/module/testbench.v output/synthesized/vsdbabysoc.synth.v
cd output/post_synth_sim
./post_synth_sim.out- Module Redefinition: If you encounter redefinition errors, ensure modules are included only once, either in the testbench or in the command line.
- Path Issues: Verify paths specified with -I are correct. Use full paths if relative paths cause errors.
Week3
Gate-Level Simulation is used to verify the functionality of a design after the synthesis process. Unlike behavioral or RTL (Register Transfer Level) simulations, which are performed at a higher level of abstraction, GLS works on the netlist generated post-synthesis. This netlist includes the actual gates and connections used to implement the design.
-
Verification with Timing Information:
- GLS is performed using Standard Delay Format (SDF) files to ensure timing correctness.
- This checks if the SoC behaves as expected under real-world timing constraints.
-
Design Validation Post-Synthesis:
- Confirms that the design's logical behavior remains correct after mapping it to the gate-level representation.
- Ensures that the design is free from issues like metastability or glitches.
-
Simulation Tools:
- Tools like Icarus Verilog or a similar simulator can be used for compiling and running the gate-level netlist.
- Waveforms are typically analyzed using GTKWave.
-
Importance for BabySoC:
- BabySoC consists of multiple modules like the RISC-V processor, PLL, and DAC. GLS ensures that these modules interact correctly and meet the timing requirements in the synthesized design.
yosysInside the Yosys shell, run:
read_verilog /home/aadarsh/VSDBabySoC/src/module/vsdbabysoc.v
read_verilog -I /home/aadarsh/VSDBabySoC/src/include /home/ananya123/VSDBabySoCC/src/module/rvmyth.v
read_verilog -I /home/aadarsh/VSDBabySoC/src/include /home/ananya123/VSDBabySoCC/src/module/clk_gate.v
Inside the same Yosys shell, run:
read_liberty -lib /home/aadarsh/VSDBabySoC/src/lib/avsdpll.lib
read_liberty -lib /home/aadarsh/VSDBabySoC/src/lib/avsddac.lib
read_liberty -lib /home/aadarsh/VSDBabySoC/src/lib/sky130_fd_sc_hd__tt_025C_1v80.lib
synth -top vsdbabysoc
dfflibmap -liberty /home/aadarsh/VSDBabySoC/src/lib/sky130_fd_sc_hd__tt_025C_1v80.lib
opt
stat
write_verilog -noattr /home/aadarsh/VSDBabySoC/output/post_synth_sim/vsdbabysoc.synth.v
Week4
Details
In MOSFET device characterization, multiple experiments are conducted to understand its electrical behavior under different operating conditions. Each experiment provides insight into specific physical parameters and performance characteristics that are crucial for circuit design.
1️⃣ Id vs Vds (Output Characteristics)
This experiment measures the drain current (Id) as a function of the drain-to-source voltage (Vds) for different gate-to-source voltages (Vgs). ✅ Purpose:
To analyze the MOSFET’s behavior in linear (ohmic) and saturation regions.
To determine the transition between regions.
To calculate parameters like output resistance (ro) and channel modulation (λ).
2️⃣ Id vs Vgs (Transfer Characteristics)
This experiment plots drain current (Id) versus gate-to-source voltage (Vgs) at a fixed Vds. ✅ Purpose:
To determine threshold voltage (Vth).
To understand the device’s transconductance (gm) and gate control over the channel.
To analyze how Id increases with gate bias in saturation.
3️⃣ VTC (Voltage Transfer Characteristics) of CMOS Inverter
In this test, the output voltage (Vout) of a CMOS inverter is measured against varying input voltage (Vin). ✅ Purpose:
To analyze the switching behavior of the inverter.
To find noise margins (NMH, NML).
To determine the inverter threshold voltage (Vm).
To evaluate the logic gain and switching region sharpness.
4️⃣ Transconductance Evaluation (gm vs Vgs or gm vs Id)
This involves extracting gm as Vgs or Id is varied. ✅ Purpose:
To evaluate how efficiently the MOSFET converts gate voltage variations into drain current.
To optimize the device for analog circuit applications like amplifiers.
5️⃣ Subthreshold Region (Id vs Vgs in Log Scale)
This is performed at low Vgs values with logarithmic Id scaling. ✅ Purpose:
To analyze MOSFET behavior in weak inversion.
To extract subthreshold slope (SS) and understand leakage currents, important for low-power design.
6️⃣ Capacitance Measurements (Cgs, Cgd vs Vgs)
Capacitances are measured as Vgs is varied. ✅ Purpose:
To evaluate charging/discharging time in digital circuits.
To analyze delay, speed, and AC performance.





