Don't let python convert lane number to float.

While at it also:
* Don't multilane for reg >= 8 bit width.
* Only check if we should switch to multilane after finding min field width.
This commit is contained in:
Piotr Esden-Tempski 2020-03-19 18:12:41 -07:00
parent dd07a0ad2f
commit 279886721b
1 changed files with 5 additions and 4 deletions

View File

@ -270,10 +270,11 @@ class DocumentedCSRRegion:
attr_str = "\"attr\": 'reset: " + str(reg.reset_value) + "', " attr_str = "\"attr\": 'reset: " + str(reg.reset_value) + "', "
print(" {\"name\": \"" + reg.short_name.lower() + self.bit_range(reg.offset, reg.offset + reg.size, empty_if_zero=True) + "\", " + attr_str + "\"bits\": " + str(reg.size) + "}" + term, file=stream) print(" {\"name\": \"" + reg.short_name.lower() + self.bit_range(reg.offset, reg.offset + reg.size, empty_if_zero=True) + "\", " + attr_str + "\"bits\": " + str(reg.size) + "}" + term, file=stream)
if reg.size != self.csr_data_width: if reg.size != self.csr_data_width:
multilane = True
print(" {\"bits\": " + str(self.csr_data_width - reg.size) + "},", file=stream) print(" {\"bits\": " + str(self.csr_data_width - reg.size) + "},", file=stream)
if reg.size < 8:
multilane = True
if multilane: if multilane:
lanes = self.busword / 8 lanes = self.busword // 8
else: else:
lanes = 1 lanes = 1
print(" ], \"config\": {\"hspace\": 400, \"bits\": " + str(self.busword) + ", \"lanes\": " + str(lanes) + " }, \"options\": {\"hspace\": 400, \"bits\": " + str(self.busword) + ", \"lanes\": " + str(lanes) + "}", file=stream) print(" ], \"config\": {\"hspace\": 400, \"bits\": " + str(self.busword) + ", \"lanes\": " + str(lanes) + " }, \"options\": {\"hspace\": 400, \"bits\": " + str(self.busword) + ", \"lanes\": " + str(lanes) + "}", file=stream)