Skip to content

Commit e63a06e

Browse files
committed
Atualizando casca
1 parent 096f1f8 commit e63a06e

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

internal/test.s

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# addi implementation
2+
.text
3+
4+
.global _start;
5+
6+
_start:
7+
addi a1, zero, 5; # a1 = zero + 5
8+
9+
nop;
10+
nop;
11+
nop; # 3 nops to not cause forwarding
12+
13+
sw a1, 60(zero);

rtl/RISC-V.sv

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
`include "processor_ci_defines.vh"
55
`endif
66

7+
`define ENABLE_SECOND_MEMORY 1
8+
79
module processorci_top (
810
input logic sys_clk, // Clock de sistema
911
input logic rst_n, // Reset do sistema
@@ -137,17 +139,25 @@ Controller #(
137139

138140
// Core space
139141
logic write;
142+
logic async_rst;
143+
logic [31:0] sync_instr, sync_data;
144+
145+
always_ff @( posedge clk_core ) begin
146+
async_rst <= ~rst_core;
147+
sync_data <= data_mem_data_in;
148+
sync_instr <= core_data_in;
149+
end
140150

141151
core #(
142152
.reset_vector (0) //Program counter will be set to reset_vector when a reset occurs. By default, it is 0.
143153
) core0(
144154
//Clock and reset signals.
145155
.clk_i (clk_core),
146-
.reset_i (~rst_core), //active-low, asynchronous reset
156+
.reset_i (async_rst), //active-low, asynchronous reset
147157

148158
//Data memory interface
149159
.data_addr_o (data_mem_addr),
150-
.data_i (data_mem_data_in),
160+
.data_i (sync_data),
151161
.data_o (data_mem_data_out),
152162
.data_wmask_o (data_mem_wstrb),
153163
.data_wen_o (write), //active-low
@@ -156,7 +166,7 @@ core #(
156166

157167
//Instruction memory interface
158168
.instr_addr_o (core_addr),
159-
.instr_i (core_data_in),
169+
.instr_i (sync_instr),
160170
.instr_access_fault_i (0),
161171

162172
//Interrupts

0 commit comments

Comments
 (0)