{"id":13775197,"url":"https://github.com/growly/bfg","last_synced_at":"2025-04-14T15:30:54.822Z","repository":{"id":45509055,"uuid":"499658756","full_name":"growly/bfg","owner":"growly","description":"An Open-Source Silicon Compiler for Reduced-Complexity Reconfigurable Fabrics","archived":false,"fork":false,"pushed_at":"2024-10-23T22:50:56.000Z","size":38729,"stargazers_count":7,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-25T02:20:57.496Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PureBasic","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/growly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-03T21:40:36.000Z","updated_at":"2024-10-23T22:51:00.000Z","dependencies_parsed_at":"2023-01-30T02:15:54.663Z","dependency_job_id":"4f6013d4-020b-42e6-9793-d47f41e7c23c","html_url":"https://github.com/growly/bfg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growly%2Fbfg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growly%2Fbfg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growly%2Fbfg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/growly%2Fbfg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/growly","download_url":"https://codeload.github.com/growly/bfg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248906381,"owners_count":21181167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:01:35.157Z","updated_at":"2025-04-14T15:30:54.815Z","avatar_url":"https://github.com/growly.png","language":"PureBasic","funding_links":[],"categories":["Accelerators"],"sub_categories":[],"readme":"# BFG\n\nAn Open-Source Silicon Compiler for Reduced-Complexity Reconfigurable Fabrics\n\n## Installation\n\n### Prerequisites\n\nLibraries\n\n#### Debian\n```\n  sudo apt install -y build-essential cmake autoconf automake libtool curl make g++ unzip\n  sudo apt install -y clang ninja-build python3 pkg-config zlib1g-dev\n  # for gRPC\n  sudo apt install -y libre2-dev libc-ares-dev libssl-dev\n```\n\n#### Ubuntu\n```\n  sudo apt install -y build-essential cmake autoconf automake libtool curl \\\n    make g++ unzip clang ninja-build python libre2-dev libc-ares-dev libssl-dev\n```\n\n#### Red Hat\nRed Hat 7 doesn't have a new enough `cmake`. Red Hat 9 doesn't have `ninja` in its `yum` repositories. Nor does it have re2, so you have to build it from source (below).\n\n```\n  sudo yum group install \"Development Tools\"\n  sudo yum install cmake autoconf automake libtool curl make g++ unzip\n  # there is no ninja package for yum :(\n  sudo yum install clang python\n  # for gRPC\n  sudo yum install c-ares-devel\n```\n\nAlso, *very importantly*, RHEL9 doesn't seem to include `/usr/local/lib` as a default linker path, so you have to add it (or set `LD_LIBRARY_PATH`). This breaks proto creation in particular.\n```\ncat \u003c\u003cEOF \u003e /tmp/libc.conf\n/usr/local/lib\nEOF\nsudo mv /tmp/libc.conf /etc/ld.so.conf.d/\nsudo ldconfig\n```\n\n[google/googletest](https://github.com/google/googletest)\n\n  ```\n  git clone git@github.com:google/googletest\n  pushd googletest\n  mkdir build \u0026\u0026 cd build\n  cmake ../\n  make -j $(nproc) \u0026\u0026 sudo make install\n  popd\n  ```\n\n\u003c!---\n[google/tcmalloc](https://github.com/google/tcmalloc)\n  ```\n  git clone git@github.com:google/tcmalloc\n  ?\n  ```\n  ---\u003e\n\n[gperftools/gperftools](https://github.com/gperftools/gperftools)\n  ```\n  git clone git@github.com:gperftools/gperftools\n  pushd gperftools\n  ./autogen.sh\n  ./configure\n  make -j $(nproc) \u0026\u0026 sudo make install\n  popd\n  ```\n\n[gflags/gflags](https://github.com/gflags/gflags/blob/master/INSTALL.md)\n  ```\n  git clone git@github.com:gflags/gflags.git\n  pushd gflags\n  mkdir build \u0026\u0026 cd build\n  cmake .. -DBUILD_SHARED_LIBS=ON\n  make -j $(nproc) \u0026\u0026 sudo make install\n  popd\n  ```\n\n[glog/glog](https://github.com/google/glog)\n\n  ```\n  git clone https://github.com/google/glog.git\n  pushd glog\n  cmake -S . -B build -G \"Unix Makefiles\"\n  cmake --build build\n  sudo cmake --build build --target install\n  popd\n  ```\n\n\u003e [!CAUTION]\n\u003e When I compile and build newer protobuf, Abseil or gRPC libraries I end\n\u003e up in a hellish pit of compilation and/or linker and/or ABI errors that I have\n\u003e not had time to fix. These libraries should all be modernised at the same\n\u003e time(along with any fixes to this code). Contributions welcome!\n\n[abseil/abseil-cpp](https://abseil.io/docs/cpp/quickstart-cmake)\n\n\n  ```\n  git clone git@github.com:abseil/abseil-cpp.git\n  pushd abseil-cpp\n  git checkout 1a31b81c0a467c1c8e229b9fc172a4eb0db5bd85\n  mkdir build \u0026\u0026 cd build\n  cmake -DABSL_RUN_TESTS=ON -DABSL_USE_GOOGLETEST_HEAD=ON -DCMAKE_CXX_STANDARD=17 -DABSL_PROPAGATE_CXX_STD=ON ../\n  make -j $(nproc)\n  sudo make install\n  popd\n  ```\n\n[google/re2](https://github.com/google/re2)\n\n\u003e [!WARNING]\n\u003e You must build RE2 against the Abseil library you just installed in the\n\u003e previous step. Otherwise the wrong version of Abseil might be installed by\n\u003e your package manager as a dependency of libre2, and you will have a nightmare\n\u003e trying to link `bfg` later.\n\n\n```\ngit clone https://github.com/google/re2.git\npushd re2\nmkdir build \u0026\u0026 cd build\ncmake ../\nmake -j $(nproc)\nsudo make install\npopd\n```\n\n[protocolbuffers/protobuf](https://github.com/protocolbuffers/protobuf/tree/master/src)\n\n  ```\n  wget https://github.com/protocolbuffers/protobuf/releases/download/v21.5/protobuf-all-21.5.tar.gz\n  tar xf protobuf-all-21.5.tar.gz\n  pushd protobuf-21.5\n  ./autogen.sh\n  ./configure\n  make -j $(nproc)\n  sudo make install\n  sudo ldconfig # refresh shared library cache.\n  popd\n  ```\n\n[grpc/grpc](https://github.com/grpc/grpc)\n\nWe have to use an old version of gRPC because we use an old version of\nprotobuf.  (Feel free to update both!) There are actually quite a few\ninteresting gRPC build options which we do not explore because I need to\ngraduate, *including* how modern `cmake`s handle dependencies *and* the use of\na `.local` installation for the project instead of the entire system.\n\n  ```\n  wget https://github.com/grpc/grpc/archive/refs/tags/v1.48.1.tar.gz -O grpc-1.48.1.tar.gz\n  tar xf grpc-1.48.1.tar.gz\n  cd grpc-1.48.1\n  mkdir -p cmake/build\n  pushd cmake/build\n  cmake \\\n    -DgRPC_INSTALL=ON \\\n    -DgRPC_BUILD_TESTS=OFF \\\n    -DgRPC_CARES_PROVIDER=package \\\n    -DgRPC_ABSL_PROVIDER=package \\\n    -DgRPC_PROTOBUF_PROVIDER=package \\\n    -DgRPC_RE2_PROVIDER=package \\\n    -DgRPC_SSL_PROVIDER=package \\\n    -DgRPC_ZLIB_PROVIDER=package \\\n    ../..\n  make -j $(nproc)\n  sudo make install\n  popd\n  ```\n\n\u003c!---\n[skia](https://skia.org/user/build#quick)\n\n(You need the [ninja build system](https://ninja-build.org/).) We include skia as a submodule because it was too hard to get to build as a library.\n\n  ```\n  # git clone https://skia.googlesource.com/skia.git\n  git submodule update --init\n  cd skia\n  python2 tools/git-sync-deps\n  bin/gn gen out/Shared --args='is_official_build=true is_component_build=true'\n  bin/gn gen out/Static --args='is_official_build=true'\n  tools/install_dependencies.sh\n  ninja -C out/Shared\n  ninja -C out/Static\n  ```\n---\u003e\n\n## Building\n\n  ```\n  git clone git@github.com:growly/bfg\n  cd bfg\n  git submodule update --init --recursive\n  mkdir build \u0026\u0026 cd build\n  cmake ../\n  make\n  ```\n\n## Making tech protos\n\n```\nprotoc --proto_path=vlsir/ --encode vlsir.tech.Technology vlsir/tech.proto \u003c gf180mcu.technology.pb.txt \u003e gf180mcu.technology.pb\n```\n\n## Testing the router service\n\nUse [`grpcurl`](https://github.com/fullstorydev/grpcurl). `jq` makes the output\npretty (and is optional):\n\n```\ngo install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest\n~/go/bin/grpcurl -plaintext localhost:8222 list\n~/go/bin/grpcurl -plaintext localhost:8222 bfg.router_service.RouterService list\n~/go/bin/grpcurl \\\n    -plaintext \\\n    -d '{ \"predefined_technology\": \"TECHNOLOGY_SKY130\", \"grid_definition\": { \"layers\": [{}, {}] } }' \\\n    localhost:8222 \\\n    bfg.router_service.RouterService/CreateRoutingGrid | jq\n```\n\nA full example of this is in the\n[`router_service_poke.sh`](https://github.com/growly/bfg/blob/f52d23a74e4ed57b72fa4431ee85db1e2a1b450f/router_service_poke.sh)\nscript.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrowly%2Fbfg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrowly%2Fbfg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrowly%2Fbfg/lists"}