Commit 9779e820 authored by Lucas Russo's avatar Lucas Russo

src/boards/*: add EPICS mapping options

This is needed as we use a custom mapping between
board/bpm and the bpm_id used to spawn EPICS IOC
processes.
parent 74a31dc7
......@@ -4,6 +4,10 @@
#include "hw/pcie_regs.h"
#include "acq_chan_afcv3.h"
#define NUM_MAX_SLOTS 12
#define NUM_MAX_BPM_PER_SLOT 2
#define NUM_MAX_BPMS (NUM_MAX_SLOTS * NUM_MAX_BPM_PER_SLOT)
#define NUM_FMC130M_4CH_SMIOS 2
/*********************** Static AFCv3 FPGA layout ***********************/
......
......@@ -4,6 +4,10 @@
#include "hw/pcie_regs.h"
#include "acq_chan_ml605.h"
#define NUM_MAX_SLOTS 1
#define NUM_MAX_BPM_PER_SLOT 2
#define NUM_MAX_BPMS (NUM_MAX_SLOTS * NUM_MAX_BPM_PER_SLOT)
#define NUM_FMC130M_4CH_SMIOS 1
/*********************** Static ML605 FPGA layout ***********************/
......
......@@ -26,6 +26,7 @@
/* General dependencies */
#include "board.h"
#include "epics_mapping.h"
#include "revision.h"
#include "acq_chan_gen_defs.h"
......
/*
* Copyright (C) 2015 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU LGPL, version 3 or any later version.
*/
#ifndef _EPICS_MAPPING_H_
#define _EPICS_MAPPING_H_
#ifdef __cplusplus
extern "C" {
#endif
/* BPM reverse mappping structure */
typedef struct {
int bpm_id;
} board_epics_rev_map_t;
typedef struct {
int telnet_port;
} board_epics_opts_t;
/* EPICS mapping definitions */
extern const board_epics_rev_map_t board_epics_rev_map [NUM_MAX_SLOTS+1][NUM_MAX_BPM_PER_SLOT];
extern const board_epics_opts_t board_epics_opts [NUM_MAX_SLOTS+1][NUM_MAX_BPM_PER_SLOT];
#ifdef __cplusplus
}
#endif
#endif
board_DIR = $(SRC_DIR)/boards/afcv3
board_OBJS = $(board_DIR)/epics_mapping.o
/*
* Copyright (C) 2015 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU LGPL, version 3 or any later version.
*/
#include "bpm_server.h"
/* Undef ASSERT_ALLOC to avoid conflicting with other ASSERT_ALLOC */
#ifdef ASSERT_TEST
#undef ASSERT_TEST
#endif
#define ASSERT_TEST(test_boolean, err_str, err_goto_label, /* err_core */ ...) \
ASSERT_HAL_TEST(test_boolean, DEV_IO, "[dev_io:epics]", \
err_str, err_goto_label, /* err_core */ __VA_ARGS__)
#ifdef ASSERT_ALLOC
#undef ASSERT_ALLOC
#endif
#define ASSERT_ALLOC(ptr, err_goto_label, /* err_core */ ...) \
ASSERT_HAL_ALLOC(ptr, DEV_IO, "[dev_io:epics]", \
devio_err_str(DEVIO_ERR_ALLOC), \
err_goto_label, /* err_core */ __VA_ARGS__)
#ifdef CHECK_ERR
#undef CHECK_ERR
#endif
#define CHECK_ERR(err, err_type) \
CHECK_HAL_ERR(err, DEV_IO, "[dev_io:epics]", \
devio_err_str (err_type))
/* Reverse bpm-sw <-> EPICS board mapping */
const board_epics_rev_map_t board_epics_rev_map[NUM_MAX_SLOTS+1][NUM_MAX_BPM_PER_SLOT] = {
/* board, bpm */ /* bpm_id */
/* 0, 0 (INVALID) */ {{-1},
/* 0, 1 (INVALID) */ {-1}},
/* 1, 0 */ {{0},
/* 1, 1 */ {1}},
/* 2, 0 */ {{2},
/* 2, 1 */ {3}},
/* 3, 0 */ {{4},
/* 3, 1 */ {5}},
/* 4, 0 */ {{6},
/* 4, 1 */ {7}},
/* 5, 0 */ {{8},
/* 5, 1 */ {9}},
/* 6, 0 */ {{10},
/* 6, 1 */ {11}},
/* 7, 0 */ {{12},
/* 7, 1 */ {13}},
/* 8, 0 */ {{14},
/* 8, 1 */ {15}},
/* 9, 0 */ {{16},
/* 9, 1 */ {17}},
/* 10, 0 */ {{18},
/* 10, 1 */ {19}},
/* 11, 0 */ {{20},
/* 11, 1 */ {21}},
/* 12, 0 */ {{22},
/* 12, 1 */ {23}}
};
const board_epics_opts_t board_epics_opts[NUM_MAX_SLOTS+1][NUM_MAX_BPM_PER_SLOT] = {
/* board, bpm */ /* bpm_id */
/* 0, 0 (INVALID) */ {{-1},
/* 0, 1 (INVALID) */ {-1}},
/* 1, 0 */ {{20000 + 0},
/* 1, 1 */ {20000 + 1}},
/* 2, 0 */ {{20000 + 2},
/* 2, 1 */ {20000 + 3}},
/* 3, 0 */ {{20000 + 4},
/* 3, 1 */ {20000 + 5}},
/* 4, 0 */ {{20000 + 6},
/* 4, 1 */ {20000 + 7}},
/* 5, 0 */ {{20000 + 8},
/* 5, 1 */ {20000 + 9}},
/* 6, 0 */ {{20000 + 10},
/* 6, 1 */ {20000 + 11}},
/* 7, 0 */ {{20000 + 12},
/* 7, 1 */ {20000 + 13}},
/* 8, 0 */ {{20000 + 14},
/* 8, 1 */ {20000 + 15}},
/* 9, 0 */ {{20000 + 16},
/* 9, 1 */ {20000 + 17}},
/* 10, 0 */ {{20000 + 18},
/* 10, 1 */ {20000 + 19}},
/* 11, 0 */ {{20000 + 20},
/* 11, 1 */ {20000 + 21}},
/* 12, 0 */ {{20000 + 22},
/* 12, 1 */ {20000 + 23}}
};
board_DIR = $(SRC_DIR)/boards/ml605
board_OBJS = $(board_DIR)/epics_mapping.o
/*
* Copyright (C) 2015 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU LGPL, version 3 or any later version.
*/
#include "bpm_server.h"
/* Undef ASSERT_ALLOC to avoid conflicting with other ASSERT_ALLOC */
#ifdef ASSERT_TEST
#undef ASSERT_TEST
#endif
#define ASSERT_TEST(test_boolean, err_str, err_goto_label, /* err_core */ ...) \
ASSERT_HAL_TEST(test_boolean, DEV_IO, "[dev_io:epics]", \
err_str, err_goto_label, /* err_core */ __VA_ARGS__)
#ifdef ASSERT_ALLOC
#undef ASSERT_ALLOC
#endif
#define ASSERT_ALLOC(ptr, err_goto_label, /* err_core */ ...) \
ASSERT_HAL_ALLOC(ptr, DEV_IO, "[dev_io:epics]", \
devio_err_str(DEVIO_ERR_ALLOC), \
err_goto_label, /* err_core */ __VA_ARGS__)
#ifdef CHECK_ERR
#undef CHECK_ERR
#endif
#define CHECK_ERR(err, err_type) \
CHECK_HAL_ERR(err, DEV_IO, "[dev_io:epics]", \
devio_err_str (err_type))
/* Reverse bpm-sw <-> EPICS board mapping */
const board_epics_rev_map_t board_epics_rev_map[NUM_MAX_SLOTS+1][NUM_MAX_BPM_PER_SLOT] = {
/* board, bpm */ /* bpm_id */
/* 0, 0 (INVALID) */ {{-1},
/* 0, 1 (INVALID) */ {-1}},
/* 1, 0 */ {{0},
/* 1, 1 */ {1}}
};
const board_epics_opts_t board_epics_opts[NUM_MAX_SLOTS+1][NUM_MAX_BPM_PER_SLOT] = {
/* board, bpm */ /* bpm_id */
/* 0, 0 (INVALID) */ {{-1},
/* 0, 1 (INVALID) */ {-1}},
/* 1, 0 */ {{20000 + 0},
/* 1, 1 */ {20000 + 1}}
};
revision_DIR = $(SRC_DIR)/revision
revision_OBJS = $(revision_DIR)/revision.o
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment