mirror of
https://github.com/YosysHQ/yosys.git
synced 2026-10-06 10:03:36 +02:00
The JSON backend writes "signed": 1 for any signed wire, including internal nets. The frontend only parsed the attribute for ports, so a write-read roundtrip silently cleared is_signed on internal nets. Signed internal wires became unsigned between the two passes. Fix: parse 'signed' in the netnames loop, next to the existing upto/offset handling. Regression test does a full roundtrip and checks the internal signed wire survives.
9 lines
463 B
Plaintext
9 lines
463 B
Plaintext
! mkdir -p temp
|
|
read_verilog json_netnames_signed.v
|
|
write_json temp/json_netnames_signed_r1.json
|
|
design -reset
|
|
read_json temp/json_netnames_signed_r1.json
|
|
write_json temp/json_netnames_signed_r2.json
|
|
# the internal signed wire t must survive the roundtrip with signedness intact
|
|
! python3 -c "import json; d=json.load(open('temp/json_netnames_signed_r2.json')); assert d['modules']['top']['netnames']['t'].get('signed') == 1, 'signedness lost on internal net t'"
|