Skip to content

Commit

Permalink
Merge pull request #640 from AndreMerendeira/main
Browse files Browse the repository at this point in the history
[iob_soc] removed [width-1:0] in for width=1
  • Loading branch information
jjts authored Nov 15, 2023
2 parents 9ff7410 + 2a723d9 commit edb27ba
Showing 1 changed file with 17 additions and 6 deletions.
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

0 comments on commit edb27ba

Please sign in to comment.