OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [src_processor/] [aeMB/] [verilog/] [src/] [aeMB2_pipe.v] - Blame information for rev 16

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 alirezamon
/* $Id: aeMB2_pipe.v,v 1.4 2008-05-01 08:32:58 sybreon Exp $
2
**
3
** AEMB2 EDK 6.2 COMPATIBLE CORE
4
** Copyright (C) 2004-2008 Shawn Tan <shawn.tan@aeste.net>
5
**
6
** This file is part of AEMB.
7
**
8
** AEMB is free software: you can redistribute it and/or modify it
9
** under the terms of the GNU Lesser General Public License as
10
** published by the Free Software Foundation, either version 3 of the
11
** License, or (at your option) any later version.
12
**
13
** AEMB is distributed in the hope that it will be useful, but WITHOUT
14
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
16
** Public License for more details.
17
**
18
** You should have received a copy of the GNU Lesser General Public
19
** License along with AEMB. If not, see <http:**www.gnu.org/licenses/>.
20
*/
21
/**
22
 * System signal controller
23
 * @file aeMB2_pipe.v
24
 
25
 * Generates clock, reset, and enable signals. Hardware clock/reset
26
   managers can be instantiated here.
27
 
28
 */
29
`timescale  1ns/1ps
30
module aeMB2_pipe (/*AUTOARG*/
31
   // Outputs
32
   brk_if, gpha, gclk, grst, dena, iena,
33
   // Inputs
34
   bra_ex, dwb_fb, xwb_fb, ich_fb, fet_fb, msr_ex, exc_dwb, exc_iwb,
35
   exc_ill, sys_clk_i, sys_int_i, sys_rst_i, sys_ena_i
36
   );
37
   parameter AEMB_HTX = 1;
38
 
39
   output [1:0] brk_if;
40
   input [1:0]   bra_ex;
41
   input        dwb_fb;
42
   input        xwb_fb;
43
   input        ich_fb;
44
   input        fet_fb;
45
   input [9:0]   msr_ex;
46
 
47
   output       gpha,
48
                gclk,
49
                grst,
50
                dena,
51
                iena;
52
 
53
   input [1:0]   exc_dwb;
54
   input        exc_iwb;
55
   input        exc_ill;
56
 
57
   input        sys_clk_i,
58
                sys_int_i,
59
                sys_rst_i,
60
                sys_ena_i;
61
 
62
   /*AUTOREG*/
63
   // Beginning of automatic regs (for this module's undeclared outputs)
64
   reg [1:0]             brk_if;
65
   reg                  gpha;
66
   // End of automatics
67
   reg [1:0]             rst;
68
   reg                  por;
69
   reg                  fet;
70
   reg                  hit;
71
 
72
   // Instantiate clock/reset managers
73
   assign               gclk = sys_clk_i;
74
   assign               grst = !rst[1];
75
 
76
   // run instruction side pipeline
77
   assign               iena = ich_fb &
78
                               xwb_fb &
79
                               dwb_fb &
80
                               sys_ena_i;
81
   // run data side pipeline
82
   assign               dena = iena;
83
 
84
   // interrupt process - latches onto any interrupt until it is handled
85
   reg                  int_lat; ///< interrupt latch
86
 
87
   always @(posedge sys_clk_i)
88
     if (sys_rst_i) begin
89
        /*AUTORESET*/
90
        // Beginning of autoreset for uninitialized flops
91
        int_lat <= 1'h0;
92
        // End of automatics
93
     end else begin
94
        int_lat <= #1 msr_ex[1] & (int_lat | sys_int_i);
95
     end
96
 
97
   // exception process - exceptions handled immediately
98
   wire                 exc_lat; ///< exception latch
99
   assign exc_lat = exc_ill | exc_dwb[1];
100
 
101
   always @(posedge gclk)
102
     if (grst) begin
103
        /*AUTORESET*/
104
        // Beginning of autoreset for uninitialized flops
105
        brk_if <= 2'h0;
106
        // End of automatics
107
     end else if (dena) begin
108
        brk_if[1] <= #1 exc_lat & msr_ex[8] & !msr_ex[9]; // HIGH PRIORITY - exception
109
        brk_if[0] <= #1 !exc_lat & !msr_ex[9] & !msr_ex[3] & int_lat; // LOW PRIORITY - interrupt (not BIP/EIP)
110
     end
111
 
112
   // RESET DELAY
113
   always @(posedge sys_clk_i)
114
     if (sys_rst_i) begin
115
        /*AUTORESET*/
116
        // Beginning of autoreset for uninitialized flops
117
        rst <= 2'h0;
118
        // End of automatics
119
     end else begin
120
        rst <= #1 {rst[0], !sys_rst_i};
121
     end
122
 
123
   // PHASE TOGGLE
124
   always @(posedge sys_clk_i)
125
     if (sys_rst_i) begin
126
        /*AUTORESET*/
127
        // Beginning of autoreset for uninitialized flops
128
        gpha <= 1'h0;
129
        // End of automatics
130
     end else if (dena | grst) begin
131
        gpha <= #1 !gpha;
132
     end
133
 
134
endmodule // aeMB2_pipe
135
 

powered by: WebSVN 2.1.0

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