/* -*- c++ -*- * File : dspin_dhccp_param.h * Date : 01/03/2013 * Copyright : UPMC / LIP6 * Authors : Cesar Fuguet * * SOCLIB_LGPL_HEADER_BEGIN * * This file is part of SoCLib, GNU LGPLv2.1. * * SoCLib is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; version 2.1 of the License. * * SoCLib is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with SoCLib; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA * * SOCLIB_LGPL_HEADER_END */ #ifndef DSPIN_DHCCP_PARAMS_H #define DSPIN_DHCCP_PARAMS_H #include #include namespace soclib { namespace caba { /* * L1 cache to Memory Cache command packets * * CLEANUP * * flit 1 * ---------------------------------------------------------------------------------------------- * EOP:0 | DEST | SRCID | NLINE MSB(2 bits)| X | WAY_INDEX(2 bits) | TYPE:0b1X | BC:0 * | (10 bits) | (14 bits) | | | | | * ---------------------------------------------------------------------------------------------- * | X: 0 DATA | * | 1 INST | * flit 2 * ---------------------------------------------------------------------------------------------- * EOP:1 | NLINE(32 bits) * ---------------------------------------------------------------------------------------------- * * MULTICAST ACKNOWLEDGEMENT * * flit 1 * ---------------------------------------------------------------------------------------------- * EOP:1 | DEST(10 bits) | X(15 bits) | UPDT_INDEX(4 bits) | TYPE:0b00 | BC:0 * ---------------------------------------------------------------------------------------------- * * TEST * * * flit 1 * ---------------------------------------------------------------------------------------------- * EOP:0 | DEST | SRCID | X | TEST | X | TYPE:0b11 | BC:0 * | (10 bits) | (14 bits) | (2 bits) | (1 bit) | (2 bits) | | * ---------------------------------------------------------------------------------------------- * * flit 2 * ---------------------------------------------------------------------------------------------- * EOP:1 | SIGNATURE(32 bits) * ---------------------------------------------------------------------------------------------- */ /* * M2P command packets * * MULTICAST UPDATE * * flit 1 * ---------------------------------------------------------------------------------------------- * EOP:0 | DEST(14 bits) | X(4 bits) | MEMC_ID(14 bits) | UPDT_INDEX(4 bits) | TYPE:0b0X | BC:0 * ---------------------------------------------------------------------------------------------- * | X: 0 DATA | * | 1 INST | * flit 2 * ---------------------------------------------------------------------------------------------- * EOP:0 | X | WORD_INDEX(4 bits) | NLINE (34 bits) * ---------------------------------------------------------------------------------------------- * * flit 3 * ---------------------------------------------------------------------------------------------- * EOP:0 | X(3 bits) | BE(4 bits) | WDATA(32 bits) * ---------------------------------------------------------------------------------------------- * * flit N * ---------------------------------------------------------------------------------------------- * EOP:1 | X(3 bits) | BE(4 bits) | WDATA(32 bits) * ---------------------------------------------------------------------------------------------- * * MULTICAST INVALIDATE * * flit 1 * ---------------------------------------------------------------------------------------------- * EOP:0 | DEST(14 bits) | X(4 bits) | MEMC_ID(14 bits) | UPDT_INDEX(4 bits) | TYPE:0b1X | BC:0 * ---------------------------------------------------------------------------------------------- * | X: 0 DATA | * | 1 INST | * flit 2 * ---------------------------------------------------------------------------------------------- * EOP:1 | X(5 bits) | NLINE (34 bits) * ---------------------------------------------------------------------------------------------- * * BROADCAST INVALIDATE * * flit 1 * | BOUNDING BOX(20 bits) | * ---------------------------------------------------------------------------------------------- * EOP:0 | XMIN | XMAX | YMIN | YMAX | MEMC_ID(14 bits) | NETWORK_RESERVED(4 bits) | BC:1 * ---------------------------------------------------------------------------------------------- * * flit 2 * ---------------------------------------------------------------------------------------------- * EOP:1 | X(5 bits) | NLINE (34 bits) * ---------------------------------------------------------------------------------------------- * * TEST * * flit 1 * ---------------------------------------------------------------------------------------------- * EOP:0 | DEST(14 bits) | TEST: 1 | X(3 bits) | MEMC_ID(14 bits) | X(10 bits) | BC:0 * ---------------------------------------------------------------------------------------------- * * flit 2 * ---------------------------------------------------------------------------------------------- * EOP:1 | SIGNATURE MSB(7 bits) | SIGNATURE (32 bits) * ---------------------------------------------------------------------------------------------- * * CLACK commands * * CLEANUP ACKNOWLEDGEMENT * * flit 1 * ---------------------------------------------------------------------------------------------- * EOP:1 | DEST(14 bits) | X(5 bits) | SET_INDEX(16 bits) | WAY_INDEX(2 bits) | TYPE:0bX | BC:0 * ---------------------------------------------------------------------------------------------- * | X: 0 CLACK | * | DATA | * | 1 CLACK | * | INST | * TEST * * flit 1 * ---------------------------------------------------------------------------------------------- * EOP:0 | DEST(14 bits) | TEST:1 | X(3 bits) | MEMC_ID(14 bits) | X(10 bits) | BC:0 * ---------------------------------------------------------------------------------------------- * * flit 2 * ---------------------------------------------------------------------------------------------- * EOP:1 | SIGNATURE MSB(7 bits) | SIGNATURE (32 bits) * ---------------------------------------------------------------------------------------------- * * */ /* * Utility MACROS */ #define GET_FIELD(x,y)\ case y: return ((x >> y##_SHIFT) & y##_MASK) #define SET_FIELD(x,y,z)\ case z: x |= ((y & z##_MASK) << z##_SHIFT);break class DspinDhccpParam { public: static const uint8_t m2p_flit_width = 40; static const uint8_t p2m_flit_width = 33; static const uint8_t clack_flit_width = 40; static const uint8_t UPDT_INDEX_WIDTH = 4; static const uint8_t NLINE_WIDTH = 34; static const uint8_t SRCID_WIDTH = 14; static const uint8_t GLOBALID_WIDTH = 10; static const uint8_t WORD_INDEX_WIDTH = 4; static const uint8_t BE_WIDTH = 4; static const uint8_t DATA_WIDTH = 32; static const uint8_t SET_INDEX_WIDTH = 6; static const uint8_t WAY_INDEX_WIDTH = 2; static const uint8_t BROADCAST_BOX_WIDTH = 20; static const uint8_t M2P_TYPE_WIDTH = 2; static const uint8_t P2M_TYPE_WIDTH = 2; static const uint8_t CLACK_TYPE_WIDTH = 1; static const uint8_t P2M_TYPE_SHIFT = 1; static const uint64_t P2M_TYPE_MASK = ((1ULL<