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

Subversion Repositories embedded_risc

[/] [embedded_risc/] [trunk/] [Verilog/] [IR.V] - Blame information for rev 27

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 hosseinami
/****************************************************************************************
2
 MODULE:                Sub Level Instruction Register Block
3
 
4
 FILE NAME:     ir.v
5
 VERSION:       1.0
6
 DATE:          September 28th, 2001
7
 AUTHOR:                Hossein Amidi
8
 COMPANY:       California Unique Electrical Co.
9
 CODE TYPE:     Register Transfer Level
10
 
11
 Instantiations:
12
 
13
 DESCRIPTION:
14
 Sub Level RTL Instruction Register block
15
 
16
   This module generates the OPERAND and OPCODE to be used by
17
   modules ALU and CONTROLLER
18
   Inputs:
19
 
20
        Internal Name      Net Name             From
21
        -----------------------------------------------------------
22
        IRDataIn: [15:0]  MemDataOut    input into cpu module   (from memory)
23
 
24
        IRInEn:                         IRInEn          Controller
25
 
26
        clock:                  clock                   input into cpu Module   (from stimulus.v)
27
        reset:                  reset                   input into cpu Module   (from stimulus.v)
28
   Outputs:
29
 
30
        Internal Name       Net Name                    Used By
31
        -----------------------------------------------------------
32
 
33
        OpCode: [3:0]       OpCode                              ALU and Controller
34
 
35
        OperandOut: [11:0] OperandAddress       MUX12
36
 
37
 Hossein Amidi
38
 (C) September 2001
39
 California Unique Electric
40
 
41
***************************************************************************************/
42
 
43
`timescale 1ns / 1ps
44
 
45
 module  IR (   // Input
46
                                        clock,
47
                                        reset,
48
                                        IRInEn,
49
                                        IRDataIn,
50
                                        // Output
51
                                        OperandOut,
52
                                        OpCodeOut
53
                                        );
54
 
55
 
56
// Parameter
57
parameter DataWidth = 32;
58
parameter AddrWidth = 24;
59
parameter OpcodeSize = 8;
60
 
61
// Input
62
input  [DataWidth - 1 : 0] IRDataIn;
63
input    IRInEn;
64
input  clock;
65
input  reset;
66
 
67
// Output
68
output [AddrWidth - 1 : 0] OperandOut;
69
output [OpcodeSize - 1 : 0]  OpCodeOut;
70
 
71
// Signal Declerations
72
reg [AddrWidth - 1 : 0]  OperandOut;
73
reg [OpcodeSize - 1 : 0]   OpCodeOut;
74
 
75
 
76
always @ (posedge reset or negedge clock)
77
begin
78
        if(reset == 1'b1)
79
        begin
80
                OperandOut <= 24'h00_0000;
81
                OpCodeOut  <= 8'h00;
82
        end
83
        else
84
        if(IRInEn == 1'b1)
85
        begin
86
                OperandOut <= IRDataIn [23:0];
87
                OpCodeOut  <= IRDataIn [31:24];
88
        end
89
        else
90
        begin
91
                OperandOut <= OperandOut;
92
                OpCodeOut  <= OpCodeOut;
93
        end
94
end
95
endmodule
96
 

powered by: WebSVN 2.1.0

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