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

Subversion Repositories instruction_list_pipelined_processor_with_peripherals

[/] [instruction_list_pipelined_processor_with_peripherals/] [trunk/] [hdl/] [outputReg.v] - Blame information for rev 10

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

Line No. Rev Author Line
1 10 maheshpalv
////////////////////////////////////////////////////////////////////////////////////////////////
2
////                                                                                                                    ////
3
////                                                                                                                    ////
4
////    This file is part of the project                                                                                        ////
5
////    "instruction_list_pipelined_processor_with_peripherals"                                                         ////
6
////                                                                                                                    ////
7
////  http://opencores.org/project,instruction_list_pipelined_processor_with_peripherals        ////
8
////                                                                                                                    ////
9
////                                                                                                                    ////
10
////                             Author:                                                                                ////
11
////                            - Mahesh Sukhdeo Palve                                                                                                  ////
12
////                                                                                                                                                                            ////
13
////////////////////////////////////////////////////////////////////////////////////////////////
14
////////////////////////////////////////////////////////////////////////////////////////////////
15
////                                                                                                                                                                            ////
16
////                                                                                                                                                            ////
17
////                                                                                                                    ////
18
////                                    This source file may be used and distributed without                    ////
19
////                                    restriction provided that this copyright statement is not               ////
20
////                                    removed from the file and that any derivative work contains             ////
21
////                                    the original copyright notice and the associated disclaimer.            ////
22
////                                                                                                                    ////
23
////                                    This source file is free software; you can redistribute it              ////
24
////                                    and/or modify it under the terms of the GNU Lesser General              ////
25
////                                    Public License as published by the Free Software Foundation;            ////
26
////                                    either version 2.1 of the License, or (at your option) any              ////
27
////                                    later version.                                                          ////
28
////                                                                                                                    ////
29
////                                    This source is distributed in the hope that it will be                  ////
30
////                                    useful, but WITHOUT ANY WARRANTY; without even the implied              ////
31
////                                    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR                 ////
32
////                                    PURPOSE.  See the GNU Lesser General Public License for more            ////
33
////                                    details.                                                                ////
34
////                                                                                                                    ////
35
////                                    You should have received a copy of the GNU Lesser General               ////
36
////                                    Public License along with this source; if not, download it              ////
37
////                                    from http://www.opencores.org/lgpl.shtml                                ////
38
////                                                                                                                    ////
39
////////////////////////////////////////////////////////////////////////////////////////////////
40 3 maheshpalv
 
41
`include "timescale.v"
42
`include "defines.v"
43
 
44
 
45
module outputReg (reset, outputRw, outputRwAddr, outputWriteIn, outputReadOut, outputs);
46
 
47
        input reset, outputRw;
48
        input [`outputAddrLen-1:0] outputRwAddr;
49
        input outputWriteIn;
50
 
51
        output outputReadOut;
52
        output [`outputNumber-1:0] outputs;
53
 
54
        reg outputReadOut;
55 8 maheshpalv
        reg [`outputNumber-1:0] outputs = 0;
56
        reg [`outputNumber-1 :0] outputReg = 0;
57 3 maheshpalv
 
58
 
59
 
60
        always @ (reset or outputRw or outputRwAddr or outputWriteIn or outputReg)
61
        begin
62
 
63
                if (reset)
64
                begin
65
                        outputReadOut = 1'bz;
66 8 maheshpalv
                        $write ("\nmodule outputRegister is reset       ");
67 3 maheshpalv
                end
68
 
69
                else
70
                begin
71
 
72
                        outputs = outputReg;
73
 
74
                        if (outputRw)   // read output status
75
                        begin
76
                                outputReadOut = outputReg[outputRwAddr];
77 8 maheshpalv
//                              $write ("\nreading output register      :       module outputRegister   ");
78 3 maheshpalv
                        end
79
                        else                            // write operation
80
                        begin
81
                                outputReg[outputRwAddr] = outputWriteIn;
82 8 maheshpalv
//                              $write ("\nwriting to the output register       :       module outputRegister   ");
83 3 maheshpalv
                        end
84
 
85
                end
86
 
87
        end
88
 
89
 
90
endmodule

powered by: WebSVN 2.1.0

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