Jump to content

Use of alternate register


Recommended Posts

Hi,

I'm developing CSR generation tool named RgGen and planing to IP-XACT generation.
https://github.com/rggen/rggen

I'm wondering how to interpret RgGen's CSR description into IP-XACT.
RgGen supports the indirect register type of which accessibility is controlled by other bit fields.
Eexample: 

  register {
    name 'register_11'
    offset_address 0x50
    size [2, 4]
    type [:indirect, 'register_0.bit_field_0', 'register_0.bit_field_1', ['register_0.bit_field_2', 0]]
    # bit assignments: [ 7:0] [23:16] [39:32] [55:48]
    bit_field { name 'bit_field_0'; bit_assignment lsb: 0, width: 8, sequence_size: 4, step: 16; type :rw; initial_value 0 }
    # bit assignments: [15:8] [31:24] [47:40] [63:56]
    bit_field { name 'bit_field_1'; bit_assignment lsb: 8, width: 8, sequence_size: 4, step: 16; type :rw; initial_value 0 }
  }

The register_11 register is an array register and its array size is 2 x 4.
A sub-element of this register is selected by bit fields 'register_0.bit_field_0' and 'register_0.bit_field_1'.
In addition, the 'register_11' can be accessed only when the bit field 'regiter_0.bit_field_2' is 0.

For this case, do I need to use the 'mode' element and 'alternateRegister' element to interpret this kind of regiter?

Regards,
Taichi Ishitani

Link to comment
Share on other sites

Hi Taichi,

Yes, in the latest IP-XACT version 1685-2022, you can use the mode element with sub-element condition and then you can reference that mode in an alternateRegister element.

Indirect registers with indirect addressing are described with an indirectInterface.

Best regards,
Erwin

Link to comment
Share on other sites

Hi Erwin-san,

Thank you for your feedback!

image.thumb.png.2e47fe669809afe08b4032795bcfa1e2.png

From this description, I think only one bit field can be specified as the index field.
So I'm wondering whthier or not an indirect interface can be used for an indirect register which has multiple index fields.

For the above example, the 'regiter_11' register uses 'register_0.bit_field_0' and 'register_0.bit_field_1' bit fields as its index fields.

Regards,
Taichi Ishitani

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...