Skip to content

Commit 6d66d46

Browse files
committed
Atualizando cascas
1 parent 802dbc2 commit 6d66d46

29 files changed

+601
-218
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,5 @@ rename.py
179179
march.py
180180
experiment/
181181
repositories.txt
182+
work-obj93.cf
183+
rvx.txt

config/cv32e40p.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"folder": "cv32e40p",
44
"sim_files": [],
55
"files": [
6+
"rtl/include/cv32e40p_apu_core_pkg.sv",
7+
"rtl/include/cv32e40p_fpu_pkg.sv",
8+
"rtl/include/cv32e40p_pkg.sv",
69
"rtl/cv32e40p_aligner.sv",
710
"rtl/cv32e40p_alu.sv",
811
"rtl/cv32e40p_alu_div.sv",
@@ -15,7 +18,6 @@
1518
"rtl/cv32e40p_ex_stage.sv",
1619
"rtl/cv32e40p_ff_one.sv",
1720
"rtl/cv32e40p_fifo.sv",
18-
"rtl/cv32e40p_fp_wrapper.sv",
1921
"rtl/cv32e40p_hwloop_regs.sv",
2022
"rtl/cv32e40p_id_stage.sv",
2123
"rtl/cv32e40p_if_stage.sv",
@@ -27,15 +29,14 @@
2729
"rtl/cv32e40p_prefetch_buffer.sv",
2830
"rtl/cv32e40p_prefetch_controller.sv",
2931
"rtl/cv32e40p_register_file_ff.sv",
30-
"rtl/cv32e40p_register_file_latch.sv",
3132
"rtl/cv32e40p_sleep_unit.sv",
3233
"rtl/cv32e40p_top.sv"
3334
],
3435
"include_dirs": [
3536
"rtl/include/"
3637
],
3738
"repository": "https://github.com/openhwgroup/cv32e40p",
38-
"top_module": "",
39+
"top_module": "cv32e40p_core",
3940
"extra_flags": [],
4041
"language_version": "2012",
4142
"march": "rv32i",

config/cv32e41p.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
"example_tb/core/include/perturbation_pkg.sv"
1515
],
1616
"files": [
17-
"bhv/cv32e41p_apu_tracer.sv",
18-
"bhv/cv32e41p_core_log.sv",
19-
"bhv/cv32e41p_sim_clock_gate.sv",
20-
"bhv/cv32e41p_tracer.sv",
21-
"bhv/cv32e41p_wrapper.sv",
22-
"bhv/include/cv32e41p_tracer_pkg.sv",
17+
18+
"rtl/include/cv32e41p_apu_core_pkg.sv",
19+
"rtl/include/cv32e41p_fpu_pkg.sv",
20+
"rtl/include/cv32e41p_pkg.sv",
2321
"rtl/cv32e41p_aligner.sv",
2422
"rtl/cv32e41p_alu.sv",
2523
"rtl/cv32e41p_alu_div.sv",
@@ -43,11 +41,7 @@
4341
"rtl/cv32e41p_prefetch_controller.sv",
4442
"rtl/cv32e41p_register_file_ff.sv",
4543
"rtl/cv32e41p_register_file_latch.sv",
46-
"rtl/cv32e41p_sleep_unit.sv",
47-
"rtl/include/cv32e41p_apu_core_pkg.sv",
48-
"rtl/include/cv32e41p_fpu_pkg.sv",
49-
"rtl/include/cv32e41p_pkg.sv",
50-
"sva/cv32e41p_prefetch_controller_sva.sv"
44+
"rtl/cv32e41p_sleep_unit.sv"
5145
],
5246
"include_dirs": [],
5347
"repository": "https://github.com/openhwgroup/cv32e41p",

config/kronos.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"folder": "kronos",
44
"sim_files": [],
55
"files": [
6+
"rtl/core/kronos_types.sv",
67
"rtl/core/kronos_EX.sv",
78
"rtl/core/kronos_ID.sv",
89
"rtl/core/kronos_IF.sv",
@@ -14,8 +15,7 @@
1415
"rtl/core/kronos_counter64.sv",
1516
"rtl/core/kronos_csr.sv",
1617
"rtl/core/kronos_hcu.sv",
17-
"rtl/core/kronos_lsu.sv",
18-
"rtl/core/kronos_types.sv"
18+
"rtl/core/kronos_lsu.sv"
1919
],
2020
"include_dirs": [],
2121
"repository": "https://github.com/SonalPinto/kronos",

config/leaf.json

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030
"uart/tbs/uart_tb.vhdl"
3131
],
3232
"files": [
33+
"cpu/rtl/core_pkg.vhdl",
3334
"cpu/rtl/alu.vhdl",
3435
"cpu/rtl/alu_ctrl.vhdl",
3536
"cpu/rtl/br_detector.vhdl",
36-
"cpu/rtl/core.vhdl",
37-
"cpu/rtl/core_pkg.vhdl",
3837
"cpu/rtl/csrs.vhdl",
3938
"cpu/rtl/ex_block.vhdl",
4039
"cpu/rtl/id_block.vhdl",
@@ -47,25 +46,11 @@
4746
"cpu/rtl/main_ctrl.vhdl",
4847
"cpu/rtl/reg_file.vhdl",
4948
"cpu/rtl/wb_ctrl.vhdl",
50-
"soc/rtl/debug_reg.vhdl",
51-
"soc/rtl/leaf_soc.vhdl",
52-
"soc/rtl/leaf_soc_pkg.vhdl",
53-
"soc/rtl/ram.vhdl",
54-
"soc/rtl/rom.vhdl",
55-
"soc/rtl/soc_syscon.vhdl",
56-
"uart/rtl/down_counter.vhdl",
57-
"uart/rtl/fifo.vhdl",
58-
"uart/rtl/piso.vhdl",
59-
"uart/rtl/sipo.vhdl",
60-
"uart/rtl/uart.vhdl",
61-
"uart/rtl/uart_pkg.vhdl",
62-
"uart/rtl/uart_rx.vhdl",
63-
"uart/rtl/uart_tx.vhdl",
64-
"uart/rtl/uart_wbsl.vhdl"
49+
"cpu/rtl/core.vhdl"
6550
],
6651
"include_dirs": [],
6752
"repository": "https://github.com/daniel-santos-7/leaf",
68-
"top_module": "",
53+
"top_module": "core",
6954
"extra_flags": [],
7055
"language_version": "08",
7156
"march": "rv32i",

config/microrv32.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"extra_flags": [],
1212
"language_version": "2005",
1313
"march": "rv32i",
14-
"two_memory": false
14+
"two_memory": false,
15+
"pre_script": "cd microrv32 && sbt run"
1516
}

config/riscado-v.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"riscv.v",
1111
"load_store.v"
1212
],
13-
"include_dirs": [],
13+
"include_dirs": [
14+
"./"
15+
],
1416
"repository": "https://github.com/zxmarcos/riscado-v",
1517
"top_module": "RISCV",
1618
"extra_flags": [],

core/fpga.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def make_build_file(config: dict, board: str, toolchain_path: str) -> str:
227227
for i in config['files']:
228228
is_sv_file = i.endswith('.sv')
229229
prefix = get_prefix(
230-
board, vhdl=i.endswith('.vhd'), sverilog=is_sv_file
230+
board, vhdl=i.endswith('.vhd') or i.endswith('.vhdl'), sverilog=is_sv_file
231231
)
232232
exist_sv_file = exist_sv_file or is_sv_file
233233
if is_sv_file and board in YOSYS_BOARDS:

internal/memory.hex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
00500593
2+
00000013
3+
00000013
4+
00000013
5+
02b02e23

internal/memory.sv

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module Memory #(
2+
parameter MEMORY_FILE = "",
3+
parameter MEMORY_SIZE = 4096
4+
)(
5+
input logic clk,
6+
7+
input logic cyc_i, // Indica uma transação ativa
8+
input logic stb_i, // Indica uma solicitação ativa
9+
input logic we_i, // 1 = Write, 0 = Read
10+
11+
input logic [31:0] addr_i, // Endereço
12+
input logic [31:0] data_i, // Dados de entrada (para escrita)
13+
output logic [31:0] data_o, // Dados de saída (para leitura)
14+
15+
output logic ack_o // Confirmação da transação (agora assíncrona)
16+
);
17+
18+
localparam BIT_INDEX = $clog2(MEMORY_SIZE) - 1'b1;
19+
logic [31:0] memory [(MEMORY_SIZE/4)-1:0];
20+
21+
// Inicialização da memória com arquivo, se fornecido
22+
initial begin
23+
if (MEMORY_FILE != "") begin
24+
$readmemh(MEMORY_FILE, memory);
25+
end
26+
end
27+
28+
// Leitura assíncrona
29+
assign data_o = (cyc_i && stb_i && !we_i) ? memory[addr_i[BIT_INDEX:2]] : 32'd0;
30+
31+
// Resposta assíncrona de ACK (igual ao antigo `response`)
32+
assign ack_o = cyc_i && stb_i;
33+
34+
// Escrita síncrona
35+
always_ff @(posedge clk) begin
36+
if (cyc_i && stb_i && we_i) begin
37+
memory[addr_i[BIT_INDEX:2]] <= data_i;
38+
end
39+
end
40+
41+
endmodule

0 commit comments

Comments
 (0)