Skip to content

MIT-OpenCompute/xilinx-flake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xilinx for Nix users

forked from https://gitlab.com/asmir.abdulahovic/nix-xilinx - Adapted to run newer vivado versions

This repo is a collection of files that should help Nix and NixOS users install Xilinx’s software tools - Vivado & Vitis imperatively.

This includes the necessary packages containing the necessary linkers to install & run the full software suite.

Install

Like any other distro user, you should first go to your Xilinx account at: https://www.xilinx.com/support/download.html and download the installation .tar file. To extract run tar xvf FPGA*.tar To run this installer, you must enter in the shell. (DO NOT TRY TO RUN THE .BIN YOU WILL NOT HAVE A GOOD TIME) This tarball is rather large after extraction. Make sure you have roughly 300 GB to spare. (don’t worry, you can delete the zip and download folder later)

Run xilinx-shell with stable Nix > 2.3

nix run github:MIT-OpenCompute/xilinx-flake#xilinx-shell

Installation of vivado & vitis themselves

Installing vivado using .bin sucks install the full tarball and install directly in the command line.

./xsetup -b ConfigGen

Go to ~/.Xilinx/install_config.txt and edit the configuration file Here is an example of what I have as my config as I need a certain Vivado tool for my specific FPGA.

#### Vivado ML Standard Install Configuration ####
Edition=Vivado ML Standard

Product=Vivado

# Path where AMD FPGAs & Adaptive SoCs software will be installed.
Destination=/home/kaitotlex/Xilinx

# Choose the Products/Devices the you would like to install.
Modules=xcv80:0,Zynq UltraScale+ MPSoCs:1,Kintex UltraScale+ FPGAs:0,Virtex UltraScale+ 58G FPGAs:0,xcve2202:0,Vitis Model Composer(A toolbox for Simulink):1,Artix-7 FPGAs:0,Install devices for Alveo and edge acceleration platforms:0,Vitis Embedded Development:0,xcvm1102:0,Zynq-7000 All Programmable SoC:0,xcve2002:0,Virtex UltraScale+ HBM FPGAs:0,Spartan UltraScale+:0,xcve2302:0,Vitis Networking P4:0,Kintex UltraScale FPGAs:0,Power Design Manager (PDM):0,Virtex UltraScale+ FPGAs:0,Artix UltraScale+ FPGAs:0,Spartan-7 FPGAs:0,DocNav:1,Versal RF Series ES1:0,Install Devices for Kria SOMs and Starter Kits:0,xcve2102:0,Kintex-7 FPGAs:0

# Choose the post install scripts you'd like to run as part of the finalization step. Please note that some of these scripts may require user interaction during runtime.
InstallOptions=Acquire or Manage a License Key:0

## Shortcuts and File associations ##
# Choose whether Start menu/Application menu shortcuts will be created or not.
CreateProgramGroupShortcuts=1

# Choose the name of the Start menu/Application menu shortcut. This setting will be ignored if you choose NOT to create shortcuts.
ProgramGroupFolder=AMD Adaptive SoC and FPGA Tools

# Choose whether shortcuts will be created for All users or just the Current user. Shortcuts can be created for all users only if you run the installer as administrator.
CreateShortcutsForAllUsers=0

# Choose whether shortcuts will be created on the desktop or not.
CreateDesktopShortcuts=1

# Choose whether file associations will be created or not.
CreateFileAssociation=1

Then, run ./xsetup -a XilinxEULA,3rdPartyEULA,WebTalkTerms -b Install -c $HOME/.Xilinx/install_config.txt to install the entire application.

Adding the executables to your system

With what was done now, you can run vivado / vitis from the command line with:

nix run github:MIT-OpenCompute/xilinx-flake#vivado

Use nix search github:MIT-OpenCompute/xilinx-flake to view all other packages defined.

It’s likely you’d like to make the FHS environment survive garbage collections and add a desktop launcher to your system. To do that you can follow one of the following paths according to your setup.

For NixOS users with a flakes setup

inputs = {
  # ...
  nix-xilinx = {
    # Recommended if you also override the default nixpkgs flake, common among
    # nixos-unstable users:
    #inputs.nixpkgs.follows = "nixpkgs";
    url = "github:MIT-OpenCompute/xilinx-flake";
  };
  # ...
  outputs = { self, nixpkgs, nix-xilinx }:
  let
    flake-overlays = [
      nix-xilinx.overlay
    ];
  in {
    nixosConfigurations = (
      HOSTNAME = nixpkgs.lib.nixosSystem {
        modules = [ (import ./configuration.nix flake-overlays) ]
      };
    };
  };
};

And in ./configuration.nix:

# All overlays given by flakes
flake-overlays:

{ config, pkgs, options, lib, ... }:
{
  nixpkgs.overlays = [
    (
      final: prev: {
        # Your own overlays...
      }
    )
  ] ++ flake-overlays;
}

Example evaluated here and here.

For NixOS users without a flakes setup

The following setup should also fit flake NixOS users.

Add to your configration.nix (untested, but should work):

  nixpkgs.overlays = let
    nix-xilinx = import (builtins.fetchTarball "https://gitlab.com/doronbehar/nix-xilinx/-/archive/master/nix-xilinx-master.tar.gz");
  in [
    nix-xilinx.overlay
    (
      final: prev: {
        # Your own overlays...
      }
    )
  ];

Usage in Other Flakes / shell.nix

Some people may wish to not install xilinx' tools globally, and only making it part of the buildInputs of their project. Usually this paradigm follows along with direnv
shell.nix / flake.nix setup. For example you can create in your project a shell.nix, or define devShell in your flake.nix similarly to this:

{ pkgs, nix-xilinx }:

pkgs.mkShell {
  buildInputs = (with nix-xilinx.packages.x86_64-linux; [
    vivado
    vitis
  ]);
  # Define some probably useful environment variables
  shellHook = nix-xilinx.shellHooksCommon;
}

Note that xilinx' tools still need to be installed in a user-writeable location for this shellHook to work, as explained here.

Previous work / Credits

This repository is mostly copy paste from nix-matlab.

About

forked from https://gitlab.com/asmir.abdulahovic/nix-xilinx, adapted for new Vivado versions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages