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

Software-writable field spanning multiple words should cause error message (accesswidth/regwidth problem) #178

Open
kjeldbeg opened this issue Jun 13, 2023 · 1 comment

Comments

@kjeldbeg
Copy link

Here is my example:

addrmap mymap_t {
  reg {
    accesswidth = 32;
    regwidth = 64;
    field {
      sw = rw;
      hw = r;
    } myfield[40];
  } myreg;
};

I expected it would fail to compile as the field is software writable and requires two accesses. As stated in the SystemRDL 2.0 spec. 10.6.1f:

  1. Any field that is software-writable or clear on read shall not span multiple software accessible sub-words (e.g., a 64-bit register with a 32-bit access width may not have a writable field with bits in both the upper and lower half of the register).

Is this check missing in the compiler?

@kjeldbeg kjeldbeg changed the title Software-writable field spanning multiple words should cause error message Software-writable field spanning multiple words should cause error message (accesswidth/regwidth problem) Jun 13, 2023
@jeras
Copy link

jeras commented Nov 17, 2023

This seems an impractical requirement in the standard. The most common use case, where you would be in violation of the rule is having a 32-bit system bus and 64-bit counters timers. Writing the 64-bit register as a pair of HI/LO 32-bit registers is rather common, but it would also reduce practicality. In generated HDL code it would be nice to have 64 bit vectors without hand written glue logic, and in generated SW code it would be nice to be able to tell a 64-bit CPU, it can use 64-bit load/store operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants