diff options
| author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-01-09 21:20:11 -0600 |
|---|---|---|
| committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-01-09 21:20:11 -0600 |
| commit | a4eb2fb6bfae4f5f71d7a0b3b1b384c19d94ecc6 (patch) | |
| tree | 2f44cac5570f990b5feb8ee35a915cbf0c67040e /fpga/gpmc/xilinx/common/data_storage.v | |
| parent | 04ab7c66320d2f4601626c3018e4ac9fceb4a75c (diff) | |
| download | ulab-a4eb2fb6bfae4f5f71d7a0b3b1b384c19d94ecc6.tar.gz ulab-a4eb2fb6bfae4f5f71d7a0b3b1b384c19d94ecc6.zip | |
Move hardware design files to their correct locations
Diffstat (limited to 'fpga/gpmc/xilinx/common/data_storage.v')
| -rw-r--r-- | fpga/gpmc/xilinx/common/data_storage.v | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fpga/gpmc/xilinx/common/data_storage.v b/fpga/gpmc/xilinx/common/data_storage.v new file mode 100644 index 0000000..b98fb25 --- /dev/null +++ b/fpga/gpmc/xilinx/common/data_storage.v @@ -0,0 +1,33 @@ +`timescale 1ns / 1ps +////////////////////////////////////////////////////////////////////////////////// +// +// (c) 2014 Timothy Pearson, Raptor Engineering +// Released into the Public Domain +// +////////////////////////////////////////////////////////////////////////////////// + +module data_storage( + input clka, + input [7:0] dina, + input [(RAM_ADDR_BITS-1):0] addra, + input wea, + output reg [7:0] douta); + + parameter RAM_ADDR_BITS = 14; + parameter RAM_WIDTH = 8; + + // Xilinx specific directive + (* RAM_STYLE="BLOCK" *) + + reg [RAM_WIDTH-1:0] data_storage_ram [(2**RAM_ADDR_BITS)-1:0]; + + always @(posedge clka) begin + if (wea) begin + data_storage_ram[addra] <= dina; + douta <= dina; + end else begin + douta <= data_storage_ram[addra]; + end + end + +endmodule |
