Origen-SDK / o2

MIT License
4 stars 0 forks source link

New proj command and various infrastructure updates #108

Closed ginty closed 4 years ago

ginty commented 4 years ago

Sorry about the size of this, another update that should have been fairly self-contained but which ended up requiring a lot of tangential infrastructure...

This adds a new global Origen command called origen proj which is for creating workspaces/views of a project comprised of multiple packages which can each be pulled from Git, DesignSync, a symlink, or a tarball and potentially other revision control tools in future.

Potential applications include things like building a test program directory from a collection of sub-blocks. The features of the command are likely to continue to evolve for a while as driven by use cases.

I held off documenting it until the doc system is available, but I'll demo at the core team this week and in a nutshell:

origen proj init   # Initialize a new project area with a bill of materials (BOM) file
origen proj create my_workspace   # Create a new workspace/view of the project BOM
cd my_workspace
origen proj update # Update the workspace per the latest BOM
origen proj bom    # View the workspace BOM which is the combination of the wsp and project BOMs

To enable this command quite a lot of basic infrastructure has been added and/or improved:

Macros

fn some_func(x: i32) -> origen::Result<()> {
  if x < 10 {
    // Equivalent code
    Err(origen::Error::new(&format!("Something is wrong, x is {}", x)))
  } else {
    // Note that this doesn't generate a 'return', that's still required where applicable
    error!("Something is wrong, x is {}", x)
  }
}

Logger

User Model

Revision Control API

Utilities

General Points of Interest

When writing this README I learned that if you type y when looking a file in Github it turns the url into a permalink, good for links in PRs like this!

I think there might be some conflict with #107 due to some of the file moves in here, but I'll take care of that once that is merged.

priyavadan commented 4 years ago

a lot of good work on this PR @ginty , I am reviewing the changes you have made , primarily to increase my understanding of rust.

ginty commented 4 years ago

@coreyeng, any objection to merging this?

I've built my prog gen branch on top-of this and would like to open a PR for that soon to handle it in manageable pieces rather than dumping a huge change at the end.

coreyeng commented 4 years ago

Ah, sorry. I didn't have a chance to look at it when it was first opened and its slipped my mind since.

Nope, no objection from me! Looks good!