Jump to content
rahuljn

Array of registers

Recommended Posts

Hi Folks

 

I have a scenario where I have 32 identical register which are placed equally spaced in the memory map but there is some unused space beetween them.

For example, register are 32 bit wide and located at 0x0, 0x10, 0x20,.....

Do I need to write all 32 instances speartely in the IP-XACT ?

I see there is a dim element but I think it is for the cases when there is no gaps between successive registers.

Is there a way to write such registers in a compact way in IP-Xact ?

 

Thanks

RahulJn

Share this post


Link to post
Share on other sites

Hi RahulJn,

 

The simplest approach would be to use a registerFile with a single register in it. Set the dim on the register file instead of the register, and then use the 'range' on the registerFile to account for the spacing you need.

 

Thanks,

Mark

Share this post


Link to post
Share on other sites

Hi Rahul,

 

This is how we modelled this scenario:

 

        <spirit:register>
          <spirit:name>REG_A</spirit:name>
          <spirit:addressOffset>0x0</spirit:addressOffset>
          <spirit:size>32</spirit:size>
          <spirit:field>
            <spirit:name>FIELD_A</spirit:name>
            <spirit:bitOffset>0</spirit:bitOffset>
            <spirit:bitWidth>32</spirit:bitWidth>
            <spirit:access>read-write</spirit:access>
          </spirit:field>
          <spirit:vendorExtensions>
            <vendorExtensions:array xmlns:vendorExtensions="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.5">
              <vendorExtensions:x_from>0</vendorExtensions:x_from>
              <vendorExtensions:x_to>31</vendorExtensions:x_to>
              <vendorExtensions:offset_calc>0x0 + ( x * 16 )</vendorExtensions:offset_calc>
            </vendorExtensions:array>
          </spirit:vendorExtensions>

        </spirit:register>
 

vendorExtensions helps us to capture the array of registers inside an existing address space or register file.

 

This approach does not need a new register file inside your address_block.

Share this post


Link to post
Share on other sites

Hi Mark

 

When I model this using register file. I have some schema complaincy error.

In my IP-XACT, can I have a registerFile followed by a register and again followed by a registerFile ?

For example

<spirit:registerFile>

..

</spirit:registerFile>

<spirit:register>

..

</spirit:register>

<spirit:registerFile>

..

</spirit:registerFile>

 

As per the schema, it says we need to put all registers together and followed by all registerFiles together.

 

But I want to keep all registers (including registers within registerFile) in increasing offset order.

Can we do that

 

 

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×