If the current behavior is a bug, please provide the steps to reproduce the problem:
Run vlsi_rom_gen with python3.5 or higher, e.g., python3.7 scripts/vlsi_rom_gen file.rom.conf file.hex
What is the current behavior?
(line numbers are slightly off, because I tinker with the file)
Traceback (most recent call last):
File "rocket-chip/scripts/vlsi_rom_gen", line 92, in iterate_by_n
batch += (next(it),)
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "rocket-chip/scripts/vlsi_rom_gen", line 142, in <module>
main()
File "rocket-chip/scripts/vlsi_rom_gen", line 138, in main
**parse_line(line))
File "rocket-chip/scripts/vlsi_rom_gen", line 118, in parse_line
for key, val in iterate_by_n(line.split(), 2)}
File "rocket-chip/scripts/vlsi_rom_gen", line 117, in <dictcomp>
kwargs = {key: try_cast_int(val)
RuntimeError: generator raised StopIteration
Type of issue: bug report
If the current behavior is a bug, please provide the steps to reproduce the problem: Run vlsi_rom_gen with python3.5 or higher, e.g.,
python3.7 scripts/vlsi_rom_gen file.rom.conf file.hex
What is the current behavior? (line numbers are slightly off, because I tinker with the file)
Python 3.5 changed generators slightly (PEP479).
Instead of raising a StopIteration exception, the generator should simply return. Otherwise the script will fail. The
raise
should therefore be replaced by areturn
. https://github.com/freechipsproject/rocket-chip/blob/f07a86fe05fb4271231fa8ec5d3809c962156dd3/scripts/vlsi_rom_gen#L96What is the expected behavior? A successful execution.
Please tell us about your environment:
#! /usr/bin/env python
is python3)