Merge pull request #1383 from andrewb1999/json-add-explicit-type

Add dedicated port type to harness design.json
This commit is contained in:
litghost 2020-07-01 15:59:30 -07:00 committed by GitHub
commit b0432d14d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,15 @@ def main():
design_json['info'] = {}
with open(args.design_txt) as f:
for d in csv.DictReader(f, delimiter=' '):
if d['name'].startswith('dout['):
d['type'] = 'out'
elif d['name'].startswith('din['):
d['type'] = 'in'
elif d['name'].startswith('clk'):
d['type'] = 'clk'
else:
assert False, d
design_json['ports'].append(d)
with open(args.design_info_txt) as f: