Skip to content

Commit

Permalink
Merge pull request #943 from mbot27/ram2
Browse files Browse the repository at this point in the history
Ram2
  • Loading branch information
jjts authored Sep 9, 2024
2 parents f963808 + 9dada39 commit 2a11bc9
Show file tree
Hide file tree
Showing 22 changed files with 1,425 additions and 805 deletions.
48 changes: 0 additions & 48 deletions lib/hardware/memories/ram/iob_ram_at2p/hardware/src/iob_ram_at2p.v

This file was deleted.

124 changes: 123 additions & 1 deletion lib/hardware/memories/ram/iob_ram_at2p/iob_ram_at2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,129 @@ def setup(py_params_dict):
"original_name": "iob_ram_at2p",
"name": "iob_ram_at2p",
"version": "0.1",
"generate_hw": False,
"confs": [
{
"name": "HEXFILE",
"type": "P",
"val": '"none"',
"min": "NA",
"max": "NA",
"descr": "Name of file to load into RAM",
},
{
"name": "DATA_W",
"type": "P",
"val": "0",
"min": "NA",
"max": "NA",
"descr": "DATA width",
},
{
"name": "ADDR_W",
"type": "P",
"val": "0",
"min": "NA",
"max": "NA",
"descr": "Address bus width",
},
{
"name": "MEM_INIT_FILE_INT",
"type": "F",
"val": "HEXFILE",
"min": "NA",
"max": "NA",
"descr": "",
},
],
"ports": [
{
"name": "w_clk_i",
"descr": "Input port",
"signals": [
{"name": "w_clk", "width": 1, "direction": "input"},
],
},
{
"name": "w_en_i",
"descr": "Input port",
"signals": [
{"name": "w_en", "width": 1, "direction": "input"},
],
},
{
"name": "w_addr_i",
"descr": "Input port",
"signals": [
{"name": "w_addr", "width": "ADDR_W", "direction": "input"},
],
},
{
"name": "w_data_i",
"descr": "Input port",
"signals": [
{"name": "w_data", "width": "DATA_W", "direction": "input"},
],
},
{
"name": "r_clk_i",
"descr": "Input port",
"signals": [
{"name": "r_clk", "width": 1, "direction": "input"},
],
},
{
"name": "r_en_i",
"descr": "Input port",
"signals": [
{"name": "r_en", "width": 1, "direction": "input"},
],
},
{
"name": "r_addr_i",
"descr": "Input port",
"signals": [
{"name": "r_addr", "width": "ADDR_W", "direction": "input"},
],
},
{
"name": "r_data_o",
"descr": "Output port",
"signals": [
{"name": "r_data", "width": "DATA_W", "direction": "output"},
],
},
],
"snippets": [
{
"verilog_code": """
// Declare the RAM
reg [DATA_W-1:0] ram[(2**ADDR_W)-1:0];
reg [DATA_W-1:0] r_data_o_reg;
assign r_data_o=r_data_o_reg;
// Initialize the RAM
initial begin
if (MEM_INIT_FILE_INT != "none") begin
$readmemh(MEM_INIT_FILE_INT, ram, 0, (2 ** ADDR_W) - 1);
end
end
//write
always @(posedge w_clk_i) begin
if (w_en_i) begin
ram[w_addr_i] <= w_data_i;
end
end
//read
always @(posedge r_clk_i) begin
if (r_en_i) begin
r_data_o_reg <= ram[r_addr_i];
end
end
""",
},
],
}

return attributes_dict
58 changes: 0 additions & 58 deletions lib/hardware/memories/ram/iob_ram_atdp/hardware/src/iob_ram_atdp.v

This file was deleted.

Loading

0 comments on commit 2a11bc9

Please sign in to comment.