|
1 | | -# GF130 Test Chip Repo |
| 1 | +# Chipflow Examples |
| 2 | + |
| 3 | +## Install Requirements |
| 4 | + * Install the latest version of Python installed [Python Downloads](https://www.python.org/downloads/). |
| 5 | + * Ensure you have git command line tools installed [Git Downloads](https://git-scm.com/downloads). |
| 6 | + * We reccomend VS Code as a development environment [VSCode Downloads](https://code.visualstudio.com/download). |
| 7 | + * Github Desktop is a great tool for cloning git repos [Github Desktop Downloads](https://desktop.github.com/download/) |
| 8 | + |
| 9 | +## Clone this repository |
| 10 | +If you're familiar withi the [git](https://git-scm.com/) command line then you'll know what to do, otherwise install [GitHub Desktop](https://github.com/apps/desktop). Once its installed, lauch it. You will be asked to sign in or create an account - we reccomend you take this moment to create a GitHub account if you don't already have one. |
| 11 | + |
| 12 | +Come back to [this page](https://github.com/ChipFlow/chipflow-examples) and click the green 'Code' button at the top. Select 'Open with Github Desktop' and follow the prompts. Once Github Desktop has cloned your repo you can click the button to open it in VSCode. |
| 13 | + |
| 14 | +## Install the dependancies |
| 15 | +In VScode, open up a terminal from the title menu bar, or using a terminal of your choice. |
| 16 | + |
| 17 | +We use [PDM](https://pdm-project.org) to manage our dependancies, so this will need to be installed. Follow the [PDM install instructions](https://pdm-project.org/en/latest/#installation) |
| 18 | + |
| 19 | +Once PDM is installed, make sure your in the `chipflow-examples` directory and then run: |
| 20 | +``` |
| 21 | +pdm lock -d |
| 22 | +pdm install |
| 23 | +``` |
| 24 | + |
| 25 | +## Set up the environment |
| 26 | +Generate your API key at https://build-staging.chipflow.org/user/detail |
| 27 | + |
| 28 | +Create a file called `.env` at the top level in the `chipflow-examples` directory, containing the line below, subsituting your key from the page above: |
| 29 | + |
| 30 | +``` |
| 31 | +CHIPFLOW_API_KEY=<Paste your key here> |
| 32 | +``` |
| 33 | + |
| 34 | +## Running ChipFlow |
| 35 | + |
| 36 | +First choose a design to test. Here we will use the `minimal` design. |
| 37 | + |
| 38 | +Change into the `minimal` directory in `chipflow-examples` to use this design. Now we need to 'lock' our pins - the chipflow tooling will then automatically allocate inputs and outputs from your design to pins on the chip. |
| 39 | + |
| 40 | +``` |
| 41 | +pdm run chipflow pin lock |
| 42 | +``` |
| 43 | + |
| 44 | +We can now simulate and test the design by running: |
| 45 | +``` |
| 46 | +make sim-check |
| 47 | +``` |
| 48 | + |
| 49 | +You should see the simulation model being built and run - and a small test firmware running on the simulated System-on-a-Chip (aided by our local friendly cat!) |
| 50 | + |
| 51 | +``` |
| 52 | +pdm run chipflow sim |
| 53 | +-- build_sim_cxxrtl |
| 54 | +-- build_sim |
| 55 | +pdm run chipflow software |
| 56 | +-- gather_depencencies |
| 57 | +-- build_software_elf |
| 58 | +-- build_software |
| 59 | +cd build/sim && ./sim_soc |
| 60 | +🐱: nyaa~! |
| 61 | +SoC type: CA7F100F |
| 62 | +Flash ID: CA7CA7FF |
| 63 | +Quad mode |
| 64 | +pdm run json-compare design/tests/events_reference.json build/sim/events.json |
| 65 | +Event logs are identical |
| 66 | +``` |
| 67 | + |
| 68 | +Now you are ready to try building this design into a chip! To submit your design to ChipFlow Platform where it will be built into GDS, run: |
| 69 | + |
| 70 | +``` |
| 71 | +pdm run chipflow silicon submit |
| 72 | +
|
| 73 | +``` |
| 74 | +This should return something like: |
| 75 | +``` |
| 76 | +INFO:chipflow_lib.steps.silicon:Submitting c23dab6-dirty for project chipflow-examples-minimal |
| 77 | +INFO:chipflow_lib.steps.silicon:Submitted design: {'build_id': '3f51a69c-b3e3-4fd3-88fd-52826ac5e5dd'} |
| 78 | +Design submitted successfully! Build URL: https://build-staging.chipflow.org//build/3f51a69c-b3e3-4fd3-88fd-52826ac5e5dd |
| 79 | +``` |
| 80 | + |
| 81 | +Your design will now start building: pictures and logs of the build are available at build URL that is returned, once it is complete. |
| 82 | + |
| 83 | +If you would like to get the build logs streamed to your commandline, you can instead call: |
| 84 | +``` |
| 85 | +pdm run chipflow silicon submit --wait |
| 86 | +``` |
2 | 87 |
|
3 | | -## VS Code debugger |
4 | 88 |
|
5 | | -* Download the [latest VSIX package](https://github.com/ChipFlow/rtl-debugger/releases/tag/latest) for the extension. |
6 | | -* Install it (eg `code --install-extension ../rtl-debugger-0.0.0.vsix` or right-click in explorer pane and select "Install VSIX"). |
7 | | -* `Shift+Ctrl+P` "RTL Debugger: Start Session" |
8 | | -* `Shift+Ctrl+P` "RTL Debugger: Run Simulation Until..." "10ms" |
9 | | -* `Shift+Ctrl+P` "RTL Debugger: Go to Time..." "10ms" |
|
0 commit comments