Skip to content

My fork of VERICA including a shell.nix and some bugfixes.

License

Notifications You must be signed in to change notification settings

FelixUhle/VERICA

 
 

Repository files navigation

VERICA Fork - Nix Packaging

This is a fork of VERICA with added Nix/Flake support for reproducible builds and easy integration into other Nix-based projects.

For full documentation on VERICA itself (features, configuration, usage), see README_upstream.md.

Changes in this Fork

Bug Fixes

Merged from upstream PR #5 (still open upstream):

  • Fixed shift overflow checks and changed integer literal types to ull
  • Relocated size validation check to execute after virtual probes are incorporated
  • Adapted variable type for loops over extended_probes.size() to allow probe sizes up to 63

Nix Packaging

  • default.nix: Nix derivation that builds verica and installs runtime data files (model/, cell/) to $out/share/verica/
  • flake.nix: Flake interface exposing the package and development shell
  • shell.nix: Development shell (works with both nix-shell and nix develop)

Building with Nix

# Build the package
nix build

# Enter development shell
nix develop
# or with legacy nix-shell
nix-shell

# In dev shell, build manually
make release

Using VERICA as a Dependency

Add this repository as a flake input in your project:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    verica.url = "github:FelixUhle/VERICA";
  };

  outputs = { self, nixpkgs, verica, ... }:
    let
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};
      vericaPkg = verica.packages.${system}.default;
    in {
      devShells.${system}.default = pkgs.mkShell {
        packages = [ vericaPkg ];

        # Create symlinks to verica data files for config compatibility
        shellHook = ''
          mkdir -p verica
          ln -sfn ${vericaPkg.modelDir} verica/model
          ln -sfn ${vericaPkg.cellDir} verica/cell
        '';
      };
    };
}

Accessing Data Files

VERICA requires model and cell library files at runtime. These are installed to the Nix store and exposed via passthru:

Attribute Path
vericaPkg.dataDir /nix/store/...-verica/share/verica
vericaPkg.modelDir /nix/store/...-verica/share/verica/model
vericaPkg.cellDir /nix/store/...-verica/share/verica/cell

The shellHook above creates symlinks in your project directory, so you can use simple relative paths in your verica.json:

{
  "general": {
    "library": { "file": "verica/cell/nang45.txt", "name": "NANG45" },
    "filtering": {
      "sca": { "whitelist": "verica/model/sca-whitelist" }
    }
  },
  "fault-injection": {
    "model": { "mapping": "verica/model/setreset.txt" }
  }
}

Add the symlink directory to your .gitignore:

verica/

Notes

  • The build preserves -march=native for performance (breaks Nix reproducibility but gives better runtime performance)
  • The hardcoded CI boost path is patched out; Nix provides boost via buildInputs

About

My fork of VERICA including a shell.nix and some bugfixes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Verilog 72.6%
  • NewLisp 22.5%
  • C++ 3.9%
  • FIRRTL 0.5%
  • C 0.5%
  • Makefile 0.0%