Skip to content

Commit a585e0d

Browse files
committed
Speed up with 1 cycle
ram_ready is always true when using look ahead interface Signed-off-by: Tom Vijlbrief <[email protected]>
1 parent c1b65b5 commit a585e0d

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

examples/soc_ecp5_evn/attosoc.v

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ module attosoc (
4646
reg [31:0] ram [0:MEM_WORDS-1];
4747
initial $readmemh("firmware.hex", ram);
4848
reg [31:0] ram_rdata;
49-
reg ram_ready;
5049

5150
reg [31:0] irq = 32'h 0000_0000;
5251
wire [31:0] eoi;
@@ -69,15 +68,11 @@ module attosoc (
6968

7069
always @(posedge clk)
7170
begin
72-
ram_ready <= 1'b0;
7371
if (mem_addr[31:24] == 8'h00 && mem_valid) begin
7472
if (mem_wstrb[0]) ram[mem_addr[23:2]][7:0] <= mem_wdata[7:0];
7573
if (mem_wstrb[1]) ram[mem_addr[23:2]][15:8] <= mem_wdata[15:8];
7674
if (mem_wstrb[2]) ram[mem_addr[23:2]][23:16] <= mem_wdata[23:16];
7775
if (mem_wstrb[3]) ram[mem_addr[23:2]][31:24] <= mem_wdata[31:24];
78-
79-
// ram_rdata <= ram[mem_addr[23:2]];
80-
ram_ready <= 1'b1;
8176
end
8277
end
8378

@@ -110,8 +105,8 @@ module attosoc (
110105

111106

112107
assign mem_ready = (iomem_valid && iomem_ready) ||
113-
simpleuart_reg_div_sel || (simpleuart_reg_dat_sel && !simpleuart_reg_dat_wait) ||
114-
ram_ready;
108+
simpleuart_reg_div_sel || (simpleuart_reg_dat_sel && !simpleuart_reg_dat_wait)
109+
|| (!simpleuart_reg_dat_sel);
115110

116111
assign mem_rdata = simpleuart_reg_div_sel ? simpleuart_reg_div_do :
117112
simpleuart_reg_dat_sel ? simpleuart_reg_dat_do :
@@ -120,7 +115,7 @@ module attosoc (
120115
.STACKADDR(STACKADDR),
121116
.PROGADDR_RESET(PROGADDR_RESET),
122117
.PROGADDR_IRQ(32'h 0000_0010),
123-
.BARREL_SHIFTER(0),
118+
.BARREL_SHIFTER(1),
124119
.COMPRESSED_ISA(1),
125120
.ENABLE_MUL(1),
126121
.ENABLE_DIV(1),

0 commit comments

Comments
 (0)