mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
feat: check for missing ports on user module
also improve error messages for user module checks
This commit is contained in:
+10
-4
@@ -69,10 +69,11 @@ class Project():
|
||||
]
|
||||
for port, bits in required_ports:
|
||||
if port not in module_ports:
|
||||
logging.error(f"{self} {port} not found in top")
|
||||
logging.error(f"{self} port '{port}' missing from top module ('{top}')")
|
||||
exit(1)
|
||||
if len(module_ports[port]['bits']) != bits:
|
||||
logging.error(f"{self} {port} doesn't have {bits} bits")
|
||||
actual_bits = len(module_ports[port]['bits'])
|
||||
if actual_bits != bits:
|
||||
logging.error(f"{self} incorrect width for port '{port}' in module '{top}': {bits} bits required, {actual_bits} found")
|
||||
exit(1)
|
||||
|
||||
def check_num_cells(self):
|
||||
@@ -201,7 +202,12 @@ class Project():
|
||||
for match in rgx_mod.finditer(line):
|
||||
if match.group(1) == self.top_module:
|
||||
top_verilog.append(src)
|
||||
assert len(top_verilog) == 1
|
||||
if len(top_verilog) == 0:
|
||||
logging.error(f"Couldn't find verilog module '{self.top_module}' in any of the project's source files")
|
||||
exit(1)
|
||||
if len(top_verilog) > 1:
|
||||
logging.error(f"Top verilog module '{self.top_module}' found in multiple source files: {', '.join(top_verilog)}")
|
||||
exit(1)
|
||||
return top_verilog[0]
|
||||
|
||||
def get_git_remote(self):
|
||||
|
||||
@@ -62,6 +62,7 @@ if __name__ == '__main__':
|
||||
project.print_wokwi_id()
|
||||
|
||||
if args.create_user_config:
|
||||
project.check_ports()
|
||||
project.create_user_config()
|
||||
|
||||
if args.harden:
|
||||
|
||||
Reference in New Issue
Block a user