Skip to content

Commit 05e3552

Browse files
committed
Alterando logica de enderecos
Alterando logica de enderecamento para acessar segunda memoria
1 parent 75c7f39 commit 05e3552

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

fpga/digilent_arty/run.tcl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
read_verilog "main.v"
2-
#read_verilog ../../modules/uart.v
3-
#read_verilog ../../modules/UART/rtl/uart_rx.v
4-
#read_verilog ../../modules/UART/rtl/uart_tx.v
5-
read_verilog ../../modules/spi.v;
6-
read_verilog ../../modules/SPI-Slave/rtl/spi_slave.v;
2+
read_verilog ../../modules/uart.v
3+
read_verilog ../../modules/UART/rtl/uart_rx.v
4+
read_verilog ../../modules/UART/rtl/uart_tx.v
5+
#read_verilog ../../modules/spi.v;
6+
#read_verilog ../../modules/SPI-Slave/rtl/spi_slave.v;
77
read_verilog ../../src/fifo.v
88
read_verilog ../../src/reset.v
99
read_verilog ../../src/clk_divider.v
@@ -48,5 +48,6 @@ report_power -file digilent_arty_a7_power.rpt
4848

4949
# write bitstream
5050
write_bitstream -force "./build/out.bit"
51-
51+
#210203A7C2EE fpga 1
52+
#210203A7C654 fpga 2exit
5253
exit

fpga/xilinx_vc709/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
VIVADO_PATH = ${VIVADO_PATH}
1+
ifndef VIVADO_PATH
2+
VIVADO_PATH=vivado
3+
endif
24

35
all: ./build/out.bit
46

modules/spi.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module SPI #(
1414
input wire miso,
1515

1616
// SPI callback signals
17-
input wire rw,
17+
input wire rw,
1818
output wire intr,
1919

2020
// FIFOs signals
@@ -51,7 +51,7 @@ wire rst, busy, data_out_valid, busy_posedge;
5151

5252
assign busy_posedge = (busy_sync[2:1] == 2'b01) ? 1'b1 : 1'b0;
5353

54-
reg [1:0] read_state_machine, write_state_machine;
54+
reg [2:0] read_state_machine, write_state_machine;
5555

5656
localparam IDLE = 3'b000;
5757
localparam READ = 3'b001;

src/controller.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,13 @@ UART #(
196196
) Uart(
197197
.clk (clk),
198198
.reset(reset),
199-
200-
.uart_rx_empty(communication_rx_empty),
201-
.uart_tx_empty(communication_tx_empty),
202199

203200
.rx(rx),
204201
.tx(tx),
205202

203+
.uart_rx_empty(communication_rx_empty),
204+
.uart_tx_empty(communication_tx_empty),
205+
206206
.read (communication_read),
207207
.write(communication_write),
208208
.read_response (communication_read_response),

src/interpreter.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ always @(posedge clk) begin
232232

233233
WRITE_IN_MEMORY: begin
234234
memory_mux_selector <= 1'b0;
235-
address <= {6'h0, communication_buffer[31:8], 2'b0};
235+
address <= {communication_buffer[31], 6'h0, communication_buffer[30:8], 2'b0};
236236

237237
if(communication_rx_empty == 1'b0) begin
238238
state <= READ_SECOND_PAGE_FROM_SERIAL;
@@ -261,7 +261,7 @@ always @(posedge clk) begin
261261

262262
READ_FROM_MEMORY: begin
263263
memory_mux_selector <= 1'b0;
264-
address <= {6'h0, communication_buffer[31:8], 2'b0};
264+
address <= {communication_buffer[31], 6'h0, communication_buffer[30:8], 2'b0};
265265
memory_read <= 1'b1;
266266
state <= MEMORY_READ;
267267
end
@@ -283,7 +283,7 @@ always @(posedge clk) begin
283283

284284
WRITE_ACUMULATOR_IN_POS_N: begin
285285
memory_mux_selector <= 1'b0;
286-
address <= {6'h0, communication_buffer[31:8], 2'b0}; // ver alinhamento depois
286+
address <= {communication_buffer[31], 6'h0, communication_buffer[30:8], 2'b0}; // ver alinhamento depois
287287
write_data <= accumulator[31:0];
288288
memory_write <= 1'b1;
289289
state <= IDLE;

0 commit comments

Comments
 (0)