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 8

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

Line No. Rev Author Line
1 3 maheshpalv
 
2
`include "timescale.v"
3
`include "defines.v"
4
 
5
module bitRam (clk, reset, bitRamEn, bitRamRw, bitRamIn, bitRamAddr, bitRamOut);
6
 
7
 
8
                input   clk, reset, bitRamEn, bitRamRw, bitRamIn;
9
                input [`bitRamAddrLen-1:0]       bitRamAddr;
10
 
11
                output bitRamOut;
12
 
13
                reg bitRam [`bitRamDepth-1:0];
14
                reg bitRamOut;
15
 
16
 
17
                always @ (posedge clk or posedge reset)
18
                begin
19
 
20
                        if (reset)
21
                        begin
22
                                bitRamOut = 1'b0;
23 8 maheshpalv
                                $write ("\nmodule bitRam is reset       ");
24 3 maheshpalv
                        end
25
 
26
                        else
27
                        begin
28
 
29
                        if (bitRamEn)
30
                        begin
31
                                if (bitRamRw)   // read operation
32
                                begin
33
                                        bitRamOut = bitRam[bitRamAddr];
34 8 maheshpalv
//                                      $write ("\nreading bit-RAM      :       module bitRAM   ");
35 3 maheshpalv
                                end
36
 
37
                                else                            // write operation
38
                                begin
39
                                        bitRam[bitRamAddr] = bitRamIn;
40 8 maheshpalv
//                                      $write ("\nwriting to bit-RAM   :       module bitRam   ");
41 3 maheshpalv
                                end
42
                        end
43
 
44
                        else
45
                        begin
46
                                bitRamOut = 1'bZ;
47
                        end
48
 
49
                        end     // end else of reset
50
 
51
                end     // end always block
52
 
53
 
54
endmodule

powered by: WebSVN 2.1.0

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