🚀 Getting Started — AITL Chapter 1 Python Baseline

This guide explains how to set up and run the Python baseline model for AITL Chapter 1.
You will install dependencies, execute the main controller, and run simulations for step response and fault scenarios.


1️⃣ Prerequisites


2️⃣ Project Layout (Recap)

Make sure your repository contains:

aitl-silicon-pathway/
├── chapter1_python_model/
│   ├── src/
│   ├── sim/
│   ├── plots/
│   ├── tests/
│   ├── main.py
│   └── requirements.txt
└── docs/
    └── chapter1/
        ├── index.md
        ├── overview.md
        ├── python_model.md
        ├── fsm.md
        ├── api.md
        └── getting_started.md

All commands below assume you start from:

cd aitl-silicon-pathway/chapter1_python_model

3️⃣ Installing Dependencies

From inside chapter1_python_model:

# (Optional but recommended) create virtual environment
python -m venv venv

# Activate venv (Windows)
venv\Scripts\activate

# Activate venv (Linux / macOS)
source venv/bin/activate

# Install required packages
pip install -r requirements.txt

Typical contents of requirements.txt:

numpy
matplotlib

You can extend this list if you add more tooling later.


4️⃣ Running the Main Demo

The simplest way to verify the controller is working:

python main.py

This script typically:

If everything is configured correctly, you should see:


5️⃣ Running the Step Response Simulation

This scenario evaluates dynamic response of the closed-loop system to a step setpoint.

From chapter1_python_model:

python sim/run_step_response.py

Expected behavior:

plots/step_response_YYYYMMDD_HHMMSS.png

If a window does not appear, check:


6️⃣ Running the Fault Scenario Simulation

This scenario verifies fault handling and supervisory logic.

From chapter1_python_model:

python sim/run_fault_scenario.py

Expected behavior:

A plot is generated, typically including:

And a PNG is saved under:

plots/fault_scenario_YYYYMMDD_HHMMSS.png

7️⃣ Saving Plots and Using Them in Docs

All simulation scripts are designed to:

You can then move or copy selected plots into:

docs/chapter1/images/

for use in documentation pages (e.g. python_model.md, fsm.md).


8️⃣ Running Tests (Optional but Recommended)

If you have unit tests under tests/, you can run:

python -m pytest

or

pytest

Common tests include:

This is especially useful before:


9️⃣ Troubleshooting

ModuleNotFoundError: No module named 'src'

Make sure you are running commands from chapter1_python_model:

cd aitl-silicon-pathway/chapter1_python_model
python sim/run_step_response.py

and that the project is structured exactly as shown in the directory listing above.


❓ No plots saved / blank plots


🔗 How This Connects to Later Chapters

The code and behavior you run here will later be:

The Python model is the golden reference.
If you change it, you must also update RTL and verification flows.


✅ Summary

In this Getting Started guide, you:

You are now ready to move deeper into the AITL Silicon Pathway.


© AITL Silicon Pathway Project