aboutsummaryrefslogtreecommitdiff
path: root/design
diff options
context:
space:
mode:
Diffstat (limited to 'design')
-rw-r--r--design/embedded_bram_slave.v10
1 files changed, 6 insertions, 4 deletions
diff --git a/design/embedded_bram_slave.v b/design/embedded_bram_slave.v
index 17738af..3829316 100644
--- a/design/embedded_bram_slave.v
+++ b/design/embedded_bram_slave.v
@@ -30,6 +30,11 @@ module embedded_bram_slave
if (WORDS_TO_INITIALIZE) begin
initial
$readmemb(INITIAL_CONTENTS_FILE, memory, 0, WORDS_TO_INITIALIZE - 1);
+ end else begin
+ always @ (posedge CLK_I) begin
+ if (!RST_I && STB_I && WE_I)
+ memory[ADR_I] <= DAT_I;
+ end
end
endgenerate
@@ -47,9 +52,6 @@ module embedded_bram_slave
ack <= STB_I;
output_data <= memory[ADR_I];
-
- if (STB_I && WE_I)
- memory[ADR_I] <= DAT_I;
end
- end // always @ (posedge CLK_I)
+ end
endmodule // embedded_bram_slave