Is there a scripting language for building logic gate logic?
from remotelove@lemmy.ca to programming@programming.dev on 14 Jan 17:26
https://lemmy.ca/post/37145422

Weird title, sorry. Let me try and explain.

Goal: Convert simple higher level script into a low level logic gate mess. Basically, I want to build my own custom computers in Factorio with circuit networks. I can easily create any type of logic gate that I want, similar to how computers Minecraft have been built, but with more options.

It would be super nice to code in something similar to Python but have it “compile” into clusters of logic gates. Of course, functionality would be extremely limited, but that is OK and I don’t need to boil the ocean… yet…

(TBH, this sounds really close to what I know about programming FPGAs.)

#programming

threaded - newest

nikstarling@programming.dev on 14 Jan 17:31 next collapse

Don’t know about Python like languages but is sounds like something like Verilog or VHDL may be suitable for your case

BartyDeCanter@lemmy.sdf.org on 14 Jan 18:20 collapse

This is exactly it. The various *HDLs are explicitly written to create systems of logic gates.

Disregard3145@lemmy.world on 14 Jan 17:51 next collapse

Maybe www.jitx.com

remotelove@lemmy.ca on 15 Jan 07:37 collapse

Not sure if that will help in this particular case, but that looks super neat anyway. I have been planning to build a custom modular synthesizer so I’ll try that out anyway. (Thankfully, it’s Kicad integration is free. Yay!)

refurbishedrefurbisher@lemmy.sdf.org on 14 Jan 19:52 next collapse

github.com/verilator/verilator

towerful@programming.dev on 15 Jan 08:05 next collapse

I stumbled across Amaranth a while ago. It’s been years since I’ve done FPGA programming, and I haven’t had a reason to get into it again.
But Amaranth seems like a cool paradigm instead of AHDL/VHDL.

github.com/amaranth-lang/amaranth

beeng@discuss.tchncs.de on 16 Jan 10:05 next collapse

These guys are floating around berlin and its FOSS afaik.

Basicallly i think its a c++ library to help you write fgpa language for fgpa controllers (which are logic gates )

www.synogate.com

github.com/synogate/gatery

Not sure how close it will get you to your needs but feels on topic.

K2yfi@programming.dev on 16 Jan 12:51 next collapse

Sounds like you should take a look at www.nand2tetris.org. Basically it walks through the process of building up a game like Tetris starting from logic gates. It has you write a very simple compiler for a mini language where you’ve built everything up from the base logic gates level, so it should be a pretty good guide for what you want.

FizzyOrange@programming.dev on 16 Jan 20:12 collapse

Yeah Verilog. That’s literally the language people use to design chips and FPGA bitstreams.

Someone has already done it: github.com/Redcrafter/verilog2factorio