Origen-SDK / o2

MIT License
4 stars 0 forks source link

General Infrastructure #113

Closed ginty closed 4 years ago

ginty commented 4 years ago

The intention here was to originally start working on the program generator, but it went off on a lot of tangents to add some basic things that were required before I could really get into the prog gen development. This includes:

App Commands

Apps can define commands via config/commands.toml as shown in the example app - https://github.com/Origen-SDK/o2/blob/d1d3567c66f30a18057727767c17a8f878586006/example/config/commands.toml

This exposes a subset of the clap options, though we could extend it to all of them if we want - for now though, I think the current subset should be adequate for 99% of use cases. It also supports sub-commands.

Commands are defined in <app>/commands as shown in these examples - https://github.com/Origen-SDK/o2/tree/d1d3567c66f30a18057727767c17a8f878586006/example/example/commands

Basically just define Python modules named after the command and it must implement a run function where the command line options will be passed in as kwargs. All args will be passed in as a list of strings and it is up to the command to cast them as required.

File Differ

A file differ utility has been added here - https://github.com/Origen-SDK/o2/blob/d1d3567c66f30a18057727767c17a8f878586006/rust/origen/src/utility/differ.rs

It is well documented and tested if anyone wants to use it elsewhere, it supports everything the O1 differ did including optionally ignoring diffs in comments, blanks lines and the ability to suspend/resume diffing whenever a certain character sequence is encountered.

This is fully hooked up to the patgen and an origen save_ref command has been added to update reference files. See here for more details on how this system works - https://github.com/Origen-SDK/o2/blob/d1d3567c66f30a18057727767c17a8f878586006/rust/origen/src/core/reference_files.rs

App Versioning

An application version is now defined by config/version.toml. Rust APIs exist to read and write this, e.g. origen::app().version() - See https://github.com/Origen-SDK/o2/blob/d1d3567c66f30a18057727767c17a8f878586006/rust/origen/src/core/application.rs

The origen -v command now reports the CLI version, Origen version used by Python and the app version when run within an app.

Outside of an app just a single Origen version is reported since the CLI and Origen core version will always be the same in that case.

The object returned by origen.app in Python now has its root base class defined in Rust (same technique used by @coreyeng for the tester.

Tester Changes

DUT Loading

Misc

Prog Gen

There is some early functionality included in this, but will cover that in more detail in a future PR.

In this version the origen g can be executed on the flows in the app directory and the infrastructure is in place to instantiate an interface.

I've probably missed some things, please just ask below if you want an explanation on anything you see that is not covered.

ginty commented 4 years ago

Thanks for the patch @pderouen!