[Elphel-support] How to do averaging on the FPGA?

Jens Bürger jbuerger at arcor.de
Thu Nov 18 01:59:11 PST 2010


> Dear Jens,
> 
> Our goal is to do an image averaging of ~5 frames on the FPGA.
>>
> It would be easier to start with averaging of 2^x frames.

Yes, then we'll try 2²->4 frames.

> We thought about implementing the averaging at the point in sensorpix.v
>> where the FPN-correction-data is processed.
>> We would replace the FPN-correction with the averaging. What would be
>> the
>> simplest way accessing the SDRAM of the FPGA to buffer and access the
>> frames?
>>
> In the x3x3 project there is an "mcontr" module. It has channels for
> writing/reading to/from SDRAM. You need to add new channels.
> 
>  What would be the most convenient way to realize this?
>>
> The most convenient way is to use the 10359 board - it's a mux board for 3
> sensors, but:
> 1. it has the same fpga and the same SDRAM.
> 2. there's a little chance to break something in the 10353's fpga code
> 3. the memory controller is simplier in 10359

Okay, we ordered the 10359-board for our camera and can do the averaging on the 10359.

> The 10359-10353 interface is the same as with the sensor -
> Vact,Hact,PXD[11:0].
> 
> It would be nice if you describe your algorithm in terms of memory
> transactions, data flow and timing.
> 1. fps/5 frame rate?
I spoke to the software-people of our project-team, the opinion is "as fast as it's conveniently achievable".

> 2. store intermediate sum, read it line by line and sum up with the
> incoming
> frame lines, store back the results, output the result with the last
> incoming frame?

Yes, sounds like what we thought about.

> If you have any further questions, feel free to ask.

So we do so :)

How can we simulate our code?

I tried simulating 10359 from the 8.0.9.1-source.
First I tried ISE 12.1.

ISim consumes ALL MEMORY of the system an then stops (see attached ISim.log).

So we try simulating with Icarus Verilog an the x359_sim.sh. The window of GTKWave contains signals but no data. 
The last few lines of the Icarus Verilog output and the first lines of GTKWave are:
...
At time 14162577.000 ns AREF : Auto Refresh
At time 14211477.000 ns AREF : Auto Refresh
At time 14260377.000 ns AREF : Auto Refresh
 ... 921.878 seconds, 549656.0/547312.0/1844.0 KBytes size/rss/shared
Event counts:
    14006068 time steps (pool=256)
    249912289 thread schedule events
    634848094 assign events
             ...assign(vec4) pool=311296
             ...assign(vec8) pool=341
             ...assign(real) pool=409
             ...assign(word) pool=256
    60887049 other events (pool=8192)

GTKWave Analyzer v3.3.2 (w)1999-2010 BSI

LXTLOAD | 7984 facilities
LXTLOAD | Read 386 block headers OK
LXTLOAD | [0] start time
LXTLOAD | [14288500000] end time
LXTLOAD | 
LXTLOAD | Finished building 7984 facs.
LXTLOAD | Merging in 1373 aliases.
LXTLOAD | Building facility hierarchy tree.
LXTLOAD | Sorting facility hierarchy tree.
** WARNING: Error opening .sav file 'x359.sav', skipping.

The x359.sav-file doesn't exist indeed. What's wrong here?

I'm not really into how the simulating works; when we start implementing the averaging, what would be a good way to generate testdata and verify the correct processing of them?

Thank you in advance,

Jens




More information about the Support-list mailing list