├── .gitignore ├── streamlogic ├── images │ └── monocle-pipeline.png ├── README.md └── pipeline.json ├── README.md └── LICENSE.md /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | synth/impl -------------------------------------------------------------------------------- /streamlogic/images/monocle-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brilliantlabsAR/monocle-fpga/HEAD/streamlogic/images/monocle-pipeline.png -------------------------------------------------------------------------------- /streamlogic/README.md: -------------------------------------------------------------------------------- 1 | # StreamLogic FPGA Pipeline 2 | 3 | This folder contains the StreamLogic source for the Monocle's FPGA pipeline in `pipeline.json`. 4 | 5 | ![Diagam](images/monocle-pipeline.png) 6 | 7 | ## Customization 8 | 9 | To customize the pipeline, download the `pipeline.json` file and load it into the StreamLogic tool using the Import -> File menu option. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Monocle FPGA 2 | 3 | **The pre-built binary and project file is available on the [releases page](https://github.com/brilliantlabsAR/monocle-fpga/releases).** 4 | 5 | If you're using the Brilliant REPL, the FPGA update should be automatically suggested. 6 | 7 | ## Building manually 8 | 9 | This repository contains a [StreamLogic](https://streamlogic.io) generated project designed to run on the Monocle hardware. It can be built using the GoWin EDA, and SteamLogic command line utility. 10 | 11 | If you want to customize your own version, try it out on SteamLogic [here](https://fpga.streamlogic.io/monocle/). 12 | 13 | ### Steps: 14 | 15 | - Download and install the [GoWin EDA](https://www.gowinsemi.com/en/support/home/). 16 | 17 | - Apply for a free (standard edition) licence from the GoWin website. 18 | 19 | - Install the StreamLogic command line utility: 20 | 21 | ```python 22 | pip install sxlogic 23 | ``` 24 | 25 | - Build the project: 26 | 27 | ```sh 28 | python -m sxlogic.monocle build monocle-fpga.tgz 29 | ``` 30 | 31 | - The final `.bin` file can be found inside the folder `monocle-fpga-build/hw/impl/pnr/` 32 | 33 | - Upload the file to your Monocle using the [Brilliant WebREPL](https://repl.brilliant.xyz/). 34 | 35 | --- 36 | 37 | If you're looking to build a totally custom FPGA application. Check out the [`old-rtl`](https://github.com/brilliantlabsAR/monocle-fpga/tree/old-rtl) branch. -------------------------------------------------------------------------------- /streamlogic/pipeline.json: -------------------------------------------------------------------------------- 1 | [{"id":"9fee35a9.8395","type":"FBGraphics","z":"2bf10dd2.d0c3c2","datasize":"8192","name":"","x":219,"y":182,"wires":[["c5ad7ced.783658"]],"wireports":[[0]]},{"id":"d7d3c9be.b322c8","type":"FBOut","z":"2bf10dd2.d0c3c2","u":"Rgb","mode":"2","programmability":0,"name":"","x":219,"y":308,"wires":[["f782fc8c.b846","99113cc9.3552d8"]],"wireports":[[0,0]]},{"id":"2cfa1247.80b056","type":"OLED","z":"2bf10dd2.d0c3c2","name":"","x":219,"y":420,"wires":[],"wireports":[]},{"id":"59cc31b8.b75f58","type":"FBBackground","z":"2bf10dd2.d0c3c2","otype":"Rgb","xres":"640","yres":"400","color":"000000","programmability":0,"name":"","x":219,"y":126,"wires":[["9fee35a9.8395"]],"wireports":[[0]]},{"id":"f782fc8c.b846","type":"ToYuv","z":"2bf10dd2.d0c3c2","u":"Yuv422","name":"","x":219,"y":364,"wires":[["2cfa1247.80b056"]],"wireports":[[0]]},{"id":"c5ad7ced.783658","type":"FBText","z":"2bf10dd2.d0c3c2","datasize":"4096","name":"","x":219,"y":238,"wires":[["d7d3c9be.b322c8"]],"wireports":[[0]]},{"id":"99113cc9.3552d8","type":"Encode","z":"2bf10dd2.d0c3c2","format":"jpg","name":"","x":401,"y":362,"wires":[["65c3bc75.faf674"]],"wireports":[[0]]},{"id":"65c3bc75.faf674","type":"Preview","z":"2bf10dd2.d0c3c2","content":"media","testOnly":true,"name":"","x":401,"y":392,"wires":[],"wireports":[]},{"id":"2c11f62a.e5f06a","type":"ExtConst","z":"2bf10dd2.d0c3c2","regid":"2","hexvalue":"7632332e3233302e30383038","name":"MonocleID","x":877,"y":56,"wires":[],"wireports":[]},{"id":"3381cac5.dd0f76","type":"ExtConst","z":"2bf10dd2.d0c3c2","regid":"1","hexvalue":"4d6e636c","name":"MonocleID","x":653,"y":56,"wires":[],"wireports":[]},{"id":"3c7d4e6e.444582","type":"Mic","z":"2bf10dd2.d0c3c2","gain":"0","mode":"2","programmability":true,"testfile":"s3:///streamlogic/sine440-pure.wav","name":"","x":653,"y":196,"wires":[["a807edf6.0dfd68"]],"wireports":[[0]]},{"id":"a807edf6.0dfd68","type":"AudioBuf","z":"2bf10dd2.d0c3c2","n":"30","programmability":"0","name":"","x":653,"y":266,"wires":[["a257fd1c.35f098"]],"wireports":[[0]]},{"id":"a257fd1c.35f098","type":"ABReadout","z":"2bf10dd2.d0c3c2","fifosize":"120","name":"","x":653,"y":336,"wires":[],"wireports":[]},{"id":"f2556316.474418","type":"OVJpeg","z":"2bf10dd2.d0c3c2","fifosize":"254","name":"","x":877,"y":196,"wires":[],"wireports":[]}] -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | CERN Open Hardware Licence Version 2 - Permissive 2 | 3 | 4 | Preamble 5 | 6 | CERN has developed this licence to promote collaboration among 7 | hardware designers and to provide a legal tool which supports the 8 | freedom to use, study, modify, share and distribute hardware designs 9 | and products based on those designs. Version 2 of the CERN Open 10 | Hardware Licence comes in three variants: this licence, CERN-OHL-P 11 | (permissive); and two reciprocal licences: CERN-OHL-W (weakly 12 | reciprocal) and CERN-OHL-S (strongly reciprocal). 13 | 14 | The CERN-OHL-P is copyright CERN 2020. Anyone is welcome to use it, in 15 | unmodified form only. 16 | 17 | Use of this Licence does not imply any endorsement by CERN of any 18 | Licensor or their designs nor does it imply any involvement by CERN in 19 | their development. 20 | 21 | 22 | 1 Definitions 23 | 24 | 1.1 'Licence' means this CERN-OHL-P. 25 | 26 | 1.2 'Source' means information such as design materials or digital 27 | code which can be applied to Make or test a Product or to 28 | prepare a Product for use, Conveyance or sale, regardless of its 29 | medium or how it is expressed. It may include Notices. 30 | 31 | 1.3 'Covered Source' means Source that is explicitly made available 32 | under this Licence. 33 | 34 | 1.4 'Product' means any device, component, work or physical object, 35 | whether in finished or intermediate form, arising from the use, 36 | application or processing of Covered Source. 37 | 38 | 1.5 'Make' means to create or configure something, whether by 39 | manufacture, assembly, compiling, loading or applying Covered 40 | Source or another Product or otherwise. 41 | 42 | 1.6 'Notice' means copyright, acknowledgement and trademark notices, 43 | references to the location of any Notices, modification notices 44 | (subsection 3.3(b)) and all notices that refer to this Licence 45 | and to the disclaimer of warranties that are included in the 46 | Covered Source. 47 | 48 | 1.7 'Licensee' or 'You' means any person exercising rights under 49 | this Licence. 50 | 51 | 1.8 'Licensor' means a person who creates Source or modifies Covered 52 | Source and subsequently Conveys the resulting Covered Source 53 | under the terms and conditions of this Licence. A person may be 54 | a Licensee and a Licensor at the same time. 55 | 56 | 1.9 'Convey' means to communicate to the public or distribute. 57 | 58 | 59 | 2 Applicability 60 | 61 | 2.1 This Licence governs the use, copying, modification, Conveying 62 | of Covered Source and Products, and the Making of Products. By 63 | exercising any right granted under this Licence, You irrevocably 64 | accept these terms and conditions. 65 | 66 | 2.2 This Licence is granted by the Licensor directly to You, and 67 | shall apply worldwide and without limitation in time. 68 | 69 | 2.3 You shall not attempt to restrict by contract or otherwise the 70 | rights granted under this Licence to other Licensees. 71 | 72 | 2.4 This Licence is not intended to restrict fair use, fair dealing, 73 | or any other similar right. 74 | 75 | 76 | 3 Copying, Modifying and Conveying Covered Source 77 | 78 | 3.1 You may copy and Convey verbatim copies of Covered Source, in 79 | any medium, provided You retain all Notices. 80 | 81 | 3.2 You may modify Covered Source, other than Notices. 82 | 83 | You may only delete Notices if they are no longer applicable to 84 | the corresponding Covered Source as modified by You and You may 85 | add additional Notices applicable to Your modifications. 86 | 87 | 3.3 You may Convey modified Covered Source (with the effect that You 88 | shall also become a Licensor) provided that You: 89 | 90 | a) retain Notices as required in subsection 3.2; and 91 | 92 | b) add a Notice to the modified Covered Source stating that You 93 | have modified it, with the date and brief description of how 94 | You have modified it. 95 | 96 | 3.4 You may Convey Covered Source or modified Covered Source under 97 | licence terms which differ from the terms of this Licence 98 | provided that You: 99 | 100 | a) comply at all times with subsection 3.3; and 101 | 102 | b) provide a copy of this Licence to anyone to whom You 103 | Convey Covered Source or modified Covered Source. 104 | 105 | 106 | 4 Making and Conveying Products 107 | 108 | You may Make Products, and/or Convey them, provided that You ensure 109 | that the recipient of the Product has access to any Notices applicable 110 | to the Product. 111 | 112 | 113 | 5 DISCLAIMER AND LIABILITY 114 | 115 | 5.1 DISCLAIMER OF WARRANTY -- The Covered Source and any Products 116 | are provided 'as is' and any express or implied warranties, 117 | including, but not limited to, implied warranties of 118 | merchantability, of satisfactory quality, non-infringement of 119 | third party rights, and fitness for a particular purpose or use 120 | are disclaimed in respect of any Source or Product to the 121 | maximum extent permitted by law. The Licensor makes no 122 | representation that any Source or Product does not or will not 123 | infringe any patent, copyright, trade secret or other 124 | proprietary right. The entire risk as to the use, quality, and 125 | performance of any Source or Product shall be with You and not 126 | the Licensor. This disclaimer of warranty is an essential part 127 | of this Licence and a condition for the grant of any rights 128 | granted under this Licence. 129 | 130 | 5.2 EXCLUSION AND LIMITATION OF LIABILITY -- The Licensor shall, to 131 | the maximum extent permitted by law, have no liability for 132 | direct, indirect, special, incidental, consequential, exemplary, 133 | punitive or other damages of any character including, without 134 | limitation, procurement of substitute goods or services, loss of 135 | use, data or profits, or business interruption, however caused 136 | and on any theory of contract, warranty, tort (including 137 | negligence), product liability or otherwise, arising in any way 138 | in relation to the Covered Source, modified Covered Source 139 | and/or the Making or Conveyance of a Product, even if advised of 140 | the possibility of such damages, and You shall hold the 141 | Licensor(s) free and harmless from any liability, costs, 142 | damages, fees and expenses, including claims by third parties, 143 | in relation to such use. 144 | 145 | 146 | 6 Patents 147 | 148 | 6.1 Subject to the terms and conditions of this Licence, each 149 | Licensor hereby grants to You a perpetual, worldwide, 150 | non-exclusive, no-charge, royalty-free, irrevocable (except as 151 | stated in this section 6, or where terminated by the Licensor 152 | for cause) patent licence to Make, have Made, use, offer to 153 | sell, sell, import, and otherwise transfer the Covered Source 154 | and Products, where such licence applies only to those patent 155 | claims licensable by such Licensor that are necessarily 156 | infringed by exercising rights under the Covered Source as 157 | Conveyed by that Licensor. 158 | 159 | 6.2 If You institute patent litigation against any entity (including 160 | a cross-claim or counterclaim in a lawsuit) alleging that the 161 | Covered Source or a Product constitutes direct or contributory 162 | patent infringement, or You seek any declaration that a patent 163 | licensed to You under this Licence is invalid or unenforceable 164 | then any rights granted to You under this Licence shall 165 | terminate as of the date such process is initiated. 166 | 167 | 168 | 7 General 169 | 170 | 7.1 If any provisions of this Licence are or subsequently become 171 | invalid or unenforceable for any reason, the remaining 172 | provisions shall remain effective. 173 | 174 | 7.2 You shall not use any of the name (including acronyms and 175 | abbreviations), image, or logo by which the Licensor or CERN is 176 | known, except where needed to comply with section 3, or where 177 | the use is otherwise allowed by law. Any such permitted use 178 | shall be factual and shall not be made so as to suggest any kind 179 | of endorsement or implication of involvement by the Licensor or 180 | its personnel. 181 | 182 | 7.3 CERN may publish updated versions and variants of this Licence 183 | which it considers to be in the spirit of this version, but may 184 | differ in detail to address new problems or concerns. New 185 | versions will be published with a unique version number and a 186 | variant identifier specifying the variant. If the Licensor has 187 | specified that a given variant applies to the Covered Source 188 | without specifying a version, You may treat that Covered Source 189 | as being released under any version of the CERN-OHL with that 190 | variant. If no variant is specified, the Covered Source shall be 191 | treated as being released under CERN-OHL-S. The Licensor may 192 | also specify that the Covered Source is subject to a specific 193 | version of the CERN-OHL or any later version in which case You 194 | may apply this or any later version of CERN-OHL with the same 195 | variant identifier published by CERN. 196 | 197 | 7.4 This Licence shall not be enforceable except by a Licensor 198 | acting as such, and third party beneficiary rights are 199 | specifically excluded. 200 | --------------------------------------------------------------------------------