FABulous Configuration Variables

FABulous can use environment variables to configure options, paths and projects. We distinguish between two types of environment variables: global and project specific environment variables.

  • Global environment variables are used to configure FABulous itself. They always start with FAB_.

  • Project specific environment variables are used to configure a specific FABulous project. They always start with FAB_PROJ_.

All environment variables can be set in the shell before running FABulous or can be set via .env files.

.env File Locations

Scope

Location

How to use

User global

~/.config/FABulous/.env

Created automatically or manually

Global (explicit)

Any path

Pass via --globalDotEnv CLI argument

Project (auto-detected)

<project_dir>/.FABulous/.env

Placed inside your project

Project (explicit)

Any path

Pass via --projectDotEnv CLI argument

Note

Environment variables set in the shell always have the highest priority, followed by project-specific .env files, then global .env files.

PDK Resolution Logic

FABulous uses three environment variables to locate and manage a Process Design Kit (PDK) for back-end GDS generation.

Variable

Purpose

FAB_PDK

Name of the PDK (e.g. ihp-sg13g2)

FAB_PDK_ROOT

File-system path to the PDK installation directory

FAB_PDK_HASH

Version hash identifying a specific PDK snapshot

Default value of FAB_PDK

When a new project is created with create_project, FAB_PDK is set to ihp-sg13g2 in the project .env file by default. This value can be overridden afterward.

Resolution at startup

When FABulous loads its settings, the following rules determine how the PDK is resolved. For ciel-supported PDKs, FABulous handles installation and activation automatically, so there is no need to manually run ciel enable.

  1. Neither FAB_PDK nor FAB_PDK_ROOT is set. A warning is logged and GDS features are unavailable.

  2. FAB_PDK_ROOT is set but FAB_PDK is missing. An error is raised asking the user to set FAB_PDK.

  3. FAB_PDK is set without FAB_PDK_ROOT, and the PDK belongs to a ciel-supported family. FAB_PDK_ROOT is automatically resolved from the ciel home directory and the PDK is installed and activated via ciel.

  4. FAB_PDK is set without FAB_PDK_ROOT, and the PDK is not ciel-supported. An error is raised asking the user to set FAB_PDK_ROOT manually.

  5. Both are set, but the PDK is not a ciel family. FABulous assumes a custom PDK with manual setup. The path must exist on disk.

  6. Both are set and the PDK is a ciel family. The recommended FAB_PDK_HASH is resolved from librelane. If the user did not provide FAB_PDK_HASH, it is filled in automatically; if the user-provided value differs from the recommended one, a mismatch warning is logged. The PDK is then installed and activated via ciel.

Global Environment Variables

Variable

Environment Variable

Type

Default

User Value

Description

user_config_dir

FAB_USER_CONFIG_DIR

Path

(dynamic)

/path/to/file

-

oss_cad_suite

FAB_OSS_CAD_SUITE

Path

None

/path/to/file

-

yosys_path

FAB_YOSYS_PATH

Path

yosys

/path/to/file

-

opensta_path

FAB_OPENSTA_PATH

Path

sta

/path/to/file

-

nextpnr_path

FAB_NEXTPNR_PATH

Path

nextpnr-generic

/path/to/file

-

iverilog_path

FAB_IVERILOG_PATH

Path

iverilog

/path/to/file

-

vvp_path

FAB_VVP_PATH

Path

vvp

/path/to/file

-

ghdl_path

FAB_GHDL_PATH

Path

ghdl

/path/to/file

-

klayout_path

FAB_KLAYOUT_PATH

Path

klayout

/path/to/file

-

openroad_path

FAB_OPENROAD_PATH

Path

openroad

/path/to/file

-

fabulator_root

FAB_FABULATOR_ROOT

Path

None

/path/to/file

-

models_pack

FAB_MODELS_PACK

Path

None

/path/to/file

-

switch_matrix_debug_signal

FAB_SWITCH_MATRIX_DEBUG_SIGNAL

bool

False

true / false

-

editor

FAB_EDITOR

str

None

any string

-

verbose

FAB_VERBOSE

int

0

1, 2

-

debug

FAB_DEBUG

bool

False

true / false

-

pdk_root

FAB_PDK_ROOT

Path

None

/path/to/file

Root directory of the PDK installation

pdk

FAB_PDK

str

None

any string

PDK name (e.g. ‘ihp-sg13g2’)

pdk_hash

FAB_PDK_HASH

str

None

any string

Specific PDK version hash; auto-resolved from librelane when omitted if the PDK is supported by ciel

fabric_die_area

FAB_FABRIC_DIE_AREA

tuple

(0, 0, 1000, 1000)

[0, 0, 1000, 1000]

-

windows_warning_acknowledged

FAB_WINDOWS_WARNING_ACKNOWLEDGED

bool

False

true / false

-

Project Specific Environment Variables

Variable

Environment Variable

Type

Default

User Value

Description

proj_dir

FAB_PROJ_DIR

Path

(dynamic)

/path/to/file

-

proj_lang

FAB_PROJ_LANG

HDLType

HDLType.VERILOG

verilog, vhdl, sv

-

proj_version_created

FAB_PROJ_VERSION_CREATED

Version

0.0.1

1.2.3

-

proj_version

FAB_PROJ_VERSION

Version

-

1.2.3

-

Interactive CLI Settables

These variables can be set and get interactively in the FABulous CLI using the set and get commands.

Usage:

FABulous> set <variable> <value>
FABulous> get <variable>

Variable

Type

Description

projectDir

Path

The directory of the project

csvFile

Path

The fabric file

verbose

bool

verbose output

force

bool

force execution