diff --git a/fuzzers/030-iob/check_results.py b/fuzzers/030-iob/check_results.py index ea22c473..9f36324e 100644 --- a/fuzzers/030-iob/check_results.py +++ b/fuzzers/030-iob/check_results.py @@ -76,10 +76,10 @@ def create_sites_from_fasm(fasm_file): sites[key]['type'] = ['IOBUF', 'IOBUF_INTERMDISABLE'] else: sites[key]['type'] = [ - "OBUF", - "OBUFDS_DUAL_BUF", - "OBUFTDS_DUAL_BUF", - ] + "OBUF", + "OBUFDS_DUAL_BUF", + "OBUFTDS_DUAL_BUF", + ] return sites @@ -131,9 +131,9 @@ def process_specimen(fasm_file, params_json): iostandard = iostandard[5:] assert iostandard in site_from_fasm['IOSTANDARDS'], ( - p['IOSTANDARD'], - site_from_fasm['IOSTANDARDS'], - ) + p['IOSTANDARD'], + site_from_fasm['IOSTANDARDS'], + ) if p['type'] != 'IBUF': if verilog.unquote(p['SLEW']) == '': @@ -159,10 +159,13 @@ def process_specimen(fasm_file, params_json): else: # Check that drive is at default assert 'I12' in site_from_fasm['DRIVES'], ( - tile, site_key, p['DRIVE'], site_from_fasm['DRIVES']) + tile, site_key, p['DRIVE'], + site_from_fasm['DRIVES']) else: - assert 'I{}'.format(p['DRIVE']) in site_from_fasm['DRIVES'], ( - tile, site_key, p['DRIVE'], site_from_fasm['DRIVES']) + assert 'I{}'.format( + p['DRIVE']) in site_from_fasm['DRIVES'], ( + tile, site_key, p['DRIVE'], + site_from_fasm['DRIVES']) def scan_specimens(): @@ -170,8 +173,8 @@ def scan_specimens(): if os.path.basename(root).startswith('specimen_'): print('Processing', os.path.basename(root)) process_specimen( - fasm_file=os.path.join(root, 'design.fasm'), - params_json=os.path.join(root, 'params.json')) + fasm_file=os.path.join(root, 'design.fasm'), + params_json=os.path.join(root, 'params.json')) print('No errors found!') diff --git a/minitests/litex/src.yosys/top.tcl b/minitests/litex/src.yosys/top.tcl index 3a1868a1..5537f2f4 100644 --- a/minitests/litex/src.yosys/top.tcl +++ b/minitests/litex/src.yosys/top.tcl @@ -1,29 +1,29 @@ proc write_iobuf_report {filename} { set fp [open $filename w] puts $fp "{ \"tiles\": \[" - foreach port [get_ports] { - set net [get_nets -of $port] - if { $net == "" } { - continue + foreach port [get_ports] { + set net [get_nets -of $port] + if { $net == "" } { + continue + } + + set cell [get_cells -of $net] + set site [get_sites -of $cell] + set tile [get_tiles -of $site] + + puts $fp "{" + puts $fp "\"port\": \"$port\"," + puts $fp "\"pad_wire\": \"$net\"," + puts $fp "\"cell\": \"$cell\"," + puts $fp "\"site\": \"$site\"," + puts $fp "\"tile\": \"$tile\"," + puts $fp "\"type\": \"[get_property REF_NAME $cell]\"," + puts $fp "\"IOSTANDARD\": \"\\\"[get_property IOSTANDARD $cell]\\\"\"," + puts $fp "\"PULLTYPE\": \"\\\"[get_property PULLTYPE $cell]\\\"\"," + puts $fp "\"DRIVE\": \"[get_property DRIVE $cell]\"," + puts $fp "\"SLEW\": \"\\\"[get_property SLEW $cell]\\\"\"," + puts $fp "}," } - - set cell [get_cells -of $net] - set site [get_sites -of $cell] - set tile [get_tiles -of $site] - - puts $fp "{" - puts $fp "\"port\": \"$port\"," - puts $fp "\"pad_wire\": \"$net\"," - puts $fp "\"cell\": \"$cell\"," - puts $fp "\"site\": \"$site\"," - puts $fp "\"tile\": \"$tile\"," - puts $fp "\"type\": \"[get_property REF_NAME $cell]\"," - puts $fp "\"IOSTANDARD\": \"\\\"[get_property IOSTANDARD $cell]\\\"\"," - puts $fp "\"PULLTYPE\": \"\\\"[get_property PULLTYPE $cell]\\\"\"," - puts $fp "\"DRIVE\": \"[get_property DRIVE $cell]\"," - puts $fp "\"SLEW\": \"\\\"[get_property SLEW $cell]\\\"\"," - puts $fp "}," - } puts $fp "\]}" close $fp }