Skip to content

The object structure generator prototype #354

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AleksandrDanilovIntel
Copy link

@AleksandrDanilovIntel AleksandrDanilovIntel commented Feb 28, 2025

Generates the internal object structure (objects, configuration attributes, input and output interfaces) in JSON format for later use in CLI commands and Blueprints.

attaching the output format
test-cmn-700-dml.json

It's easy to extend the number of JSON parameters by adding an optional object parameter in DML code.

template impl_connect {
    interface memory_space;
    interface signal {
        param required = false;
    }
    interface map_demap {
        param required = false;
    }
}
    if node.get_component('required') != None and param_defined(node, 'required'):
        d['required'] = param_bool(node, 'required')
  "connect": [
    {
      "name": "QWERTY",
      "desc": "BBB",
      "interfaces": [
        {
          "name": "map_demap_interface",
          "required": true
        }  
      ]
    },
    { 
      "name": "map_connected",
      "desc": "CCC",
      "interfaces": [
        {
          "name": "map_demap_interface",
          "required": false
        },
        { 
          "name": "memory_space_interface",
          "required": true
        },
        { 
          "name": "signal_interface",
          "required": false
        }
      ]
    }
  ],

Copy link
Contributor

@jhbaarnh jhbaarnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could tag this with the JIRAs SIMICS-22377 and/or SIMICS-22497

I think it is a good idea, not sure which data we need to store though.

@AleksandrDanilovIntel
Copy link
Author

You could tag this with the JIRAs SIMICS-22377 and/or SIMICS-22497

I think it is a good idea, not sure which data we need to store though.

We can create a well known list of parameters and give a user list as an option.

@peternystrom-intel
Copy link

I see how this information can be useful but it is quite a gap from generating this file to having it accessible to a user or component/blueprint designer from cli.
If we should go down this route the C++ Api will probably need something similar.

@AleksandrDanilovIntel
Copy link
Author

I see how this information can be useful but it is quite a gap from generating this file to having it accessible to a user or component/blueprint designer from cli. If we should go down this route the C++ Api will probably need something similar.

The next step is to generate module_load.py files and add extra info commands each registered class.
Which will be automatically piked up by framework. And user will be able to see the object structure in DML terms.
Henrik suggested adding cli_name to each object in the JSON file for easier matching. It also solves the problem of conversion of the DML types into the framework primitives.
It seems to me that the C++ types are different and it would be better to display it as is. And the cli_name approach works well with C++.

@AleksandrDanilovIntel
Copy link
Author

I moved all parameter names into a config file. Now it's much more flexible.
Adding one more example
test-subdev-dml.json

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

Successfully merging this pull request may close these issues.

3 participants