Skip to content
Snippets Groups Projects
corr_matrix.rdl 5.19 KiB
Newer Older
`include "corr_matrix.vh" //automatically created and added by fwk with conf variables such a C_VERSION ...
BRONES Romain's avatar
BRONES Romain committed

/* default values of defined variables */
`ifndef C_ID
`define C_ID 0x507E1730
`endif
`ifndef C_VERSION
`define C_VERSION 0x00000000
`endif

addrmap corr_matrix {
BRONES Romain's avatar
BRONES Romain committed
    name = "PI corrector with matrix multiplier";
    desyrdl_interface = "AXI4L";


    reg {
        desc="Module Identification Number.";
        default sw = r;
        default hw = r;
        field {} data[32] = `C_ID;
    } ID @0x00;

    reg {
        desc="Module Version Number.";
        default sw = r;
BRONES Romain's avatar
BRONES Romain committed
        default hw = rw;
BRONES Romain's avatar
BRONES Romain committed
        field {} data [32];
    } VERSION @0x04;

    reg {
        desc="X-plane control of the corrector.";
        default sw=rw; default hw=r;
        field {} ENABLE_CORR;
        field {} RST_CORR;
    } CONTROL_X;

    reg {
        desc="Y-plane control of the corrector.";
        default sw=rw; default hw=r;
        field {} ENABLE_CORR;
        field {} RST_CORR;
    } CONTROL_Y;

    reg {
        desc="Theshold autostop.";
        default sw=rw; default hw=r;
        field {} ENABLE;
        field {} RST;
    } THRESH;
BRONES Romain's avatar
BRONES Romain committed

    reg {
        desc="Global status of the corrector.";
        default sw=r; default hw=rw;
        field {} THRESH_REACHED;
    } STATUS;

BRONES Romain's avatar
BRONES Romain committed
    reg {
        desc="Correction coefficient A.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
    } CORR_K1A_X;

    reg {
        desc="Correction coefficient B.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
    } CORR_K1B_X;

    reg {
        desc="Correction coefficient (inverse) C.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
    } CORR_K1IC_X;

    reg {
        desc="Correction coefficient D.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
    } CORR_K1D_X;


    reg {
        desc="Correction coefficient A.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
    } CORR_K2A_X;
BRONES Romain's avatar
BRONES Romain committed

    reg {
        desc="Correction coefficient B.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];

    reg {
        desc="Correction coefficient (inverse) C.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];

    reg {
        desc="Correction coefficient D.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
    } CORR_K2D_X;

    reg {
        desc="Correction coefficient A.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
    } CORR_K1A_Y;

    reg {
        desc="Correction coefficient B.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
    } CORR_K1B_Y;

    reg {
        desc="Correction coefficient (inverse) C.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
    } CORR_K1IC_Y;

    reg {
        desc="Correction coefficient D.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
    } CORR_K1D_Y;


    reg {
        desc="Correction coefficient A.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];

    reg {
        desc="Correction coefficient B.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];

    reg {
        desc="Correction coefficient (inverse) C.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];

    reg {
        desc="Correction coefficient D.";
        desyrdl_data_type="int32";
        field {sw = rw; hw = r;} data[`C_W_COR_COEF];
BRONES Romain's avatar
BRONES Romain committed

    reg {
        desc="Number of ID to count for matrix multiplication.";
        field {sw = rw; hw = r;} data[`C_W_MM_IDCNT] = `C_N_MM_BPM;
BRONES Romain's avatar
BRONES Romain committed
    mem {
        desc = "X Reference orbit.";
        desyrdl_data_type="int32";
        memwidth = 32;
        mementries = 2**`C_W_MM_IDCNT;
BRONES Romain's avatar
BRONES Romain committed
    } external REFORBITX;

    mem {
        desc = "Y Reference orbit.";
        desyrdl_data_type="int32";
        memwidth = 32;
        mementries = 2**`C_W_MM_IDCNT;
BRONES Romain's avatar
BRONES Romain committed
    } external REFORBITY;

    mem {
        desc = "PSC identifier table.";
        memwidth = 32;
        mementries = 2**`C_W_PSCID;
BRONES Romain's avatar
BRONES Romain committed
    } external PSCIDTABLE;


    mem {
        desc = "Matrix multiplication coefficients.";
        desyrdl_data_type="int32";
        memwidth = 32;
        mementries = 2**`C_W_MM_IDCNT;
BRONES Romain's avatar
BRONES Romain committed
    } external MATRIXCOEF[`C_N_MM_PSC];

        desyrdl_data_type="int32";
        sw=r;
        memwidth = 32;
        mementries = 2**`C_W_MM_IDCNT;
    } external ERRORBITX;

    mem {
        desc = "Y Average orbit error";
        desyrdl_data_type="int32";
        sw=r;
        memwidth = 32;
        mementries = 2**`C_W_MM_IDCNT;
    } external ERRORBITY;

    mem {
        desc = "Average correction, both planes";
        desyrdl_data_type="int32";
        sw=r;
        memwidth = 32;
        mementries = 2**`C_W_PSCID;
    } external CORRCMD;