OpenCores
URL https://opencores.org/ocsvn/sparc64soc/sparc64soc/trunk

Subversion Repositories sparc64soc

[/] [sparc64soc/] [trunk/] [T1-CPU/] [lsu/] [lsu_pcx_qmon.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dmitryr
// ========== Copyright Header Begin ==========================================
2
// 
3
// OpenSPARC T1 Processor File: lsu_pcx_qmon.v
4
// Copyright (c) 2006 Sun Microsystems, Inc.  All Rights Reserved.
5
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
6
// 
7
// The above named program is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU General Public
9
// License version 2 as published by the Free Software Foundation.
10
// 
11
// The above named program is distributed in the hope that it will be 
12
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
// General Public License for more details.
15
// 
16
// You should have received a copy of the GNU General Public
17
// License along with this work; if not, write to the Free Software
18
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19
// 
20
// ========== Copyright Header End ============================================
21
////////////////////////////////////////////////////////////////////////
22
/*
23
//      Description:    Monitors queue state of pcx.
24
*/
25
////////////////////////////////////////////////////////////////////////
26
// Global header file includes
27
////////////////////////////////////////////////////////////////////////
28
`include        "sys.h" // system level definition file which contains the
29
                                        // time scale definition
30
 
31
////////////////////////////////////////////////////////////////////////
32
// Local header file includes / local defines
33
////////////////////////////////////////////////////////////////////////
34
 
35
module lsu_pcx_qmon (/*AUTOARG*/
36
   // Outputs
37
   so, qwrite, sel_qentry0,
38
   // Inputs
39
   rclk, grst_l, arst_l, si, se, send_by_pcx, send_to_pcx
40
   ) ;
41
 
42
input           rclk ;
43
input           grst_l;
44
input           arst_l;
45
input           si;
46
input           se;
47
output          so;
48
 
49
input   send_by_pcx ;           // PCX sends packet to dest.
50
input   send_to_pcx ;           // SKB sends packet to PCX.
51
 
52
output  qwrite ;                // PCX queue is writable.
53
output  sel_qentry0 ;           // entry to be written.
54
 
55
wire       clk;
56
wire    reset ,dbb_reset_l ;
57
wire    entry0_rst, entry1_rst ;
58
wire    entry0_en, entry1_en ;
59
wire    entry0_din, entry1_din ;
60
wire    entry0_full,entry1_full;
61
 
62
    dffrl_async rstff(.din (grst_l),
63
                        .q   (dbb_reset_l),
64
                        .clk (clk), .se(se), .si(), .so(),
65
                        .rst_l (arst_l));
66
 
67
assign  reset =  ~dbb_reset_l;
68
assign  clk = rclk;
69
 
70
 
71
//======================================================================================
72
//
73
//      Queue Monitor 
74
//
75
//======================================================================================
76
 
77
//
78
//      Pipeline :
79
//--------------------------------------------------------------------------------------
80
//
81
//      | req to pcx    | payload to pcx|               |               |
82
//      | qfull=0       |   arb/grant=1 |               |               |
83
//      | qentry=1      |               |               |               |
84
//      |               |               |               |               |
85
//      |               | req to pcx    | payload to pcx|               |
86
//      |               | qfull=0       |   arb/grant=0 |               |
87
//      |               | qentry=2      |               |               |
88
//      |               |               | req to pcx    | payload to pcx| 
89
//      |               |               | qfull=0       |     arb/grant |
90
//
91
//      
92
 
93
 
94
// OPERATION :
95
// Monitors state per 2 input queue of pcx for given processor.
96
// - Implemented as FIFO.
97
// - The queue is cleared on reset. 
98
// - A packet sent from the core to pcx will set a bit in the 
99
// corresponding logical queue entry.
100
// - A packet sent from pcx to dest, will cause entry0 to be cleared.
101
// Only entry0 need be cleared as entry1 will shift to entry0 on
102
// a grant by the pcx.
103
// - The queue will never overflow as a packet will never be sent 
104
// from the skb to the pcx unless at least one queue entry is free.
105
// Timing : May have to flop grant and then use it.
106
 
107
assign entry0_rst =     reset |
108
                        (send_by_pcx & ~entry0_en) ;            // pcx sends to dest.
109
assign entry0_en  =     ( entry1_full & send_by_pcx)    |       // shift entry1 to entry0
110
                        (~(entry0_full & ~send_by_pcx) & send_to_pcx) ;
111
assign entry0_din =     entry0_en ;
112
 
113
// represents oldest packet.
114
dffre_s  qstate_entry0 (
115
        .din    (entry0_din), .q  (entry0_full),
116
        .rst    (entry0_rst), .en (entry0_en), .clk (clk),
117
        .se     (1'b0),       .si (),          .so ()
118
        );
119
 
120
assign entry1_rst =     reset |
121
                        (send_by_pcx & ~entry1_en) ;
122
assign entry1_en  =     entry0_full & send_to_pcx
123
                        & ~(send_by_pcx & ~entry1_full) ; // new packet to entry1
124
assign entry1_din =     entry1_en ;
125
 
126
// represents youngest packet.
127
dffre_s  qstate_entry1 (
128
        .din    (entry1_din), .q  (entry1_full),
129
        .rst    (entry1_rst), .en (entry1_en),  .clk (clk),
130
        .se     (1'b0), .si     (), .so ()
131
        );
132
 
133
assign qwrite = ~entry1_full ;
134
                //(entry1_full & send_by_pcx) ;         // look at top of stack only.
135
assign sel_qentry0 =
136
        (~entry0_full & ~send_to_pcx) ;
137
        //(~entry0_full | 
138
        //(~entry1_full & entry0_full & send_by_pcx)) & ~send_to_pcx ;                                  
139
                                                                        // select which entry to write.
140
 
141
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.