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

[bug] external register type seems to not be working #207

Closed
SzymonHitachi opened this issue May 10, 2024 · 4 comments · Fixed by rggen/rggen-vhdl-rtl#5
Closed

[bug] external register type seems to not be working #207

SzymonHitachi opened this issue May 10, 2024 · 4 comments · Fixed by rggen/rggen-vhdl-rtl#5
Assignees
Labels
bug Something isn't working

Comments

@SzymonHitachi
Copy link

It seems that external registers mode does not work

Fatal: (vsim-3420) Array lengths do not match. Left is 11 (10 downto 0). Right is 12 (11 downto 0).
#    Time: 473200 ps  Iteration: 1  Process: csr_i/g_DATA/u_register/line__119 File: rggen/rggen_external_register.vhd
# Fatal error in Process line__119 at rggen/rggen_external_register.vhd line 47

failing line:

address := std_logic_vector(unsigned(register_address) - START_ADDRESS);

external register is defined with offset 0x10 (determined byregisters existing before it)
image

version:

$ rggen --plugin rggen-vhdl --verbose-version
RgGen 0.33
  - rggen-core 0.33.0
  - rggen-default-register-map 0.33.0
  - rggen-sv-rtl 0.33.0
  - rggen-sv-ral 0.33.0
  - rggen-c-header 0.5.0
  - rggen-markdown 0.26.0
  - rggen-spreadsheet-loader 0.25.2
  - rggen-vhdl 0.10.0
@SzymonHitachi SzymonHitachi changed the title [external] register type seems to not be working [bug] external register type seems to not be working May 10, 2024
@SzymonHitachi
Copy link
Author

Issue occurs because instantiation of rggen_external_register in the autogenerated code

    u_register: entity work.rggen_external_register
      generic map (
        ADDRESS_WIDTH => 11,
        BUS_WIDTH     => 32,
        STROBE_WIDTH  => DATA_STROBE_WIDTH,
        START_ADDRESS => x"010",
        BYTE_SIZE     => 1024
      )

doesn't provide the size of string, thus it's by default expanded to 12 in START_ADDRESS

    u_register: entity work.rggen_external_register
      generic map (
        ADDRESS_WIDTH => 11,
        BUS_WIDTH     => 32,
        STROBE_WIDTH  => DATA_STROBE_WIDTH,
        START_ADDRESS => 11x"010",
        BYTE_SIZE     => 1024
      )

Specifying the actual size represented by string START_ADDRESS => 11x"010", fixes the issue.

taichi-ishitani added a commit to rggen/rggen-vhdl-rtl that referenced this issue May 10, 2024
@taichi-ishitani
Copy link
Member

Hi @SzymonHitachi ,
Thank you for your reporting this issue.

I've pushed the fix for this error to the branch below.
https://github.com/rggen/rggen-vhdl-rtl/tree/fix_width_mismatch
Can you checkout this branch and confirm this error is resolved?

@taichi-ishitani taichi-ishitani added the bug Something isn't working label May 10, 2024
@taichi-ishitani taichi-ishitani self-assigned this May 10, 2024
@taichi-ishitani
Copy link
Member

Hi @SzymonHitachi ,
Does this change resolve your issue?

@SzymonHitachi
Copy link
Author

SzymonHitachi commented May 22, 2024

Hi @SzymonHitachi , Does this change resolve your issue?

I apologize for late response. It did indeed slip my mind. Yes this one fixes the issue. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants