Skip to content

Commit

Permalink
No SDRAM bank gets stalled even in very busy situations
Browse files Browse the repository at this point in the history
  • Loading branch information
jotego committed Jan 19, 2024
1 parent e613a27 commit cb09824
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion modules/jtframe/hdl/sdram/jtframe_sdram64.v
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ jtframe_sdram64_bank #(
) u_bank0(
.rst ( other_rst ),
.clk ( clk ),
.help ( help ),

// requests
.addr ( ba0_addr_l ),
Expand Down Expand Up @@ -401,6 +402,7 @@ jtframe_sdram64_bank #(
) u_bank1(
.rst ( other_rst ),
.clk ( clk ),
.help ( help ),

// requests
.addr ( ba1_addr_l ),
Expand Down Expand Up @@ -447,6 +449,7 @@ jtframe_sdram64_bank #(
) u_bank2(
.rst ( other_rst ),
.clk ( clk ),
.help ( help ),

// requests
.addr ( ba2_addr_l ),
Expand Down Expand Up @@ -493,6 +496,7 @@ jtframe_sdram64_bank #(
) u_bank3(
.rst ( other_rst ),
.clk ( clk ),
.help ( help ),

// requests
.addr ( ba3_addr_l ),
Expand Down Expand Up @@ -532,7 +536,7 @@ jtframe_sdram64_bank #(
always @(*) begin
rfsh_bg = &idle && (noreq | help) && rfsh_br;
prog_bg = pre_br & !rfshing;
if( rfshing | help ) begin
if( rfshing ) begin
bg=0;
end else begin
if( BAPRIO ) begin
Expand Down
7 changes: 4 additions & 3 deletions modules/jtframe/hdl/sdram/jtframe_sdram64_bank.v
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module jtframe_sdram64_bank #(
)(
input rst,
input clk,
input help,

// requests
input [AW-1:0] addr,
Expand Down Expand Up @@ -153,7 +154,7 @@ end
always @(*) begin
rot_st = { st[STW-2:0], st[STW-1] };
next_st = st;
if( st[IDLE] ) begin
if( st[IDLE] & ~help) begin
if(do_prech) next_st = rot_st;
if(do_act ) next_st = ONE<<ACT;
if(do_read ) next_st = ONE<<READ;
Expand Down Expand Up @@ -191,7 +192,7 @@ generate
br <= 0;
end else begin
br <= 0;
if( (st[IDLE] || next_st[IDLE] || next_st[PRE_ACT] || next_st[PRE_RD]) && rd_wr ) begin
if( ( ((st[IDLE] || next_st[IDLE])&&!help) || next_st[PRE_ACT] || next_st[PRE_RD]) && rd_wr ) begin
br <= 1;
if( next_st[PRE_RD] & (all_dbusy | (all_dbusy64&wr)) ) br <= 0; // Do not try to request
end
Expand All @@ -200,7 +201,7 @@ generate
end else begin
always @(*) begin
br = 0;
if( (st[IDLE] || st[PRE_ACT] || st[PRE_RD]) && rd_wr ) begin
if( ( (st[IDLE]&&!help) || st[PRE_ACT] || st[PRE_RD]) && rd_wr ) begin
br = 1;
if( st[PRE_RD] & (all_dbusy | (all_dbusy64&wr)) ) br = 0; // Do not try to request
end
Expand Down

0 comments on commit cb09824

Please sign in to comment.