Online FPGA simulator? - Page 1
Forum section: electronics / beginners

author: Dmeads
author_rank: Regular Contributor
timestamp: February 12, 2019, 05:06:14 am
content: Hello everyone! This is my first post!I'm a 2nd year EE.I am fascinated by FPGA, but I really don't have a lot of money to spend on a board.I have seen things like arduino simulators online in autodesk products and things like that.Just wondering if there are any online simulation options to save me some money, or should I just save up for a board.Also could you please point me in the direction in some good getting started in FPGA tutorials please?Thanks!

author: james_s
author_rank: Super Contributor
timestamp: February 12, 2019, 05:30:38 am
content: How low is your budget? One of my favorite FPGA boards costs only about $13 + another $3 or so for the programming cable. The Cyclone II is an old part but it's still big enough to fit an entire 8 bit computer running BASIC in it and another advantage is projects compile much quicker than for bigger newer parts.If you really want to just simulate VHDL or Verilog, all the FPGA development packages have a simulator.

author: ataradov
author_rank: Super Contributor
timestamp: February 12, 2019, 05:32:45 am
content: Why do you need online simulators? Download tools from manufacturers. They all have simulators.There are plenty of free and open simulators too.Simulators for FPGAs are a very common thing. And using simulators is a good first step in any FPGA development anyway.

author: KE5FX
author_rank: Super Contributor
timestamp: February 12, 2019, 07:31:51 am
content: Not exactly an "FPGA (board) simulator" butEDA Playgroundis an extremely valuable resource for accessing, evaluating, and learning about various HDL-related tools, IMO. It is well worth signing up for an account and I don't say that about many sites.

author: jackthomson41
author_rank: Regular Contributor
timestamp: February 12, 2019, 07:53:31 am
content: I think you should buy the cheapest FPGa board, available online. Simulator is a good start but I have many experiences where everything works pretty good on simulator but when I run it on actual hardware, it creates much trouble. So, go with the actual board, my suggestion. You can also try ESP8266, checkESP8266 Pinoutfirst before working on it.

author: ataradov
author_rank: Super Contributor
timestamp: February 12, 2019, 07:57:10 am
content: Post place-and-route simulation is very accurate to the actual hardware. But it is slow.Behavioral simulation is fast, but does not reproduce the non-ideal behavior of the actual hardware (like propagation delays).

author: james_s
author_rank: Super Contributor
timestamp: February 12, 2019, 08:43:18 am
content: I like having the actual board because for some reason it's a lot more fun, generally a simulation should be very accurate though. Where it gets difficult is trying to unit test modules that depend on complex external stimuli.

author: rstofer
author_rank: Super Contributor
timestamp: February 12, 2019, 03:55:14 pm
content: https://www.fpga4fun.com/When you look at boards to buy, you need to consider what is on the board. I like lots of switches, LEDs, buttons and 7-segment displays. I also want as many offboard connections as possible and I prefer with 50 pin headers over the 6 or 12 pin PMOD connections. OTOH, in the Digilent world, there are a lot of interesting gadgets that connect to the PMOD headers.I know it is over the top in price but I really like this type of board:https://store.digilentinc.com/nexys-a7-fpga-trainer-board-recommended-for-ece-curriculum/I can get a lot of diagnostic information from the LEDs and displays and I can select what I see with the switches. I can also use a pushbutton for single-stepping.A very common board might be something like the Artyhttps://store.digilentinc.com/arty-a7-artix-7-fpga-development-board-for-makers-and-hobbyists/I have a couple of them and they are very useful but in many ways it's like working in the dark. Either that or I have to gin up some kind of display/switches/pushbutton arrangement and hang it off the edge. Digilent has some gadgets that help with this but there is no way that Arty will ever be the board the Nexys board is.Education has never been free and it won't be for FPGAs either.

author: Berni
author_rank: Super Contributor
timestamp: February 12, 2019, 04:16:20 pm
content: Best simulators tend to be the ones included with your FPGA tools.Main reason is that as soon as you use any chip specific functionality (Even as simple as memory blocks) you will need a simulation model for that block to be able to simulate a design that uses it. The manufacturers don't give out models for the on chip functionality in plain HDL source code so you can't just stick the code into any simulator out there. But they do have precompiled binary blobs of there modules for the specific simulator they support and the simulator is aware of them so it just magically works.FPGAs are not like C where the same piece of code easily recompiles for any architecture that a C compiler exists for. The majority of HDL code you find in the real world is very vendor specific and will not port easily to any other compiler/IDE. Yes the actual HDL code is universal and portable, but real world projects with FPGAs always use some of the chip specific hardware because it makes for huge performance gains(memory blocks, hardware multiplier blocks, serdes blocks, memory controllers etc)You can learn a HDL language really well in 1 week if you put yourself to it. Actually learning how to implement a large project and getting it to compile and run on a real FPGA is much harder as knowing a HDL language is only a small part of it. The other parts are knowing your way around the development tools, knowing how to properly simulate things, understanding timing closure, understanding the limitations and advantages of specific FPGA families, learning how to efficiently use the FPGA resources and in general a lot of computer science stuff in how to efficiently do various tasks in the digital world.

author: emece67
author_rank: Frequent Contributor
timestamp: February 12, 2019, 05:20:23 pm
content: .

author: rstofer
author_rank: Super Contributor
timestamp: February 12, 2019, 07:17:51 pm
content: Quote from: emece67 on February 12, 2019, 05:20:23 pmIn earlier times with Xilinx ISE, the simulator wasn't free. The IDE was free, the synthesis and place/route tools were free but not the simulator. As a result, I have never used the simulator.Now the simulator is free in Vivado but I still don't use it. I liken simulation to single stepping through pages of assembly code - a colossal waste of time. Yes, it could be useful for small pieces of a project (perhaps observing the ALU or not, see below) but I'm not convinced it brings anything to the dance when the actual circuit fails about a million cycles into booting the OS. And the OS is KNOWN to work...The new Internal Logic Analyzer of Vivado, OTOH, can be quite handy because I can trigger it just before where I expect a problem. Getting the constraints file correct can be a bit of a challenge but much of it is automated.I can also arrange for an address breakpoint that will change the CPU mode from Run to Single Step and pause. Now I can single step in the area where I expect to find a problem.There are a lot of ways to debug projects, FPGAs or otherwise, and all have a place. That's why I want a board with lots of LEDs and 7-segment displays.A long time back I was messing with the design of an ALU for the PDP 11/45. That thing is complicated! So, I coded it up on an FPGA and I connected the inputs and outputs (data and flags) to a long shift register. That allowed me to insert test vectors and grab the results. I used another processor (Blackfin) to handle the data transfer while grabbing vectors from an NFS server. And that's the way you test an ALU. With a Raspberry Pi it might be even easier since it could handle the transfer and contain the files. Handling the transfer on a typical Linux box seems daunting.

author: KE5FX
author_rank: Super Contributor
timestamp: February 12, 2019, 10:05:26 pm
content: Quote from: emece67 on February 12, 2019, 05:20:23 pmWasting a lot of time with simulators and expecting it to improve your ability to get things done with FPGAs in real-world hardware projects is like wasting a lot of time alone with porn and expecting it to improve your sex life.Buy a board, hook up a scope, and do some probing. And yes, keep it synchronous.

author: ataradov
author_rank: Super Contributor
timestamp: February 12, 2019, 10:11:36 pm
content: There are issues that can only be realistically debugged in a simulator. And keeping it synchronous is not always an option.Simulators are useful tools and there is no financial penalty in trying it.

author: emece67
author_rank: Frequent Contributor
timestamp: February 12, 2019, 10:37:24 pm
content: .

author: jmelson
author_rank: Super Contributor
timestamp: February 12, 2019, 10:45:06 pm
content: Quote from: KE5FX on February 12, 2019, 10:05:26 pmWell, you can actually test a lot of things internal to a module of HDL code with a few minutes of writing a testbench and then simulating the sequence you think might not work as intended. This can be MUCH faster than trying to instrument a physical board. ChipScope (Xilinx in-FPGA logic analyzer) takes up a lot of room on small FPGAs and has limited record depth. In really difficult cases, it can tell you what is going wrong between internal and external signals, but is a lot of hassle. Guessing where the issues might turn up and then checking those by simulation can save a lot of hard work.QuoteReally, trying to debug an FPGA in a more complex system with just a scope can be very frustrating. And, of course, lacking synchronizers on inputs to the FPGA is something that will generally NOT be caught by simulation, but you need synchronizers on pretty much ALL inputs, so you should just check to make sure they are in the code.Jon

author: KE5FX
author_rank: Super Contributor
timestamp: February 12, 2019, 10:59:01 pm
content: Quote from: jmelson on February 12, 2019, 10:45:06 pmAs opposed to simulating a USB controller, DDR SDRAM, and numerous complex proprietary peripherals for which you don't have models?Simulation has its value in education, but you'll never convince me that it's a win in real-world complex designs. The effort required to keep the simulation faithful to the peripheral hardware, including aspects that aren't documented, will generally be higher than the effort needed to debug the hardware itself.I have a big problem with people who stick their noses in the air and preach the virtues of simulation over getting one's hands dirty. They generally have not shipped many FPGA products themselves, but they're happy to tell beginners how to do it.

author: james_s
author_rank: Super Contributor
timestamp: February 12, 2019, 11:29:24 pm
content: Quote from: rstofer on February 12, 2019, 07:17:51 pmIt's been free for a while, I've been doing FPGA development as a hobby for about 5 years and I've always had the simulator in ISE. I don't use it all that often because my projects are mostly small enough to just compile and debug but it's there and it works. I think if I were doing very large complex projects or things where timing was critical then I'd use the simulator a lot more.

author: ogden
author_rank: Super Contributor
timestamp: February 12, 2019, 11:57:19 pm
content: Quote from: KE5FX on February 12, 2019, 10:59:01 pmOP do not have money to spend on FPGA board, not to mention multi-gigahertz scopeIt is unlikely that he owns ANY scope, yet you are pushing "hands dirty with scope" agenda. I would like to remind that simulator is what OP asked for. (You may want to check subject of this thread)

author: rstofer
author_rank: Super Contributor
timestamp: February 13, 2019, 12:40:05 am
content: Quote from: james_s on February 12, 2019, 11:29:24 pmI started when I retired, about 15 years ago. Modelsim was available but not free. So I came up with a different plan.There are lots of ways to do things. Circumstances will often shorten the list of possibilities.

author: KE5FX
author_rank: Super Contributor
timestamp: February 13, 2019, 01:51:24 am
content: Quote from: ogden on February 12, 2019, 11:57:19 pmYes, and if you'll notice, I recommended some free online simulation tools. OP's use case falls into the category of "education," where simulation can be a valuable time saver and aid to understanding.

author: Yansi
author_rank: Super Contributor
timestamp: February 13, 2019, 01:55:47 am
content: FPGA kits from china may go as low as $10.If you want very cheap but yetadult FPGA, search for Cyclone II devices.

author: rstofer
author_rank: Super Contributor
timestamp: February 13, 2019, 02:09:37 am
content: Here is a free simulatorhttp://ghdl.free.fr/

author: Berni
author_rank: Super Contributor
timestamp: February 13, 2019, 06:28:30 am
content: Simulation is not that useful for simulating entire huge designs, it is for modules.The simulation in HDL tends to be used more like unit tests in C++ programming. You just take one reasonably small self contained module of HDL code and write a test bench to exercise it. The modules being small makes it much easier to write a testbench for because the module doesn't have a massive number of complex states you have to exercise. If you are making a USB PHY you don't try to emulate an entire USB host to connect it to. You would just feed data trough it and then have the testbench decode that raw bits on the USB pins back out to compare if it matches. Other times you might use two of the modules under test to talk to each other. Like when i was working on a CAN controller i simply connected two of them together on a "virtual CAN network" so that i could watch them talk back and forth to each other on the bus rather than implementing a whole CAN device in my testbench for it to talk to.Once all the modules are tested individually you can then stick them together and run it in a real FPGA to test it. If you find a problem with the interaction of two modules but after many hours of debugging still have no idea why it breaks, then you can go and stick those modules together in a simulator and exercise them to reproduce the problem and step trough the code to figure out why it happens.Simulators are very useful for FPGA design, but they won't teach you anything more than VHDL/Verilog syntax and a bit of binary. It has to be stuck into a real FPGA chip at some point to experience the true challenges and pitfalls of FPGA design.

author: emece67
author_rank: Frequent Contributor
timestamp: February 13, 2019, 09:16:07 am
content: .

author: james_s
author_rank: Super Contributor
timestamp: February 13, 2019, 07:22:02 pm
content: I think what it comes down to is if you want to do this professionally then being proficient with simulation and the latest tools is mandatory. You might not always simulate everything but you need to know how to do it and when it makes sense to do so.If you're doing it as a hobby then the right approach is the one that works for you, as long as you're having fun then you're doing it right. I still think it's worth learning how to use the simulator because it's another tool to have on your belt when faced with a problem but I admittedly rarely use it myself. I'm more of the "build it and see what happens" type.

author: Dmeads
author_rank: Regular Contributor
timestamp: May 20, 2019, 03:07:41 am
content: Okay,Im the OP, and here's what I did with the information yall gave me:I bought a Lattice ICEstick FPGA dev board (25 bucks)I am currently going through a bunch of Hackaday forums and thats helping me learn EDA playground. The simulator on that is just fine for what I need, and its in a browser, not a an application.I haven't actually programmed the hardware yet, but I will soon!Thanks for all the info!Its actually a lot more fun than I thought!

author: tggzzz
author_rank: Super Contributor
timestamp: May 20, 2019, 07:14:52 am
content: Quote from: KE5FX on February 12, 2019, 10:59:01 pmThose are valid points, but there is another benefit to simulation: rerunning previous validation and verification tests when something changes.Changes can be any of:the next incremental implementation of part of a design. The software world has triumphantly reinvented this concept as TDD!a peripheral changechanged requirements, either from the customer or based on improved understandingchanged device, within limits!and there are many others, of course.Of course the temptation is to use TDD as a crutch, "it passes the simulation tests, therefore it works". Inappropriate use of any tool is possible, and probable with some peopleNormally in large designs developing and maintaining tests takes at least as much time as developing the implementation. The benefits can and should be reduced integration times, coupled with the ability to point fingers at other people/companies

author: KE5FX
author_rank: Super Contributor
timestamp: May 20, 2019, 07:44:48 am
content: Quote from: tggzzz on May 20, 2019, 07:14:52 amOld serviceman's adage: "The only tube tester that matters is the set itself."The more things change...

author: rstofer
author_rank: Super Contributor
timestamp: May 20, 2019, 01:56:50 pm
content: A free book:http://freerangefactory.org/pdf/df344hdh4h8kjfh3500ft2/free_range_vhdl.pdf

author: Old Printer
author_rank: Frequent Contributor
timestamp: May 20, 2019, 03:03:53 pm
content: Quote from: rstofer on May 20, 2019, 01:56:50 pmThanks, price is right and it's under 200 pages.To the OP... If any of those Hackaday pages were particularity useful a link or two would be a good followup for those of us tagging along. Thanks.

author: Dmeads
author_rank: Regular Contributor
timestamp: May 24, 2019, 05:13:57 am
content: Quote from: Old Printer on May 20, 2019, 03:03:53 pmhttps://hackaday.com/2018/08/06/learn-fpga-fast-with-hackadays-fpga-boot-camp/i have only done the first two modules of the boot camp, but its very good. Al is good at explaining.Eda playground is fun to use, and there are a bunch of good videos on it.https://www.youtube.com/user/edaplaygroundSo far I have been just working on shematic description in verilog (not circuit behavior), and I have successfuly built some gates and latches.The hard part for me is making the test bench, because im used to SPICE where you can just hit run and it simulates for you. Verilog is a little different.Its my first coding language (although I know some very basic arduino), and its going well! Thanks to everyone for all the replies and links to the posts.