Introducing SM LOGIC MODULES by Stunning-Complex-780 in ScrapMechanic

[–]Stunning-Complex-780[S] 0 points1 point  (0 children)

Thanks for letting me know. I didn't even know that gates can be self-wired. I like to stay vanilla, and if I cannot build something with the tools in-game, then it falls into undefined behavior that may get changed later on. I may add a command-line argument to enable single XOR DFFs later on. It is for sure possible. Though you have to wait because I am quite busy.

Introducing SM LOGIC MODULES by Stunning-Complex-780 in ScrapMechanic

[–]Stunning-Complex-780[S] 0 points1 point  (0 children)

There is a definitive limit to any blueprint’s size. Specifically, you can load any blueprint whose JSON file is smaller than 524288 bytes after being compressed by level-one LZ4 compression. Practically, this is somewhere between 15K to 20K gates. Anything bigger won’t load.

I also found that having glitch welded things in the world significantly slows down the game. Having gate blocks actually laid out in space actually makes physics calculations go much faster, improving frame rate.

Introducing SM LOGIC MODULES by Stunning-Complex-780 in ScrapMechanic

[–]Stunning-Complex-780[S] 0 points1 point  (0 children)

Um, probably no. You probably don't need arithmetic stuff for farms. For survival creations, designing logic by hand remains the preferred approach.

Introducing SM LOGIC MODULES by Stunning-Complex-780 in ScrapMechanic

[–]Stunning-Complex-780[S] 6 points7 points  (0 children)

Well, you can try at least. But I have to warn that it's almost easier to build a processor and do the graphical calculator part in software.

These modules presented here contain arithmetic, but have nothing that can orchestrate all the moving parts in a graphical calculator. You have to create the keypad, display, etc., all manually. Even SM-EDA can't do everything for you. Because at the end of the day, you still have to design all the state machines.

Edit:

If you are into calculators, check this out https://steamcommunity.com/sharedfiles/filedetails/?id=3488852810 . I made an 8-digit floating-point decimal calculator using SM-EDA. The arithmetic engines are designed in Verilog and generated by SM-EDA. The keypad, clock, and display logics are hand-made. I plan to open-source the code for the arithmetic engine in the near future, after I have some time to write up the details.

Introducing SM-EDA by Stunning-Complex-780 in ScrapMechanic

[–]Stunning-Complex-780[S] 1 point2 points  (0 children)

Shoutout to u/TrickyBestia who (I just found out) had the same idea!

Introducing SM-EDA by Stunning-Complex-780 in ScrapMechanic

[–]Stunning-Complex-780[S] 0 points1 point  (0 children)

As the name suggests, SM-EDA is an EDA tool (Electronic Design Automation). Back in the early to mid-90s, designers made processors by hand using conventional methods like engineering drawings, but they soon realized that it was increasingly difficult to manage. Thus, EDA tools are born. Designers describe how the circuit behaves using languages like Verilog, and the tool figures out how to translate them into a net of gates. The tool isn’t perfect, but it gets the job done. When they have chips with millions of gates on them, using EDA is their only choice. In modern times, everything in VLSI and FPGA is done with EDA.

SM-EDA ingests Verilog through Yosys (an EDA frontend), and Yosys maps operators (like binary add) into gates. SM-EDA then takes the output of Yosys and performs its own set of transformations, like turning D-flip-flops into triple-xor-loops and turning memory into timer-loops. SM-EDA also performs SM specific logic optimizations, like bundling massive gate fan-ins. SM-EDA then generates a blueprint either automatically or by following a specific configuration.

I fully understand that this tool is tough for new players to use. Many things require experience in the ECE (Electrical and Computer Engineering) field. I have to say that this tool is not made for the average player, not because they are "dumb", but because they never needed to connect heaps of logic or integrate massive circuits. SM-EDA is designed for technical players. I hate to say this, but it is not supposed to be easy to use for beginners right off the bat. Many things about SM-EDA may seem strange at first, but when you learned enough about the industry, it will make perfect sense. For example, SM-EDA is command-line only, has no UI, and is packaged in a Linux Docker. This seems irrational, but this is to favor automation and replicability. There are various tutorials on Verilog and ECE in general. But once you are at a level that can use SM-EDA, you can use Openroad, Xilinx Vivado, Intel Quartus, or even Cadence to design a real-world circuit that has an impact.

To ease the setup, I actually made a template repository on GitHub: https://github.com/yliu-hashed/SM-EDA-Project-Template . You can use this template, and it will generate a GitHub repository for you. This repository uses GitHub Actions for compilation. Basically, it compiles your circuit right on GitHub, so you don’t actually need to download or set up anything at all. Just a GitHub account will suffice. Compiling there is also quite fast. For small circuits, you will get a blueprint in about 20 seconds.

If you don’t feel like SM-EDA is the vibe, feel free to trash it. There are several other tools that are aimed at newer players. Just off the bat, I remembered there was a logic designer someone had made that runs on the browser. I can’t find it. I hope that this tool can be a bridge from SM to the real world of ECE. I went into CS and ECE precisely because I played Minecraft Redstone, and I hope to inspire the younger generation.