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

Subversion Repositories mips_fault_tolerant

[/] [mips_fault_tolerant/] [trunk/] [source/] [In_mux.vhd] - Blame information for rev 57

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 41 jimi39
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    01:31:18 05/30/2012 
6
-- Design Name: 
7
-- Module Name:    In_mux - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
 
23
-- Uncomment the following library declaration if using
24
-- arithmetic functions with Signed or Unsigned values
25
--use IEEE.NUMERIC_STD.ALL;
26
 
27
-- Uncomment the following library declaration if instantiating
28
-- any Xilinx primitives in this code.
29
--library UNISIM;
30
--use UNISIM.VComponents.all;
31
 
32
entity In_mux is
33
Generic (
34
         busw : integer := 31
35
);
36
    Port (
37
                A_in : in  STD_LOGIC_VECTOR (busw downto 0);
38
                          B_in : in  STD_LOGIC_VECTOR (busw downto 0);
39
           I : in  STD_LOGIC_VECTOR (busw downto 0);
40
                          ALUSrcA : in  STD_LOGIC;
41
           ALUSrcB : in  STD_LOGIC_VECTOR(1 downto 0);
42
           A : out  STD_LOGIC_VECTOR (busw downto 0);
43
                          B : out  STD_LOGIC_VECTOR (busw downto 0)
44
                          );
45
end In_mux;
46
 
47
architecture Behavioral of In_mux is
48
 
49
begin
50
          A <= A_in when ALUSrcA = '1' else
51
                              x"00000000";
52
 
53
                         B <= B_in when ALUSrcB = "00" else
54
                               "00000000000000000000000000000100" when ALUSrcB = "01" else
55
                                         I when ALUSrcB = "10" else
56
                                         I when ALUSrcB = "11" else -- i have to make shit left 2
57
                                         x"00000000";
58
 
59
 
60
end Behavioral;
61
 

powered by: WebSVN 2.1.0

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