// ========== Copyright Header Begin ========================================== // // OpenSPARC T2 Processor File: irritator.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 // have any questions. // // ========== Copyright Header End ============================================ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define CLASSNAME Irritator #define CLASSNAMEQ "Irritator" //gCcxDevice[] 0-16 !== null class CLASSNAME extends BaseCCXtrans { local string className = "Irritator"; // rands // end rands task new(StandardDisplay dbgHndl, reg l2BFMs); task decker(); task evictFlood(); task bufferFlood(); task randStores(); task randStLd(); task randLoads(); } task CLASSNAME::new(StandardDisplay dbgHndl, reg l2BFMs) { super.new(dbgHndl, l2BFMs); srandom(gSeed,this); // void = randomize(); anyMemPort = gCpxPort[0]; anySpcPort = gPcxPort[0]; fork { evictFlood(); bufferFlood(); randStores(); randStLd(); randLoads(); } join none } ////////////////////////////////////////////////////// // higher level tasks ////////////////////////////////////////////////////// // enqueue a bunch of noop evictions for directed coverage. // every source sends to every FloodTarget. No checking. // +evictFloodAmount, +evictFloodFreq, +evictFloodTargets task CLASSNAME::evictFlood() { integer amount; if (! gParam.evictFloodFreq || ! gParam.evictFloodAmount || ! gParam.evictFloodTargets) return; if (gCcxDevice[8] == null || gCcxDevice[16] == null) PR_ERROR(CLASSNAMEQ, MON_ERROR, psprintf ("evictFlood task needs L2 BFMs and NCU BFM!")); amount = gParam.evictFloodAmount; repeat (500) @(posedge anyMemPort.$clk); while (amount) { repeat (gParam.evictFloodFreq) @(posedge anyMemPort.$clk); repeat (2) bogusEvict(gParam.evictFloodTargets, 8'hff); repeat (2) super.sendIntr(0, 3, 0); amount--; } } // For CCX coverage activity. 2 ifill resp followed by 1 eviction. (ncu does 3 interrupts) // Will enqueue a bunch of ifill responses and noop evictions for directed coverage. // Every source sends to ONE FloodTarget, all at once. No checking. // // bufferFloodFreq = getParam(DEC, "bufferFloodFreq", 0, 100000, 0); // bufferFloodAmount = getParam(DEC, "bufferFloodAmount", 1, 100, 10); // bufferFloodTarget = getParam(HEX, "bufferFloodTarget", 1, 7, 7); task CLASSNAME::bufferFlood() { integer amount; if (! gParam.bufferFloodFreq || ! gParam.bufferFloodAmount || ! gParam.bufferFloodTarget) return; if (gCcxDevice[8] == null || gCcxDevice[16] == null) PR_ERROR(CLASSNAMEQ, MON_ERROR, psprintf ("bufferFlood task needs L2 BFMs and NCU BFM!")); amount = gParam.bufferFloodAmount; repeat (500) @(posedge anyMemPort.$clk); while (amount) { repeat (gParam.bufferFloodFreq) @(posedge anyMemPort.$clk); bogusEvict(1< ld packet pairs // irritLdStFreq // irritLdStAdr1 // irritLdStAdr2 task CLASSNAME::randStLd() { integer i; // if (! gParam.irritLdStFreq) return; // spcCheck("randStLd"); }