Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7525927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:41:27+00:00 2026-05-30T03:41:27+00:00

I have a data structure (created from a YAML document) that looks like this:

  • 0

I have a data structure (created from a YAML document) that looks like this:

{
    'SD_TX_EN_CFG[5]': {'Bits': {0: 'ENTX // 0 = Disabled, 1 = Enabled'}, 'Name': 'TX Enable Register (Link 5)', 'Offset': 43024},
    'SD_TX_EN_CFG[4]': {'Bits': {0: 'ENTX // 0 = Disabled, 1 = Enabled'}, 'Name': 'TX Enable Register (Link 4)', 'Offset': 40976},
    'SD_RX_EN_CFG[5]': {'Bits': {0: 'ENRX // 0 = Disabled, 1 = Enabled'}, 'Name': 'RX Enable Register (Link 5)', 'Offset': 43008},
    'SD_RX_EN_CFG[3]': {'Bits': {0: 'ENRX // 0 = Disabled, 1 = Enabled'}, 'Name': 'RX Enable Register (Link 3)', 'Offset': 38912},
    'SD_RX_EN_CFG[2]': {'Bits': {0: 'ENRX // 0 = Disabled, 1 = Enabled'}, 'Name': 'RX Enable Register (Link 2)', 'Offset': 36864},
    'SD_RX_EN_CFG[0]': {'Bits': {0: 'ENRX // 0 = Disabled, 1 = Enabled'}, 'Name': 'RX Enable Register (Link 0)', 'Offset': 32768}, 
    'aif2_scratch': {'Offset': 4, 'Bits': {'0-31': 'scratch'}, 'Description': None, 'Name': 'aif2_scratch'},
    'SD_RX_R2_CFG[0]': {'Bits': {'15-16': 'RXLOOPBACK // 00 = Disabled, 11 = Enabled'}, 'Name': 'RX Configuration Register 2 (Link 0)', 'Offset': 32776},
    'aif2_pid': {'Offset': 0, 'Bits': {'6-7': 'Custom version code', '8-10': 'Major revision X code // \n    Should be 1\n', '0-5': 'Minor revision Y code'}, 'Description': None, 'Name': 'aif2_pid'},
    'SD_TX_EN_CFG[1]': {'Bits': {0: 'ENTX // 0 = Disabled, 1 = Enabled'}, 'Name': 'TX Enable Register (Link 1)', 'Offset': 34832},
    'SD_TX_EN_CFG[0]': {'Bits': {0: 'ENTX // 0 = Disabled, 1 = Enabled'}, 'Name': 'TX Enable Register (Link 0)', 'Offset': 32784},
    'SD_RX_EN_CFG[1]': {'Bits': {0: 'ENRX // 0 = Disabled, 1 = Enabled'}, 'Name': 'RX Enable Register (Link 1)', 'Offset': 34816},
    'SD_RX_EN_CFG[4]': {'Bits': {0: 'ENRX // 0 = Disabled, 1 = Enabled'}, 'Name': 'RX Enable Register (Link 4)', 'Offset': 40960},
    'SD_TX_R1_CFG[0]': {'Bits': {'15-16': 'TXLOOPBACK // 00 = Disabled, 11 = Enabled'}, 'Name': 'TX Configuration Register 1 (Link 0)', 'Offset': 32788}, 
    'SD_TX_EN_CFG[2]': {'Bits': {0: 'ENTX // 0 = Disabled, 1 = Enabled'}, 'Name': 'TX Enable Register (Link 2)', 'Offset': 36880},
    'RM_LK_CFG0[0]': {'Bits': {0: 'Short frame mode // 0 = CPRI, 1 = OBSAI', '2-3': 'Link Rate // 0 = 8x, 1 = 4x, 2 = 2x, 3 = 1x', 1: 'Enable RM Link // 0 = Disabled, 1 = Enabled'}, 'Name': 'RM Link Configuration Register 0 (Link 0)', 'Offset': 327680},
    'SD_TX_EN_CFG[3]': {'Bits': {0: 'ENTX // 0 = Disabled, 1 = Enabled'}, 'Name': 'TX Enable Register (Link 3)', 'Offset': 38928}
}

The YAML definition looks like

SD_RX_EN_CFG[0]:
  Name: RX Enable Register (Link 0)
  Offset: 0x8000
  Bits:
    0: ENRX // 0 = Disabled, 1 = Enabled

etc.

I would like to handle each element in the order defined by ‘Offset’ but I can’t seem to manage to do this. I have read and re-read question 72899 but this seems a bit more complicated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T03:41:28+00:00Added an answer on May 30, 2026 at 3:41 am

    Where data is the dict you posted:

    sorted(data.items(), key=lambda i: i[1]['Offset'])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data structure that represents C# code like this: class Namespace: string
If I have a requirement to create a data structure that has the following
I have to write a component that re-creates SQL Server tables (structure and data)
I have a tree data structure that is L levels deep each node has
I have a program that load data from a file using std::ifstream and store
I'm trying to merge two file that have the same structure, and some data
I have a dataset that I read in from a complex xml structure.... here
Apologies in advance for the length of this question! I have a data structure
I have the following data structure returning from a Yahoo API: cbfunc({ query: {
I have created a custom ArrayAdapter to display data within ListView items from an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.