Skip to content

Commit

Permalink
Add TDP ram
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanG077 committed May 9, 2024
1 parent 5d13ebf commit 8b99239
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ project:
source_files:
- "project.v"
- "topEntity.v"
- "Clash_TinyTapeout_EthernetMac_TopEntity_topEntity_trueDualPortBlockRamWrapper.v"

# The pinout of your project. Leave unused pins blank. DO NOT delete or add any pins.
pinout:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* AUTOMATICALLY GENERATED VERILOG-2001 SOURCE CODE.
** GENERATED BY CLASH 1.6.4. DO NOT MODIFY.
*/
`timescale 100fs/100fs
module Clash_TinyTapeout_EthernetMac_TopEntity_topEntity_trueDualPortBlockRamWrapper
( // Inputs
input clkA // clock
, input enA
, input weA
, input [3:0] addrA
, input [9:0] datA
, input clkB // clock
, input enB
, input weB
, input [3:0] addrB
, input [9:0] datB

// Outputs
, output wire [19:0] result
);


// trueDualPortBlockRam begin
// Shared memory
reg [10-1:0] mem [16-1:0];

reg [9:0] data_slow;
reg [9:0] data_fast;

// Port A
always @(posedge clkA) begin
if(enA) begin
data_slow <= mem[addrA];
if(weA) begin
data_slow <= datA;
mem[addrA] <= datA;
end
end
end

// Port B
always @(posedge clkB) begin
if(enB) begin
data_fast <= mem[addrB];
if(weB) begin
data_fast <= datB;
mem[addrB] <= datB;
end
end
end

assign result = {data_slow, data_fast};

// end trueDualPortBlockRam


endmodule

0 comments on commit 8b99239

Please sign in to comment.