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

Subversion Repositories mips32

[/] [mips32/] [trunk/] [Classic-MIPS/] [source/] [src/] [bypath2.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jjf
`timescale 1ns / 1ps
2
//////////////////////////////////////////////////////////////////////////////////
3
// Company: 
4
// Engineer: 
5
// 
6
// Create Date: 2017/01/13 12:53:40
7
// Design Name: 
8
// Module Name: bypath
9
// Project Name: 
10
// Target Devices: 
11
// Tool Versions: 
12
// Description: 
13
// 
14
// Dependencies: 
15
// 
16
// Revision:
17
// Revision 0.01 - File Created
18
// Additional Comments:
19
// 
20
//////////////////////////////////////////////////////////////////////////////////
21
 
22
 
23
module bypath2(
24
input wire [31:0]   reg_data,
25
input wire [31:0]   ex_mem_data,
26
input wire [31:0]   mem_wb_data,
27
input wire [31:0]   immediate,
28
input wire          ALUSrc_flag,
29
input wire [1:0]    sel,
30
output wire [31:0]  out
31
    );
32
 
33
    /* the bypass is a 3-1 MUX */
34
    assign out = OUT(reg_data, ex_mem_data, mem_wb_data, immediate, ALUSrc_flag, sel);
35
 
36
    function [31:0] OUT;
37
    input [31:0]    a;
38
    input [31:0]    b;
39
    input [31:0]    c;
40
    input [31:0]    d;
41
    input           flag;
42
    input [1:0]     sel;
43
    begin
44
       case(  {flag, sel})
45
        3'b100: OUT = d;
46
        3'b101: OUT = d;
47
        3'b110: OUT = d;
48
        3'b111: OUT = d;
49
        3'b000: OUT = a;
50
        3'b010: OUT = b;
51
        3'b001: OUT = c;
52
        default: OUT = a;
53
       endcase
54
    end
55
    endfunction
56
 
57
endmodule

powered by: WebSVN 2.1.0

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