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

[iob_soc] removed [width-1:0] in for width=1 #640

Merged
merged 1 commit into from
Nov 15, 2023
Merged
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
23 changes: 17 additions & 6 deletions scripts/iob_soc_create_wrapper_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,23 @@ def create_wrapper_files(build_dir, name, ios, confs, num_extmem_connections):
if pio_signals and "if_defined" in table.keys():
pwires_str += f"`ifdef {table['if_defined']}\n"
for signal in pio_signals:
pwires_str += " wire [{}-1:0] {};\n".format(
add_prefix_to_parameters_in_string(
signal["n_bits"], confs, "`" + name.upper() + "_"
),
signal["name"],
)
# check if n_bits (a string) is only an integer or a parameter
if signal["n_bits"].isdigit():
n_bits = int(signal["n_bits"])
# If n_bits is 1, do not add [0:0] to the wire
if n_bits == 1:
pwires_str += " wire {};\n".format(signal["name"])
else :
pwires_str += " wire [{}-1:0] {};\n".format(
n_bits, signal["name"]
)
else:
pwires_str += " wire [{}-1:0] {};\n".format(
add_prefix_to_parameters_in_string(
signal["n_bits"], confs, "`" + name.upper() + "_"
),
signal["name"],
)
if pio_signals and "if_defined" in table.keys():
pwires_str += "`endif\n"

Expand Down