summaryrefslogtreecommitdiff
path: root/rtl/cache/sram.sv
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2023-10-04 18:06:48 -0600
committerAlejandro Soto <alejandro@34project.org>2023-10-04 18:06:48 -0600
commitcb1c2ce13066d7ef64d92699d005a67858ff06a8 (patch)
treeb5ef55f9756e96ea01d396c89189c54f8f2a1876 /rtl/cache/sram.sv
parent8741aef09939f7775cb66058c59cbc8e321f4372 (diff)
parent84ac4c10f1e3ca4f779a19a1b0a2c43c5e18e37d (diff)
Merge remote-tracking branch 'origin/comentarios' into arqui2
Diffstat (limited to '')
-rw-r--r--rtl/cache/sram.sv8
1 files changed, 7 insertions, 1 deletions
diff --git a/rtl/cache/sram.sv b/rtl/cache/sram.sv
index 986c09b..74f9e65 100644
--- a/rtl/cache/sram.sv
+++ b/rtl/cache/sram.sv
@@ -26,7 +26,12 @@ module cache_sram
line data_file[DEPTH] /*verilator public*/;
addr_tag tag_file[DEPTH] /*verilator public*/;
line_state state_file[DEPTH] /*verilator public*/;
-
+
+ /* 3 funciones principales:
+ * 1. Si se necesita escribir un dato: escribe en los tag y data files en la posición del index de escritura
+ * 2. Si se necesita escribir un estado: escribe en el state file en la posición del index de escritura
+ * 3. Cada ciclo retorna siempre lo que esté en todos los files en la posición de index de lectura
+ */
always_ff @(posedge clk) begin
if (write_data) begin
tag_file[index_wr] <= tag_wr;
@@ -41,6 +46,7 @@ module cache_sram
state_rd <= state_file[index_rd];
end
+ // Se inicializan todas las líneas del state file como INVALID
//FIXME: rst_n para state_file?
initial
for (int i = 0; i < DEPTH; ++i)