diff --git a/caravel.py b/caravel.py index bdc6eb7..b1bc808 100644 --- a/caravel.py +++ b/caravel.py @@ -64,6 +64,7 @@ class CaravelConfig(): mux_address = (module['y'] << 5) + module['x'] module_name = 'tt_um_' + module['name'] project = next(p for p in self.projects if p.top_module == module_name) + project.mux_address = mux_address mux_index[mux_address] = { "macro": module_name, "x": module['x'], diff --git a/configure.py b/configure.py index 835a64f..3bb61e1 100755 --- a/configure.py +++ b/configure.py @@ -239,6 +239,7 @@ if __name__ == '__main__': docs.dump_json() if args.dump_markdown: + caravel.configure_mux() docs.dump_markdown() if args.build_hugo_content: diff --git a/docs/doc_template.md b/docs/doc_template.md index 85528d7..cd5ddd4 100644 --- a/docs/doc_template.md +++ b/docs/doc_template.md @@ -1,4 +1,4 @@ -## {index} : {title} +## {title} [{mux_address}] {picture_link} diff --git a/documentation.py b/documentation.py index 6b4d06b..c87c914 100644 --- a/documentation.py +++ b/documentation.py @@ -19,8 +19,9 @@ class Docs(): readme = fh.read() with open("README.md", 'w') as fh: fh.write(readme) - fh.write("| Index | Author | Title | Type | Git Repo |\n") - fh.write("| ----- | ------ | ------| -----| ---------|\n") + fh.write("| Address | Author | Title | Type | Git Repo |\n") + fh.write("| ------- | ------ | ------| -----| ---------|\n") + self.projects.sort(key=lambda x: x.mux_address) for project in self.projects: fh.write(project.get_index_row()) @@ -65,10 +66,12 @@ class Docs(): with open(self.args.dump_markdown, 'w') as fh: fh.write(doc_header) + self.projects.sort(key=lambda x: x.mux_address) + for project in self.projects: yaml_data = project.get_project_doc_yaml() - yaml_data['index'] = project.index + yaml_data['mux_address'] = project.mux_address logging.info(f"building datasheet for {project}") # handle pictures diff --git a/project.py b/project.py index c3245db..89431cb 100644 --- a/project.py +++ b/project.py @@ -179,7 +179,7 @@ class Project(): # docs stuff for index on README.md def get_index_row(self): - return f'| {self.index} | {self.yaml["documentation"]["author"]} | {self.yaml["documentation"]["title"]} | {self.get_project_type_string()} | {self.git_url} |\n' + return f'| {self.mux_address} | {self.yaml["documentation"]["author"]} | {self.yaml["documentation"]["title"]} | {self.get_project_type_string()} | {self.git_url} |\n' def get_project_type_string(self): if self.is_wokwi():