Skip to content

Commit

Permalink
test analog pins in datasheet
Browse files Browse the repository at this point in the history
  • Loading branch information
htfab committed May 5, 2024
1 parent 87b7b5b commit 8aee901
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
10 changes: 10 additions & 0 deletions docs/doc_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@
| 5 | {pinout.ui[5]} | {pinout.uo[5]} | {pinout.uio[5]} |
| 6 | {pinout.ui[6]} | {pinout.uo[6]} | {pinout.uio[6]} |
| 7 | {pinout.ui[7]} | {pinout.uo[7]} | {pinout.uio[7]} |

### Analog pins

| Int# | Ext# | Description |
| 0 | {analog_pins[0]} | {pinout.ua[0]} |
| 1 | {analog_pins[1]} | {pinout.ua[1]} |
| 2 | {analog_pins[2]} | {pinout.ua[2]} |
| 3 | {analog_pins[3]} | {pinout.ua[3]} |
| 4 | {analog_pins[4]} | {pinout.ua[4]} |
| 5 | {analog_pins[5]} | {pinout.ua[5]} |
10 changes: 10 additions & 0 deletions docs/hugo_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ weight: {weight}
| 6 | {pinout.ui[6]} | {pinout.uo[6]} | {pinout.uio[6]} |
| 7 | {pinout.ui[7]} | {pinout.uo[7]} | {pinout.uio[7]} |

### Analog pins

| Int# | Ext# | Description |
| 0 | {analog_pins[0]} | {pinout.ua[0]} |
| 1 | {analog_pins[1]} | {pinout.ua[1]} |
| 2 | {analog_pins[2]} | {pinout.ua[2]} |
| 3 | {analog_pins[3]} | {pinout.ua[3]} |
| 4 | {analog_pins[4]} | {pinout.ua[4]} |
| 5 | {analog_pins[5]} | {pinout.ua[5]} |

### Chip location

{{{{< shuttle-map "{shuttle_id}" "{mux_address}" >}}}}
10 changes: 10 additions & 0 deletions docs/project_preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@
| 5 | {ui[5]} | {uo[5]} | {uio[5]} |
| 6 | {ui[6]} | {uo[6]} | {uio[6]} |
| 7 | {ui[7]} | {uo[7]} | {uio[7]} |

### Analog pins

| Int# | Ext# | Description |
| 0 | ? | {pinout.ua[0]} |
| 1 | ? | {pinout.ua[1]} |
| 2 | ? | {pinout.ua[2]} |
| 3 | ? | {pinout.ua[3]} |
| 4 | ? | {pinout.ua[4]} |
| 5 | ? | {pinout.ua[5]} |
2 changes: 2 additions & 0 deletions documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def write_datasheet(self, markdown_file: str, pdf_file: Optional[str] = None):
yaml_data["user_docs"], f"projects/{project.get_macro_name()}/docs"
)
yaml_data["mux_address"] = project.mux_address
yaml_data["analog_pins"] = (project.analog_pins or ()) + ('?',) * 6

logging.info(f"building datasheet for {project}")

Expand Down Expand Up @@ -180,6 +181,7 @@ def build_hugo_content(self, hugo_root: str) -> None:
os.path.join(project.src_dir, "docs"),
project_image_dir,
)
yaml_data["analog_pins"] = (project.analog_pins or ()) + ('?',) * 6

doc = doc_template.format(**yaml_data)
with open(os.path.join(project_dir, "_index.md"), "w") as pfh:
Expand Down
1 change: 1 addition & 0 deletions project.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Args:
class Project:
top_verilog_filename: str
mux_address: int
analog_pins: tuple[int, ...] | None
commit_id: str
sort_id: int

Expand Down
4 changes: 2 additions & 2 deletions shuttle.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ def configure_mux(self):
range(len(module["analog"]))
), f"analog pins are not contiguous for {module_name}"

project.analog_pins = tuple(module['analog'].values())
if len(module["analog"]) > 0:
project_info["analog_pins"] = list(module["analog"].values())
project_info["analog_pins"] = project.analog_pins

project_index.append(project_info)
mux_index_reverse[module_name] = mux_address
Expand All @@ -123,7 +124,6 @@ def configure_mux(self):
if project.info.top_module not in mux_index_reverse:
logging.error(f"no placement found for {project}!")
exit(1)
project.mux_address = mux_index_reverse[project.info.top_module]

repo = git.Repo(".")

Expand Down

0 comments on commit 8aee901

Please sign in to comment.