Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / ilu_peu / vera / N2fc / N2fcDmaCfgIORwStr.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: N2fcDmaCfgIORwStr.vr
4// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
5// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
6//
7// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8//
9// This program is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; version 2 of the License.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21//
22// For the avoidance of doubt, and except that if any non-GPL license
23// choice is available it will apply instead, Sun elects to use only
24// the General Public License version 2 (GPLv2) at this time for any
25// software where a choice of GPL license versions is made
26// available with the language indicating that GPLv2 or any later version
27// may be used, or where a choice of which version of the GPL is applied is
28// otherwise unspecified.
29//
30// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
31// CA 95054 USA or visit www.sun.com if you need additional information or
32// have any questions.
33//
34// ========== Copyright Header End ============================================
35class N2fcDmaCfgIORwStr extends DmaURCfgIORdWrPEUStr {
36
37 local string cmd;
38 local bit [63:0] addr;
39 local bit [31:0] length;
40
41 public task new(PEUTestEnv a_env,
42 string a_cmd,
43 bit [63:0] a_addr,
44 bit [31:0] a_length);
45
46 public task Execute();
47
48}
49
50
51
52//-------------------------------------------------------------------
53// Method Name:
54// Description:
55//-------------------------------------------------------------------
56task N2fcDmaCfgIORwStr::new(PEUTestEnv a_env,
57 string a_cmd,
58 bit [63:0] a_addr,
59 bit [31:0] a_length)
60{
61 super.new(a_env);
62
63 this._env = a_env;
64 this.cmd = a_cmd;
65 this.addr = a_addr;
66 this.length = a_length;
67
68 SetPacketParams();
69
70 case (cmd) {
71 "DMA_CFG0": this._type_req = PEC_PCI__TYPE_CFG0;
72 "DMA_CFG1": this._type_req = PEC_PCI__TYPE_CFG1;
73 "DMA_IO" : this._type_req = PEC_PCI__TYPE_IO;
74 }
75 if (this._type_req == PEC_PCI__TYPE_CFG0) this._addr_lsb[15:12] = 4'b_0000;
76 if (this._type_req == PEC_PCI__TYPE_CFG1) this._addr_lsb[15:12] = 4'b_0000;
77 reqHdr [PEC_PCI__TYPE] = this._type_req;
78 reqHdr [PEC_PCI__ADDR32] = { this._addr_lsb[31:2], 2'b_00 };
79
80 cplHdr [PEC_PCI__BCM] = 0;
81 this.Execute ();
82}
83
84task N2fcDmaCfgIORwStr::Execute ()
85{
86 if( this._type_req === PEC_PCI__TYPE_IO ){
87 this._env.Pod.FNXPCIEEnableTrans.tempSuppressDenaliErr(PCIE_TL_NONFATAL_TLP_MF_vlIOExpEp);
88 }else{
89 this._env.Pod.FNXPCIEEnableTrans.tempSuppressDenaliErr(PCIE_TL_NONFATAL_TLP_MF_vlCfgTx);
90 this._env.Pod.FNXPCIEEnableTrans.tempSuppressDenaliErr(PCIE_TL_NONFATAL_TLP_MF_vlCfg0);
91 }
92
93 if( (this._format_req === PEC_PCI__FMT_NO_DATA_3DW) && this._ep_req ){
94 this._env.Pod.FNXPCIEEnableTrans.tempSuppressDenaliErr(PCIE_TL_NONFATAL_TLP_MF_vlPoison);
95 }
96
97 if ( super.f_abortErrTlp )
98 {
99 this._env.drivePCIE(reqHdr, this._data, *, *, *, 1 );
100 if( this._type_req === PEC_PCI__TYPE_IO ){
101 this._env.Pod.FNXPCIEEnableTrans.unSuppressDenaliErr(PCIE_TL_NONFATAL_TLP_MF_vlIOExpEp);
102 }else{
103 this._env.Pod.FNXPCIEEnableTrans.unSuppressDenaliErr(PCIE_TL_NONFATAL_TLP_MF_vlCfgTx);
104 }
105 //this._env.waitIngressLatency( reqHdr );
106 }else{
107 //this._env.reserveIngressCredits(reqHdr);
108 this._env.drivePCIE(reqHdr, this._data);
109 if( this._type_req === PEC_PCI__TYPE_IO ){
110 this._env.Pod.FNXPCIEEnableTrans.unSuppressDenaliErr(PCIE_TL_NONFATAL_TLP_MF_vlIOExpEp);
111 }else{
112 this._env.Pod.FNXPCIEEnableTrans.unSuppressDenaliErr(PCIE_TL_NONFATAL_TLP_MF_vlCfgTx);
113 this._env.Pod.FNXPCIEEnableTrans.unSuppressDenaliErr(PCIE_TL_NONFATAL_TLP_MF_vlCfg0);
114 }
115 //this._env.consumeIngressCredits(reqHdr);
116 //this._env.expectILU(reqHdr, this._data);
117
118 if ( this._errQueue != 0 )
119 {
120 //mailbox_put(this._errQueue, e_ERR_ue_ur);
121 //mailbox_put(this._errQueue, reqHdr);
122 }
123
124 //this._env.driveILU(cplHdr, 0, this._data);
125 this._env.expectPCIE(cplHdr, this._data);
126 }
127
128 //Free up the Tags
129 _env.freeDmaTag( this._tag );
130
131}