learn-fpga
bubbleos
learn-fpga | bubbleos | |
---|---|---|
22 | 16 | |
2,337 | - | |
- | - | |
7.3 | - | |
18 days ago | - | |
C++ | ||
BSD 3-clause "New" or "Revised" License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
learn-fpga
-
FPGA Dev Boards for $150 or Less
I've followed this tutorial recently, and it's amazing:
https://github.com/BrunoLevy/learn-fpga/blob/master/FemtoRV/...
The author includes detailed instruction for how to build a micro-controller in Verilog on an icestick, starting from a very simple blinker all the way to a functional RISC-V core.
My other suggestion would be: for most of the toolchain, skip your package manager and directly install the binary artifacts published on this Github repo:
https://github.com/YosysHQ/oss-cad-suite-build
You'll spare yourself a world of pain.
- Top Ten Fallacies About RISC-V (David Patterson)
-
What are the best learning resources for a beginner?
You might want to look at https://github.com/BrunoLevy/learn-fpga
-
First FPGA Board
Lattice Icestick is pretty cheap and has just enough LUTs to run a small riscv. Also check out https://github.com/BrunoLevy/learn-fpga
-
My first Risc-V core in FPGA
Thanks Bruno Levy
-
How to Emulate a CPU on an FPGA
These are good starting points: https://github.com/BrunoLevy/learn-fpga/ and, from there, https://github.com/BrunoLevy/learn-fpga/blob/master/FemtoRV/README.md.
-
PicoBlaze in Verilog / Vivado
The best point-of-entry for "tiny" MCUs these days is FemtoRV32-Quark or SERV. I also maintain my own small RISC-V core (Minimax), though it's early on in graduating from "experiment" to "real design".
- looking for ideas for a small project using digilent pmod on xilinx zynq 7 series fpga using hdl (verilog).
-
Embedded Systems Weekly #125
Rust blinky on RISC-V soft core If you were looking for, an introduction example of an embedded Rust program, running on a RISC-V soft core, check out this blinky that is using the FemtoRV .
-
Minimax: A Compressed-First, Microcoded RISC-V CPU
Nope - that's all there is.
It's possible to be incredibly expressive in Verilog and VHDL. This implementation is written in VHDL, which has an outdated reputation for being long-winded.
Also worth a look: FemtoRV32 Quark [0], which is written in Verilog.
[0]: https://github.com/BrunoLevy/learn-fpga/blob/master/FemtoRV/...
bubbleos
-
Niklaus Wirth Passed Away
do you think writing st is an achievement that merits a turing award
because i've also written a terminal emulator, and it compiles from source in 0.98 seconds https://gitlab.com/kragen/bubbleos/blob/master/yeso/admu-she... screenshot at https://gitlab.com/kragen/bubbleos/blob/master/yeso/admu_she...
(steps to reproduce: install dependencies; make; rm admu-shell admu-shell-fb admu-shell-wercam admu admu.o admu-shell.o admu_tv_typewriter.o; time make -j. it only takes 0.37 seconds if you only make -j admu-shell)
i wrote pretty much all of it on october 12 and 13 of 02018 so forgive me if i don't think that this is an achievement worthy of a turing award. even if it were as great as st
-
Write Your Own Terminal
nice! probably magenta on a red background is undesirable, though; maybe switch to colors with better contrasts
i hate x11 visuals and in https://gitlab.com/kragen/bubbleos/blob/master/yeso/yeso-xli... i just assume that everything is 32-bit bgra. i need to get around to fixing that at some point
what do you think an idiomatic ruby binding for yeso would look like? so far i only have lua, c, and python bindings. my ruby experience is both limited (only a few thousand lines of code) and over a decade ago
-
Minetest: An open source voxel game engine
debian and ubuntu ship an implementation of tetris in the bsdgames package (and bsd has included it since the 80s), gnu emacs has included tetris.el for 25 years (despite removing yow lines), and debian also includes bastet, blocks of the undead, crack-attack, gtkboard, kblocks (which is part of kde), ltris, netris, petris, stax, termtris, tetrinet, tint, vdr-plugin-games, vitetris, /usr/share/vim-scripts/plugin/tetris.vim, and quadrapassel (which is part of the official gnome release)
you've been able to buy cheap '9999 in 1 block game' hardware at any import port with 200 nematic pixels for at least 15 years
i've written two tetris clones myself, http://canonical.org/~kragen/sw/inexorable-misc/tetris and https://gitlab.com/kragen/bubbleos/blob/master/yeso/tetris.c, and no lawsuits have yet arrived
also, minecraft is just an infiniminer clone, and there are fifty zillion clones of each of pacman, space invaders, breakout, snake, doom, and super mario
so these novel legal precedents you mention are at least still being very narrowly applied in practice
-
Minimal Cross-Platform Graphics
since everyone else is posting links to their similar libraries, i thought i'd post mine too, https://gitlab.com/kragen/bubbleos/-/tree/master/yeso
it's probably a bit more efficient than fenster on x-windows because it uses shared memory, and i think the programming interface is a little nicer (see the readme above for code examples)
apps i've written in yeso include an adm-3a terminal emulator, a tetris game, a raytracer, an rpn calculator, a fractal explorer, and so on
i haven't ported yeso to win32/64, macos, android, or the browser canvas yet, just x-windows, the linux framebuffer (partly), and a window system implemented in yeso called wercam
it includes bindings for c, python (via cffi), and lua (via luajit's ffi), and presumably you could use it from zig or rust in the same way as fenster, but i haven't tried
- If one GUI's not enough for your SPARC workstation, try four
-
Turns are better than radians
If you're not using derivatives, integrals, or complex numbers, maybe you'd be better off using Wildberger's "rational trigonometry" with quadrances and spreads instead of angles? I haven't actually tried it myself. Wildberger's motivation is a sort of ultra-strict Platonism mixed with the desire to extend analytic geometry to fields other than the real numbers, though, so it wouldn't be surprising if it wasn't actually a simpler way to write Asteroids.
Alternatively you can just directly represent angles as unit vectors in the desired direction, which is pretty much the same as using complex numbers. Angle addition is complex multiplication, angle bisection is complex square root, and computing the sine and cosine is simplicity itself. (This takes twice as much space. If you choose to store only the real part of the complex number, you can only represent angles up to half a turn, same as in Wildberger's approach, you lose some precision near the limits, and the other operations require some extra computations.) I have tried this, for example in http://canonical.org/~kragen/sw/aspmisc/my-very-first-raytra... and https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/sdf.lu..., and in the cases I've tried it, it works great.
I'm interested to hear other people's experiences on this count!
-
Take More Screenshots
> There at least three small Wasm interpreters in Rust
None of those are small; the smallest one you found is 500 lines of code, and doesn't include the peripherals. The UM interpreter in the Cult of the Bound Variable paper was I think 55 lines of C (also, not including peripherals). My dumb Chifir interpreter was 75 lines of code; adding Yeso graphical output was another 30 lines https://gitlab.com/kragen/bubbleos/blob/master/yeso/chifir-y....
I agree that UM, Chifir, and uxn are Art, and that wasm is a great platform to run this kind of archival virtual machine on top of, as well as having some very interesting ideas about how to design a VM instruction set to be amenable to efficient implementation. RISC-V is a good source of ideas for that, too!
Why am I being so unreasonable about the amount of code? After all, a few hundred lines of C is something that you can write in an afternoon, right, so what's the big deal about 500 lines of code for something you'll use for decades?
The problem is that, to parody Perlis's epigram, if your virtual machine definition has 500 lines of code, you probably forgot some. If a platform includes that much functionality, you have designed it so that that functionality has to live in the base platform rather than being implemented in programs that run on the platform. And that means that you will be strongly tempted to add stuff to the base platform, which is how you break programs that used to work.
In the case of MS-DOS or NES emulation this is limited by the fact that Nintendo couldn't go out and patch all the Famicoms and NESes in people's houses, so if they wanted to change things, well, too bad. NES emulator authors have very little incentive to add new functionality because the existing ROMs won't use it, and that's what they want to run.
One of the interesting ideas in the RISC-V ecosystem is that a Cray-style vector instruction set (RV64V) can give you SIMD-instruction-like performance without SIMD-instruction-like instruction set inflation. And, as the APL family shows, such vector instructions can include scalar math as a special case. I haven't been able to come up with a way to define such a vector instruction set that wouldn't be unacceptably bug-prone, though; https://dercuano.github.io/notes/vector-vm.html describes some of the things I tried that didn't work.
- The SQLite Code of Ethics
-
GPU ray tracing tutorial – 10 articles
I've written several smaller raytracers than 200 lines of C++, though quite likely they're worse pedagogically than Jaco's slashdotted tutorial:
http://canonical.org/~kragen/sw/aspmisc/my-very-first-raytra... 184 lines of C, including vector arithmetic, input parsing, and PPM output. I'm not sure what you mean by "excluding the headers" — this one doesn't have any headers of its own (why would a 200-line program have headers of its own?) but it #includes math.h, stdio.h, stdlib.h, and string.h, which total almost 1800 lines of code on my machine and presumably 15× that by the time you count their transitive includes.
http://canonical.org/~kragen/sw/dev3/circle.clj 39 lines of Clojure, including the model, which is a single sphere; it uses java.awt.image for JPEG output. About half of the code is implementing basic vector math by hand. A minified version is under 1K: http://canonical.org/~kragen/sw/dev3/raytracer1k.clj
https://gitlab.com/kragen/bubbleos/blob/master/yeso/sdf.lua 51 lines of Lua for an SDF raymarcher including animation, the model itself, and live graphical output.
I feel like basic raytracing is a little simpler than basic rasterizing, but I don't think the difference is hugely dramatic:
http://canonical.org/~kragen/sw/torus is a basic rasterizer in 261 lines of JS, which is larger than the three raytracers I mentioned above, but about 60% of that is 3-D modeling rather than rendering, and another 5% or so is DOM manipulation.
http://canonical.org/~kragen/sw/netbook-misc-devel/rotcube.p... The smallest I've been able to get a basic rasterizer down to, 15 lines of Python, just rotating a point cloud.
http://canonical.org/~kragen/sw/dev3/rotcube.cpp in C++ it's 41 lines, and
http://canonical.org/~kragen/sw/dev3/braillecube.py with wireframes in Braille Unicode art it's 24 lines of Python.
So I think that the core of either a (polygon!) rasterizer or a raytracer, without optimizations, is only about 20 lines of code if your ecosystem provides you with the stuff around the edges: graphical display (or image file output), model input, linear algebra, color arithmetic.
For a rasterizer, it's something like:
tpoints = [camera_transform @ point for point in points]
-
How much boilerplate code you need to write a ray-tracer?
https://gitlab.com/kragen/bubbleos/blob/master/yeso/sdf.lua one page of Lua, runs in real time at a lousy framerate
http://canonical.org/~kragen/sw/dev3/ about five pages of C
What are some alternatives?
riscv-v-spec - Working draft of the proposed RISC-V V vector extension
gnu-units - GNU Units (mirror)
wain - WebAssembly implementation from scratch in Safe Rust with zero dependencies
electron-vlog - Take video recordings, screenshots and time-lapses of your Electron app with ease
openfpga - Open FPGA tools
WasmCert-Isabelle - A mechanisation of Wasm in Isabelle.
rust-wasm - A simple and spec-compliant WebAssembly interpreter
Lifeslice - Automatically take webcam pics, screenshot, and other metrics throughout the day.
Carp - A statically typed lisp, without a GC, for real-time applications.
wasm-lisp - Experimental Lisp to WebAssembly Compiler
inferno-os - Inferno® is a distributed operating system. Inferno represents services and resources in a file-like name hierarchy, including devices, network and protocol interfaces, dynamic data sources, and services.Applications are written in a concurrent programming language, Limbo.