| 1 | // ========== Copyright Header Begin ========================================== |
| 2 | // |
| 3 | // OpenSPARC T2 Processor File: ucb___packet.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 ============================================ |
| 35 | #include <vera_defines.vrh> |
| 36 | |
| 37 | class UCB___packet { |
| 38 | string name; |
| 39 | bit [127:0] pkt; // the whole 128-bit ucb packet |
| 40 | //---each field---- |
| 41 | bit [63:0] payload; // [127:64] of ucb pkt |
| 42 | bit [8:0] bytemask; // [63:55] of ucb pkt |
| 43 | bit [39:0] addr; // [54:15] of ucb pkt |
| 44 | bit [2:0] req_size; // [14:12] of ucb pkt |
| 45 | bit [1:0] buffer_id; // [11:10] of ucb pkt |
| 46 | bit [2:0] cpu_id; // [9:7] of ucb pkt |
| 47 | bit [2:0] thread_id; // [6:4] of ucb pkt |
| 48 | bit [3:0] pkt_type; // [3:0] of ucb pkt |
| 49 | |
| 50 | task new(string name="UCB_pkt", bit [127:0] pkt=0) { |
| 51 | this.name = name; |
| 52 | this.pkt = pkt; |
| 53 | break_into_fields(); |
| 54 | } |
| 55 | |
| 56 | //---break 128-bit value of ucb pkt into each field--- |
| 57 | task break_into_fields() { |
| 58 | this.payload = this.pkt[127:64]; |
| 59 | this.bytemask = this.pkt[63:55]; |
| 60 | this.addr = this.pkt[54:15]; |
| 61 | this.req_size = this.pkt[14:12]; |
| 62 | this.buffer_id = this.pkt[11:10]; |
| 63 | this.cpu_id = this.pkt[9:7]; |
| 64 | this.thread_id = this.pkt[6:4]; |
| 65 | this.pkt_type = this.pkt[3:0]; |
| 66 | } |
| 67 | } |