GithubHelp home page GithubHelp logo

silky / verilog2factorio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redcrafter/verilog2factorio

0.0 0.0 0.0 4.98 MB

This project will compile verilog (a hardware description language) into factorio blueprints.

Home Page: https://redcrafter.github.io/verilog2factorio/

License: GNU General Public License v3.0

TypeScript 99.94% Shell 0.06%

verilog2factorio's Introduction

Factorio verilog compiler

This project will compile verilog (a hardware description language) into factorio blueprints.
Using this it should also be possible to compile vhdl. (not tested)

Web Demo

You can check out the web demo here.

Install

Manually compile yosys (since the last release is quite old) and add it to your PATH.

Run npm install to install all dependencies.

Usage

Usage: v2f [options] <files..>

Options:
  -s, --seed <seed>         Specify a seed for the layout generation.
  -o, --output <file>       File to output the compiled blueprint to.
  -m, --modules <names...>  Verilog modules to output blueprint for. (defaults to all).
  -f, --files <files...>    List of Verilog files to compile. (only has to be explicitly specified after -m).
  -r, --retry               Retry until there are no longer layout errors.
  -h, --help                Display this information.

Quick Start

Run ./v2f with verilog files as parameters. Example: ./v2f ./samples/counter.v

The compiled blueprint will be output on the command line unless otherwise specified with -f.

The circuit will have inputs and outputs at the top in the order in which they were written in the code. Clock pulses are required to be exactly one tick high. (since adding edge detectors would produce a lot of overhead)

Examples

samples/counter.v

module counter(input clk, input rst, input inc, output reg [3:0] cnt);
  always @(posedge clk) begin
    if (rst)
      cnt <= 0;
    else if (inc)
      cnt <= cnt + 1'b1;
  end
endmodule

image At the top in order clk, rst, inc and cnt.

6502 CPU from https://github.com/Arlet/verilog-6502/

(Currently not entirely working) image

verilog2factorio's People

Contributors

jaller94 avatar justchen1369 avatar mdfl64 avatar redcrafter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.