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/] [ramBit.v] - Blame information for rev 10

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
module bitRam (clk, reset, bitRamEn, bitRamRw, bitRamIn, bitRamAddr, bitRamOut);
45
 
46
 
47
                input   clk, reset, bitRamEn, bitRamRw, bitRamIn;
48
                input [`bitRamAddrLen-1:0]       bitRamAddr;
49
 
50
                output bitRamOut;
51
 
52
                reg bitRam [`bitRamDepth-1:0];
53
                reg bitRamOut;
54
 
55
 
56
                always @ (posedge clk or posedge reset)
57
                begin
58
 
59
                        if (reset)
60
                        begin
61
                                bitRamOut = 1'b0;
62 8 maheshpalv
                                $write ("\nmodule bitRam is reset       ");
63 3 maheshpalv
                        end
64
 
65
                        else
66
                        begin
67
 
68
                        if (bitRamEn)
69
                        begin
70
                                if (bitRamRw)   // read operation
71
                                begin
72
                                        bitRamOut = bitRam[bitRamAddr];
73 8 maheshpalv
//                                      $write ("\nreading bit-RAM      :       module bitRAM   ");
74 3 maheshpalv
                                end
75
 
76
                                else                            // write operation
77
                                begin
78
                                        bitRam[bitRamAddr] = bitRamIn;
79 8 maheshpalv
//                                      $write ("\nwriting to bit-RAM   :       module bitRam   ");
80 3 maheshpalv
                                end
81
                        end
82
 
83
                        else
84
                        begin
85
                                bitRamOut = 1'bZ;
86
                        end
87
 
88
                        end     // end else of reset
89
 
90
                end     // end always block
91
 
92
 
93
endmodule

powered by: WebSVN 2.1.0

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