Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pad offset in mcu gen #144

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add pad offset in mcu gen
  • Loading branch information
davideschiavone committed Oct 11, 2022
commit cfbbcb67e7fec69c35890dcbfe826cdf70b2bc48
1 change: 1 addition & 0 deletions mcu_cfg.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
},
gpio: {
num: 32,
num_offset: 0, #first gpio is gpio0
type: inout
},
spi_flash_sck: {
Expand Down
10 changes: 8 additions & 2 deletions util/mcu_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,17 @@ def main():
pad_name = key
pad_num = pads[key]['num']
pad_type = pads[key]['type']
try:
pad_offset = int(pads[key]['num_offset'])
except KeyError:
pad_offset = 0



if pad_num > 1:
for p in range(pad_num):
pad_cell_name = "pad_" + key + "_" + str(p) + "_i"
pad_obj = Pad(pad_name + "_" + str(p), pad_cell_name, pad_type, pad_index_counter)
pad_cell_name = "pad_" + key + "_" + str(p+pad_offset) + "_i"
pad_obj = Pad(pad_name + "_" + str(p+pad_offset), pad_cell_name, pad_type, pad_index_counter)
pad_index_counter = pad_index_counter + 1
pad_list.append(pad_obj)
else:
Expand Down