hallovipin
Member level 1
Friends,
I have built one 12 bit 8K RAM inside FPGA (spartan 3A). This FPGA has 20K block ram INSIDE. BUT WHAT i FIND IS IN-SPITE OF USING ONLY 8 k MY WHOLE 20 k BLOCK RAM has got exhausted.
have a look on my coding style.
always @(posedge clk_adc) begin /////////////////// Write Buffer //////////////////////
if(write_enable)
if(address_w== 13'b1111111111111)
begin
address_w<=13'b0000000000000;
end
else begin
int_ram[address_w]<=adc_data_in;
address_w<=address_w+ 13'b0000000000001;
end
end
always @(posedge clk) begin
if(!write_enable) begin
address_curr<=address_r;
if(address_r==13'b1111111111111)begin
address_r<=13'0000000000000;
address_next<=13'b0000000000000;
end
else begin
temp_sum<=temp_sum+neg_check;
address_r<=address_r+13'b0000000000001;
address_next<=address_r+13'b0000000000001;
end
assign neg_check=(int_ram[address_next]>int_ram[address_r])?(int_ram[address_next]-int_ram[address_r]):12'd0;
for this code ISE is using 18K RAM. IS it due to the fact that I am reading wto data point sin a single clock (int_ram[address_next]-int_ram[address_r]) or is there anything else.
if it is so then how can I solve this isse. But I need to have two data points to make calcultaions.
thanx
I have built one 12 bit 8K RAM inside FPGA (spartan 3A). This FPGA has 20K block ram INSIDE. BUT WHAT i FIND IS IN-SPITE OF USING ONLY 8 k MY WHOLE 20 k BLOCK RAM has got exhausted.
have a look on my coding style.
always @(posedge clk_adc) begin /////////////////// Write Buffer //////////////////////
if(write_enable)
if(address_w== 13'b1111111111111)
begin
address_w<=13'b0000000000000;
end
else begin
int_ram[address_w]<=adc_data_in;
address_w<=address_w+ 13'b0000000000001;
end
end
always @(posedge clk) begin
if(!write_enable) begin
address_curr<=address_r;
if(address_r==13'b1111111111111)begin
address_r<=13'0000000000000;
address_next<=13'b0000000000000;
end
else begin
temp_sum<=temp_sum+neg_check;
address_r<=address_r+13'b0000000000001;
address_next<=address_r+13'b0000000000001;
end
assign neg_check=(int_ram[address_next]>int_ram[address_r])?(int_ram[address_next]-int_ram[address_r]):12'd0;
for this code ISE is using 18K RAM. IS it due to the fact that I am reading wto data point sin a single clock (int_ram[address_next]-int_ram[address_r]) or is there anything else.
if it is so then how can I solve this isse. But I need to have two data points to make calcultaions.
thanx