mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
feat(datasheet): include mux addresses
This commit is contained in:
@@ -64,6 +64,7 @@ class CaravelConfig():
|
|||||||
mux_address = (module['y'] << 5) + module['x']
|
mux_address = (module['y'] << 5) + module['x']
|
||||||
module_name = 'tt_um_' + module['name']
|
module_name = 'tt_um_' + module['name']
|
||||||
project = next(p for p in self.projects if p.top_module == 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] = {
|
mux_index[mux_address] = {
|
||||||
"macro": module_name,
|
"macro": module_name,
|
||||||
"x": module['x'],
|
"x": module['x'],
|
||||||
|
|||||||
@@ -239,6 +239,7 @@ if __name__ == '__main__':
|
|||||||
docs.dump_json()
|
docs.dump_json()
|
||||||
|
|
||||||
if args.dump_markdown:
|
if args.dump_markdown:
|
||||||
|
caravel.configure_mux()
|
||||||
docs.dump_markdown()
|
docs.dump_markdown()
|
||||||
|
|
||||||
if args.build_hugo_content:
|
if args.build_hugo_content:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
## {index} : {title}
|
## {title} [{mux_address}]
|
||||||
|
|
||||||
{picture_link}
|
{picture_link}
|
||||||
|
|
||||||
|
|||||||
+6
-3
@@ -19,8 +19,9 @@ class Docs():
|
|||||||
readme = fh.read()
|
readme = fh.read()
|
||||||
with open("README.md", 'w') as fh:
|
with open("README.md", 'w') as fh:
|
||||||
fh.write(readme)
|
fh.write(readme)
|
||||||
fh.write("| Index | Author | Title | Type | Git Repo |\n")
|
fh.write("| Address | Author | Title | Type | Git Repo |\n")
|
||||||
fh.write("| ----- | ------ | ------| -----| ---------|\n")
|
fh.write("| ------- | ------ | ------| -----| ---------|\n")
|
||||||
|
self.projects.sort(key=lambda x: x.mux_address)
|
||||||
for project in self.projects:
|
for project in self.projects:
|
||||||
fh.write(project.get_index_row())
|
fh.write(project.get_index_row())
|
||||||
|
|
||||||
@@ -65,10 +66,12 @@ class Docs():
|
|||||||
with open(self.args.dump_markdown, 'w') as fh:
|
with open(self.args.dump_markdown, 'w') as fh:
|
||||||
fh.write(doc_header)
|
fh.write(doc_header)
|
||||||
|
|
||||||
|
self.projects.sort(key=lambda x: x.mux_address)
|
||||||
|
|
||||||
for project in self.projects:
|
for project in self.projects:
|
||||||
yaml_data = project.get_project_doc_yaml()
|
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}")
|
logging.info(f"building datasheet for {project}")
|
||||||
# handle pictures
|
# handle pictures
|
||||||
|
|||||||
+1
-1
@@ -179,7 +179,7 @@ class Project():
|
|||||||
|
|
||||||
# docs stuff for index on README.md
|
# docs stuff for index on README.md
|
||||||
def get_index_row(self):
|
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):
|
def get_project_type_string(self):
|
||||||
if self.is_wokwi():
|
if self.is_wokwi():
|
||||||
|
|||||||
Reference in New Issue
Block a user