Compare commits
No commits in common. "94e9c0403da495d3ead108ad154a5fb51a6a6313" and "a56b655682805fb3fe9a71989643856bfa185ab7" have entirely different histories.
94e9c0403d
...
a56b655682
@ -35,7 +35,7 @@ RB_NO_UPDATE 27 0x0 Ring Buffer No Write to Read Pointer. The p
|
|||||||
POSSIBLE VALUES:
|
POSSIBLE VALUES:
|
||||||
00 - Write to Host`s copy of Read Pointer in system memory.
|
00 - Write to Host`s copy of Read Pointer in system memory.
|
||||||
01 - Do not write to Host`s copy of Read pointer.
|
01 - Do not write to Host`s copy of Read pointer.
|
||||||
RB_RPTR_WR_ENA 31 0x0 Ring Buffer Read Pointer Write Transfer Enable. When
|
RB_RPTR_WR_ENA 31 0bx0 Ring Buffer Read Pointer Write Transfer Enable. When
|
||||||
set the contents of the CP_RB_RPTR_WR register is
|
set the contents of the CP_RB_RPTR_WR register is
|
||||||
transferred to the active read pointer (CP_RB_RPTR)
|
transferred to the active read pointer (CP_RB_RPTR)
|
||||||
whenever the CP_RB_WPTR register is written.
|
whenever the CP_RB_WPTR register is written.
|
@ -14,8 +14,8 @@ PIPE_COUNT 3:1 0x0 Specifies the number of active pipes and c
|
|||||||
POSSIBLE VALUES:
|
POSSIBLE VALUES:
|
||||||
00 - RV350 (1 pipe, 1 ctx)
|
00 - RV350 (1 pipe, 1 ctx)
|
||||||
03 - R300 (2 pipes, 1 ctx)
|
03 - R300 (2 pipes, 1 ctx)
|
||||||
06 - R420-3P (3 pipes, 1 ctx)
|
06 – R420-3P (3 pipes, 1 ctx)
|
||||||
07 - R420 (4 pipes, 1 ctx)
|
07 – R420 (4 pipes, 1 ctx)
|
||||||
TILE_SIZE 5:4 0x1 Specifies width & height (square), in pixels (only 16, 32
|
TILE_SIZE 5:4 0x1 Specifies width & height (square), in pixels (only 16, 32
|
||||||
available).
|
available).
|
||||||
POSSIBLE VALUES:
|
POSSIBLE VALUES:
|
@ -5,42 +5,26 @@ from dataclasses import dataclass
|
|||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
def split_line_fields(line, fields):
|
def split_line_fields(line):
|
||||||
|
fields = [0, 17, 24, 32]
|
||||||
a = line[fields[0]:fields[1]]
|
a = line[fields[0]:fields[1]]
|
||||||
b = line[fields[1]:fields[2]]
|
b = line[fields[1]:fields[2]]
|
||||||
c = line[fields[2]:fields[3]]
|
c = line[fields[2]:fields[3]]
|
||||||
d = line[fields[3]:]
|
d = line[fields[3]:]
|
||||||
assert a[-1] == ' '
|
|
||||||
assert b[-1] == ' '
|
|
||||||
assert c[-1] == ' ' or len(line) < fields[3]
|
|
||||||
return a, b, c, d
|
return a, b, c, d
|
||||||
|
|
||||||
def find_line_fields(line):
|
|
||||||
field_name_ix = line.index('Field Name')
|
|
||||||
bits_ix = line.index('Bits')
|
|
||||||
default_ix = line.index('Default')
|
|
||||||
description_ix = line.index('Description')
|
|
||||||
assert field_name_ix == 0
|
|
||||||
assert bits_ix > field_name_ix
|
|
||||||
assert default_ix > bits_ix
|
|
||||||
assert description_ix > default_ix
|
|
||||||
return field_name_ix, bits_ix, default_ix, description_ix
|
|
||||||
|
|
||||||
def parse_file_fields(filename):
|
def parse_file_fields(filename):
|
||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
lines = f.read().split('\n')
|
lines = f.read().split('\n')
|
||||||
first, *rest = lines
|
first, *rest = lines
|
||||||
fields = find_line_fields(first)
|
a, b, c, d = split_line_fields(first)
|
||||||
a, b, c, d = split_line_fields(first, fields)
|
assert a == 'Field Name ', a
|
||||||
assert a.rstrip() == 'Field Name', a
|
assert b == 'Bits ', b
|
||||||
assert b.rstrip() == 'Bits', b
|
assert c == 'Default ', c
|
||||||
assert c.rstrip() == 'Default', c
|
|
||||||
assert d.rstrip() == 'Description', d
|
assert d.rstrip() == 'Description', d
|
||||||
|
|
||||||
for line in rest:
|
for line in rest:
|
||||||
if not line.strip():
|
a, b, c, d = split_line_fields(line)
|
||||||
continue
|
|
||||||
a, b, c, d = split_line_fields(line, fields)
|
|
||||||
yield a.strip(), b.strip(), c.strip(), d.strip()
|
yield a.strip(), b.strip(), c.strip(), d.strip()
|
||||||
|
|
||||||
def parse_bits(s):
|
def parse_bits(s):
|
||||||
@ -76,6 +60,8 @@ def aggregate(fields):
|
|||||||
nonlocal ix
|
nonlocal ix
|
||||||
if ix + 1 >= len(fields):
|
if ix + 1 >= len(fields):
|
||||||
return
|
return
|
||||||
|
if not fields[ix+1][0] == '':
|
||||||
|
return
|
||||||
if not fields[ix+1][3] == 'POSSIBLE VALUES:':
|
if not fields[ix+1][3] == 'POSSIBLE VALUES:':
|
||||||
return
|
return
|
||||||
ix += 1
|
ix += 1
|
||||||
@ -103,7 +89,7 @@ def aggregate(fields):
|
|||||||
ix += 1
|
ix += 1
|
||||||
|
|
||||||
def parse_possible_value_num(s):
|
def parse_possible_value_num(s):
|
||||||
num, description = s.split(' - ', maxsplit=1)
|
num, description = s.split(' - ')
|
||||||
num = int(num, 10)
|
num = int(num, 10)
|
||||||
if ": " in description:
|
if ": " in description:
|
||||||
name, description = description.split(": ")
|
name, description = description.split(": ")
|
||||||
@ -113,21 +99,17 @@ def aggregate(fields):
|
|||||||
|
|
||||||
while ix < len(fields):
|
while ix < len(fields):
|
||||||
field_name, bits, default, description = fields[ix]
|
field_name, bits, default, description = fields[ix]
|
||||||
if description == 'POSSIBLE VALUES:':
|
description_lines = [description]
|
||||||
description_lines = []
|
description_lines.extend(parse_description_lines())
|
||||||
ix -= 1
|
|
||||||
else:
|
|
||||||
description_lines = [description]
|
|
||||||
description_lines.extend(parse_description_lines())
|
|
||||||
possible_values = OrderedDict(
|
possible_values = OrderedDict(
|
||||||
map(parse_possible_value_num, parse_possible_values())
|
map(parse_possible_value_num, parse_possible_values())
|
||||||
)
|
)
|
||||||
|
|
||||||
assert default.startswith('0x') or default == 'none', default
|
assert default.startswith('0x'), default
|
||||||
yield Descriptor(
|
yield Descriptor(
|
||||||
field_name = field_name,
|
field_name = field_name,
|
||||||
bits = parse_bits(bits),
|
bits = parse_bits(bits),
|
||||||
default = 0 if default == 'none' else int(default, 16),
|
default = int(default, 16),
|
||||||
description = ' '.join(description_lines),
|
description = ' '.join(description_lines),
|
||||||
possible_values = possible_values
|
possible_values = possible_values
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Field Name Bits Description
|
Field Name Bit(s) Description
|
||||||
PVS_SRC_REG_TYPE 1:0 Defines the Memory Select (Register Type) for the Source Operand. See Below.
|
PVS_SRC_REG_TYPE 1:0 Defines the Memory Select (Register Type) for the Source Operand. See Below.
|
||||||
PVS_DST_OPCODE_MSB 2 Math Opcode MSB for Dual Math Inst.
|
PVS_DST_OPCODE_MSB 2 Math Opcode MSB for Dual Math Inst.
|
||||||
PVS_SRC_ABS_XYZW 3 If set, Take absolute value of both components of Dual Math input vector.
|
PVS_SRC_ABS_XYZW 3 If set, Take absolute value of both components of Dual Math input vector.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user