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

Subversion Repositories fluid_core_2

[/] [fluid_core_2/] [trunk/] [xilinx14.5 project/] [Staller.v] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 azmathmoos
`timescale 1ns / 1ps
2
`include "Configuration.v"
3
module Staller(
4
        input Clk,
5
        input RST,
6
        input bubble,
7
        input load_hazard,
8
        output stall,
9
        output [0:4] bubble_lines
10
    );
11
 
12
        reg [0:8] bubble_reg;
13
        reg stall_reg;
14
 
15
                initial begin
16
                        stall_reg <= 0;
17
                end
18
 
19
        wire Clk_RST;
20
        assign Clk_RST = Clk || RST;
21
 
22
        always@(posedge Clk_RST) begin
23
                if (RST) begin
24
                        bubble_reg <= 9'b111100000;
25
                end else begin
26
                  if (bubble) begin
27
                        bubble_reg <= 9'b111100000;
28
                  end else begin
29
                        bubble_reg <= {1,bubble_reg[0:7]};
30
                  end
31
 
32
                  if (~stall_reg) begin
33
                        if (load_hazard) begin
34
                                stall_reg <= 1;
35
                        end else begin
36
                                stall_reg <= 0;
37
                        end
38
                   end else begin
39
                                stall_reg <= 0;
40
                        end
41
                end
42
        end
43
 
44
 
45
 
46
        assign bubble_lines = bubble_reg[4:8];
47
        assign stall = stall_reg;
48
endmodule

powered by: WebSVN 2.1.0

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