Move SwitchInfoPOD to chipdb blob
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
a3e0842299
commit
1f9c28ba58
@ -188,8 +188,8 @@ static const int max_switch_bits = 5;
|
|||||||
|
|
||||||
struct SwitchInfoPOD
|
struct SwitchInfoPOD
|
||||||
{
|
{
|
||||||
|
int32_t num_bits;
|
||||||
int8_t x, y;
|
int8_t x, y;
|
||||||
int num_bits;
|
|
||||||
ConfigBitPOD cbits[max_switch_bits];
|
ConfigBitPOD cbits[max_switch_bits];
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
@ -734,28 +734,38 @@ for info in pipinfo:
|
|||||||
bba.u16(info["switch_mask"], "switch_mask")
|
bba.u16(info["switch_mask"], "switch_mask")
|
||||||
bba.u32(info["switch_index"], "switch_index")
|
bba.u32(info["switch_index"], "switch_index")
|
||||||
|
|
||||||
bba.finalize()
|
|
||||||
if compact_output:
|
|
||||||
bba.write_compact_c(sys.stdout)
|
|
||||||
else:
|
|
||||||
bba.write_verbose_c(sys.stdout)
|
|
||||||
|
|
||||||
switchinfo = []
|
switchinfo = []
|
||||||
switchid = 0
|
|
||||||
for switch in switches:
|
for switch in switches:
|
||||||
dst, x, y, bits = switch
|
dst, x, y, bits = switch
|
||||||
bitlist = []
|
bitlist = []
|
||||||
for b in bits:
|
for b in bits:
|
||||||
m = cbit_re.match(b)
|
m = cbit_re.match(b)
|
||||||
assert m
|
assert m
|
||||||
bitlist.append("{%d, %d}" % (int(m.group(1)), int(m.group(2))))
|
bitlist.append((int(m.group(1)), int(m.group(2))))
|
||||||
cbits = ", ".join(bitlist)
|
si = dict()
|
||||||
switchinfo.append("{%d, %d, %d, {%s}}" % (x, y, len(bits), cbits))
|
si["x"] = x
|
||||||
switchid += 1
|
si["y"] = y
|
||||||
|
si["bits"] = bitlist
|
||||||
|
switchinfo.append(si)
|
||||||
|
|
||||||
print("static SwitchInfoPOD switch_data_%s[%d] = {" % (dev_name, len(switchinfo)))
|
bba.l("switch_data_%s" % dev_name, "SwitchInfoPOD", export=True)
|
||||||
print(" " + ",\n ".join(switchinfo))
|
for info in switchinfo:
|
||||||
print("};")
|
bba.u32(len(info["bits"]), "num_bits")
|
||||||
|
bba.u8(info["x"], "x")
|
||||||
|
bba.u8(info["y"], "y")
|
||||||
|
for i in range(5):
|
||||||
|
if i < len(info["bits"]):
|
||||||
|
bba.u8(info["bits"][i][0], "row<%d>" % i)
|
||||||
|
bba.u8(info["bits"][i][1], "col<%d>" % i)
|
||||||
|
else:
|
||||||
|
bba.u8(0, "row<%d> (unused)" % i)
|
||||||
|
bba.u8(0, "col<%d> (unused)" % i)
|
||||||
|
|
||||||
|
bba.finalize()
|
||||||
|
if compact_output:
|
||||||
|
bba.write_compact_c(sys.stdout)
|
||||||
|
else:
|
||||||
|
bba.write_verbose_c(sys.stdout)
|
||||||
|
|
||||||
print("static TileInfoPOD tile_data_%s[%d] = {" % (dev_name, num_tile_types))
|
print("static TileInfoPOD tile_data_%s[%d] = {" % (dev_name, num_tile_types))
|
||||||
print(" " + ",\n ".join(tileinfo))
|
print(" " + ",\n ".join(tileinfo))
|
||||||
|
Loading…
Reference in New Issue
Block a user