#!/bin/sh

PFX=../../../software/include

# Memory map for 1 trigger unit
cheby -i trigunit_regs.cheby --gen-c $PFX/trigunit_regs.h
cheby -i vtudiag_regs.cheby --gen-c $PFX/vtudiag_regs.h

# Memory map for the trigger units
cheby -i wr2rf_rftrigger_regs.cheby --gen-c $PFX/wr2rf_rftrigger_regs.h

cheby -i wr2rf_init_rf_regs.cheby --gen-c $PFX/wr2rf_init_rf_regs.h
cheby -i wr2rf_init_rf_ch_regs.cheby --gen-c $PFX/wr2rf_init_rf_ch_regs.h

cheby -i wr2rf_init_regs.cheby --gen-c $PFX/wr2rf_init_regs.h
cheby -i oc_spi16_regs.cheby --gen-c $PFX/oc_spi16_regs.h

cheby -i wr2rf_ctrl_regs.cheby --gen-c $PFX/wr2rf_ctrl_regs.h

# RFNCO
( cd ../../../dependencies/RFNCO/MemMap/stdInfo ; cheby -i ipInfo.cheby --gen-c ) > $PFX/ipInfo.h
( cd ../../../dependencies/RFNCO/MemMap/ ; cheby -i RFNCO.cheby --gen-c ) > $PFX/wr2rf_rfnco_regs.h

cheby -i ../../../dependencies/stdinfo/hwInfo.cheby --gen-c $PFX/hwInfo.h

# Top-level memory map
cheby -i wr2rf_vme_regs.cheby --gen-c $PFX/wr2rf_vme_regs.h
