verite.bi

Contains the register definitions for the Rendition Verite video cards (V1000 and V2x00)

Author

Marcel Sondaar

License Public Domain

Summary
verite.biContains the register definitions for the Rendition Verite video cards (V1000 and V2x00)
VREGSRegisters common to all Verite-based boards
Constants
VERITE_MEMENDIANThis register controls the byteswapping performed when writing to the linear framebuffer.
VERITE_GPUCTLThis register controls the state of the RISC processor It holds several bitflags:
VERITE_GPUSTATThis register contains the current status of the device Only present on V2x00
VERITE_GPUINDEXindex register to the GPU external registers
VERITE_GPUDATAThis register contains the value of the GPU register selected by VERITE_GPUINDEX.
VERITE_MODEThis register allows one to select between CRTC modes.
VERITE_CRTCCTLCRTC Control register.
VERITE_CRTCHHorizontal timing register
VERITE_CRTCVVertical timing register
VERITE_FRAMESTARTFrame offset
VERITE_WIDTHVirtual width?
VERITE_DAC_PIXELMASKRAMDAC configuration
VERITE_DAC_CR0RAMDAC configuration
VERITE_DAC_CR1RAMDAC configuration
VERITE_DAC_CR2RAMDAC configuration
VERITE_DOTCLOCKAccess to the V2x00 dot clock PLL
VINSNSList of verite GPU opcodes Each instruction is exactly 32-bits, of the form ooxxxxxx, where oo is the opcode and xx are the arguments Most opcodes follow a triadic instruction: ooddxxyy, where dd is destination register, xx and yy are source registers Jumps are pipelined and therefore have a delay of a cycle.
Constants
VINSN_ADDIAdd a register and a byte immediate
VINSN_SUBISubtract a byte immediate from a register
VINSN_ANDNIComputes the binary and-not of a register and a byte immediate
VINSN_RSUBISubtract a register from a byte immediate
VINSN_ANDIComputes the inclusive or of a register and a byte immediate
VINSN_ORIComputes the inclusive or of a register and a byte immediate
VINSN_NORIComputes the binary nor of a register and a byte immediate
VINSN_XORIComputes the exclusive or of a register and a byte immediate
VINSN_ADDadd two registers and put the result in the target register
VINSN_SUBsubtract the second source from the first source register and put the result in the target register
VINSN_ANDNcompute the and-not of two registers and put the result in the target register
VINSN_RSUBsubtract the first source register from the second source register and put the result in the target register
VINSN_ANDcompute the binary and of two registers and put the result in the target register
VINSN_ORcompute the binary inclusive or of two registers and put the result in the target register
VINSN_NORcompute the binary nor two registers and put the result in the target register
VINSN_XORcompute the binary exclusive or of two registers and put the result in the target register
VINSN_RFIFOPops a slot from the FIFO, stall if the fifo is empty.
fixme-VINSN_PLD16Iload the high 16 bits of a register with an immediate value
VINSN_RORIrotate register right by a constant number of positions.
VINSN_SHLIshift register right by a constant number of positions, sign extending in the process.
VINSN_SARIshift register right by a constant number of positions, sign extending in the process.
VINSN_SHRIshift register right by a constant number of positions, adding zeros on the far end
fixme-VINSN_PLD8Iload the high 24 bits of a register with an immediate value
VINSN_JZJump conditional if register is zero
VINSN_JNZJump conditional if register is non-zero
VINSN_JSJump conditional if register is negative
VINSN_JNSJump conditional if register is not negative
VINSN_JAJump conditional if register is above zero
VINSN_JNAJump conditional if register is not above zero
VINSN_JMPJump to an absolute address
VINSN_JMPRJump to address specified in register
VINSN_LDB.  The result is not available until after the next cycle.Load a byte from RAM
VINSN_LDHLoad a 16-bit halfword from RAM.
VINSN_LDWLoad a 32-bit word from RAM.
VINSN_LDILoad an 16-bit immediate into the selected register
VINSN_LDHILoad a shifted 16-bit immediate into the selected register.

VREGS

Registers common to all Verite-based boards

Summary
Constants
VERITE_MEMENDIANThis register controls the byteswapping performed when writing to the linear framebuffer.
VERITE_GPUCTLThis register controls the state of the RISC processor It holds several bitflags:
VERITE_GPUSTATThis register contains the current status of the device Only present on V2x00
VERITE_GPUINDEXindex register to the GPU external registers
VERITE_GPUDATAThis register contains the value of the GPU register selected by VERITE_GPUINDEX.
VERITE_MODEThis register allows one to select between CRTC modes.
VERITE_CRTCCTLCRTC Control register.
VERITE_CRTCHHorizontal timing register
VERITE_CRTCVVertical timing register
VERITE_FRAMESTARTFrame offset
VERITE_WIDTHVirtual width?
VERITE_DAC_PIXELMASKRAMDAC configuration
VERITE_DAC_CR0RAMDAC configuration
VERITE_DAC_CR1RAMDAC configuration
VERITE_DAC_CR2RAMDAC configuration
VERITE_DOTCLOCKAccess to the V2x00 dot clock PLL

Constants

VERITE_MEMENDIAN

This register controls the byteswapping performed when writing to the linear framebuffer.

Size

8 bits

valid register values

0no byteswapping
132-bit byteswapping
216-bit byteswapping
3swap halfwords

VERITE_GPUCTL

This register controls the state of the RISC processor It holds several bitflags:

Size

unknown

Bitflags

01hreset chip
02hhold risc.  Setting this bit will stop the main GPU from executing more instructions
04hsingle step.  Setting this bit will cause a single step in the pipeline to be executed.  The bit will be cleared by the GPU when the instruction is executed.
08hdivide by 2 disable
10hVGA reset
20hassert XReset output to ext devices

VERITE_GPUSTAT

This register contains the current status of the device Only present on V2x00

Size

unknown

02hrisc held

VERITE_GPUINDEX

index register to the GPU external registers

Size

unknown

Values

80Intruction Register
82Status Register 1

VERITE_GPUDATA

This register contains the value of the GPU register selected by VERITE_GPUINDEX.  A write will load the corresponding GPU register

VERITE_MODE

This register allows one to select between CRTC modes.  One can choose between VGA, VESA and Native mode by encoding the proper bits

Size

8 bits

Bitflags

01hDecode 0xA0000.
02hOperate in VGA Mode.  This will enable A0000-BFFFF indepent of bit 1
04h32-bit VGA

VERITE_CRTCCTL

CRTC Control register.  32-bits in size, contains several flags and pixel formats

Size

32 bits

Bitflags

0000000Fcolor format
00000010CRTCCTL_VIDEOFIFOSIZE128
00000020CRTCCTL_ENABLEDDC
00000040CRTCCTL_DDCOUTPUT
00000080CRTCCTL_DDCDATA
00000100CRTCCTL_VSYNCHI
00000200CRTCCTL_HSYNCHI
00000400CRTCCTL_VSYNCENABLE
00000800CRTCCTL_HSYNCENABLE
00001000CRTCCTL_VIDEOENABLE
00002000CRTCCTL_STEREOSCOPIC
00004000CRTCCTL_FRAMEDISPLAYED
00008000CRTCCTL_FRAMEBUFFERBGR
00010000CRTCCTL_EVENFRAME
00020000CRTCCTL_LINEDOUBLE
00040000CRTCCTL_FRAMESWITCHED

Color formats

416 bpp (R5-G6-B5)
516 bpp (R4-G4-B4-X4)
1232 bpp (R8-G8-B8-X8)

VERITE_CRTCH

Horizontal timing register

Size

32 bits

VERITE_CRTCV

Vertical timing register

Size

32 bits

VERITE_FRAMESTART

Frame offset

Size

unknown

VERITE_WIDTH

Virtual width?

Size

32 bits

VERITE_DAC_PIXELMASK

RAMDAC configuration

Size

8 bits

VERITE_DAC_CR0

RAMDAC configuration

Size

8 bits

VERITE_DAC_CR1

RAMDAC configuration

Size

8 bits

Bitfields

08Use 565 RGB
10Bypass color lookup (disable palette)
E0Bits per pixel 00 = 24 bits 20 = 16 bits 40 = 8 bits 60 = 4 bits

VERITE_DAC_CR2

RAMDAC configuration

Size

8 bits

VERITE_DOTCLOCK

Access to the V2x00 dot clock PLL

Size

unknown

Bitfields

VINSNS

List of verite GPU opcodes Each instruction is exactly 32-bits, of the form ooxxxxxx, where oo is the opcode and xx are the arguments Most opcodes follow a triadic instruction: ooddxxyy, where dd is destination register, xx and yy are source registers Jumps are pipelined and therefore have a delay of a cycle.

Summary
Constants
VINSN_ADDIAdd a register and a byte immediate
VINSN_SUBISubtract a byte immediate from a register
VINSN_ANDNIComputes the binary and-not of a register and a byte immediate
VINSN_RSUBISubtract a register from a byte immediate
VINSN_ANDIComputes the inclusive or of a register and a byte immediate
VINSN_ORIComputes the inclusive or of a register and a byte immediate
VINSN_NORIComputes the binary nor of a register and a byte immediate
VINSN_XORIComputes the exclusive or of a register and a byte immediate
VINSN_ADDadd two registers and put the result in the target register
VINSN_SUBsubtract the second source from the first source register and put the result in the target register
VINSN_ANDNcompute the and-not of two registers and put the result in the target register
VINSN_RSUBsubtract the first source register from the second source register and put the result in the target register
VINSN_ANDcompute the binary and of two registers and put the result in the target register
VINSN_ORcompute the binary inclusive or of two registers and put the result in the target register
VINSN_NORcompute the binary nor two registers and put the result in the target register
VINSN_XORcompute the binary exclusive or of two registers and put the result in the target register
VINSN_RFIFOPops a slot from the FIFO, stall if the fifo is empty.
fixme-VINSN_PLD16Iload the high 16 bits of a register with an immediate value
VINSN_RORIrotate register right by a constant number of positions.
VINSN_SHLIshift register right by a constant number of positions, sign extending in the process.
VINSN_SARIshift register right by a constant number of positions, sign extending in the process.
VINSN_SHRIshift register right by a constant number of positions, adding zeros on the far end
fixme-VINSN_PLD8Iload the high 24 bits of a register with an immediate value
VINSN_JZJump conditional if register is zero
VINSN_JNZJump conditional if register is non-zero
VINSN_JSJump conditional if register is negative
VINSN_JNSJump conditional if register is not negative
VINSN_JAJump conditional if register is above zero
VINSN_JNAJump conditional if register is not above zero
VINSN_JMPJump to an absolute address
VINSN_JMPRJump to address specified in register
VINSN_LDB.  The result is not available until after the next cycle.Load a byte from RAM
VINSN_LDHLoad a 16-bit halfword from RAM.
VINSN_LDWLoad a 32-bit word from RAM.
VINSN_LDILoad an 16-bit immediate into the selected register
VINSN_LDHILoad a shifted 16-bit immediate into the selected register.

Constants

VINSN_ADDI

Add a register and a byte immediate

Format

00 dd ss xx

dddestination register
sssource register
xxbyte value

operation

dd = ss + xx

VINSN_SUBI

Subtract a byte immediate from a register

Format

01 dd ss xx

dddestination register
sssource register
xxbyte value

operation

dd = ssxx

VINSN_ANDNI

Computes the binary and-not of a register and a byte immediate

Format

02 dd ss xx

dddestination register
sssource register
xxbyte value

operation

dd = ss & ~xx

VINSN_RSUBI

Subtract a register from a byte immediate

Format

03 dd ss xx

dddestination register
sssource register
xxbyte value

operation

dd = xxss

VINSN_ANDI

Computes the inclusive or of a register and a byte immediate

Format

04 dd ss xx

dddestination register
sssource register
xxbyte value

operation

dd = ss & xx

VINSN_ORI

Computes the inclusive or of a register and a byte immediate

Format

05 dd ss xx

dddestination register
sssource register
xxbyte value

operation

dd = ss | xx

VINSN_NORI

Computes the binary nor of a register and a byte immediate

Format

06 dd ss xx

dddestination register
sssource register
xxbyte value

operation

dd = ~ (ss | xx)

VINSN_XORI

Computes the exclusive or of a register and a byte immediate

Format

07 dd ss xx

dddestination register
sssource register
xxbyte value

operation

dd = ss ^ xx

VINSN_ADD

add two registers and put the result in the target register

format

10 dd xx yy

dddestination register
xxsource register 1
yysource register

operation

dd = xx + yy

VINSN_SUB

subtract the second source from the first source register and put the result in the target register

format

11 dd xx yy

dddestination register
xxsource register 1
yysource register

operation

dd = xxyy

VINSN_ANDN

compute the and-not of two registers and put the result in the target register

format

12 dd xx yy

dddestination register
xxsource register 1
yysource register

operation

dd = xx & ~yy

VINSN_RSUB

subtract the first source register from the second source register and put the result in the target register

format

13 dd xx yy

dddestination register
xxsource register 1
yysource register

operation

dd = yyxx

VINSN_AND

compute the binary and of two registers and put the result in the target register

format

14 dd xx yy

dddestination register
xxsource register 1
yysource register

operation

dd = xx & yy

VINSN_OR

compute the binary inclusive or of two registers and put the result in the target register

format

15 dd xx yy

dddestination register
xxsource register 1
yysource register

operation

dd = xx | yy

VINSN_NOR

compute the binary nor two registers and put the result in the target register

format

16 dd xx yy

dddestination register
xxsource register 1
yysource register

operation

dd = ~(xx | yy)

VINSN_XOR

compute the binary exclusive or of two registers and put the result in the target register

format

17 dd xx yy

dddestination register
xxsource register 1
yysource register

operation

dd = xx ^ yy

VINSN_RFIFO

Pops a slot from the FIFO, stall if the fifo is empty.

format

43 dd xx yy

dddestination register
xxmask register (between 0 and F)
yycontrol byte

operation

dd = fifo.pop() & xx

The mask does not seem to work properly with general purpose registers.  The following can be used consistently

08and the fifo value with 0xffff0000
0Dmask with 0xffffffff (i.e. read all bytes)

The control byte specifies one of the fifo formats

20read fifo in big-endian format
21read fifo in little-endian format

fixme-VINSN_PLD16I

load the high 16 bits of a register with an immediate value

format

40 dd ss xx

dddestination register
sssource register
xxbyte immediate

operation

dd = (ss & 0xffff) | (xx << 16)

VINSN_RORI

rotate register right by a constant number of positions.

format

44 dd ss xx

dddestination register
sssource register
xxbyte immediate

operation

dd = ss ROR xx

VINSN_SHLI

shift register right by a constant number of positions, sign extending in the process.

format

45 dd ss xx

dddestination register
sssource register
xxbyte immediate

operation

dd = ss << xx

VINSN_SARI

shift register right by a constant number of positions, sign extending in the process.

format

46 dd ss xx

dddestination register
sssource register
xxbyte immediate

operation

dd = ss >>> xx

VINSN_SHRI

shift register right by a constant number of positions, adding zeros on the far end

format

47 dd ss xx

dddestination register
sssource register
xxbyte immediate

operation

dd = ss >> xx

fixme-VINSN_PLD8I

load the high 24 bits of a register with an immediate value

format

4b dd ss xx

dddestination register
sssource register
xxbyte immediate

operation

dd = (ss & 0xff) | (xx << 8)

VINSN_JZ

Jump conditional if register is zero

format

60 nn nn ss

nnnnsigned 16-bit displacement.  Contains the number of instructions to jump if the condition is met.  A displacement of -1 would be the jump instruction.
ssthe source register whose contents to check

operation

if (ss = 0) schedule_jump(pc+44*nnnn)

VINSN_JNZ

Jump conditional if register is non-zero

format

61 nn nn ss

nnnnsigned 16-bit displacement.  Contains the number of instructions to jump if the condition is met.  A displacement of -1 would be the jump instruction.
ssthe source register whose contents to check

operation

if (ss != 0) schedule_jump(pc+44*nnnn)

VINSN_JS

Jump conditional if register is negative

format

62 nn nn ss

nnnnsigned 16-bit displacement.  Contains the number of instructions to jump if the condition is met.  A displacement of -1 would be the jump instruction.
ssthe source register whose contents to check

operation

if (ss < 0) schedule_jump(pc+44*nnnn)

VINSN_JNS

Jump conditional if register is not negative

format

63 nn nn ss

nnnnsigned 16-bit displacement.  Contains the number of instructions to jump if the condition is met.  A displacement of -1 would be the jump instruction.
ssthe source register whose contents to check

operation

if (ss >= 0) schedule_jump(pc+44*nnnn)

VINSN_JA

Jump conditional if register is above zero

format

64 nn nn ss

nnnnsigned 16-bit displacement.  Contains the number of instructions to jump if the condition is met.  A displacement of -1 would be the jump instruction.
ssthe source register whose contents to check

operation

if (ss > 0) schedule_jump(pc+44*nnnn)

VINSN_JNA

Jump conditional if register is not above zero

format

64 nn nn ss

nnnnsigned 16-bit displacement.  Contains the number of instructions to jump if the condition is met.  A displacement of -1 would be the jump instruction.
ssthe source register whose contents to check

operation

if (ss > 0) schedule_jump(pc+44*nnnn)

VINSN_JMP

Jump to an absolute address

format

6c nn nn nn

nnnnnn24-bit absolute jump target.  This value is shifted left by two to create the actual address (and keep the program counter dword aligned)

VINSN_JMPR

Jump to address specified in register

format

6f xx xx nn

nnThe register that holds the jump target.
xxxxunused?

VINSN_LDB.  The result is not available until after the next cycle.

Load a byte from RAM

format

70 dd xx ss

dddestination register
xxunsigned immediate displacement
ssmemory offset register

operation

dd = mem[ss + xx]

VINSN_LDH

Load a 16-bit halfword from RAM.  The result is not available until after the next cycle.

format

71 dd xx ss

dddestination register
xxunsigned immediate displacement
ssmemory offset register

operation

dd = mem[ss + 2*xx]

VINSN_LDW

Load a 32-bit word from RAM.  The result is not available until after the next cycle.

format

72 dd xx ss

dddestination register
xxunsigned immediate displacement
ssmemory offset register

operation

dd = mem[ss + 4*xx]

VINSN_LDI

Load an 16-bit immediate into the selected register

format

76 dd nn nn

dddestination register
nnnn16 bit constant

operation

dd = nnnn

VINSN_LDHI

Load a shifted 16-bit immediate into the selected register.

format

76 dd nn nn

dddestination register
nnnn16 bit constant

operation

dd = nnnn << 16

index register to the GPU external registers