Tcl command "rockfifo"


The tcl command "rockfifo" is a specialized tcl command. It is the interface to the level two of the ROCK library.

If used, nobody else should read out the related FIFOs!


Index


FIFO id

The access to the FIFOs is implemented via channels. Each channel have its own FIFO id. In this way one application can access many different FIFOs simply using different ids.

All the routines present in rockfifo have a parameter of this type.


The cache

Because the FIFO is constantly updated, a cache must be used to avoid data loss.

Five types of cache are implemented:

off
This is the more conservative type of cache. Only the strict minimum is cache.
Useful for short runs.
minimal
This is the default cache type. It is like the off cache type, if the FIFO is less than half full. Else, it reads half FIFO in block transfer.
Allows fast transfers while maintaining low the cache size.
advanced
This type of cache is the more liberal possible. It will read the FIFO while the cache get full or the FIFO empty.
Useful for long runs.
block
Same as minimal, but always forse a block transfer.
block_advanced
Same as advanced, plus always try to read the entiry FIFO in block transfer.


Initialization

As stated before, the access to a FIFO is implemented via a FIFO id. To obtain such an id you have to open a channel to the FIFO using
rockfifo open. This id will than be used for all the accesses to the FIFO.
Each id must identify a different FIFO.

When you finish using the FIFO, please call rockfifo close to close the channel associated to the id.


Is the FIFO empty

Because of the cache, the hardware FIFO empty is not the same as the software FIFO empty. Use
rockfifo isempty to query the FIFO empty.


Decode the FIFO

Use
rockfifo decode to decode the FIFO.

If the status is not empty, call the rockfifo synch to syncronize the FIFO to the next frame.


Read raw data from the FIFO

While is the decoding the most usual operation during the run, during the test raw read can be even more important.

Use rockfifo read for this task.

Do not use the "rock" command!


An example

#open the ROCK
set rid [rock open 0x50100000]
#open a FIFO
set fid [rockfifo open efifo $rid]
...
# decode the FIFO
set decode [rockfifo decode $fid 8192]

set alist [lindex $decode 1]

foreach {el} $alist {
 ...
}
#if there was an error, synch
if {[lindex $decode 0]==""} {
 set adump [rockfifo synch $fid]
 ...
}
...
# read the FIFO
set alist [rockfifo read $fid 8192]

foreach {el} $alist {
 ...
}
...
#close the FIFO
set acache [rockfifo close $fid]
...
#close the rock
rock close $rid


Top of the page. Rock documention.
Send comments to: Igor Sfiligoi

Created:11.3.1997
Last modified:11.3.1997