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

Subversion Repositories mips32

[/] [mips32/] [trunk/] [Classic-MIPS/] [source/] [src/] [bypath.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 bypath(
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 [1:0]    sel,
28
output wire [31:0]  out
29
    );
30
 
31
    /* the bypass is a 3-1 MUX */
32
    assign out = OUT(reg_data, ex_mem_data, mem_wb_data, sel);
33
 
34
    function [31:0] OUT;
35
    input [31:0]    a;
36
    input [31:0]    b;
37
    input [31:0]    c;
38
    input [1:0]     sel;
39
    begin
40
        case( sel )
41
        2'b00: OUT = a;
42
        2'b10: OUT = b;
43
        2'b01: OUT = c;
44
        default: OUT = a;
45
        endcase
46
    end
47
    endfunction
48
 
49
endmodule

powered by: WebSVN 2.1.0

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