Skip to content

Is there one default offset of one sub addrmap? #175

Closed Answered by amykyta3
peidongbin asked this question in Q&A
Discussion options

You must be logged in to vote

The default address packing behavior is to align objects to offsets based on their size, rounded up to the next power-of-two. Therefore the sub1 instance is allocated to an address of 0x200.
If you want tight packing, you can use the addressing = compact; property.
Also, in your example there is no need to use Perl preprocessing. Instead you can use an array of registers:

addrmap sub_map0{
    default regwidth = 32;
    reg {
        field {} a[5];
    } myreg[76];
};
addrmap sub_map1{
    default regwidth = 32;
    reg {
        field {} a[5];
    } myreg[76];
};
addrmap top{
    addressing = compact;
    sub_map0 sub0;
    sub_map1 sub1;
};

Alternatively, you can assign the addresses e…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@peidongbin
Comment options

Answer selected by peidongbin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants