Question

I'm a programmer wishing to learn verilog.

What would be amazingly neat would be a tutorial where one constructs a tiny microprocessor with a very clean design, something like an Intel 4004, and then goes on to actually make it using an fpga and gets it to flash LEDs to order.

Is there such a tutorial?

If not, I might have a go at writing one as I try to do it. Has anyone got any recommendations as to resources I might draw on? e.g. nice open source verilog compiler, debugging tools, simulators, verilog tutorials, cheap fpgas and programming tools, breadboards for LEDs, etc.

Was it helpful?

Solution

I found some glorious slides about an elementary microprocessor here:

http://www.slideshare.net/n380/elementary-processor-tutorial

OTHER TIPS

The open source tools are good for development/testing but won't be able to synthesise your hdl to produce a bitstream, you'll need to use one of the manufacturers tools from altera or xilinx (or others).

The manufacturers tools come as suites , are large (5GB install and need 7 to 12 GB drive space) available for windows and linux. altera.com xilinx.com

There are plenty of soft cores out there. opencores.org would be a good place to have a look at There is the zpuino which is arduino compatible.

Best idea is start simple and build up Get a fpga board, implement a simple design (led flasher) and work up from there. Quite a learning curve especially if you haven't done much digital electronics.

Remember its hardware and your designing circuits not writing code so timing is everything.

Have a look at the fpga4fun.com projects and work through them as a starting point.

xilinx based digilentinc has some low cost boards , as does gadget factory. avnet has a usb dongle based board for $80.

altera based . terasic has some nice boards.

Gadget factory has a kickstarter project up at the moment for the paillio + a few addon boards http://www.kickstarter.com/projects/13588168/retrocade-synth-one-chiptune-board-to-rule-them-al

You can play with Verilog without an actual board using the GNU Icarus Verilog. You can get a Windows build from here.

There is a also a tutorial by Niklaus Wirth on how to design and build a simple CPU, with code in Verilog for a Xilinx board:

https://www.inf.ethz.ch/personal/wirth/FPGA-relatedWork/RISC.pdf https://www.inf.ethz.ch/personal/wirth/FPGA-relatedWork/ComputerSystemDesign.pdf

~Yes, it is the same Wirth that invented Pascal -- he is playing with FPGAs in his retirement.

Not sure about an explicit verilog tutorial, but you might find this class interesting from MIT open courseware:

http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-004-computation-structures-spring-2009/

All the class notes are online, and the syllabus sounds like it might be what you're interested in (emphasis mine):

6.004 offers an introduction to the engineering of digital systems. Starting with MOS transistors, the course develops a series of building blocks — logic gates, combinational and sequential circuits, finite-state machines, computers and finally complete systems. Both hardware and software mechanisms are explored through a series of design examples.

6.004 is required material for any EECS undergraduate who wants to understand (and ultimately design) digital systems. A good grasp of the material is essential for later courses in digital design, computer architecture and systems. Before taking 6.004, students should feel comfortable using computers; a rudimentary knowledge of programming language concepts (6.001) and electrical fundamentals (6.002) is assumed.

The problem sets and lab exercises are intended to give students "hands-on" experience in designing digital systems; each student completes a gate-level design for a reduced instruction set computer (RISC) processor during the semester. Access to workstations as well as help from the course staff is provided in the lab but it is possible to complete the assignments using Athena machines or one's home computer.

Altera has great resources on this kind of stuff.

You can try out this link: http://www.altera.com/education/univ/materials/digital_logic/labs/unv-labs.html

There's a series of lab tutorials that goes through making an embedded processor using Verilog/VHDL.

All of the FPGA vendors have inexpensive ($200~250 range) development kits. For example, the SP601 from Xilinx or the Cyclone III Starter from Altera. I personally own an SP605 (~$500) from Xilinx. You may be able to find cheaper options from other options (e.g. Sparkfun).

Strictly speaking, while you can find open source VHDL/Verilog tools, I am not aware of any such tools for synthesis (making something the FPGA will use). Both Xilinx and Altera provide free (as in beer) tooling, but they are not open or free (as in libre) software. The Xilinx tools include a simulator (limited in the free version) and can run on Windows or Linux. I assume the Altera tools are similar, but I am not familiar with them.

Building a simple microprocessor in Verilog/VHDL is a pretty common feature in college computer architecture classes. You can undoubtedly find class notes and the like from pretty much any major school.

There is an excellent open source verilog compiler, Icarus. From the Icarus web page

Icarus Verilog is a Verilog simulation and synthesis tool. It operates as a compiler, compiling source code written in Verilog (IEEE-1364) into some target format.

I am not aware of a microprocessor-in-verilog tutorial, but there is the OpenCores web site. In the Processors tag under Projects, I see many processors implemented in Verilog or VHDL: 8080, 6502, 8051, Z80, 6805, to name a few. I assume one of these would serve you as an example to get you started.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top