1 # Resources and Specifications
3 This page aims to collect all the resources and specifications we need
4 in one place for quick access. We will try our best to keep links here
5 up-to-date. Feel free to add more links here.
11 This section is primarily a series of useful links found online
13 * [FSiC2019](https://wiki.f-si.org/index.php/FSiC2019)
14 * Fundamentals to learn to get started [[3d_gpu/tutorial]]
16 ## Is Open Source Hardware Profitable?
17 [RaptorCS on FOSS Hardware Interview](https://www.youtube.com/watch?v=o5Ihqg72T3c&feature=youtu.be)
21 * [3.0 PDF](https://openpowerfoundation.org/?resource_lib=power-isa-version-3-0)
22 * [2.07 PDF](https://openpowerfoundation.org/?resource_lib=ibm-power-isa-version-2-07-b)
24 ## Overview of the user ISA:
26 [Raymond Chen's PowerPC series](https://devblogs.microsoft.com/oldnewthing/20180806-00/?p=99425)
28 # RISC-V Instruction Set Architecture
30 **PLEASE UPDATE** - we are no longer implementing full RISCV, only user-space
33 The Libre RISC-V Project is building a hybrid CPU/GPU SoC. As the name
34 of the project implies, we will be following the RISC-V ISA I due to it
35 being open-source and also because of the huge software and hardware
36 ecosystem building around it. There are other open-source ISAs but none
37 of them have the same momentum and energy behind it as RISC-V.
39 To fully take advantage of the RISC-V ecosystem, it is important to be
40 compliant with the RISC-V standards. Doing so will allow us to to reuse
41 most software as-is and avoid major forks.
43 * [Official compiled PDFs of RISC-V ISA Manual]
44 (https://github.com/riscv/riscv-isa-manual/releases/latest)
45 * [Working draft of the proposed RISC-V Bitmanipulation extension](https://github.com/riscv/riscv-bitmanip/blob/master/bitmanip-draft.pdf)
46 * [RISC-V "V" Vector Extension](https://riscv.github.io/documents/riscv-v-spec/)
47 * [RISC-V Supervisor Binary Interface Specification](https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.md)
49 Note: As far as I know, we aren't using the RISC-V V Extension directly
50 at the moment. However, there are many wiki pages that make a reference
51 to the V extension so it would be good to include it here as a reference
52 for comparative/informative purposes with regard to Simple-V.
55 - [Qemu emulation](https://github.com/qemu/qemu/commit/d5fee0bbe68d5e61e2d2beb5ff6de0b9c1cfd182)
58 # RTL Arithmetic SQRT, FPU etc.
61 * [Fast Floating Point Square Root](https://pdfs.semanticscholar.org/5060/4e9aff0e37089c4ab9a376c3f35761ffe28b.pdf)
62 * [Reciprocal Square Root Algorithm](http://www.acsel-lab.com/arithmetic/arith15/papers/ARITH15_Takagi.pdf)
64 ## CORDIC and related algorithms
66 * <https://bugs.libre-soc.org/show_bug.cgi?id=127> research into CORDIC
67 * <https://bugs.libre-soc.org/show_bug.cgi?id=208>
68 * [BKM (log(x) and e^x)](https://en.wikipedia.org/wiki/BKM_algorithm)
69 * [CORDIC](http://www.andraka.com/files/crdcsrvy.pdf)
70 - Does not have an easy way of computing tan(x)
71 * [zipcpu CORDIC](https://zipcpu.com/dsp/2017/08/30/cordic.html)
72 * [Low latency and Low error floating point TCORDIC](https://ieeexplore.ieee.org/document/7784797) (email Michael or Cole if you don't have IEEE access)
73 * <http://www.myhdl.org/docs/examples/sinecomp/> MyHDL version of CORDIC
75 ## IEEE Standard for Floating-Point Arithmetic (IEEE 754)
77 Almost all modern computers follow the IEEE Floating-Point Standard. Of
78 course, we will follow it as well for interoperability.
80 * IEEE 754-2019: <https://standards.ieee.org/standard/754-2019.html>
82 Note: Even though this is such an important standard used by everyone,
83 it is unfortunately not freely available and requires a payment to
84 access. However, each of the Libre RISC-V members already have access
87 ## Past FPU Mistakes to learn from
89 * [Intel Underestimates Error Bounds by 1.3 quintillion on
90 Random ASCII – tech blog of Bruce Dawson ](https://randomascii.wordpress.com/2014/10/09/intel-underestimates-error-bounds-by-1-3-quintillion/)
91 * [Intel overstates FPU accuracy 06/01/2013](http://notabs.org/fpuaccuracy)
95 The Khronos Group creates open standards for authoring and acceleration
96 of graphics, media, and computation. It is a requirement for our hybrid
97 CPU/GPU to be compliant with these standards *as well* as with IEEE754,
98 in order to be commercially-competitive in both areas: especially Vulkan
99 and OpenCL being the most important. SPIR-V is also important for the
102 Thus the [[zfpacc_proposal]] has been created which permits runtime dynamic
103 switching between different accuracy levels, in userspace applications.
105 [**SPIR-V Main Page Link**](https://www.khronos.org/registry/spir-v/)
107 * [SPIR-V 1.5 Specification Revision 1](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html)
108 * [SPIR-V OpenCL Extended Instruction Set](https://www.khronos.org/registry/spir-v/specs/unified1/OpenCL.ExtendedInstructionSet.100.html)
109 * [SPIR-V GLSL Extended Instruction Set](https://www.khronos.org/registry/spir-v/specs/unified1/GLSL.std.450.html)
111 [**Vulkan Main Page Link**](https://www.khronos.org/registry/vulkan/)
113 * [Vulkan 1.1.122](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/index.html)
115 [**OpenCL Main Page**](https://www.khronos.org/registry/OpenCL/)
117 * [OpenCL 2.2 API Specification](https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_API.html)
118 * [OpenCL 2.2 Extension Specification](https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_Ext.html)
119 * [OpenCL 2.2 SPIR-V Environment Specification](https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_Env.html)
121 * OpenCL released the proposed OpenCL 3.0 spec for comments in april 2020
123 * [Announcement video](https://youtu.be/h0_syTg6TtY)
124 * [Announcement video slides (PDF)](https://www.khronos.org/assets/uploads/apis/OpenCL-3.0-Launch-Apr20.pdf)
126 Note: We are implementing hardware accelerated Vulkan and
127 OpenCL while relying on other software projects to translate APIs to
128 Vulkan. E.g. Zink allows for OpenGL-to-Vulkan in software.
130 # Graphics and Compute API Stack
132 I found this informative post that mentions Kazan and a whole bunch of
133 other stuff. It looks like *many* APIs can be emulated on top of Vulkan,
134 although performance is not evaluated.
136 <https://synappsis.wordpress.com/2017/06/03/opengl-over-vulkan-dev/>
138 * Pixilica is heading up an initiative to create a RISC-V graphical ISA
140 * [Pixilica 3D Graphical ISA Slides](https://b5792ddd-543e-4dd4-9b97-fe259caf375d.filesusr.com/ugd/841f2a_c8685ced353b4c3ea20dbb993c4d4d18.pdf)
143 # Various POWER Communities
144 - [An effort to make a 100% Libre POWER Laptop](https://www.powerpc-notebook.org/en/)
145 The T2080 is a POWER8 chip.
146 - [Power Progress Community](https://www.powerprogress.org/campaigns/donations-to-all-the-power-progress-community-projects/)
147 Supporting/Raising awareness of various POWER related open projects on the FOSS
149 - [OpenPOWER](https://openpowerfoundation.org)
150 Promotes and ensure compliance with the Power ISA amongst members.
151 - [OpenCapi](https://opencapi.org)
152 High performance interconnect for POWER machines. One of the big advantages
153 of the POWER architecture. Notably more performant than PCIE Gen4, and is
154 designed to be layered on top of the physical PCIE link.
155 - [OpenPOWER “Virtual Coffee” Calls](https://openpowerfoundation.org/openpower-virtual-coffee-calls/)
156 Truly open bi-weekly teleconference lines for anybody interested in helping
157 advance or adopting the POWER architecture.
161 ## Free Silicon Conference
163 The conference brought together experts and enthusiasts who want to build
164 a complete Free and Open Source CAD ecosystem for designing analog and
165 digital integrated circuits. The conference covered the full spectrum of
166 the design process, from system architecture, to layout and verification.
168 * <https://wiki.f-si.org/index.php/FSiC2019#Foundries.2C_PDKs_and_cell_libraries>
170 * LIP6's Coriolis - a set of backend design tools:
171 <https://www-soc.lip6.fr/equipe-cian/logiciels/coriolis/>
173 Note: The rest of LIP6's website is in French, but there is a UK flag
174 in the corner that gives the English version.
176 * KLayout - Layout viewer and editor: <https://www.klayout.de/>
178 # The OpenROAD Project
180 OpenROAD seeks to develop and foster an autonomous, 24-hour, open-source
181 layout generation flow (RTL-to-GDS).
183 * <https://theopenroadproject.org/>
185 # Other RISC-V GPU attempts
187 * <https://fossi-foundation.org/2019/09/03/gsoc-64b-pointers-in-rv32>
189 * <http://bjump.org/manycore/>
191 * <https://resharma.github.io/RISCV32-GPU/>
193 TODO: Get in touch and discuss collaboration
195 # Tests, Benchmarks, Conformance, Compliance, Verification, etc.
199 RISC-V Foundation is in the process of creating an official conformance
200 test. It's still in development as far as I can tell.
202 * //TODO LINK TO RISC-V CONFORMANCE TEST
204 ## IEEE 754 Testing/Emulation
206 IEEE 754 has no official tests for floating-point but there are
207 well-known third party tools to check such as John Hauser's TestFloat.
209 There is also his SoftFloat library, which is a software emulation
210 library for IEEE 754.
212 * <http://www.jhauser.us/arithmetic/>
214 Jacob is also working on an IEEE 754 software emulation library written
215 in Rust which also has Python bindings:
217 * Source: <https://salsa.debian.org/Kazan-team/simple-soft-float>
218 * Crate: <https://crates.io/crates/simple-soft-float>
219 * Autogenerated Docs: <https://docs.rs/simple-soft-float/>
221 A cool paper I came across in my research is "IeeeCC754++ : An Advanced
222 Set of Tools to Check IEEE 754-2008 Conformity" by Dr. Matthias Hüsken.
224 * Direct link to PDF:
225 <http://elpub.bib.uni-wuppertal.de/servlets/DerivateServlet/Derivate-7505/dc1735.pdf>
229 OpenCL Conformance Tests
231 * <https://github.com/KhronosGroup/OpenCL-CTS>
233 Vulkan Conformance Tests
235 * <https://github.com/KhronosGroup/VK-GL-CTS>
237 MAJOR NOTE: We are **not** allowed to say we are compliant with any of
238 the Khronos standards until we actually make an official submission,
239 do the paperwork, and pay the relevant fees.
241 ## Formal Verification
243 Formal verification of Libre RISC-V ensures that it is bug-free in
244 regards to what we specify. Of course, it is important to do the formal
245 verification as a final step in the development process before we produce
246 thousands or millions of silicon.
248 Some learning resources I found in the community:
250 * ZipCPU: <http://zipcpu.com/> ZipCPU provides a comprehensive
251 tutorial for beginners and many exercises/quizzes/slides:
252 <http://zipcpu.com/tutorial/>
253 * Western Digital's SweRV CPU blog (I recommend looking at all their
254 posts): <https://tomverbeure.github.io/>
255 * <https://tomverbeure.github.io/risc-v/2018/11/19/A-Bug-Free-RISC-V-Core-without-Simulation.html>
256 * <https://tomverbeure.github.io/rtl/2019/01/04/Under-the-Hood-of-Formal-Verification.html>
260 * <https://www.ohwr.org/project/wishbone-gen>
264 ## Adding new instructions:
266 * <https://archive.fosdem.org/2015/schedule/event/llvm_internal_asm/>
270 * <https://danluu.com/branch-prediction/>
274 * [Migen - a Python RTL](https://jeffrey.co.in/blog/2014/01/d-flip-flop-using-migen/)
275 * [LiTeX](https://github.com/timvideos/litex-buildenv/wiki/LiteX-for-Hardware-Engineers)
276 An SOC builder written in Python Migen DSL. Allows you to generate functional
277 RTL for a SOC configured with cache, a RISCV core, ethernet, DRAM support,
278 and parameterizeable CSRs.
279 * [Migen Tutorial](http://blog.lambdaconcept.com/doku.php?id=migen:tutorial>)
280 * There is a great guy, Robert Baruch, who has a good
281 [tutorial](https://github.com/RobertBaruch/nmigen-tutorial) on nMigen.
282 He also build an FPGA-proven Motorola 6800 CPU clone with nMigen and put
283 [the code](https://github.com/RobertBaruch/n6800) and
284 [instructional videos](https://www.youtube.com/playlist?list=PLEeZWGE3PwbbjxV7_XnPSR7ouLR2zjktw)
286 * [Minerva](https://github.com/lambdaconcept/minerva)
287 An SOC written in Python nMigen DSL
288 * [Using our Python Unit Tests(old)](http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2019-March/000705.html)
289 * <https://chisel.eecs.berkeley.edu/api/latest/chisel3/util/DecoupledIO.html>
290 * <http://www.clifford.at/papers/2016/yosys-synth-formal/slides.pdf>
294 * <https://wiki.f-si.org/index.php/FSiC2019>
295 * <https://fusesoc.net>
296 * <https://www.lowrisc.org/open-silicon/>
297 * <http://fpgacpu.ca/fpga/Pipeline_Skid_Buffer.html> pipeline skid buffer
298 * <https://pyvcd.readthedocs.io/en/latest/vcd.gtkw.html> GTKwave
299 * <http://www.sunburst-design.com/papers/CummingsSNUG2002SJ_Resets.pdf>
300 Synchronous Resets? Asynchronous Resets? I am so confused! How will I
301 ever know which to use? by Clifford E. Cummings
302 * <http://www.sunburst-design.com/papers/CummingsSNUG2008Boston_CDC.pdf>
303 Clock Domain Crossing (CDC) Design & Verification Techniques Using
304 SystemVerilog, by Clifford E. Cummings
305 In particular, see section 5.8.2: Multi-bit CDC signal passing using
306 1-deep / 2-register FIFO synchronizer.
307 * <http://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/EECS-2016-143.pdf>
308 Understanding Latency Hiding on GPUs, by Vasily Volkov
311 # Real/Physical Projects
313 * [Samuel's KC5 code](http://chiselapp.com/user/kc5tja/repository/kestrel-3/dir?ci=6c559135a301f321&name=cores/cpu)
314 * <https://chips4makers.io/blog/>
315 * <https://hackaday.io/project/7817-zynqberry>
316 * <https://github.com/efabless/raven-picorv32>
317 * <https://efabless.com>
318 * <https://efabless.com/design_catalog/default>
319 * <https://wiki.f-si.org/index.php/The_Raven_chip:_First-time_silicon_success_with_qflow_and_efabless>
320 * <https://mshahrad.github.io/openpiton-asplos16.html>
322 # ASIC tape-out pricing
324 * <https://europractice-ic.com/wp-content/uploads/2020/05/General-MPW-EUROPRACTICE-200505-v8.pdf>
328 * <https://toyota-ai.ventures/>
329 * [NLNet Applications](http://bugs.libre-riscv.org/buglist.cgi?columnlist=assigned_to%2Cbug_status%2Cresolution%2Cshort_desc%2Ccf_budget&f1=cf_nlnet_milestone&o1=equals&query_format=advanced&resolution=---&v1=NLnet.2019.02)
331 # Good Programming/Design Practices
333 * [Liskov Substitution Principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle)
334 * [Principle of Least Astonishment](https://en.wikipedia.org/wiki/Principle_of_least_astonishment)
335 * <https://peertube.f-si.org/videos/watch/379ef007-40b7-4a51-ba1a-0db4f48e8b16>
336 * [Rust-Lang Philosophy and Consensus](http://smallcultfollowing.com/babysteps/blog/2019/04/19/aic-adventures-in-consensus/)
338 * <https://youtu.be/o5Ihqg72T3c>
339 * <http://flopoco.gforge.inria.fr/>
340 * Fundamentals of Modern VLSI Devices
341 <https://groups.google.com/a/groups.riscv.org/d/msg/hw-dev/b4pPvlzBzu0/7hDfxArEAgAJ>
345 * <https://www.crnhq.org/cr-kit/>
349 * <https://github.com/Isotel/mixedsim>
350 * <http://www.vlsiacademy.org/open-source-cad-tools.html>
351 * <http://ngspice.sourceforge.net/adms.html>
352 * <https://en.wikipedia.org/wiki/Verilog-AMS#Open_Source_Implementations>
354 # Libre-SOC Standards
356 This list auto-generated from a page tag "standards":
358 [[!inline pages="tagged(standards)" actions="no" archive="yes" quick="yes"]]
362 * [[resources/server-setup/web-server]]
363 * [[resources/server-setup/git-mirroring]]
364 * [[resources/server-setup/nagios-monitoring]]