Commit 21b9a802 authored by Michel Arruat's avatar Michel Arruat
Browse files

New masterFIP lib version 1.1.2



        This pacth fixes a bug in libmasterfip-irq.c preventing the library to
        be thread safe.
        Library version is pushed to 1.1.2
        README file explains where to get wbgen2 to make a full compilation
Signed-off-by: Michel Arruat's avatarMichel Arruat <michel.arruat@cern.ch>
parent 667a0a09
// Future project documentation.. to be completed.
Compiling from root:
- mockturtle requires wbgen2. At CERN wbgen2 can be found here
/acc/local/share/ht_tools/noarch/
Therefore compiling for centos7:
WBGEN2=/acc/local/share/ht_tools/noarch/wbgen2 make CPU=L867
......@@ -318,8 +318,6 @@ static const mstrfip_irq_handler_t mstrfip_irq_handler[] ={
[MSTRFIP_HMQ_O_DIAG_APER_VAR] = mstrfip_handle_diag_aper_var_irq,
};
static struct mstrfip_trtl_buf*
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_ACQ_SLOT_COUNT];
static void* mstrfip_irq_run(void *arg)
{
......@@ -329,6 +327,7 @@ static void* mstrfip_irq_run(void *arg)
struct mstrfip_irq irq = {0};
struct mstrfip_irq_entry_desc *irq_entry = NULL;
struct mstrfip_trtl_buf *trtl;
struct mstrfip_trtl_buf *mfip_irq_trtlbuf[MSTRFIP_HMQ_ACQ_SLOT_COUNT];
for (mq_slot = 0; mq_slot < MSTRFIP_HMQ_ACQ_SLOT_COUNT; ++mq_slot) {
p[mq_slot].fd = mstrfip->hmq_acq_slot[mq_slot]->fd;
......@@ -336,15 +335,15 @@ static void* mstrfip_irq_run(void *arg)
}
// init mstrfip_trtl_buf lookup table
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_PER_VAR] =
mfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_PER_VAR] =
&mstrfip->ba.mcycle->per_vars.trtl;
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_APER_VAR] =
mfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_APER_VAR] =
&mstrfip->ba.mcycle->aper_vars.trtl;
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_APER_MSG] =
mfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_APER_MSG] =
&mstrfip->ba.mcycle->aper_msgs.trtl;
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_DIAG_PER_VAR] =
mfip_irq_trtlbuf[MSTRFIP_HMQ_O_DIAG_PER_VAR] =
&mstrfip->ba.mcycle->diag.trtl;
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_DIAG_APER_VAR] =
mfip_irq_trtlbuf[MSTRFIP_HMQ_O_DIAG_APER_VAR] =
&mstrfip->ba.mcycle->diag.trtl;
mstrfip->ba.irq_run = 1;
......@@ -407,7 +406,7 @@ static void* mstrfip_irq_run(void *arg)
/* event reported: increment evt and process the event */
++evt;
trtl = mstrfip_irq_trtlbuf[mq_slot];
trtl = mfip_irq_trtlbuf[mq_slot];
/* get the turtle message */
res = mstrfip_read_trtlmsg(mstrfip, mq_slot, trtl);
if (res)
......@@ -475,11 +474,17 @@ int mstrfip_irq_stop(struct mstrfip_desc *mstrfip)
}
/* irq thread is stopped, discard any pending message */
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_PER_VAR]->msg_count = 0;
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_APER_VAR]->msg_count = 0;
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_APER_MSG]->msg_count = 0;
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_DIAG_PER_VAR]->msg_count = 0;
mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_DIAG_APER_VAR]->msg_count = 0;
mstrfip->ba.mcycle->per_vars.trtl.msg_count = 0;
mstrfip->ba.mcycle->aper_vars.trtl.msg_count = 0;
mstrfip->ba.mcycle->aper_msgs.trtl.msg_count = 0;
mstrfip->ba.mcycle->diag.trtl.msg_count = 0;
mstrfip->ba.mcycle->diag.trtl.msg_count = 0;;
// mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_PER_VAR]->msg_count = 0;
// mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_APER_VAR]->msg_count = 0;
// mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_APP_APER_MSG]->msg_count = 0;
// mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_DIAG_PER_VAR]->msg_count = 0;
// mstrfip_irq_trtlbuf[MSTRFIP_HMQ_O_DIAG_APER_VAR]->msg_count = 0;
return 0;
}
......@@ -7,7 +7,7 @@ MFIP_GIT_USR = $(shell git config --get-all user.name)
# patch indicates bug fixes
# version of the library
MFIP_LIB_VERSION=0x10101
MFIP_LIB_VERSION=0x10102
# version of the RT software
MFIP_RT_VERSION=0x10101
# version of the FPGA
......
Supports Markdown
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