Skip to content

Commit

Permalink
Fixed error that happens in HDL templates when 1-bit wide 'reserved' …
Browse files Browse the repository at this point in the history
…field is defined at MSB position
  • Loading branch information
malsheimer authored and esynr3z committed Apr 26, 2023
1 parent 04e697c commit a30b267
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion corsair/templates/regmap_verilog.j2
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ assign {{ sig_csr_rdata(reg) }}{{ range(bf.lsb - 1, tmp.last_bit) }} = {{ zeros(
{% endif %}
{% set tmp.last_bit = bf.msb + 1 %}
{% endfor %}
{% if config['data_width'] - 1 > tmp.last_bit %}
{% if config['data_width'] > tmp.last_bit %}
assign {{ sig_csr_rdata(reg) }}{{ range(config['data_width'] - 1, tmp.last_bit) }} = {{ zeros(config['data_width'] - tmp.last_bit) }};
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion corsair/templates/regmap_vhdl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ begin
{% endif %}
{% set tmp.last_bit = bf.msb + 1 %}
{% endfor %}
{% if config['data_width'] - 1 > tmp.last_bit %}
{% if config['data_width'] > tmp.last_bit %}
{{ sig_csr_rdata(reg) }}{{ range(config['data_width'] - 1, tmp.last_bit) }} <= {{ zeros(config['data_width'] - tmp.last_bit) }};
{% endif %}

Expand Down

0 comments on commit a30b267

Please sign in to comment.