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

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [hdl/] [rtl/] [sparc_core/] [lsu_pcx_qmon.v] - Blame information for rev 113

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 95 fafa1971
// ========== 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 113 albert.wat
`ifdef SIMPLY_RISC_TWEAKS
22
`define SIMPLY_RISC_SCANIN .si(0)
23
`else
24
`define SIMPLY_RISC_SCANIN .si()
25
`endif
26 95 fafa1971
////////////////////////////////////////////////////////////////////////
27
/*
28
//      Description:    Monitors queue state of pcx.
29
*/
30
////////////////////////////////////////////////////////////////////////
31
// Global header file includes
32
////////////////////////////////////////////////////////////////////////
33 113 albert.wat
`include        "sys.h" // system level definition file which contains the
34 95 fafa1971
                                        // time scale definition
35
 
36
////////////////////////////////////////////////////////////////////////
37
// Local header file includes / local defines
38
////////////////////////////////////////////////////////////////////////
39
 
40
module lsu_pcx_qmon (/*AUTOARG*/
41
   // Outputs
42
   so, qwrite, sel_qentry0,
43
   // Inputs
44
   rclk, grst_l, arst_l, si, se, send_by_pcx, send_to_pcx
45
   ) ;
46
 
47
input           rclk ;
48
input           grst_l;
49
input           arst_l;
50
input           si;
51
input           se;
52
output          so;
53
 
54
input   send_by_pcx ;           // PCX sends packet to dest.
55
input   send_to_pcx ;           // SKB sends packet to PCX.
56
 
57
output  qwrite ;                // PCX queue is writable.
58
output  sel_qentry0 ;           // entry to be written.
59
 
60
wire       clk;
61
wire    reset ,dbb_reset_l ;
62
wire    entry0_rst, entry1_rst ;
63
wire    entry0_en, entry1_en ;
64
wire    entry0_din, entry1_din ;
65
wire    entry0_full,entry1_full;
66
 
67
    dffrl_async rstff(.din (grst_l),
68
                        .q   (dbb_reset_l),
69 113 albert.wat
                        .clk (clk), .se(se), `SIMPLY_RISC_SCANIN, .so(),
70 95 fafa1971
                        .rst_l (arst_l));
71
 
72
assign  reset =  ~dbb_reset_l;
73
assign  clk = rclk;
74
 
75
 
76
//======================================================================================
77
//
78
//      Queue Monitor 
79
//
80
//======================================================================================
81
 
82
//
83
//      Pipeline :
84
//--------------------------------------------------------------------------------------
85
//
86
//      | req to pcx    | payload to pcx|               |               |
87
//      | qfull=0       |   arb/grant=1 |               |               |
88
//      | qentry=1      |               |               |               |
89
//      |               |               |               |               |
90
//      |               | req to pcx    | payload to pcx|               |
91
//      |               | qfull=0       |   arb/grant=0 |               |
92
//      |               | qentry=2      |               |               |
93
//      |               |               | req to pcx    | payload to pcx| 
94
//      |               |               | qfull=0       |     arb/grant |
95
//
96
//      
97
 
98
 
99
// OPERATION :
100
// Monitors state per 2 input queue of pcx for given processor.
101
// - Implemented as FIFO.
102
// - The queue is cleared on reset. 
103
// - A packet sent from the core to pcx will set a bit in the 
104
// corresponding logical queue entry.
105
// - A packet sent from pcx to dest, will cause entry0 to be cleared.
106
// Only entry0 need be cleared as entry1 will shift to entry0 on
107
// a grant by the pcx.
108
// - The queue will never overflow as a packet will never be sent 
109
// from the skb to the pcx unless at least one queue entry is free.
110
// Timing : May have to flop grant and then use it.
111
 
112
assign entry0_rst =     reset |
113
                        (send_by_pcx & ~entry0_en) ;            // pcx sends to dest.
114
assign entry0_en  =     ( entry1_full & send_by_pcx)    |       // shift entry1 to entry0
115
                        (~(entry0_full & ~send_by_pcx) & send_to_pcx) ;
116
assign entry0_din =     entry0_en ;
117
 
118
// represents oldest packet.
119 113 albert.wat
dffre_s  qstate_entry0 (
120 95 fafa1971
        .din    (entry0_din), .q  (entry0_full),
121
        .rst    (entry0_rst), .en (entry0_en), .clk (clk),
122 113 albert.wat
        .se     (1'b0),       `SIMPLY_RISC_SCANIN,             .so ()
123 95 fafa1971
        );
124
 
125
assign entry1_rst =     reset |
126
                        (send_by_pcx & ~entry1_en) ;
127
assign entry1_en  =     entry0_full & send_to_pcx
128
                        & ~(send_by_pcx & ~entry1_full) ; // new packet to entry1
129
assign entry1_din =     entry1_en ;
130
 
131
// represents youngest packet.
132 113 albert.wat
dffre_s  qstate_entry1 (
133 95 fafa1971
        .din    (entry1_din), .q  (entry1_full),
134
        .rst    (entry1_rst), .en (entry1_en),  .clk (clk),
135 113 albert.wat
        .se     (1'b0), `SIMPLY_RISC_SCANIN, .so ()
136 95 fafa1971
        );
137
 
138
assign qwrite = ~entry1_full ;
139
                //(entry1_full & send_by_pcx) ;         // look at top of stack only.
140
assign sel_qentry0 =
141
        (~entry0_full & ~send_to_pcx) ;
142
        //(~entry0_full | 
143
        //(~entry1_full & entry0_full & send_by_pcx)) & ~send_to_pcx ;                                  
144
                                                                        // select which entry to write.
145
 
146
endmodule

powered by: WebSVN 2.1.0

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