M
Marwan
Guest
Peace,
I am having a nightmare trying to find an answer to this question, but
its something easy if one knows...
I want to stream 'real-time' data from an external source into
memory...
But I am unsure as to how to do this...
The data will be coming in (alternatives being investigated, so answer
generally please) and the data will be in 12 bit samples.
A method of doing this will be having n bitstreams (as opposed to
buses) coming into a memory, so I will need to 'catch' the data on
each channel in a continuous manner.
So imagine.
Data rate = 2048samples/second => 12x2048bits/second
so do I have to sample the input ports of my module at 12x2048 and
catch every bit as it comes and shift it in/along? If so how?
Or can I just sample at 2048samples/second and do the following: -
{stripped down code}
set n to 32...
module ip_mem(port_in, clk, mem_out);
....
input wire port_in[0:31]; // 32 i/p ports
....
reg [11:0] mem1 [0:1023]; // input memory
reg clk; // 2048hz
always@(posedge clk)
begin
integer i;
for(i=0; i <= 31; i = i+1)
begin
mem[i*32 :i*32 + 31 ] = port_in; /* assigning port_in to 32 of
mem1's 12 bit registers. should I use mem[i*32 +: 32] instead?*/
end
end
endmodule
Any help would be great!
Peace,
Marwan
I am having a nightmare trying to find an answer to this question, but
its something easy if one knows...
I want to stream 'real-time' data from an external source into
memory...
But I am unsure as to how to do this...
The data will be coming in (alternatives being investigated, so answer
generally please) and the data will be in 12 bit samples.
A method of doing this will be having n bitstreams (as opposed to
buses) coming into a memory, so I will need to 'catch' the data on
each channel in a continuous manner.
So imagine.
Data rate = 2048samples/second => 12x2048bits/second
so do I have to sample the input ports of my module at 12x2048 and
catch every bit as it comes and shift it in/along? If so how?
Or can I just sample at 2048samples/second and do the following: -
{stripped down code}
set n to 32...
module ip_mem(port_in, clk, mem_out);
....
input wire port_in[0:31]; // 32 i/p ports
....
reg [11:0] mem1 [0:1023]; // input memory
reg clk; // 2048hz
always@(posedge clk)
begin
integer i;
for(i=0; i <= 31; i = i+1)
begin
mem[i*32 :i*32 + 31 ] = port_in; /* assigning port_in to 32 of
mem1's 12 bit registers. should I use mem[i*32 +: 32] instead?*/
end
end
endmodule
Any help would be great!
Peace,
Marwan