Skip to content

Comment on PCB-rs:library to wite Software Emulated Hardware

Comments

I'm having difficulty understanding what this library does that HDL doesn't already accomplish.

VHDL and verilog are definitely ugly, and MyHDL took a whack at trying to make it better... But this seems to come up a little short.

Hey,thanks for your interest! As I explain in the blog post, this is not even remotely meant to "compete" or "replace" any HDLs. I think VHDL and other HDLs are pretty cool and really smart at what they do. This library is much less powerful than that.

What this aims to is make writing and learning about hardware more approachable to newcomers or self-learners. This is still in a high level language (Rust) so you have some familiarity, but you still have to consider how to connect pins and stuff, so you can start thinking about h/w that way. This is in a way choose-your-own-difficulty, so you can write everything from basic gates, or as I have done in the CPU demo, you can define pins, but write the processing logic in high-level constructs such as if-else, loops etc. This makes it easier to focus (for the CPU eg) on showing stuff like cache invalidating and wait states for memory access.

Another thing is that this can be compiled to wasm, so you can make circuits and provide nice GUI like I have done for all my demo examples at https://yjdoc2.github.io/pcb-rs-examples/ . This way you can have interactive examples right in your browser which you can play with.

Again, yes, HDLs can do all of this, but I think they are a bit scary to approach, especially if you're learning this yourself / are a newcomer ; and I hope that pcb-rs will be a rung in the ladder making it a bit easier to learn about hardware and low level systems.

Hope this clarifies it a bit! Thanks!

Maybe it helps you conceptualize design the circuit?

Isn't vhdl more about simply formally and thoroughly defining it?

Can you play with ideas and check things out by just noodling in vhdl?

Yeah, you can drop your hdl in a test bench project and simulate it with modelsim or xilinx tools (I think their main one is still vivado). You can even define your hardware in c using vivado hls.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.