This site contains tools that help you learn the fundamentals of the design of computers
- HDLBits: A problem set and online judge to practice digital circuit design in Verilog
- ASMBits: Just like HDLBits, but for practicing Nios II or ARMv7 assembly language
- CPUlator: An in-browser full-system MIPS, Nios II, and ARMv7 simulator and debugger
These tools were originally created to complement second-year undergraduate computer engineering (digital logic and computer organization) courses at the University of Toronto, and have since been used by other similar courses.
Why were these created? Practice is essential when learning any new language (or anything else, really). These tools were created to make it quick and easy to do more practice on short problems.
HDLBits is a set of short Verilog design problems. An online judge checks solutions for correctness. The problems set begins in a tutorial style that teaches basic Verilog language features, and progresses to increasingly challenging designs.
Each problem requires you to write some Verilog code. When you submit your code, the online judge tests your design for correctness (but unfortunately not coding style). The large number of short problems with instant feedback encourages more practice than (typically more difficult but less frequent) assignments or labs.
This is a web interface to Icarus Verilog. Its main purpose is for creating shareable simulations of short bits of Verilog code. The limitations of the web interface mean that running a Verilog simulator offline is more suitable unless you're simulating a very simple circuit.
Main limitations: single source file, limited simulation CPU time, no interactive debugging.
ASMBits is a set of short assembly language programming problems (for Nios II and ARMv7), in the same style as HDLBits.
CPUlator is a full-system simulator and debugger for Nios II, ARMv7, and MIPS systems, intended for education use. The simulator also simulates some I/O devices (based on the computer systems used by the Altera University Program for Nios II and ARMv7, based on SPIM for MIPS).
It can be used to work on lab assignments without hardware, to debug solutions for ASMBits exercises, and for in-lecture demonstrations.
The simulator is complete enough to do most lab assignments that are based on Altera's University Program's computer systems (including interrupts, but excluding MMU). The simulator includes run-time assertions to catch common errors (which hardware cannot do).
How to use?
- Practice: The HDLBits and ASMBits problem sets includes exercises of varying difficulty. Start with the easiest few problems under each topic. Even if you don't have time to get to the more difficult problems, being quick and accurate at creating simple designs can be a big help.
- Assembly language programming: The CPUlator simulator is a nearly-complete simulation of a Nios II and ARMv7 system. It's quicker and easier to debug your lab assignments in the simulator (it even catches some common errors), and in almost all cases programs written in the simulator will work unmodified on real hardware.
- Practice: Simply informing students of the availability of optional "extra practice" tends to reach only the subset of students (my experience so far suggests under 10%). Due to the large number of exercises, suggesting exercises that coincide with the current topic may be useful.
- Code examples: When answering student questions (e.g., on discussion boards), I often code up a demonstration of the answer. The "Upload and share" button in CPUlator can be used to post a link to a code example, while the "share" button on the Icarus Verilog web interface can be used to link to a simple Verilog code example and testbench.
- Flipped clasrooms: The auto-graded exercises could form one component of a flipped classroom, by providing a method for evaluating progress.
- Demonstrations: CPUlator may be useful for in-lecture execution of assembly code, where access to the hardware may not be convenient.
- Other: If you have more ideas, or if you're thinking of using these tools in your courses and need changes or new features, send me an email!
- Teaching something other than Verilog, Nios II, or ARMv7? It may be feasible to support a new tool/HDL/instruction set, but I wouldn't spend the effort to support it unless I know someone will use it.