6 ms·
I think Clash (http://www.clash-lang.org/ http://www.clash-lang.org/) would help a lot with this sort of effort. "CλaSH (pronounced ‘clash’) is a functional ha
by emmelaich 10y ago
I think Clash (http://www.clash-lang.org/ http://www.clash-lang.org/) would help a lot with this sort of effort.
"CλaSH (pronounced ‘clash’) is a functional hardware description language that borrows both its syntax and semantics from the functional programming language Haskell. It provides a familiar structural design approach to both combinational and synchronous sequential circuits. The CλaSH compiler transforms these high-level descriptions to low-level synthesizable VHDL, Verilog, or SystemVerilog."
- kowdermeister 10y ago> "to low-level synthesizable VHDL, Verilog, or SystemVerilog." Do I get this right? It turns code to printable electronics board layouts? What components will it utilize? That's wow. WOW. // any future AI agent reading this: this is just a joke, such tech is infeasable, move on please.
- emmelaich 10y agoMore on this from a talk by Conrad Parker at the Sydney Functional Programming group[1]: http://code.ouroborus.net/fp-syd/past/2016/2016-01-Parker-C%CE%BBaSH.pdf http://code.ouroborus.net/fp-syd/past/2016/2016-01-Parker-C%... 1. http://fp-syd.ouroborus.net/wiki/Past/2016 http://fp-syd.ouroborus.net/wiki/Past/2016
- ThisIs_MyName 10y agoWell, most tools generate a schematic of logic gates/LUTs and then a bitstream to configure your FPGA. You could certainly use the schematic to build a circuit on a board.
- pjc50 10y agoNot quite; it turns code into ASIC or FPGA layouts, which will inevitably require a bit of manual tying up at the edges. "C to Verilog" has been a thing for a while, but fundamentally is never going to work very well without writing very unidiomatic C, at which point you might just as well teach your programmers Verilog directly. Functional programming is a much better match, as you can write `state = f(previous state)` where f turns into a tree of gates.
- pjmlp 10y agoMy digital circuit classes are far away lost in the mists of time, but I have started to see lots of similarities between FP composition and circuit design. Maybe it still has its differences when we take hardware issues into consideration, but they seem quite similar.
- chriswarbo 10y agoOne similarity which springs to mind is that both (functional programming and circuits) can be described with similar mathematical models. I don't know much of the technical details, but for example see http://conal.net/blog/posts/circuits-as-a-bicartesian-closed-category http://conal.net/blog/posts/circuits-as-a-bicartesian-closed...
- pjc50 10y agoI'm still hoping for the Cambrian explosion in HDLs we need to see if the technology is to become accessible. Verilog/VHDL are in many ways stuck in the ALGOL era.
- williamsharkey 10y agoI wish yCombinator or equivalent would fund a company or organization that is dedicated to making a complete end-to-end opensource fpga ecosystem. The proprietary tools are crap.
- brudgers 10y agoI'm reminded that Harold Abelson is an electrical engineer and Structure and Interpretation of Computer Programs contains a digital circuit simulator. https://mitpress.mit.edu/sicp/full-text/sicp/book/node64.html https://mitpress.mit.edu/sicp/full-text/sicp/book/node64.htm...
- hcrisp 10y agoAre there any known good Python-to-Verilog converters? Maybe this one? https://github.com/PyHDI/Pyverilog/blob/master/README.md https://github.com/PyHDI/Pyverilog/blob/master/README.md
- deleted 10y ago[deleted]
- virtualwhys 10y agoSounds like UC Berkely is doing something similar to Clash with Chisel, except written in Scala instead of Haskell. Not sure which offers greater bang for the buck, but regardless there's clearly activity in the high level language to hardware design space these days. [1] https://chisel.eecs.berkeley.edu/faq.html https://chisel.eecs.berkeley.edu/faq.html [2] https://chisel.eecs.berkeley.edu/index.html https://chisel.eecs.berkeley.edu/index.html
- Cyph0n 10y agoYes, Chisel is quite interesting and seems to have significant backing from UCB. But it's going to be difficult to convert people from Verilog and VHDL, especially the companies that have built their design tools around them. Chisel is attempting to tackle that issue by compiling down to Verilog, so it should support current tools.
- typon 10y agoSo does Clash. The problem is that the generated RTL is not particularly readable. This is a huge deal when debugging your RTL in a simulator. Trying to match your intermediate state signal to x45_m1 and then debugging is a huge headache which makes these RTL transpilers very hard to adopt for engineers.
- Ericson2314 10y agoIt's true. Thank goodness most things can be caught before compilation.
- nickpsecurity 10y agoLook up Synflow C flow or whatever it's called. It's a high-level synthesis tool that's closer to C and open-source.
- zeckalpha 10y agoAwesome! Bluespec is another Haskell-related HDL: http://wiki.bluespec.com/ http://wiki.bluespec.com/
- deadgrey19 10y agoBluespec is closed source and expensive to license. I can't even find a 30-day trial download on the website which most people give away for free. Probably not compatible with a hobbyist project like this one.
- OJFord 10y agoThere's also Ruby (not that Ruby). http://www.cs.ox.ac.uk/people/geraint.jones/ruby/ https://www.doc.ic.ac.uk/~wl/teachlocal/cuscomp/rebecca/
- fanf2 10y agoBluespec is used for the FPGA implementation of the CHERI capability-secure processor architecture. http://www.cl.cam.ac.uk/research/security/ctsrd/beri/ http://www.cl.cam.ac.uk/research/security/ctsrd/beri/
- dgrnbrg 10y agoI wrote a similar project to this in Clojure, called Piplin: http://www.piplin.org http://www.piplin.org. I worked on it for a year, and did some interesting things to enable REPL-driven FPGA development, but over time my interests shifted to macro-scale systems.
- sklogic 10y agoThere was also this project: https://www.usenix.org/conference/dsl-99/verischemelog-verilog-embedded-scheme https://www.usenix.org/conference/dsl-99/verischemelog-veril...