Giter Site home page Giter Site logo

odb-pp-parser's Introduction

odb++ parser

Build Status

Parses odb++ files to give a human readable JSON representation of a board layer. Currently only parses features and netlist files.

Built against the ODB++ Format Specification Version 8.1 (Sept. 2015), available here: http://www.odb-sa.com/resources/

Getting started

You'll need Ruby 2.0+. Install dependencies:

bundle install

Output will be sent to stdout

Parsing the board

To parse the board:

ruby main.rb layer sample/features sample/netlist sample/components
{
  "nets": [],
  "components": [],
  "pads": []
}

Parsing features

To parse the sample/features file:

ruby main.rb features sample/features
{
  "pads": [
    {
      "id": "209",
      "symbol": {
        "type": "round",
        "diameter": "55"
      },
      "x": "1.59",
      "y": "0.1"
    },
    {
      "id": "312",
      "symbol": {
        "type": "oval",
        "width": "24",
        "height": "74"
      },
      "x": "1.64",
      "y": "0.66"
    },
    {
      "id": "346",
      "symbol": {
        "type": "square",
        "side": "70"
      },
      "x": "0.25425295",
      "y": "0.69755837"
    }
  ]
}

Parsing netlist

To parse the sample/netlist file:

ruby main.rb netlist sample/netlist
{
  "nets": [
    {
      "name": "GND",
      "points": [
        {
          "x": "1.72",
          "y": "0.56"
        },
        {
          "x": "1.14",
          "y": "0.41"
        },
        {
          "x": "1.59",
          "y": "0.1"
        },
        {
          "x": "1.64",
          "y": "0.56"
        },
        {
          "x": "1.64",
          "y": "0.51"
        },
        {
          "x": "0.2552531",
          "y": "0.2975584"
        },
        {
          "x": "1.2197234",
          "y": "0.4059187"
        },
        {
          "x": "1.5294807",
          "y": "0.1026173"
        }
      ]
    }
  ]
}

Parsing layer

This includes net information for each pad:

To parse the layer:

ruby main.rb layer sample/features sample/netlist
{
  "pads": [
    {
      "id": "90",
      "symbol": {
        "type": "round",
        "diameter": 55.0
      },
      "x": 1.94,
      "y": 0.36,
      "net": "+5V"
    },
    {
      "id": "96",
      "symbol": {
        "type": "round",
        "diameter": 55.0
      },
      "x": 1.52,
      "y": 0.56,
      "net": "+5V"
    },
    {
      "id": "100",
      "symbol": {
        "type": "round",
        "diameter": 55.0
      },
      "x": 1.41,
      "y": 0.1,
      "net": "+5V"
    }
  ]
}

Running tests

To run tests:

rspec

Abilities

Currently it can identify these entities:

Standard symbols

  • round
  • square
  • rectangle
  • oval

Features

  • pads
  • lines

Nets

  • net_name
  • serial_num

Net points

  • net_num
  • radius
  • x
  • y
  • side
  • w (optional)
  • h (optional)
  • epoint
  • exp

Components

  • CMP records (components)
  • PRP records (properties)
  • TOP records (toeprints)

odb-pp-parser's People

Contributors

capablemonkey avatar

Stargazers

 avatar KINGLOO avatar HaiwenZhang avatar  avatar George avatar cl4p-tp avatar Cody Krieger avatar Chris Wilson avatar Chintan Pandya avatar  avatar  avatar wsarsenic avatar Malcolm Mackay avatar Billo Diallo avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

odb-pp-parser's Issues

Fix 'e' values on the diameters of some pads

Some pads have a value of 'e' instead of a number for the diameter of the round shape.

If it's a variable or constant, I think we should decisively assign it a value, just to make things simple for now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.