{"id":28560543,"url":"https://github.com/udxs/ece260c-lab4-starter","last_synced_at":"2026-02-09T06:03:39.540Z","repository":{"id":296295669,"uuid":"992858199","full_name":"UDXS/ece260c-lab4-starter","owner":"UDXS","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-23T19:02:53.000Z","size":9401,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-10T08:17:41.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Tcl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UDXS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-05-29T20:30:58.000Z","updated_at":"2025-06-23T19:02:57.000Z","dependencies_parsed_at":"2025-05-29T23:41:45.751Z","dependency_job_id":null,"html_url":"https://github.com/UDXS/ece260c-lab4-starter","commit_stats":null,"previous_names":["udxs/ece260c-lab4-starter"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/UDXS/ece260c-lab4-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UDXS%2Fece260c-lab4-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UDXS%2Fece260c-lab4-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UDXS%2Fece260c-lab4-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UDXS%2Fece260c-lab4-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UDXS","download_url":"https://codeload.github.com/UDXS/ece260c-lab4-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UDXS%2Fece260c-lab4-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29257766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-06-10T09:37:10.745Z","updated_at":"2026-02-09T06:03:39.523Z","avatar_url":"https://github.com/UDXS.png","language":"Tcl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ECE 260C Lab 4: Modifying \u0026 Extending OpenROAD\n\nThis lab will be completed in GitHub Codespaces. You will not need to make any other submissions.\n\n**Name:** Your Name Here\n**PID:** Your PID Here\n\n## Introduction\n\nIn Lab 2, you worked with the Python APIs to do tasks like placement or swapping masters. In Lab 3, you built a buffer insertion predictor with a [dataset that was generated for you](https://huggingface.co/datasets/udxs/vlsi-simple-buffering) using OpenROAD's Python API. \n\nIn both cases, Python made it possible to write and revise scripts incredibly quickly but this came at the cost of performance, which is a challenge when we want to run more complex algorithms on larger databases. We need to be able to take advantage of the same powerful APIs but without the performance hit. \n\nThanks to the open-source nature of OpenROAD, this is possible. By writing native C++ to interact with the database and OpenROAD's various subsystems, we can get far better performance. \n\nIn this lab, you will build a resizer that detects ERC violations on nets and applies gate upsizing to fix them. These rely on the exact same OpenSTA calls that [OpenROAD's `rsz`](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/rsz) uses. \n\nWith source editing, we can do anything between just writing faster versions of our scripts (with access to more internal data) to implementing whole new subsystems. The resizer we build here, called `ToySizer`, will be added as part of OpenROAD's `dbSta` subsystem - which defines the interface between OpenSTA's data structures and OpenDB. We chose this subsystem exactly because it gives us access to OpenSTA's APIs.\n\nIf you remember from the lecture on Databases and STA, there is a callback-based interplay that connects the database with all the subsystems, notifying them with netlist changes. OpenSTA uses this mechanism to maintain its own timing graph/database that mirrors the entries in OpenDB. Below is a list of some of the terms that OpenSTA uses and their OpenDB equivalents (you may wish to refer to the Databases lecture):\n\n| **OpenSTA** | **OpenDB** |\n|-------------|------------|\n| Network     | Database   |\n| Instance    | dbInst     |\n| LibertyCell | dbMaster   |\n| LibertyPort | dbMTerm    |\n| Pin         | dbITerm    |\n\nYou will be editing `ToySizer.cc` to complete the implementation of all the functions required for resizing. Broadly, for each instance, you will get max slew/capacitance information for its master. Using that data, you will determine if the instance is undersized. If so, you will upsize it to the next largest drive strength. This is a simple, imperfect algorithm but it will deliver interesting results. The real `rsz` implements more complex cost functions for determining the required drive strength against size, alongside buffer insertion or even full gate cloning.\n\n\nReady? Continue to the instructions below.\n\n\n## Working on and Submitting this Lab\n\nThis lab is running in a new remote container on GitHub Codespaces. This introduces a new way to work on and turn in your code. Here's the process:\n\n1. First, allow Codespaces to build the container. This can take a few minutes.\n2. Create a new Terminal at the bottom (you may need to click the + button). Please ensure you do not create multiple. **Do this only after the `Building codespace...` popup disappears.**\n3. The first time you do this, it may take a few minutes to start as it unpacks the OpenROAD sources.\n4. Afterwards, with an open interactive terminal (you'll see the `ece 260c` logo), you can type `make open` to load the lab and open the workspace. You will find the `sta/` and `dbSta/` folders in the sidebar and the `ToySizer.cc`/`ToySizer.hh` files open. You may need to call `make open` twice if they don't appear the first time.\n5. After reading the introduction above, you can complete `ToySizer.cc` (it will be opened for you). Remember to save your work.\n6. When you're ready, try building with `make build`. Here, you can resolve build errors.\n7. When your code builds successfully, you can run `make test`. The test script will give the results of your program alongside some expected value ranges.\n8. When you're done, run `make turnin`. This will run testing one more time and then automatically turn in your code changes and your test results.\n9. Re-open your lab repo and make sure there's a commit labled `Turn-in` present. You should also check to make sure that `turnin.patch` or the files in `results/` are not empty.\n\n### Tips \u0026 Notes\n    \n- **You should NOT call Git commands yourself for this lab.**\n- You can find `ToySizer.cc` in `dbSta/src/ToySizer.cc`\n- You can find `ToySizer.hh` in `dbSta/include/db_sta/ToySizer.hh`. This is a header file that defines the functions you will need to implement in `ToySizer.cc`. You shouldn't edit this – it should be used as a reference.\n- You shouldn't need to edit any files outside of `ToySizer.cc`\n- If you are interested in seeing how the custom commands are implemented, check out `dbSta.i` and `dbSta.tcl` in `dbSta/src`. You do not need to edit these.\n- You can do `make run` to open an interactive OpenROAD shell with our custom commands `toy_resize` and `toy_count_undersized`. This isn't necessary to complete the lab.\n- The `sta/` folder is available in the sidebar as a reference for STA's data types.\n\n\nYou can always reopen this codespace by clicking the button at the top of this README or by pressing `,` on your keyboard on the repo page.\n\n\n--- \n\nCreated by Davit Markarian.\n\\\nCopyright \u0026copy; 2025 The Regents of the University of California. Do not redistribute. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudxs%2Fece260c-lab4-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudxs%2Fece260c-lab4-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudxs%2Fece260c-lab4-starter/lists"}