# LCLS-II LLRF Project

This repository includes firmware, software and hardware design files for the LCLS-II LLRF project. The LLRF hardware is divided into 4 different types of chassis (accounting for 5 chassis in one LLRF rack) and you will find the directory structure in this repository match that topology, especially in the case of firmware. The LLRF chassis types are as follows:

- RF Station (RFS),
- Precision Receiver Chassis (PRC),
- Resonance Control,
- Interlocks.


## Hardware

The BMB7 is the main target for all the firmware builds in this repository. The tools used to interact with the board and information for the BMB7 can be found in this [Dropbox](https://www.dropbox.com/sh/rbfcr47um3ty2t0/AADZCUw9kgjIqbv6FQa-_Hara?dl=0) location. A copy of the tools can be found in the `bmb7/` directory, where support Python code for the BMB7 v1.0 and 1.5 can be found in the `r1.0/` and `r1.5/` subdirectories respectively.

The `hardware/` directory contains schematics for the different chassis, along with their connections. The current state of the LLRF rack layout containing the chassis listed above can be found [here](doc/LCLS2_LLRF_Profile_Draft_rev_2.pdf).

## Software

The software directory contains the EPICS soft IOC used to interact with each one of the LLRF sub-systems. Calibration scripts and software specific to each firmware build can be found in the corresponding firmware directory. In the case of the RFS/PRC, it can be found in the `prc/run/` directory.

## Firmware

The firmware directory hierarchy follows the topology of the system. A mostly non-recursive Makefile structure is used to simulate, create automatically generated HDL code and register maps and generate bit files. Dependency lists for Verilog modules are automatically generated using [Icarus Verilog](http://iverilog.icarus.com/).

Currently the RFS and PRC firmware are combined into a single build (in the `prc/` directory) and will eventually be split into separate builds.

## Documentation

Documentation associated with the project can be found in the `doc/` directory and each sub-directory (`firmware/`, `hardware/` and `software/`) each contain a `README` file containing more information specific to those directories.