As the title suggests, ISE is having trouble inferring block RAM from my code.
wire we;
reg hold = 0;
reg start = 0;
reg [12:0] addr = 0;
reg [23:0] command = 0;
reg [7:0] RAM [8191 : 0];
reg [7:0] rx_data_buffer = 0;
assign we = new_rx_data && !hold && start;
always@(posedge clk) begin
new_tx_data <= 1'b0;
if(!tx_busy && hold && !new_tx_data) begin
new_tx_data <= 1'b1;
addr <= addr + 1'b1;
tx_data_buffer <= RAM[addr];
if(addr == 13'd8191)
hold <= 0;
end
else if(new_rx_data && !hold) begin
addr <= addr + 1'b1;
command <= {command[15:0], rx_data};
if(addr == 13'd8191)
hold <= 1;
if(start)
led <= rx_data;
end
if(we)
RAM[addr] <= rx_data;
if(command == 24'h242424) //$$$ in ASCII
start <= 1;
end
I have deduced that the root of the problem is the write enable signal for my RAM. If I set it to VCC by writing
if(1'b1)
RAM[addr] <= rx_data;
ISE infers RAM without an issue. However, this is not my intended behavior. I want the write enable signal to be
assign we = new_rx_data && !hold && start;
No matter what register I assign to "we" ISE tells me it'll be inferring distributed RAM. Has anyone dealt with this issue before?