// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: ilupeuEgressTlpStrategy.vr
// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
// This 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 program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// For the avoidance of doubt, and except that if any non-GPL license
// choice is available it will apply instead, Sun elects to use only
// the General Public License version 2 (GPLv2) at this time for any
// software where a choice of GPL license versions is made
// available with the language indicating that GPLv2 or any later version
// may be used, or where a choice of which version of the GPL is applied is
// otherwise unspecified.
// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
// CA 95054 USA or visit www.sun.com if you need additional information or
// ========== Copyright Header End ============================================
class ilupeuEgressTlpStrategy extends ilupeuTlpStrategyBase {
//Inherited from ilupeuTlpStrategyBase
// ilupeuScenario Scenario;
// FNXRandomUtil RandUtil;
//Transaction and Packet Types
// FNXPCIEXactorTransaction TlpTrans;
// FNXPCIEXactorPacket TlpPkt;
// bit [LX_TLP_HDR_WIDTH-1:0] tlpHdr = {LX_TLP_HDR_WIDTH{1'b0}};
// LPUXtrDataTLP LPUXtrTlpPkt;
// bit [7:0] pyldByteAry[*];
// bit [31:0] pyldDWAry[*];
//After constructing the class with new set the
// variables below before calling Execute().
// bit [7:0] pyldFirstByteValue = 0;
// bit [63:0] tlpAddr = 0;
task new ( ReportClass _Report,
ilupeuPodClass _Pod , //Xactors
ilupeuScenario _Scenario ); //Test Parameters
task ilupeuEgressTlpStrategy::new ( ReportClass _Report,
ilupeuScenario _Scenario )
task ilupeuEgressTlpStrategy::Execute()
integer driveCompleteTO = 1000*Scenario.EgrTlpMaxActiveStrats;
integer expectCompleteTO;
//Set the value of the 1st byte of payload -
dataSpec = pyldFirstByteValue;
dataSpec = RandUtil.Rand32( 0, 8'hff );
//Generate a random Egress FNXPCIEXactorTransaction TLP - TlpTrans
GenRandomPCIEXtrTlp( ILUPEU_EGRESS_TRANS,
//Convert the FNXPCIEXactorTransaction to Header format
// tlpHdr is filled in according to Tlp type generated in GenRandomPCIEXtrTLP
//Now Convert the Header and Payload to LPUXtr packet
// Instantiate a new LPUXtr packet and move data from tlpHdr into LPUXtrTlpPkt
// ConvertHdr2LpuXtrTlpPkt();
//Set LPUXtrTlpPkt CTTransactionID
// LPUXtrTlpPkt.SetID( ID );
//Set expect to = time to transmit a packet that size + a little overhead depending on the link width
//Read the Denali Link Status Register
denRegTmpData = regTrans.ReadDenaliReg( PCIE_REG_DEN_LINK_ST );
expectCompleteTO = ( ((xtrLen*4)/denRegTmpData[FNX_PCIE_XTR_REG_DEN_LINK_ST_LINK_WIDTH_SLC]) + 50);
//x4 and x1 links need extra time
if( denRegTmpData[FNX_PCIE_XTR_REG_DEN_LINK_ST_LINK_WIDTH_SLC] == 4 ){
expectCompleteTO = expectCompleteTO + 50;
else if( denRegTmpData[FNX_PCIE_XTR_REG_DEN_LINK_ST_LINK_WIDTH_SLC] == 1 ){
expectCompleteTO = expectCompleteTO + 120;
"%s ilupeuEgressTlpStrategy:Call DMUXtr.send expectCompleteTO=%0d LinkWidth=%0d ",ID.GetString(),expectCompleteTO,denRegTmpData[FNX_PCIE_XTR_REG_DEN_LINK_ST_LINK_WIDTH_SLC] );
Pod.DMUXtr.send( tlpHdr,dataSpec,{ 4'b1000, TlpPkt.ReqTag[3:0] } );
//Timeout if transaction can't be driven to the ilupeu - this means that dack has gone low for
//review - Deal with retraining here
while( driveCompleteTO && !driveComplete ){
"%s ilupeuEgressTlpStrategy: Pod.LPUXtr.driveTLP timed out trying to drive TlpPkt \n",ID.GetString() );
void = TlpTrans.Expect( expectCompleteTO );
//Free up the unique tag if one was used
FreeUniqueTag( TlpPkt.ReqTag );
"%s ilupeuEgressTlpStrategy:Strategy complete! ",ID.GetString() );
repeat(10) @(posedge CLOCK);