openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

cmicx_sim_schan.c (57177B)


      1 /*
      2  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      3  * 
      4  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      5  */
      6 
      7 
      8 
      9 /*
     10  * cmicx_sim_schan.c
     11  *
     12  * implements support for schan operations in the cmicx simulation
     13  */
     14 
     15 
     16 #include <string.h>
     17 #ifndef CMICX_STANDALONE_SIM
     18  #include <../systems/sim/pcid/cmicx_sim.h>
     19  #include <../systems/sim/pcid/cmicx_sim_pcid.h>
     20  #include <../systems/sim/pcid/cmicx_sim_schan.h>
     21  #include <../systems/sim/pcid/cmicsim.h>
     22  #include <../include/soc/schanmsg.h>
     23 #else
     24  #include "cmicx_sim.h"
     25  #include "cmicx_sim_pcid.h"
     26  #include "cmicx_sim_schan.h"
     27 #endif
     28 
     29 
     30 /* external cmicx global pointer */
     31 extern cmicx_t *cmicx;
     32 
     33 /* intializes an schan channel */
     34 bool cmicx_schan_init(cmicx_schan_data_t *schan_data,char *id_string) {
     35 
     36     int i;
     37 
     38     /* if the given id string is too long, log an error and quit */
     39     if ((strlen(id_string)+1)>CMIC_SCHAN_ID_STRING_LENGTH) {
     40         cmicx_error("ERROR: given id string \"");
     41         cmicx_error(id_string);
     42         cmicx_error("\" for schan is too long.\n");
     43         return false;
     44     }
     45 
     46     /* copy the id string to the storage for the schan */
     47     strcpy(schan_data->id_string,id_string);
     48 
     49     /* set all control fields of the schan data structure */
     50     schan_data->ctrl_schan_error    = false;
     51     schan_data->ctrl_timeout        = false;
     52     schan_data->ctrl_nack           = false;
     53     schan_data->ctrl_ser_check_fail = false;
     54     schan_data->ctrl_abort          = false;
     55     schan_data->ctrl_msg_done       = false;
     56     schan_data->ctrl_msg_start      = false;
     57 
     58     /* error register states */
     59     schan_data->err_op_code   = 0;
     60     schan_data->err_dst_port  = 0;
     61     schan_data->err_src_port  = 0;
     62     schan_data->err_data_len  = 0;
     63     schan_data->err_errbit    = 0;
     64     schan_data->err_err_code  = 0;
     65     schan_data->err_nack      = 0;
     66 
     67     /* ack data beat count register states */
     68     schan_data->ack_data_beat_count = 0;
     69 
     70     /* message registers */
     71     for (i=0; i<CMIC_SCHAN_NUM_MESSAGE_REGS; i++) {
     72         schan_data->message_reg[i] = 0;
     73     }
     74 
     75     /* set pending access fields fo the schan structure */
     76     schan_data->access_running   = false;
     77     schan_data->access_opcode    = 0;
     78     schan_data->access_countdown = 0;
     79 
     80     /* successful initialization complete */
     81     cmicx_log("successfully init'd \"");
     82     cmicx_log(schan_data->id_string);
     83     cmicx_log("\".");
     84     cmicx_log_newline();
     85     return true;
     86 }
     87 
     88 
     89 /* updates the state of a given schan */
     90 bool cmicx_schan_update(pcid_info_t *pcid_info, cmicx_schan_data_t *schan_data)
     91 {
     92     /* variables */
     93     int                  num_words;
     94     reg_t                ack_command[CMIC_SCHAN_NUM_MESSAGE_REGS];
     95     int                  ack_num_words = 0;
     96 
     97     /* print log messages for this schan */
     98     cmicx_log_level_set(0);
     99     cmicx_log("updating \"");
    100     cmicx_log(schan_data->id_string);
    101     cmicx_log("\"... ");
    102     cmicx_log_level_set(3);
    103 
    104 
    105     /* if we have an access running, decrement the timeout and return ACK if necessary */
    106     /* if not, we just bail */
    107     if (schan_data->access_running) {
    108         schan_data->access_countdown--;
    109         if (schan_data->access_countdown==0) {
    110 
    111             /* complete the sbus command access if possible */
    112             if (cmic_schan_sbus_command_complete(pcid_info, schan_data->message_reg,ack_command,1,&num_words)==true) {
    113 
    114                 cmicx_log(" command was completed on \"");
    115                 cmicx_log(schan_data->id_string);
    116                 cmicx_log("\".");
    117                 cmicx_log_newline();
    118                 ack_num_words = (CMIC_SCHAN_COMMAND_STRIP_DLEN(ack_command[0])/CMICX_BYTES_PER_WORD)+1;
    119                 memcpy((void *)&(schan_data->message_reg[0]),(void *)ack_command,(ack_num_words*sizeof(reg_t)));   /* note we are overwriting the schan command data here. this is the desired behavior. */
    120 
    121                 /* set control signals after successfully completing ack for sbus command */
    122                 schan_data->access_running = false;
    123                 schan_data->ctrl_msg_done  = true;
    124                 schan_data->ctrl_msg_start = false;
    125                 schan_data->ack_data_beat_count = (ack_num_words-1);
    126 
    127             }
    128             else {
    129                 cmicx_log("ERROR: could not successfully start sbus command for new schan access.\n");
    130                 return false;
    131             }
    132 
    133         }
    134 
    135     }
    136 
    137     /* end update successfully */
    138     cmicx_log_level_set(0);
    139     cmicx_log("done.");
    140     cmicx_log_newline();
    141     cmicx_log_level_set(3);
    142     return true;
    143 }
    144 
    145 
    146 /* schan command building function (from opcode, blockid/dport, etc.) */
    147 void cmic_schan_command_build(schan_command_opcode opcode,int dport,int dlen,bool err,char ecode,bool dma,char bank,bool nack,reg_t *command) {
    148 
    149     *command = 0;
    150     REG_FIELD_SET_TO(*command,CMIC_SCHAN_COMMAND_OPCODE_MSB,  CMIC_SCHAN_COMMAND_OPCODE_LSB,  (int)opcode);
    151     REG_FIELD_SET_TO(*command,CMIC_SCHAN_COMMAND_DPORT_MSB,   CMIC_SCHAN_COMMAND_DPORT_LSB,         dport);
    152     REG_FIELD_SET_TO(*command,CMIC_SCHAN_COMMAND_DLEN_MSB,    CMIC_SCHAN_COMMAND_DLEN_LSB,           dlen);
    153     REG_BIT_SET_TO(  *command,CMIC_SCHAN_COMMAND_ERR_BIT,                                             err);
    154     REG_FIELD_SET_TO(*command,CMIC_SCHAN_COMMAND_ECODE_MSB,   CMIC_SCHAN_COMMAND_ECODE_LSB,         ecode);
    155     REG_BIT_SET_TO(  *command,CMIC_SCHAN_COMMAND_DMA_BIT,                                             dma);
    156     REG_FIELD_SET_TO(*command,CMIC_SCHAN_COMMAND_BANK_MSB,    CMIC_SCHAN_COMMAND_BANK_LSB,           bank);
    157     REG_BIT_SET_TO(  *command,CMIC_SCHAN_COMMAND_NACK_BIT,                                           nack);
    158 
    159 }
    160 
    161 
    162 /* initiates an schan command access */
    163 bool cmic_schan_access_start(cmicx_schan_data_t *schan_data) {
    164 
    165     /* variables */
    166     reg_t sbus_command = schan_data->message_reg[0];
    167     int   i;
    168     bool is_write;
    169 
    170     /* logging */
    171     cmicx_log("attempting to start new schan command access on \"");
    172     cmicx_log(schan_data->id_string);
    173     cmicx_log("\"... ");
    174 
    175     /* if there is an access currently running or software hasnt cleared the msg_done bit, then we have a problem */
    176     if (schan_data->access_running) {
    177        cmicx_log("failed. access already pending.\n");
    178        return false;
    179     }
    180     if (schan_data->ctrl_msg_done)
    181     {
    182        cmicx_log("failed. schan msg_done bit not cleared before starting new access (setting msg_start).\n");
    183        return false;
    184     }
    185 
    186     /* begin a new sbus command access if possible, based on the sbus command (first word/"opcode") */
    187     if (cmic_schan_sbus_command_start(sbus_command,&is_write)==true) {
    188 
    189         /* set variables for successfully beginning schan access, and print log messages */
    190         schan_data->access_running   = true;
    191         schan_data->access_opcode    = CMIC_SCHAN_COMMAND_STRIP_OPCODE(sbus_command);
    192         schan_data->access_countdown = CMIC_SCHAN_ACCESS_COUNTDOWN_VALUE;
    193         cmicx_log(" mem/data words with command: ");
    194         for (i=0; i<(CMIC_SCHAN_COMMAND_STRIP_DLEN(sbus_command)/CMICX_BYTES_PER_WORD); i++) {
    195             cmicx_log_reg(schan_data->message_reg[1+i]);
    196             cmicx_log(", ");
    197         }
    198         cmicx_log_newline();
    199 
    200     }
    201     else {
    202         cmicx_log("ERROR: could not successfully start sbus command for new schan access.\n");
    203         return false;
    204     }
    205 
    206     return true;
    207 
    208 }
    209 
    210 
    211 /* attempts to abort a currently active schan access */
    212 bool cmic_schan_access_abort(cmicx_schan_data_t *schan_data) {
    213 
    214     /* if we have an access running, abort it and log a message, otherwise, just log a message that we could not abort. */
    215     if (schan_data->access_running) {
    216         schan_data->access_running = false;
    217         cmicx_log("schan access on \"");
    218         cmicx_log(schan_data->id_string);
    219         cmicx_log("\" successfully aborted.");
    220         cmicx_log_newline();
    221         return true;
    222     }
    223     else {
    224         cmicx_log("could not abort schan access on \"");
    225         cmicx_log(schan_data->id_string);
    226         cmicx_log("\", no access currently pending.\n");
    227         return false;
    228     }
    229 
    230 }
    231 
    232 
    233 /* gets an sbus ring number from a block id, using the SBUS_RING_MAP registers configured by software */
    234 void cmic_schan_sbus_ring_get(int blockid,int *ringnum) {
    235 
    236     int ring_map_field_lsb = 0;
    237     int ring_map_field_msb = 0;
    238 
    239     switch (blockid%CMIC_SBUS_RINGS_PER_MAP_REG) {
    240         case 0:
    241             ring_map_field_lsb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_0_LSB;
    242             ring_map_field_msb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_0_MSB;
    243             break;
    244         case 1:
    245             ring_map_field_lsb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_1_LSB;
    246             ring_map_field_msb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_1_MSB;
    247             break;
    248         case 2:
    249             ring_map_field_lsb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_2_LSB;
    250             ring_map_field_msb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_2_MSB;
    251             break;
    252         case 3:
    253             ring_map_field_lsb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_3_LSB;
    254             ring_map_field_msb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_3_MSB;
    255             break;
    256         case 4:
    257             ring_map_field_lsb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_4_LSB;
    258             ring_map_field_msb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_4_MSB;
    259             break;
    260         case 5:
    261             ring_map_field_lsb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_5_LSB;
    262             ring_map_field_msb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_5_MSB;
    263             break;
    264         case 6:
    265             ring_map_field_lsb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_6_LSB;
    266             ring_map_field_msb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_6_MSB;
    267             break;
    268         case 7:
    269             ring_map_field_lsb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_7_LSB;
    270             ring_map_field_msb = CMIC_SBUS_RING_MAP_RING_NUM_SBUS_ID_7_MSB;
    271             break;
    272     }
    273 
    274     switch (blockid/CMIC_SBUS_RINGS_PER_MAP_REG) {
    275         case 0:
    276             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_0_7_reg,ring_map_field_msb,ring_map_field_lsb);
    277             return;
    278         case 1:
    279             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_8_15_reg,ring_map_field_msb,ring_map_field_lsb);
    280             return;
    281         case 2:
    282             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_16_23_reg,ring_map_field_msb,ring_map_field_lsb);
    283             return;
    284         case 3:
    285             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_24_31_reg,ring_map_field_msb,ring_map_field_lsb);
    286             return;
    287         case 4:
    288             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_32_39_reg,ring_map_field_msb,ring_map_field_lsb);
    289             return;
    290         case 5:
    291             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_40_47_reg,ring_map_field_msb,ring_map_field_lsb);
    292             return;
    293         case 6:
    294             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_48_55_reg,ring_map_field_msb,ring_map_field_lsb);
    295             return;
    296         case 7:
    297             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_56_63_reg,ring_map_field_msb,ring_map_field_lsb);
    298             return;
    299         case 8:
    300             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_64_71_reg,ring_map_field_msb,ring_map_field_lsb);
    301             return;
    302         case 9:
    303             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_72_79_reg,ring_map_field_msb,ring_map_field_lsb);
    304             return;
    305         case 10:
    306             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_80_87_reg,ring_map_field_msb,ring_map_field_lsb);
    307             return;
    308         case 11:
    309             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_88_95_reg,ring_map_field_msb,ring_map_field_lsb);
    310             return;
    311         case 12:
    312             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_96_103_reg,ring_map_field_msb,ring_map_field_lsb);
    313             return;
    314         case 13:
    315             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_104_111_reg,ring_map_field_msb,ring_map_field_lsb);
    316             return;
    317         case 14:
    318             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_112_119_reg,ring_map_field_msb,ring_map_field_lsb);
    319             return;
    320         case 15:
    321             *ringnum = REG_FIELD_GET(cmicx->sbus_ring_map_120_127_reg,ring_map_field_msb,ring_map_field_lsb);
    322             return;
    323         default:
    324             cmicx_log("Bad block id number when attempting to get sbus ring number from sbus ring map\n");
    325             return;
    326     }
    327 
    328 }
    329 
    330 /* helper function to start an sbus command. used by schan and sbus_dma */
    331 bool cmic_schan_sbus_command_start(reg_t sbus_command,bool *is_write) {
    332 
    333     /* variables */
    334     schan_command_opcode opcode     = CMIC_SCHAN_COMMAND_STRIP_OPCODE(sbus_command);
    335     int                  blockid    = CMIC_SCHAN_COMMAND_STRIP_DPORT( sbus_command);
    336     char                 opcode_id[16];
    337     int                  ringnum;
    338 
    339     /* get the sbus ringnum based on the blockid */
    340     cmic_schan_sbus_ring_get(blockid,&ringnum);
    341 
    342     /* switch the opcode to determine the new type of access, and check that the dlen corresponds to known access limits. */
    343     /* begin a new sbus command access if possible. */
    344     switch (opcode) {
    345         case SCHAN_MEM_RD:
    346             strcpy(opcode_id,"MEM_RD");
    347             *is_write = false;
    348             break;
    349         case SCHAN_MEM_WR:
    350             strcpy(opcode_id,"MEM_WR");
    351             *is_write = true;
    352             break;
    353         case SCHAN_REG_RD:
    354             strcpy(opcode_id,"REG_RD");
    355             *is_write = false;
    356             break;
    357         case SCHAN_REG_WR:
    358             strcpy(opcode_id,"REG_WR");
    359             *is_write = true;
    360             break;
    361         case SCHAN_TBL_INSERT:
    362             strcpy(opcode_id,"TBL_INSERT");
    363             *is_write = true;
    364             break;
    365         case SCHAN_TBL_DELETE:
    366             strcpy(opcode_id,"TBL_DELETE");
    367             *is_write = true;
    368             break;
    369         case SCHAN_TBL_LOOKUP:
    370             strcpy(opcode_id,"TBL_LOOKUP");
    371             *is_write = true;
    372             break;
    373         case SCHAN_PUSH:
    374             strcpy(opcode_id,"PUSH");
    375             *is_write = true;
    376             break;
    377         case SCHAN_POP:
    378             strcpy(opcode_id,"POP");
    379             *is_write = false;
    380             break;
    381         case SCHAN_MEM_RD_ACK:       /* pass-through */
    382         case SCHAN_MEM_WR_ACK:       /* pass-through */
    383         case SCHAN_REG_RD_ACK:       /* pass-through */
    384         case SCHAN_REG_WR_ACK:       /* pass-through */
    385         case SCHAN_TBL_INSERT_ACK:   /* pass-through */
    386         case SCHAN_TBL_DELETE_ACK:   /* pass-through */
    387         case SCHAN_TBL_LOOKUP_ACK:   /* pass-through */
    388         case SCHAN_PUSH_ACK:         /* pass-through */
    389         case SCHAN_POP_ACK:          /* pass-through */
    390         default:
    391             cmicx_log("ERROR: invalid sbus command opcode supplied for new sbus command access.\n");
    392             return false;
    393     }
    394 
    395     /* display log message for successful start of sbus command and return true */
    396     cmicx_log("successfully started ");
    397     cmicx_log(opcode_id);
    398     cmicx_log(" sbus command access. driving command on ring ");
    399     cmicx_log_int(ringnum);
    400     cmicx_log(". ");
    401     return true;
    402 
    403 }
    404 
    405 /* helper function to complete an sbus command. used by schan and sbus dma. command points to an array containing the actual sbus command (first word) and all */
    406 /* associated data words/addresses. likewise, ack_command points to an array containing the response sbus command (ack) and all data wordsd that may come with it. */
    407 /* expected resp words is the expected number of data words in a response (may not be what is actually returned). num_words_in_command tells the caller how many words */
    408 /* in total were in the original sent sbus command. */
    409 bool cmic_schan_sbus_command_complete(pcid_info_t *pcid_info, reg_t *command,reg_t *ack_command,int expected_resp_words,int *num_words_in_command) {
    410 
    411     /* variables */
    412     int                  dlen, opcode, dst_blk, acc_type;
    413     char                 opcode_id[16];
    414     schan_command_opcode ack_opcode;
    415     int                  ack_dlen;
    416     schan_msg_t          *msg;
    417 
    418     soc_schan_header_cmd_get(pcid_info->unit, (schan_header_t *)&command[0], &opcode,
    419                              &dst_blk, NULL, &acc_type, &dlen, NULL, NULL);
    420     msg = (schan_msg_t *)command;
    421 
    422     /* determine which ack we need to send and the ack dlen, based on the command opcode */
    423     switch (opcode)
    424     {
    425         case SCHAN_MEM_RD:
    426             (void)soc_internal_extended_read_mem(pcid_info, dst_blk, acc_type,
    427                                                  msg->readcmd.address,
    428                                                  &(ack_command[1]));
    429             ack_opcode = SCHAN_MEM_RD_ACK;
    430             ack_dlen   = (expected_resp_words*CMIC_SBUS_DMA_BYTES_PER_WORD);
    431             strcpy(opcode_id, "MEM_RD");
    432             *num_words_in_command = 2;
    433             break;
    434         case SCHAN_MEM_WR:
    435             (void)soc_internal_extended_write_mem(pcid_info, dst_blk, acc_type,
    436                                                   msg->writecmd.address,
    437                                                   msg->writecmd.data);
    438             ack_opcode = SCHAN_MEM_WR_ACK;
    439             ack_dlen   = 0;
    440             strcpy(opcode_id, "MEM_WR");
    441             *num_words_in_command = 2+(dlen/CMIC_SBUS_DMA_BYTES_PER_WORD);
    442             break;
    443         case SCHAN_REG_RD:
    444             cmicx_switch_reg_read(command[1],&ack_command[1]);
    445             ack_opcode = SCHAN_REG_RD_ACK;
    446             ack_dlen   = CMIC_SBUS_DMA_BYTES_PER_WORD;
    447             strcpy(opcode_id, "REG_RD");
    448             *num_words_in_command = 2;
    449             break;
    450         case SCHAN_REG_WR:
    451             cmicx_switch_reg_write(command[1],command[2]);
    452             ack_opcode = SCHAN_REG_WR_ACK;
    453             ack_dlen   = 0;
    454             strcpy(opcode_id, "REG_WR");
    455             *num_words_in_command = 3;
    456             break;
    457         case SCHAN_TBL_INSERT:
    458             ack_opcode = SCHAN_TBL_INSERT_ACK;
    459             ack_dlen   = 0;
    460             strcpy(opcode_id, "TBL_INSERT");
    461             *num_words_in_command = 3;
    462             break;
    463         case SCHAN_TBL_DELETE:
    464             ack_opcode = SCHAN_TBL_DELETE_ACK;
    465             ack_dlen   = 0;
    466             strcpy(opcode_id, "TBL_DELETE");
    467             *num_words_in_command = 2;
    468             break;
    469         case SCHAN_TBL_LOOKUP:
    470             ack_opcode     = SCHAN_TBL_LOOKUP_ACK;
    471             ack_dlen       = CMIC_SBUS_DMA_BYTES_PER_WORD;
    472             ack_command[1] = 0xBEEF;
    473             strcpy(opcode_id, "TBL_LOOKUP");
    474             *num_words_in_command = 2;
    475             break;
    476         case SCHAN_PUSH:
    477             ack_opcode = SCHAN_PUSH_ACK;
    478             ack_dlen   = 0;
    479             strcpy(opcode_id, "PUSH");
    480             *num_words_in_command = 2;
    481             break;
    482         case SCHAN_POP:
    483             ack_opcode     = SCHAN_POP_ACK;
    484             ack_dlen       = CMIC_SBUS_DMA_BYTES_PER_WORD;
    485             ack_command[1] = 0xBEEF;
    486             strcpy(opcode_id, "POP");
    487             *num_words_in_command = 1;
    488             break;
    489         default:
    490             cmicx_log("ERROR: invalid opcode found in sbus command during command completion. sbus command address: ");
    491             cmicx_log_addr(command[0]);
    492             cmicx_log("\n");
    493             return false;
    494     }
    495 
    496     /* reset the ack command data (to avoid unwritten fields carrying over data data) and then build the ack sbus command. */
    497     /* format for command build function is: void cmic_schan_command_build(schan_command_opcode opcode,int dport,int dlen,bool err,char ecode,bool dma,char bank,bool nack,reg_t *command); */
    498     ack_command[0] = 0;
    499     cmic_schan_command_build(ack_opcode,1,ack_dlen, false,0,false,0,false, &ack_command[0]);
    500 
    501     /* log messages for completing sbus command and return */
    502     cmicx_log("sbus command completing, generated ");
    503     cmicx_log(opcode_id);
    504     cmicx_log(" ack. ");
    505     return true;
    506 
    507 }
    508 
    509 
    510 
    511 /*******************************************************************/
    512 /* helper functions to write/read to/from specific schan registers */
    513 /*******************************************************************/
    514 
    515 /* generic schan control read function */
    516 bool cmic_schan_ctrl_read(reg_t *val,cmicx_schan_data_t *schan_data) {
    517 
    518     REG_BIT_SET_TO(*val,CMIC_SCHAN_CTRL_REG_SCHAN_ERROR_BIT,   schan_data->ctrl_schan_error   );
    519     REG_BIT_SET_TO(*val,CMIC_SCHAN_CTRL_REG_TIMEOUT_BIT,       schan_data->ctrl_timeout       );
    520     REG_BIT_SET_TO(*val,CMIC_SCHAN_CTRL_REG_NACK_BIT,          schan_data->ctrl_nack          );
    521     REG_BIT_SET_TO(*val,CMIC_SCHAN_CTRL_REG_SER_CHECK_FAIL_BIT,schan_data->ctrl_ser_check_fail);
    522     REG_BIT_SET_TO(*val,CMIC_SCHAN_CTRL_REG_ABORT_BIT,         schan_data->ctrl_abort         );
    523     REG_BIT_SET_TO(*val,CMIC_SCHAN_CTRL_REG_MSG_DONE_BIT,      schan_data->ctrl_msg_done      );
    524     REG_BIT_SET_TO(*val,CMIC_SCHAN_CTRL_REG_MSG_START_BIT,     schan_data->ctrl_msg_start     );
    525     return true;
    526 
    527 }
    528 
    529 /* generic schan control write function */
    530 bool cmic_schan_ctrl_write(reg_t val,cmicx_schan_data_t *schan_data) {
    531 
    532     bool new_ctrl_abort_bit        = REG_BIT_GET(val,CMIC_SCHAN_CTRL_REG_ABORT_BIT    );
    533     bool new_ctrl_msg_done_bit     = REG_BIT_GET(val,CMIC_SCHAN_CTRL_REG_MSG_DONE_BIT );
    534     bool new_ctrl_msg_start_bit    = REG_BIT_GET(val,CMIC_SCHAN_CTRL_REG_MSG_START_BIT);
    535 
    536     bool clear_error_bits          = (new_ctrl_msg_start_bit || !new_ctrl_msg_done_bit);
    537 
    538     if (clear_error_bits) {
    539         schan_data->ctrl_schan_error    = false;
    540         schan_data->ctrl_timeout        = false;
    541         schan_data->ctrl_nack           = false;
    542         schan_data->ctrl_ser_check_fail = false;
    543     }
    544 
    545     schan_data->ctrl_abort          = new_ctrl_abort_bit;
    546     schan_data->ctrl_msg_done       = new_ctrl_msg_done_bit;
    547     schan_data->ctrl_msg_start      = new_ctrl_msg_start_bit;   /* should this be set when software sets it? */
    548 
    549 
    550     if (new_ctrl_msg_done_bit==false) {
    551         cmicx_log("schan \"");
    552         cmicx_log(schan_data->id_string);
    553         cmicx_log("\" msg_done bit cleared, schan now ready for new command.");
    554         cmicx_log_newline();
    555     }
    556 
    557     if (new_ctrl_msg_start_bit) {
    558         cmic_schan_access_start(schan_data);
    559     }
    560 
    561     if (new_ctrl_abort_bit) {
    562         cmic_schan_access_abort(schan_data);
    563     }
    564 
    565     return true;
    566 }
    567 
    568 /* generic helper function to read from the schan error register */
    569 bool cmic_schan_err_read(reg_t *val,cmicx_schan_data_t *schan_data) {
    570 
    571     REG_FIELD_SET_TO(*val,CMIC_SCHAN_ERR_REG_OP_CODE_MSB, CMIC_SCHAN_ERR_REG_OP_CODE_LSB, schan_data->err_op_code  );
    572     REG_FIELD_SET_TO(*val,CMIC_SCHAN_ERR_REG_DST_PORT_MSB,CMIC_SCHAN_ERR_REG_DST_PORT_LSB,schan_data->err_dst_port );
    573     REG_FIELD_SET_TO(*val,CMIC_SCHAN_ERR_REG_SRC_PORT_MSB,CMIC_SCHAN_ERR_REG_SRC_PORT_MSB,schan_data->err_src_port );
    574     REG_FIELD_SET_TO(*val,CMIC_SCHAN_ERR_REG_DATA_LEN_LSB,CMIC_SCHAN_ERR_REG_DATA_LEN_LSB,schan_data->err_data_len );
    575     REG_BIT_SET_TO(  *val,CMIC_SCHAN_ERR_REG_ERRBIT_BIT,                                  schan_data->err_errbit   );
    576     REG_FIELD_SET_TO(*val,CMIC_SCHAN_ERR_REG_ERR_CODE_LSB,CMIC_SCHAN_ERR_REG_ERR_CODE_LSB,schan_data->err_err_code );
    577     REG_BIT_SET_TO(  *val,CMIC_SCHAN_ERR_REG_NACK_BIT,                                    schan_data->err_nack     );
    578     return true;
    579 
    580 }
    581 
    582 /* generic helper function to read from the schan ack data beat count register */
    583 bool cmic_schan_ack_data_beat_count_read(reg_t *val,cmicx_schan_data_t *schan_data) {
    584 
    585     REG_FIELD_SET_TO(*val, CMIC_SCHAN_ACK_DATA_BEAT_COUNT_REG_BEAT_COUNT_MSB,CMIC_SCHAN_ACK_DATA_BEAT_COUNT_REG_BEAT_COUNT_LSB, schan_data->ack_data_beat_count );
    586     return true;
    587 
    588 }
    589 
    590 
    591 /*************************************************/
    592 /* define schan register direct access functions */
    593 /*************************************************/
    594 
    595 /* sbus ring arb ctrl schan register read and write functions */
    596 bool cmic_top_sbus_ring_arb_ctrl_schan_read(reg_t *val) {
    597     REG_FIELD_SET_TO(*val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH0_WEIGHT_MSB, CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH0_WEIGHT_LSB, cmicx->sbus_ring_arb_ctrl_schan_common_ch_weight[0]);
    598     REG_FIELD_SET_TO(*val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH1_WEIGHT_MSB, CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH1_WEIGHT_LSB, cmicx->sbus_ring_arb_ctrl_schan_common_ch_weight[1]);
    599     REG_FIELD_SET_TO(*val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH2_WEIGHT_MSB, CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH2_WEIGHT_LSB, cmicx->sbus_ring_arb_ctrl_schan_common_ch_weight[2]);
    600     REG_FIELD_SET_TO(*val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH3_WEIGHT_MSB, CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH3_WEIGHT_LSB, cmicx->sbus_ring_arb_ctrl_schan_common_ch_weight[3]);
    601     REG_FIELD_SET_TO(*val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH4_WEIGHT_MSB, CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH4_WEIGHT_LSB, cmicx->sbus_ring_arb_ctrl_schan_common_ch_weight[4]);
    602     REG_FIELD_SET_TO(*val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_FIFO_WEIGHT_MSB,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_FIFO_WEIGHT_LSB,cmicx->sbus_ring_arb_ctrl_schan_common_fifo_weight);
    603     return true;
    604 }
    605 bool cmic_top_sbus_ring_arb_ctrl_schan_write(reg_t val) {
    606     cmicx->sbus_ring_arb_ctrl_schan_common_ch_weight[0] = REG_FIELD_GET(val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH0_WEIGHT_MSB, CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH0_WEIGHT_LSB );
    607     cmicx->sbus_ring_arb_ctrl_schan_common_ch_weight[1] = REG_FIELD_GET(val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH1_WEIGHT_MSB, CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH1_WEIGHT_LSB );
    608     cmicx->sbus_ring_arb_ctrl_schan_common_ch_weight[2] = REG_FIELD_GET(val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH2_WEIGHT_MSB, CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH2_WEIGHT_LSB );
    609     cmicx->sbus_ring_arb_ctrl_schan_common_ch_weight[3] = REG_FIELD_GET(val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH3_WEIGHT_MSB, CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH3_WEIGHT_LSB );
    610     cmicx->sbus_ring_arb_ctrl_schan_common_ch_weight[4] = REG_FIELD_GET(val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH4_WEIGHT_MSB, CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_CH4_WEIGHT_LSB );
    611     cmicx->sbus_ring_arb_ctrl_schan_common_fifo_weight  = REG_FIELD_GET(val,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_FIFO_WEIGHT_MSB,CMIC_TOP_SBUS_RING_ARB_CTRL_SCHAN_REG_COMMON_FIFO_WEIGHT_LSB);
    612     return true;
    613 }
    614 
    615 /* auto-generated read/write accessor functions for schan registers */
    616 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_timeout_read,                  cmicx->sbus_timeout_reg)
    617 PCID_REG_WRITE_FUNC_GEN(cmic_top_sbus_timeout_write,                 cmicx->sbus_timeout_reg)
    618 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_0_7_read,             cmicx->sbus_ring_map_0_7_reg)
    619 PCID_REG_WRITE_FUNC_GEN(cmic_top_sbus_ring_map_0_7_write,            cmicx->sbus_ring_map_0_7_reg)
    620 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_8_15_read,            cmicx->sbus_ring_map_8_15_reg)
    621 PCID_REG_WRITE_FUNC_GEN(cmic_top_sbus_ring_map_8_15_write,           cmicx->sbus_ring_map_8_15_reg)
    622 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_16_23_read,           cmicx->sbus_ring_map_16_23_reg)
    623 PCID_REG_WRITE_FUNC_GEN(cmic_top_sbus_ring_map_16_23_write,          cmicx->sbus_ring_map_16_23_reg)
    624 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_24_31_read,           cmicx->sbus_ring_map_24_31_reg)
    625 PCID_REG_WRITE_FUNC_GEN(cmic_top_sbus_ring_map_24_31_write,          cmicx->sbus_ring_map_24_31_reg)
    626 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_32_39_read,           cmicx->sbus_ring_map_32_39_reg)
    627 PCID_REG_WRITE_FUNC_GEN(cmic_top_sbus_ring_map_32_39_write,          cmicx->sbus_ring_map_32_39_reg)
    628 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_40_47_read,           cmicx->sbus_ring_map_40_47_reg)
    629 PCID_REG_WRITE_FUNC_GEN(cmic_top_sbus_ring_map_40_47_write,          cmicx->sbus_ring_map_40_47_reg)
    630 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_48_55_read,           cmicx->sbus_ring_map_48_55_reg)
    631 PCID_REG_WRITE_FUNC_GEN(cmic_top_sbus_ring_map_48_55_write,          cmicx->sbus_ring_map_48_55_reg)
    632 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_56_63_read,           cmicx->sbus_ring_map_56_63_reg)
    633 PCID_REG_WRITE_FUNC_GEN(cmic_top_sbus_ring_map_56_63_write,          cmicx->sbus_ring_map_56_63_reg)
    634 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_64_71_read,           cmicx->sbus_ring_map_64_71_reg)
    635 PCID_REG_WRITE_FUNC_GEN( cmic_top_sbus_ring_map_64_71_write,         cmicx->sbus_ring_map_64_71_reg)
    636 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_72_79_read,           cmicx->sbus_ring_map_72_79_reg)
    637 PCID_REG_WRITE_FUNC_GEN( cmic_top_sbus_ring_map_72_79_write,         cmicx->sbus_ring_map_72_79_reg)
    638 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_80_87_read,           cmicx->sbus_ring_map_80_87_reg)
    639 PCID_REG_WRITE_FUNC_GEN( cmic_top_sbus_ring_map_80_87_write,         cmicx->sbus_ring_map_80_87_reg)
    640 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_88_95_read,           cmicx->sbus_ring_map_88_95_reg)
    641 PCID_REG_WRITE_FUNC_GEN( cmic_top_sbus_ring_map_88_95_write,         cmicx->sbus_ring_map_88_95_reg)
    642 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_96_103_read,          cmicx->sbus_ring_map_96_103_reg)
    643 PCID_REG_WRITE_FUNC_GEN( cmic_top_sbus_ring_map_96_103_write,        cmicx->sbus_ring_map_96_103_reg)
    644 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_104_111_read,         cmicx->sbus_ring_map_104_111_reg)
    645 PCID_REG_WRITE_FUNC_GEN( cmic_top_sbus_ring_map_104_111_write,       cmicx->sbus_ring_map_104_111_reg)
    646 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_112_119_read,         cmicx->sbus_ring_map_112_119_reg)
    647 PCID_REG_WRITE_FUNC_GEN( cmic_top_sbus_ring_map_112_119_write,       cmicx->sbus_ring_map_112_119_reg)
    648 PCID_REG_READ_FUNC_GEN( cmic_top_sbus_ring_map_120_127_read,         cmicx->sbus_ring_map_120_127_reg)
    649 PCID_REG_WRITE_FUNC_GEN( cmic_top_sbus_ring_map_120_127_write,       cmicx->sbus_ring_map_120_127_reg)
    650 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message0_read,    cmicx->common.schan[0].message_reg[0])
    651 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message0_write,   cmicx->common.schan[0].message_reg[0])
    652 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message1_read,    cmicx->common.schan[0].message_reg[1])
    653 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message1_write,   cmicx->common.schan[0].message_reg[1])
    654 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message2_read,    cmicx->common.schan[0].message_reg[2])
    655 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message2_write,   cmicx->common.schan[0].message_reg[2])
    656 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message3_read,    cmicx->common.schan[0].message_reg[3])
    657 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message3_write,   cmicx->common.schan[0].message_reg[3])
    658 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message4_read,    cmicx->common.schan[0].message_reg[4])
    659 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message4_write,   cmicx->common.schan[0].message_reg[4])
    660 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message5_read,    cmicx->common.schan[0].message_reg[5])
    661 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message5_write,   cmicx->common.schan[0].message_reg[5])
    662 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message6_read,    cmicx->common.schan[0].message_reg[6])
    663 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message6_write,   cmicx->common.schan[0].message_reg[6])
    664 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message7_read,    cmicx->common.schan[0].message_reg[7])
    665 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message7_write,   cmicx->common.schan[0].message_reg[7])
    666 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message8_read,    cmicx->common.schan[0].message_reg[8])
    667 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message8_write,   cmicx->common.schan[0].message_reg[8])
    668 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message9_read,    cmicx->common.schan[0].message_reg[9])
    669 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message9_write,   cmicx->common.schan[0].message_reg[9])
    670 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message10_read,   cmicx->common.schan[0].message_reg[10])
    671 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message10_write,  cmicx->common.schan[0].message_reg[10])
    672 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message11_read,   cmicx->common.schan[0].message_reg[11])
    673 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message11_write,  cmicx->common.schan[0].message_reg[11])
    674 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message12_read,   cmicx->common.schan[0].message_reg[12])
    675 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message12_write,  cmicx->common.schan[0].message_reg[12])
    676 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message13_read,   cmicx->common.schan[0].message_reg[13])
    677 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message13_write,  cmicx->common.schan[0].message_reg[13])
    678 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message14_read,   cmicx->common.schan[0].message_reg[14])
    679 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message14_write,  cmicx->common.schan[0].message_reg[14])
    680 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message15_read,   cmicx->common.schan[0].message_reg[15])
    681 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message15_write,  cmicx->common.schan[0].message_reg[15])
    682 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message16_read,   cmicx->common.schan[0].message_reg[16])
    683 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message16_write,  cmicx->common.schan[0].message_reg[16])
    684 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message17_read,   cmicx->common.schan[0].message_reg[17])
    685 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message17_write,  cmicx->common.schan[0].message_reg[17])
    686 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message18_read,   cmicx->common.schan[0].message_reg[18])
    687 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message18_write,  cmicx->common.schan[0].message_reg[18])
    688 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message19_read,   cmicx->common.schan[0].message_reg[19])
    689 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message19_write,  cmicx->common.schan[0].message_reg[19])
    690 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message20_read,   cmicx->common.schan[0].message_reg[20])
    691 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message20_write,  cmicx->common.schan[0].message_reg[20])
    692 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch0_message21_read,   cmicx->common.schan[0].message_reg[21])
    693 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch0_message21_write,  cmicx->common.schan[0].message_reg[21])
    694 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message0_read,    cmicx->common.schan[1].message_reg[0])
    695 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message0_write,   cmicx->common.schan[1].message_reg[0])
    696 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message1_read,    cmicx->common.schan[1].message_reg[1])
    697 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message1_write,   cmicx->common.schan[1].message_reg[1])
    698 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message2_read,    cmicx->common.schan[1].message_reg[2])
    699 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message2_write,   cmicx->common.schan[1].message_reg[2])
    700 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message3_read,    cmicx->common.schan[1].message_reg[3])
    701 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message3_write,   cmicx->common.schan[1].message_reg[3])
    702 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message4_read,    cmicx->common.schan[1].message_reg[4])
    703 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message4_write,   cmicx->common.schan[1].message_reg[4])
    704 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message5_read,    cmicx->common.schan[1].message_reg[5])
    705 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message5_write,   cmicx->common.schan[1].message_reg[5])
    706 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message6_read,    cmicx->common.schan[1].message_reg[6])
    707 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message6_write,   cmicx->common.schan[1].message_reg[6])
    708 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message7_read,    cmicx->common.schan[1].message_reg[7])
    709 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message7_write,   cmicx->common.schan[1].message_reg[7])
    710 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message8_read,    cmicx->common.schan[1].message_reg[8])
    711 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message8_write,   cmicx->common.schan[1].message_reg[8])
    712 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message9_read,    cmicx->common.schan[1].message_reg[9])
    713 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message9_write,   cmicx->common.schan[1].message_reg[9])
    714 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message10_read,   cmicx->common.schan[1].message_reg[10])
    715 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message10_write,  cmicx->common.schan[1].message_reg[10])
    716 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message11_read,   cmicx->common.schan[1].message_reg[11])
    717 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message11_write,  cmicx->common.schan[1].message_reg[11])
    718 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message12_read,   cmicx->common.schan[1].message_reg[12])
    719 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message12_write,  cmicx->common.schan[1].message_reg[12])
    720 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message13_read,   cmicx->common.schan[1].message_reg[13])
    721 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message13_write,  cmicx->common.schan[1].message_reg[13])
    722 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message14_read,   cmicx->common.schan[1].message_reg[14])
    723 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message14_write,  cmicx->common.schan[1].message_reg[14])
    724 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message15_read,   cmicx->common.schan[1].message_reg[15])
    725 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message15_write,  cmicx->common.schan[1].message_reg[15])
    726 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message16_read,   cmicx->common.schan[1].message_reg[16])
    727 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message16_write,  cmicx->common.schan[1].message_reg[16])
    728 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message17_read,   cmicx->common.schan[1].message_reg[17])
    729 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message17_write,  cmicx->common.schan[1].message_reg[17])
    730 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message18_read,   cmicx->common.schan[1].message_reg[18])
    731 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message18_write,  cmicx->common.schan[1].message_reg[18])
    732 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message19_read,   cmicx->common.schan[1].message_reg[19])
    733 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message19_write,  cmicx->common.schan[1].message_reg[19])
    734 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message20_read,   cmicx->common.schan[1].message_reg[20])
    735 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message20_write,  cmicx->common.schan[1].message_reg[20])
    736 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch1_message21_read,   cmicx->common.schan[1].message_reg[21])
    737 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch1_message21_write,  cmicx->common.schan[1].message_reg[21])
    738 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message0_read,    cmicx->common.schan[2].message_reg[0])
    739 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message0_write,   cmicx->common.schan[2].message_reg[0])
    740 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message1_read,    cmicx->common.schan[2].message_reg[1])
    741 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message1_write,   cmicx->common.schan[2].message_reg[1])
    742 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message2_read,    cmicx->common.schan[2].message_reg[2])
    743 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message2_write,   cmicx->common.schan[2].message_reg[2])
    744 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message3_read,    cmicx->common.schan[2].message_reg[3])
    745 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message3_write,   cmicx->common.schan[2].message_reg[3])
    746 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message4_read,    cmicx->common.schan[2].message_reg[4])
    747 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message4_write,   cmicx->common.schan[2].message_reg[4])
    748 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message5_read,    cmicx->common.schan[2].message_reg[5])
    749 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message5_write,   cmicx->common.schan[2].message_reg[5])
    750 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message6_read,    cmicx->common.schan[2].message_reg[6])
    751 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message6_write,   cmicx->common.schan[2].message_reg[6])
    752 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message7_read,    cmicx->common.schan[2].message_reg[7])
    753 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message7_write,   cmicx->common.schan[2].message_reg[7])
    754 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message8_read,    cmicx->common.schan[2].message_reg[8])
    755 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message8_write,   cmicx->common.schan[2].message_reg[8])
    756 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message9_read,    cmicx->common.schan[2].message_reg[9])
    757 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message9_write,   cmicx->common.schan[2].message_reg[9])
    758 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message10_read,   cmicx->common.schan[2].message_reg[10])
    759 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message10_write,  cmicx->common.schan[2].message_reg[10])
    760 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message11_read,   cmicx->common.schan[2].message_reg[11])
    761 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message11_write,  cmicx->common.schan[2].message_reg[11])
    762 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message12_read,   cmicx->common.schan[2].message_reg[12])
    763 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message12_write,  cmicx->common.schan[2].message_reg[12])
    764 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message13_read,   cmicx->common.schan[2].message_reg[13])
    765 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message13_write,  cmicx->common.schan[2].message_reg[13])
    766 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message14_read,   cmicx->common.schan[2].message_reg[14])
    767 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message14_write,  cmicx->common.schan[2].message_reg[14])
    768 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message15_read,   cmicx->common.schan[2].message_reg[15])
    769 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message15_write,  cmicx->common.schan[2].message_reg[15])
    770 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message16_read,   cmicx->common.schan[2].message_reg[16])
    771 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message16_write,  cmicx->common.schan[2].message_reg[16])
    772 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message17_read,   cmicx->common.schan[2].message_reg[17])
    773 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message17_write,  cmicx->common.schan[2].message_reg[17])
    774 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message18_read,   cmicx->common.schan[2].message_reg[18])
    775 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message18_write,  cmicx->common.schan[2].message_reg[18])
    776 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message19_read,   cmicx->common.schan[2].message_reg[19])
    777 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message19_write,  cmicx->common.schan[2].message_reg[19])
    778 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message20_read,   cmicx->common.schan[2].message_reg[20])
    779 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message20_write,  cmicx->common.schan[2].message_reg[20])
    780 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch2_message21_read,   cmicx->common.schan[2].message_reg[21])
    781 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch2_message21_write,  cmicx->common.schan[2].message_reg[21])
    782 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message0_read,    cmicx->common.schan[3].message_reg[0])
    783 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message0_write,   cmicx->common.schan[3].message_reg[0])
    784 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message1_read,    cmicx->common.schan[3].message_reg[1])
    785 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message1_write,   cmicx->common.schan[3].message_reg[1])
    786 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message2_read,    cmicx->common.schan[3].message_reg[2])
    787 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message2_write,   cmicx->common.schan[3].message_reg[2])
    788 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message3_read,    cmicx->common.schan[3].message_reg[3])
    789 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message3_write,   cmicx->common.schan[3].message_reg[3])
    790 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message4_read,    cmicx->common.schan[3].message_reg[4])
    791 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message4_write,   cmicx->common.schan[3].message_reg[4])
    792 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message5_read,    cmicx->common.schan[3].message_reg[5])
    793 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message5_write,   cmicx->common.schan[3].message_reg[5])
    794 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message6_read,    cmicx->common.schan[3].message_reg[6])
    795 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message6_write,   cmicx->common.schan[3].message_reg[6])
    796 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message7_read,    cmicx->common.schan[3].message_reg[7])
    797 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message7_write,   cmicx->common.schan[3].message_reg[7])
    798 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message8_read,    cmicx->common.schan[3].message_reg[8])
    799 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message8_write,   cmicx->common.schan[3].message_reg[8])
    800 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message9_read,    cmicx->common.schan[3].message_reg[9])
    801 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message9_write,   cmicx->common.schan[3].message_reg[9])
    802 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message10_read,   cmicx->common.schan[3].message_reg[10])
    803 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message10_write,  cmicx->common.schan[3].message_reg[10])
    804 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message11_read,   cmicx->common.schan[3].message_reg[11])
    805 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message11_write,  cmicx->common.schan[3].message_reg[11])
    806 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message12_read,   cmicx->common.schan[3].message_reg[12])
    807 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message12_write,  cmicx->common.schan[3].message_reg[12])
    808 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message13_read,   cmicx->common.schan[3].message_reg[13])
    809 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message13_write,  cmicx->common.schan[3].message_reg[13])
    810 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message14_read,   cmicx->common.schan[3].message_reg[14])
    811 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message14_write,  cmicx->common.schan[3].message_reg[14])
    812 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message15_read,   cmicx->common.schan[3].message_reg[15])
    813 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message15_write,  cmicx->common.schan[3].message_reg[15])
    814 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message16_read,   cmicx->common.schan[3].message_reg[16])
    815 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message16_write,  cmicx->common.schan[3].message_reg[16])
    816 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message17_read,   cmicx->common.schan[3].message_reg[17])
    817 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message17_write,  cmicx->common.schan[3].message_reg[17])
    818 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message18_read,   cmicx->common.schan[3].message_reg[18])
    819 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message18_write,  cmicx->common.schan[3].message_reg[18])
    820 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message19_read,   cmicx->common.schan[3].message_reg[19])
    821 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message19_write,  cmicx->common.schan[3].message_reg[19])
    822 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message20_read,   cmicx->common.schan[3].message_reg[20])
    823 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message20_write,  cmicx->common.schan[3].message_reg[20])
    824 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch3_message21_read,   cmicx->common.schan[3].message_reg[21])
    825 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch3_message21_write,  cmicx->common.schan[3].message_reg[21])
    826 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message0_read,    cmicx->common.schan[4].message_reg[0])
    827 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message0_write,   cmicx->common.schan[4].message_reg[0])
    828 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message1_read,    cmicx->common.schan[4].message_reg[1])
    829 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message1_write,   cmicx->common.schan[4].message_reg[1])
    830 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message2_read,    cmicx->common.schan[4].message_reg[2])
    831 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message2_write,   cmicx->common.schan[4].message_reg[2])
    832 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message3_read,    cmicx->common.schan[4].message_reg[3])
    833 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message3_write,   cmicx->common.schan[4].message_reg[3])
    834 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message4_read,    cmicx->common.schan[4].message_reg[4])
    835 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message4_write,   cmicx->common.schan[4].message_reg[4])
    836 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message5_read,    cmicx->common.schan[4].message_reg[5])
    837 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message5_write,   cmicx->common.schan[4].message_reg[5])
    838 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message6_read,    cmicx->common.schan[4].message_reg[6])
    839 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message6_write,   cmicx->common.schan[4].message_reg[6])
    840 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message7_read,    cmicx->common.schan[4].message_reg[7])
    841 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message7_write,   cmicx->common.schan[4].message_reg[7])
    842 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message8_read,    cmicx->common.schan[4].message_reg[8])
    843 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message8_write,   cmicx->common.schan[4].message_reg[8])
    844 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message9_read,    cmicx->common.schan[4].message_reg[9])
    845 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message9_write,   cmicx->common.schan[4].message_reg[9])
    846 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message10_read,   cmicx->common.schan[4].message_reg[10])
    847 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message10_write,  cmicx->common.schan[4].message_reg[10])
    848 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message11_read,   cmicx->common.schan[4].message_reg[11])
    849 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message11_write,  cmicx->common.schan[4].message_reg[11])
    850 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message12_read,   cmicx->common.schan[4].message_reg[12])
    851 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message12_write,  cmicx->common.schan[4].message_reg[12])
    852 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message13_read,   cmicx->common.schan[4].message_reg[13])
    853 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message13_write,  cmicx->common.schan[4].message_reg[13])
    854 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message14_read,   cmicx->common.schan[4].message_reg[14])
    855 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message14_write,  cmicx->common.schan[4].message_reg[14])
    856 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message15_read,   cmicx->common.schan[4].message_reg[15])
    857 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message15_write,  cmicx->common.schan[4].message_reg[15])
    858 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message16_read,   cmicx->common.schan[4].message_reg[16])
    859 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message16_write,  cmicx->common.schan[4].message_reg[16])
    860 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message17_read,   cmicx->common.schan[4].message_reg[17])
    861 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message17_write,  cmicx->common.schan[4].message_reg[17])
    862 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message18_read,   cmicx->common.schan[4].message_reg[18])
    863 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message18_write,  cmicx->common.schan[4].message_reg[18])
    864 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message19_read,   cmicx->common.schan[4].message_reg[19])
    865 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message19_write,  cmicx->common.schan[4].message_reg[19])
    866 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message20_read,   cmicx->common.schan[4].message_reg[20])
    867 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message20_write,  cmicx->common.schan[4].message_reg[20])
    868 PCID_REG_READ_FUNC_GEN( cmic_common_pool_schan_ch4_message21_read,   cmicx->common.schan[4].message_reg[21])
    869 PCID_REG_WRITE_FUNC_GEN(cmic_common_pool_schan_ch4_message21_write,  cmicx->common.schan[4].message_reg[21])
    870 
    871 /* read/write access functions for schan control regs */
    872 bool cmic_common_pool_schan_ch0_ctrl_read(reg_t *val) {
    873     return cmic_schan_ctrl_read(val,&cmicx->common.schan[0]);
    874 }
    875 bool cmic_common_pool_schan_ch0_ctrl_write(reg_t val) {
    876     return cmic_schan_ctrl_write(val,&cmicx->common.schan[0]);
    877 }
    878 bool cmic_common_pool_schan_ch1_ctrl_read(reg_t *val) {
    879     return cmic_schan_ctrl_read(val,&cmicx->common.schan[1]);
    880 }
    881 bool cmic_common_pool_schan_ch1_ctrl_write(reg_t val) {
    882     return cmic_schan_ctrl_write(val,&cmicx->common.schan[1]);
    883 }
    884 bool cmic_common_pool_schan_ch2_ctrl_read(reg_t *val) {
    885     return cmic_schan_ctrl_read(val,&cmicx->common.schan[2]);
    886 }
    887 bool cmic_common_pool_schan_ch2_ctrl_write(reg_t val) {
    888     return cmic_schan_ctrl_write(val,&cmicx->common.schan[2]);
    889 }
    890 bool cmic_common_pool_schan_ch3_ctrl_read(reg_t *val) {
    891     return cmic_schan_ctrl_read(val,&cmicx->common.schan[3]);
    892 }
    893 bool cmic_common_pool_schan_ch3_ctrl_write(reg_t val) {
    894     return cmic_schan_ctrl_write(val,&cmicx->common.schan[3]);
    895 }
    896 bool cmic_common_pool_schan_ch4_ctrl_read(reg_t *val) {
    897     return cmic_schan_ctrl_read(val,&cmicx->common.schan[4]);
    898 }
    899 bool cmic_common_pool_schan_ch4_ctrl_write(reg_t val) {
    900     return cmic_schan_ctrl_write(val,&cmicx->common.schan[4]);
    901 }
    902 
    903 /* read/write access functions for schan err regs */
    904 bool cmic_common_pool_schan_ch0_err_read(reg_t *val) {
    905     return cmic_schan_err_read(val,&cmicx->common.schan[0]);
    906 }
    907 PCID_REG_WRITE_NULL_FUNC_GEN(cmic_common_pool_schan_ch0_err_write)
    908 bool cmic_common_pool_schan_ch1_err_read(reg_t *val) {
    909     return cmic_schan_err_read(val,&cmicx->common.schan[1]);
    910 }
    911 PCID_REG_WRITE_NULL_FUNC_GEN(cmic_common_pool_schan_ch1_err_write)
    912 bool cmic_common_pool_schan_ch2_err_read(reg_t *val) {
    913     return cmic_schan_err_read(val,&cmicx->common.schan[2]);
    914 }
    915 PCID_REG_WRITE_NULL_FUNC_GEN(cmic_common_pool_schan_ch2_err_write)
    916 bool cmic_common_pool_schan_ch3_err_read(reg_t *val) {
    917     return cmic_schan_err_read(val,&cmicx->common.schan[3]);
    918 }
    919 PCID_REG_WRITE_NULL_FUNC_GEN(cmic_common_pool_schan_ch3_err_write)
    920 bool cmic_common_pool_schan_ch4_err_read(reg_t *val) {
    921     return cmic_schan_err_read(val,&cmicx->common.schan[4]);
    922 }
    923 PCID_REG_WRITE_NULL_FUNC_GEN(cmic_common_pool_schan_ch4_err_write)
    924 
    925 /* read/write access functions for schan ack data beat count regs */
    926 bool cmic_common_pool_schan_ch0_ack_data_beat_count_read(reg_t *val) {
    927     return cmic_schan_ack_data_beat_count_read(val,&cmicx->common.schan[0]);
    928 }
    929 PCID_REG_WRITE_NULL_FUNC_GEN(cmic_common_pool_schan_ch0_ack_data_beat_count_write)
    930 bool cmic_common_pool_schan_ch1_ack_data_beat_count_read(reg_t *val) {
    931     return cmic_schan_ack_data_beat_count_read(val,&cmicx->common.schan[1]);
    932 }
    933 PCID_REG_WRITE_NULL_FUNC_GEN(cmic_common_pool_schan_ch1_ack_data_beat_count_write)
    934 bool cmic_common_pool_schan_ch2_ack_data_beat_count_read(reg_t *val) {
    935     return cmic_schan_ack_data_beat_count_read(val,&cmicx->common.schan[2]);
    936 }
    937 PCID_REG_WRITE_NULL_FUNC_GEN(cmic_common_pool_schan_ch2_ack_data_beat_count_write)
    938 bool cmic_common_pool_schan_ch3_ack_data_beat_count_read(reg_t *val) {
    939     return cmic_schan_ack_data_beat_count_read(val,&cmicx->common.schan[3]);
    940 }
    941 PCID_REG_WRITE_NULL_FUNC_GEN(cmic_common_pool_schan_ch3_ack_data_beat_count_write)
    942 bool cmic_common_pool_schan_ch4_ack_data_beat_count_read(reg_t *val) {
    943     return cmic_schan_ack_data_beat_count_read(val,&cmicx->common.schan[4]);
    944 }
    945 PCID_REG_WRITE_NULL_FUNC_GEN(cmic_common_pool_schan_ch4_ack_data_beat_count_write)
    946