mirror of https://github.com/YosysHQ/yosys.git
Undo more unnecessary changes
This commit is contained in:
parent
62e666c2ed
commit
38ee4fc730
|
|
@ -124,13 +124,8 @@ def simulate_rosette(
|
||||||
|
|
||||||
|
|
||||||
cmd = ["racket", test_rkt_file_path]
|
cmd = ["racket", test_rkt_file_path]
|
||||||
try:
|
status = subprocess.run(cmd, capture_output=True)
|
||||||
status = subprocess.run(cmd, capture_output=True, check=True)
|
assert status.returncode == 0, f"{cmd[0]} failed"
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
raise RuntimeError(
|
|
||||||
f"Racket simulation failed with command: {cmd}\n"
|
|
||||||
f"Error: {e.stderr.decode()}"
|
|
||||||
) from e
|
|
||||||
|
|
||||||
for signal in outputs.keys():
|
for signal in outputs.keys():
|
||||||
signals[signal] = []
|
signals[signal] = []
|
||||||
|
|
@ -154,12 +149,10 @@ def simulate_rosette(
|
||||||
)
|
)
|
||||||
for output, (value, width) in outputs_values_and_widths:
|
for output, (value, width) in outputs_values_and_widths:
|
||||||
assert isinstance(value, str), f"Bad value {value!r}"
|
assert isinstance(value, str), f"Bad value {value!r}"
|
||||||
assert value.startswith(("#b", "#x")), f"Non-binary value {value!r}"
|
assert value.startswith(('#b', '#x')), f"Non-binary value {value!r}"
|
||||||
assert (
|
assert int(width) == outputs[output], f"Width mismatch for output {output!r} (got {width}, expected {outputs[output]})"
|
||||||
int(width) == outputs[output]
|
int_value = int(value[2:], 16 if value.startswith('#x') else 2)
|
||||||
), f"Width mismatch for output {output!r} (got {width}, expected {outputs[output]})"
|
binary_string = format(int_value, '0{}b'.format(width))
|
||||||
int_value = int(value[2:], 16 if value.startswith("#x") else 2)
|
|
||||||
binary_string = format(int_value, "0{}b".format(width))
|
|
||||||
signals[output].append(binary_string)
|
signals[output].append(binary_string)
|
||||||
|
|
||||||
vcd_signals: SignalStepMap = {}
|
vcd_signals: SignalStepMap = {}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue