PS3422-0600 Page 11 of 44
Advanced Hardware Architectures, Inc.
3.8 ALGORITHM
AHA3422 ef ficientl y imple ments an algori th m
optimized f or bitonal i mages. For some compar ison
data ref er t o the AHA Applica ti on Note (AN DC13),
Compr ession Performance: StarLiteTM:
ENCODEB2 on Bitonal Images. A software
emulat ion of the algorithm is availa ble for
evaluation.
3.9 DECOMPRESSI ON ENGINE
The decompression engine is enabled with the
DCOMP bit in the Deco mpr ession Contr ol register .
When the engine is enabled , it takes data fro m the
DI FIFO as it become s available. This dat a is either
decompressed by the engine or passed through
unaltered. Pass-through mode is selected with the
DPASS bit. DPASS may only be changed when
DCOMP is set to zero and DEMP is set to one. The
contents of the dictionary are preserved when
DCOMP is changed. However, when DPASS is
changed, the contents are lost. Consequently,
AHA3422 cannot be changed from pass-through
mode to decompr ession mode or vice versa without
losing the contents of the dictionary.
The decompressor can be instructed to halt at the
end of a record or an en d of multip le-record transfer.
If the DPOR bit is set, the decompressor stops taking
data out of the DI FIFO i mmediat ely after t he l ast
byte of a r ecor d, and t he DCOMP bit i s c lear ed. I f
DPOT bit is set the decompress or halts at the end of
the multiple-record transfer . The DEMP bit indicates
the decompres sor has e mptied of all data . Decom-
pression i s r est art ed by setti ng the DCOMP bit. If
DPOR or DPOT is set and data from a se cond record
enters the FIFO immediately after the first record,
bytes from the second r ecord will ha ve en tered the
decompressor pri or t o decoding the EOR. An imp li-
cation of this is that bytes from the second record will
remain in the decompressor and prevent DEMP from
setting after a ll of t he dat a f rom th e fi rst record has
left t he decompresso r . This dif fer s from opera tion of
the compress ion engine. In e it her mode, a DEOR
interru pt is genera ted when t he last byt e of a de com-
pressed r ecor d is rea d out of the chi p, and DEOT
when the last byte of a transfer is read out of the chip.
The decompressor takes data from the
decompression input FIFO at a maximum rate of
16 MBytes/sec. AHA3422 can maintain this data
rate a s long as the deco mpressi on input FIFO is not
empty or the decompression output FIFO is not full.
Caveat: Changing the mode for the
decompressor between records or multiple -record
transfers must be done with the data of the following
record or transfer held off until the DEOR status bit
is true for the current record and the Decompression
Control registers have been reprogrammed. This
reprogramming can occur automatically with
prearming.
3.10 PREARMING
Prearming is the ability to write certain
registers that apply to th e next recor d while the
device is processing the current record. These
regist er s may be prearmed for recor d bounda ri es.
Prearming is automat ic, meaning ther e is no way to
disable it. If a prea rmable register is written whil e
the part is busy processing a record, at the end of the
record the part takes its program fr om the regi ster
value last written. Decompression Control register
has a corresponding prearm register.
The lower 3 bytes of Decompression Length
register are prearmable. If the most significant byte
of this register is written to, the counter is
immediately loaded with the current 4 byte value. if
the most significant byte is not written to the counter,
the counter gets reloaded at the end of the current
record.
3.11 INTERRUPTS
Five conditions are reported in the Interrupt
Stat us/ Control 0 and Status/Con trol 1 registers as
individual bits. All interrupts are maskable by
setti ng the corres ponding bit s in the Int errupt Mas k
register . A one in the Interrupt Mask register means
the corresponding bit in the Interrupt Status/Control
register is masked and does not affect the interrupt
pin (INTRN). The INTRN pin is active whenever
any unmasked interrupt bit is set to a one.
An E nd-of-Record inter r upt is poste d when a
word containing an end-of-record is strobed out of
the decompr ession output FIFO (DEOR). A DEOR
interr upt is also report ed if an end- of-reco rd is read
from the video output port. A decompression end of
transfer interrupt will be posted if this is the last
record of a transfer. End-of-Transfer interrupt
(DEOT) is posted when an EOR occurs that causes
the counter to decrement to zero.
Two FIFO error conditions are also reported.
Overflowing the input FIFO generates a DIOF
interrupt. An overflow can only be cleared by
resetting the FIFO via the Port Control register.
Underflowing the output FIFO (reading when it
is not ready) generates a DOUF. The underflow
interrupt is cleared by writing a one to DOUF . In the
event of an und erflow, the FIFO mu st be reset .