* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: pcie_tlp.h
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
* The above named program 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
* General Public License for more details.
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
* ========== Copyright Header End ============================================
uint32_t :1,fmt
:2,type
:5,:1,TC
:3,:4,TD
:1,EP
:1,attr
:2,:2,length
:10;
memset(&word_0
, 0, sizeof(word_0
));
struct MemTLP
:public CommonTLP
{
uint32_t rid
:16,tag
:8, first_dw_be
:4, last_dw_be
:4;
memset(&word_1
,0x0,sizeof(word_1
));
MemTLP(bool wr
,uint64_t vaddr
,uint64_t count
,uint16_t requesterId
){
memset(&word_1
,0x0,sizeof(word_1
));
/* length in DW, count is in #bytes */
word_0
.length
= (uint16_t)(count
/4);
word_1
.rid
= requesterId
;
addr1
= (uint32_t)(vaddr
>> 32);
addr2
= (((uint32_t)vaddr
)& ~0x3);
addr1
= (uint32_t)(vaddr
& ~0x3);
struct CmplTLP
:public CommonTLP
{
uint32_t cid
:16,cmpl_stat
:3, bcm
:1,word_count
:12;
uint32_t rid
:16,tag
:8,:1,lower_addr
:7;
memset(&word_1
,0x0,sizeof(word_1
));
memset(&word_2
,0x0,sizeof(word_2
));
CmplTLP(bool data
,int cmplStatus
,uint16_t completerId
,uint16_t requesterId
){
/* initialize all fields to zero */
memset(&word_1
,0x0,sizeof(word_1
));
memset(&word_2
,0x0,sizeof(word_2
));
word_2
.rid
= requesterId
;
word_1
.cid
= completerId
;
word_1.cmpl_stat = SUCCESSFUL_CMPL;
else if(cmplStatus == UR){
word_1.cmpl_stat = UNSUPPORTED_REQUEST;
else if(cmplStatus == CRS){
word_1.cmpl_stat = CONF_REQUEST_RETRY;
else if(cmplStatus == CA){
word_1.cmpl_stat = COMPLETER_ABORT;
word_1
.cmpl_stat
= cmplStatus
;
CmplTLP(bool data
,int cmplStatus
,uint16_t completerId
,uint16_t requesterId
,bool poison
){
/* initialize all fields to zero */
memset(&word_1
,0x0,sizeof(word_1
));
memset(&word_2
,0x0,sizeof(word_2
));
word_2
.rid
= requesterId
;
word_1
.cid
= completerId
;
word_1.cmpl_stat = SUCCESSFUL_CMPL;
else if(cmplStatus == UR){
word_1.cmpl_stat = UNSUPPORTED_REQUEST;
else if(cmplStatus == CRS){
word_1.cmpl_stat = CONF_REQUEST_RETRY;
else if(cmplStatus == CA){
word_1.cmpl_stat = COMPLETER_ABORT;
word_1
.cmpl_stat
= cmplStatus
;
struct IOTLP
:public CommonTLP
{
uint32_t rid
:16,tag
:8, first_dw_be
:4, last_dw_be
:4;
memset(&word_1
,0x0,sizeof(word_1
));
IOTLP(bool wr
,uint64_t vaddr
,uint64_t count
,uint16_t requesterId
){
memset(&word_1
,0x0,sizeof(word_1
));
/* length in DW, count is in #bytes */
word_0
.length
= (uint16_t)(count
/4);
word_1
.rid
= requesterId
;
addr1
= (uint32_t)(vaddr
& ~0x3);
struct CfgTLP
:public CommonTLP
{
uint32_t rid
:16,tag
:8, first_dw_be
:4, last_dw_be
:4;
uint32_t cid
:16,:4,ext_reg
:4,reg
:6,:2;
memset(&word_1
,0x0,sizeof(word_1
));
memset(&word_2
,0x0,sizeof(word_2
));
CfgTLP(bool type
,bool wr
,uint16_t completerId
,uint16_t requesterId
,uint16_t regNum
){
/* initialize all fields to zero */
memset(&word_1
,0x0,sizeof(word_1
));
memset(&word_2
,0x0,sizeof(word_2
));
word_1
.rid
= requesterId
;
word_2
.cid
= completerId
;
word_2
.reg
= (regNum
& 0x3f);
word_2
.ext_reg
= ((regNum
>> 0x6) & 0xf);
struct MsgTLP
:public CommonTLP
{
uint32_t rid
:16,tag
:8, msg_code
:8;
memset(&word_1
,0x0,sizeof(word_1
));
MsgTLP(bool data
,uint8_t msg_code
,uint16_t requesterId
,uint32_t add1
=0,uint32_t add2
=0){
/* initialize all fields to zero */
memset(&word_1
,0x0,sizeof(word_1
));
word_0
.type
= 0x10; // for now assume all msgs routed to rc
word_1
.msg_code
= (uint8_t)msg_code
;
word_1
.rid
= requesterId
;