Skip to content

Latest commit

 

History

History
123 lines (86 loc) · 3.66 KB

README.md

File metadata and controls

123 lines (86 loc) · 3.66 KB

Kicad Revision Inspector (KiRI)

KiRI is small tool to experiment having a visual diff tool for Kicad. It uses Kicad-Diff to generate layout diffs and Plotgitsch to generate schematic diffs.

It currently supports Kicad 5.* projects that use Git as source management.

Previously known as KDiff, it was renamed KiRI since the old name was pretty close to the KiDiff or Kicad-Diff, one of the projects referred to above.

Installing

To install this tool with on any Operating System, open a terminal and execute the following commands:

Windows users must use WSL/WSL2. See, Environment preparation on Windows section.

# Installing dependencies
bash -c "$(curl -fsSL https://raw.githubusercontent.com/leoheck/kiri/main/install_dependencies.sh)"
# Installing KiRI and Kicad Plugin
# The default installation path is "${HOME}/.local/share" it can be changed
# with the KIRI_INSTALL_PATH environment variable.
# Example: export KIRI_INSTALL_PATH=/home/$USER/Documents/
bash -c "$(curl -fsSL https://raw.githubusercontent.com/leoheck/kiri/main/install_kiri.sh)"

Environment preparation on Windows

Configure WSL

On a Powershell terminal with admin right, execute the following commands:

# Enable Windows Subsystem for Linux (using Power Shell)
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
#Install-WindowsFeature -Name Microsoft-Windows-Subsystem-Linux

# Install Ubuntu 20.04
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-2004 -OutFile ~/Downloads/ubuntu-2004.zip
New-Item -Path C:\ubuntu-2004 -ItemType Directory
Expand-Archive -Path ~/Downloads/ubuntu-2004.zip C:\ubuntu-2004
Set-Location C:\ubuntu-2004
& .\ubuntu2004.exe

After, install dependencies and Kiri by running script in the Installing section

Loading KiRI environment

Setup the environment using the following commands.

Make sure KIRI_HOME is the right path to the installation folder

# Kiri environment setup
eval $(opam env)
export KIRI_HOME=${HOME}/.local/share/kiri
export PATH=${KIRI_HOME}/submodules/KiCad-Diff/:${PATH}
export PATH=${KIRI_HOME}/bin:${PATH}

Using KiRI

cd [kicad_git_repo]
kiri board.pro

Command line flags (aka Help)

Command line flags can be seen using the -h flag

kiri -h

Kicad/PCBNew integration

It is possible to integrate KiRI on PCBNew adding a button to the toolbar

# Create folder if it does not exist
mkdir -p ~/.kicad/scripting/plugins

# Copy the plugin there
cd kiri
cp -r kicad_plugin ~/.kicad/scripting/plugins/kiri

Archiving generated files

There is a possibility to archive generated files. to visualize generated files, unpack the folder anywhere and execute the webserver inside of the folder, as shown below:

tar -xvzf kiri-2021.11.18-16h39.tgz
cd kiri
./kiri-webserver.py .

Examples

Schematic view, assets generated using Plotkicadsch

Schematic View

Layout view, assets generated using Kicad-Diff

Layout View

Demo on Youtube (old version)

Kicad Revision Inspector Demo