WebFPGA - Verilog development in browser

    I think many programmers, ranging from python-datasayentists and ending with harsh driver developers, sometimes raise their eyes sorrow and sigh dreamily: "Oh, it’ll be harder, harder ...". Of course, we are talking about Verilog, a language for describing and modeling electronic systems. Verilog has always stood out among programming languages; allowing to solve problems that can not be overpowered in any other way, it, however, requires a specific hardware platform, FPGA - a programmable logic integrated circuit. The threshold for entering the development at Verilog is relatively high, but it may soon become a little lower, because the crowdfunding

    project is underway right now : WebFPGA.
    The essence of the project: Debug board for FPGA iCE40UP5k. All development and debugging software is located in the cloud; interaction with the board occurs in the browser using the WebUSB API.
    Platform : Kickstarter.
    Posted by Ryan Jacobs (programmer), Mick Jacobs (electronic engineer).
    Location : Los Angeles, California, USA.

    The board combines the Lattice iCE40UP5k FPGA (5280 logic cells, 32 GPIO, 1 Mbps SRAM) and the STM32F04-Series microcontroller; more precisely, the developer does not report the microcontroller model, but judging by the photo of the board, this is TSSOP-20, and in TSSOP-20 ST Microelectronics releases only one STM32F04-Series microcontroller - STM32L041F6 for € 2.02.

    Interestingly, one of the authors of the project, Ryan Jacobs, is a student at UCLA, he does not yet have an explanatory resume, so he gives a link to GitHub, on which he already managed to earn 1700 stars.

    While the cloud part of the project is hosted on 6 servers (the exact characteristics are not announced, from the entire specification it is only known that these are “dual Xeon”), the developer promises that part of the funds raised as a result of the campaign will go to pay for equipment already purchased, if the amount collected If the project exceeds $ 10,000, then these additional funds will be a signal indicating a large number of potential users and the server park will be expanded. According to the author, cloud storage like Amazon or Azure does not fit into the current business model, so it was immediately decided to deploy the entire backend on its own servers.

    To prevent possible unrest among potential users about the insufficient processing power of the servers, Ryan assures that "the servers are used only for synthesizing and transmitting to the end user a binary code that is only 3 kilobytes in size." In my opinion, the volume of traffic is really small - “up” leaves the source code for Verilog, which can also be compressed well, “down” comes the binary firmware, the size of which is really small due to the relatively small capacity of the FPGA used.

    But with the loading of servers by the process of synthesizing firmware from Verilog-code, in my opinion, everything is not so uniquely optimistic. Even if we leave out the process of optimizing the physical placement of the resulting circuitry in the general FPGA space, which definitely requires a rather quick graphical interface and constant exchange of rather large packets of information with the server, the process of synthesizing the firmware itself remains, which, in my personal opinion, is first , must eat a sufficiently large amount of processor time and, secondly, is non-deterministic in nature and can be delayed.

    Personally, I got acquainted with FPGAs in the first half of the zero (they were Actel FPGAs, the firmware of which was developed in the Libero + Synplify + ModelSim bundle) and, as far as I remember, the synthesis process was never lightning even for simple, educational projects. Actually, like any compilation process, synthesis is characterized by all sorts of periodic hiccups and stuttering, but let's hope that the average server response time will be within the framework of human patience. By the way, when in the FAQ the author talks about optimizing compilation by caching binary files (if the Verilog file code and compiler flags were unchanged, the user is simply given the last binary received), then he mentions that “you won’t need 2 minutes expect the completion of the synthesis process. ”

    If for some reason you are not satisfied with the development through the browser (at least it can be assumed that the process will be damp at first), then you can work with FPGAs through IceStorm / iCECube.

    If you are interested in WebUSB technology, you can pay attention to the following open projects (all links lead to GitHub, so you can immediately get under these hoods for these projects):

    • WebUSB + Arduino . It only works on Arduino-compatible motherboards with full USB, like Arduino Zero or Adafruit Feather 32u4.
    • Weblight . An LED connected to the ATtiny85 microcontroller and controlled via the Internet. Of course, if you can control the LED, you can control other external devices, everything that can be connected to the GPIO.
    • Yubikey HOTP . Devices for protecting personal data on computers and smartphones. They work with Facebook, Gmail, GitHub and many other services.
    • webdfu . USB DFU is used to program microcontrollers. I myself use this mode for programming devices based on STM32 microcontrollers. Now, if the installer needs to run around the technological installation and update the firmware of several dozen devices, you can take with you not a laptop with Windows, but an Android phone.
    • JS IDE for RTOS Zephyr Project, which allows you to download code to all Zephyr compatible boards, and there are more than a hundred. So right now buy something like STM32F723E Discovery or UDOO Neo Full and write the code for them right on your phone.

    On the project page, developers talk about support for WebUSB technology in Chrome, Opera, and Edge browsers, but mozilla.org now has other information, Edge is not in the list of compatible browsers:

    Considering that Microsoft Edge now occupies only 5.2% of the browser market, this is not critical , but if you still have Edge, be aware of possible incompatibilities. On the other hand, there is now the opportunity to develop for FPGAs in Chrome OS, which was previously impossible in principle.

    Should I help this project? In my opinion, worth it. Unfortunately, when I already wanted to join the ranks of backers, it turned out that to order WebFPGA you must be a resident of the United States or Canada. If you are a resident of the global “castle”, then the author diplomatically asks to contact him and promises to think what can be done about this. I don’t quite understand what this restriction is connected with, usually the authors of crowdfunding campaigns simply determine the different cost of delivering the item to different countries (in accordance with the mail tariffs of the country of the project’s localization), so the parcel can also be received in less prosperous regions than North America.

    FPGA iCE40UP5k, as far as I know, does not fall under any export restrictions and is freely available on Mouser at a price of € 6.46. The STM32L041F6 microcontroller for € 2.02 is all the more available for free order. Perhaps the author of the crowdfunding campaign decided to be guided by the Pareto 80/20 principle and gently refuse to work with customers outside the civilized ecumenical world? If he really pulls the project alone, then this may turn out to be the right business decision.

    The project, of course, is somewhat controversial. Development on Verilog in a browser using cloud software - well, sort of cool; especially for countries where respect for proprietary software is supported by numerous real-life legal precedents and downloading some really cool and convenient IDE for development on Verilog from torrents, and then also using it in your business, is a phenomenon that is much less common than , say, in the countries of the former. USSR. I myself, of course, don’t download anything from torrents, and I don’t advise you, but someone can do this, you can expect everything from him .

    On the other hand, it’s now possible to use some kind of free programming environment for FPGAs (at least iCEcube2, which, although it is tied into your Lattice account and the MAC address of the working machine, is distributed free of charge) plus an inexpensive debugging board from a Chinese manufacturer, so if you can’t buy specialized software, it’s not necessary to focus on cloud computing. But - the project is quite cool in itself (Verilog! In the browser! WOW!), And can lead to something more as a result of development. Maybe over time, the ecosphere will be born, close to the user communities of Arduino or Raspberry Pi, and amateur FPGA enthusiasts will be able to exchange Verilog-code, compiled kernels and other developments just as freely. as it is happening in the world of microcontrollers. In general, it seems to me that the pros of the campaign outweigh the cons.

    To the credit of the authors of the crowdfunding campaign, they do not hush up the fact of the existence of competitive devices, which also try to combine an interesting stuffing and a fairly low price:

    • MojoBoard V3, priced at $ 75, carries on board the Spartan 6 XC6SLX9 FPGA in the TQFP-144 package, ATmega32U4 microcontroller companions for 84 GPIOs;
    • IceBreaker, another crowdfunding project, already successfully closed; for $ 69, a motherboard with Lattice iCE40UP5k FPGA and FT2232 converter is offered;
    • TinyFPGA BX, price $ 38, FPGA ICE40LP8K (7680 logic cells), 41 pins GPIO.

    Personally, while living in Russia, I can’t fully participate in the WebFPGA project, but I sent Ryan $ 5 using the “Make a donation without remuneration” option (this is something like the “Send money to author” button on Habré). Firstly, it seems to me that the project itself is very interesting and useful. Secondly, a small donation automatically subscribes me to all the news on the project, so I feel a little Warren Buffett, who sometimes buys one share in a company that interests him, so that later, as a shareholder, albeit a minority, annually receive a full package of reports.

    Judging by the identity of the authors, one of whom is spending the night and sleeping on GitHub, so even if the project doesn’t take off, we’ll still get a lot of very useful source code, and, possibly, over time there will be people ready say raise a fallen banner.

    I have a small blog related to open source hardware and crowdfunding; If you have any interesting DIY-development or crowdfunding project in the field of electronics, I will be grateful for the link.

    Also popular now: