Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch: add support dp_memory for tang primer 20k board #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/includes/scr1_arch_description.svh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
// `define SCR1_TRGT_FPGA_INTEL_ARRIAV // target platform is Intel Arria V FPGAs (used in the SCR1-SDK project)
// `define SCR1_TRGT_FPGA_XILINX // target platform is Xilinx FPGAs (used in the SCR1-SDK project)
// `define SCR1_TRGT_ASIC // target platform is ASIC
// `define SCR1_TRGT_FPGA_GOWIN // target platform is Gowin FPGAs (used in the SCR1-SDK project)
// `define SCR1_TRGT_SIMULATION // target is simulation (enable simulation code)

`include "scr1_arch_custom.svh"
Expand Down
30 changes: 30 additions & 0 deletions src/top/scr1_dp_memory.sv
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,36 @@ always_ff @(posedge clk) begin
qa <= memory_array[addra];
end

`elsif SCR1_TRGT_FPGA_GOWIN

localparam int unsigned RAM_SIZE_WORDS = SCR1_SIZE/SCR1_NBYTES;

//-------------------------------------------------------------------------------
// Local signal declaration
//-------------------------------------------------------------------------------
(* ram_style = "block" *) logic [SCR1_WIDTH-1:0] ram_block [(RAM_SIZE_WORDS-1):0] /* synthesis syn_ramstyle = "block_ram" */;

//FIXME here not supported bytes writing in dualport memory mode. Only words.
//-------------------------------------------------------------------------------
// Port B memory behavioral description
//-------------------------------------------------------------------------------
always_ff @(posedge clk) begin
if (wenb) begin
ram_block[addrb] <= datab;
end
if(renb) begin
qb <= ram_block[addrb];
end
end
//-------------------------------------------------------------------------------
// Port A memory behavioral description
//-------------------------------------------------------------------------------
always_ff @(posedge clk) begin
if(rena) begin
qa <= ram_block[addra];
end
end

`else // SCR1_TRGT_FPGA_INTEL

// CASE: OTHERS - SCR1_TRGT_FPGA_XILINX, SIMULATION, ASIC etc
Expand Down