Skip to content

A reinforcement learning environment for PCB routing.

License

Notifications You must be signed in to change notification settings

chrisbmr/PCBEnv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PCBEnv2: Printed Circuit Board Machine Learning Environment

Usage

See the API documentation, as well as pcbenv/playground.py and pcbenv/tests/ for examples.

Example Boards

Run pcbenv/data/boards/download.py to auto-fetch some boards for testing.

UI Controls

  • Hold right mouse button to scroll
  • Left click on pins to select a connection
  • Left click on a pin of the selected connection to reverse the order
  • Hold Ctrl to rectangle-select (for Autoroute and Unroute Selection)
  • Hold Alt to add to rectangle selection
  • Click Shift to activate manual routing tool

Installation (Linux)

  1. Check dependencies section.
  2. git clone https://github.com/chrisbmr/PCBEnv.git
  3. cd PCBEnv
  4. pip install .

Non-installation (Linux)

  1. cd PCBEnv/pcbenv/cxx
  2. mkdir build
  3. cd build
  4. cmake ../ -DENABLE_UI=[1|0]
  5. make -j$(nproc) install
  6. run your python scripts from the pcbenv directory with PYTHONPATH=$PYTHONPATH:/path/to/PCBEnv

Dependencies

Most of them (with the exception of CGAL) are hopefully already installed [on a development machine] or are fetched automatically by cmake. Only Python, Qt (optional), and SWIG are not fetched automatically.

Necessary:

  • Python with C headers
  • CGAL (Computational Geometry Algorithms C++ header library)
  • rapidjson (C++ header library)
  • swig (C++/Python interface generator)

Required by CGAL:

  • boost (Boost C++ header libraries >= 1.74) Can be used by CGAL but are disabled by default:
  • gmp (The GNU MP Bignum Library)
  • mpfr (GNU multiple-precision floating-point computations)

For the user interface (if enabled):

  • Qt6 with C++ headers
  • OpenGL headers

NOTE: CGAL and Qt are free for academic and open source users, so if you read anything about getting a license: no, click elsewhere.

Install with, for example: pacman -S cgal swig rapidjson qt6-base qt6-tools

Fallback on Linux

If you don't have root access and something has failed to install so far, please consider building manually.

For example, do ./configure --prefix=/your/home/... and edit CMakeLists.txt to look there by uncommenting the obvious bits at the top. There is a python script to do this in the Dependencies folder but you really shouldn't need to.

Directory structure

  • cxx/ C++ code (see code documentation for an overview).
  • data/ Example boards, settings file, JSON schemas, UI resources.
  • util/ Python class for the PCB JSON format and JSON to SVG converter.

About

A reinforcement learning environment for PCB routing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published