aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-06-08 19:58:28 +0200
committerClifford Wolf <clifford@clifford.at>2015-06-08 19:58:28 +0200
commit0257d2cb089e39df53e861e48e6363d9569d2dbd (patch)
tree61bcc52351d1dc864fa29b2b89c1afb484663871
parent072e5ca2c5f826fa263d31b808774e18bc02abd0 (diff)
downloadpicorv32-0257d2cb089e39df53e861e48e6363d9569d2dbd.tar.gz
picorv32-0257d2cb089e39df53e861e48e6363d9569d2dbd.zip
Small improvements in vivado_soc demo
-rw-r--r--scripts/vivado/synth_vivado_soc.v9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/vivado/synth_vivado_soc.v b/scripts/vivado/synth_vivado_soc.v
index 0b92d39..e36b7fb 100644
--- a/scripts/vivado/synth_vivado_soc.v
+++ b/scripts/vivado/synth_vivado_soc.v
@@ -11,7 +11,8 @@ module test_soc (
output [31:0] monitor_addr,
output [31:0] monitor_data
);
- parameter MEM_SIZE = 64*1024/4;
+ // 4096 32bit words = 16kB memory
+ parameter MEM_SIZE = 4096;
wire mem_valid;
wire mem_instr;
@@ -50,16 +51,14 @@ module test_soc (
assign monitor_data = mem_wstrb ? mem_wdata : mem_rdata;
reg [31:0] memory [0:MEM_SIZE-1];
- initial $readmemh("../firmware/firmware.hex", memory);
+ initial $readmemh("firmware.hex", memory);
assign mem_ready = 1;
assign out_byte = mem_wdata[7:0];
always @(posedge clk) begin
out_byte_en <= 0;
- if (mem_la_read)
- mem_rdata <= memory[mem_la_addr >> 2];
- else
+ mem_rdata <= memory[mem_la_addr >> 2];
if (mem_la_write && (mem_la_addr >> 2) < MEM_SIZE) begin
if (mem_la_wstrb[0]) memory[mem_la_addr >> 2][ 7: 0] <= mem_la_wdata[ 7: 0];
if (mem_la_wstrb[1]) memory[mem_la_addr >> 2][15: 8] <= mem_la_wdata[15: 8];