Skip to content

Commit a3f7a71

Browse files
committed
common: Make sure RAM inference works with yosys
icecube doesn't care about init values, but yosys does and you can't satisfy them with HW RAM module. So here we remove all the init values and we make sure the reads are not dependent on the reset line Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
1 parent 09f1703 commit a3f7a71

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

common/usb_fs_in_pe.v

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module usb_fs_in_pe #(
5151
// Data payload to send if any
5252
output tx_data_avail,
5353
input tx_data_get,
54-
output reg [7:0] tx_data = 0
54+
output reg [7:0] tx_data
5555
);
5656

5757
////////////////////////////////////////////////////////////////////////////////
@@ -344,6 +344,9 @@ module usb_fs_in_pe #(
344344
endcase
345345
end
346346

347+
always @(posedge clk)
348+
tx_data <= in_data_buffer[buffer_get_addr];
349+
347350
integer j;
348351
always @(posedge clk) begin
349352
if (reset) begin
@@ -352,8 +355,6 @@ module usb_fs_in_pe #(
352355
end else begin
353356
in_xfr_state <= in_xfr_state_next;
354357

355-
tx_data <= in_data_buffer[buffer_get_addr];
356-
357358
if (setup_token_received) begin
358359
data_toggle[rx_endp] <= 1;
359360
end

common/usb_fs_out_pe.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module usb_fs_out_pe #(
1414
output [NUM_OUT_EPS-1:0] out_ep_data_avail,
1515
output reg [NUM_OUT_EPS-1:0] out_ep_setup = 0,
1616
input [NUM_OUT_EPS-1:0] out_ep_data_get,
17-
output reg [7:0] out_ep_data = 0,
17+
output reg [7:0] out_ep_data,
1818
input [NUM_OUT_EPS-1:0] out_ep_stall,
1919
output reg [NUM_OUT_EPS-1:0] out_ep_acked = 0,
2020

0 commit comments

Comments
 (0)