FPGA implementation of the popular logic game using VHDL and Altera DE1. It stands by the original rules of this game, except for the secret pattern of four code pegs, that can contain duplicates. For this project, we used Quartus 13.0sp1, for it's the last version supporting our board Altera DE1, who is mounting a Cyclone II FPGA. You can download this project and load it directly into your Quartus IDE, as there's already the main project file inside this repository (Mastermind.qpf).
It's a project divided in three parts: data-path, control-unit and view (like MVC pattern for high-level applications). There are also some files supporting VGA communications with displays.
It's represented by a single file, datapath.vhd, that contains, among other things, a finite state machine mantaining game data memorized and computing changes related to user inputs.
It's represented by a single file, controller.vhd, that contains a process handling user inputs appropriately, to avoid sending asserted signals to other modules more than enough.
It's represented by a single file, view.vhd, which contains, among other things, a finite state machine describing the current part of the scene which is being written to the SRAM (see next section for this).
It's represented by a single master file, vga_framebuffer, which instantiates many other modules inside, such as vga_timing or text_controller, to appropriately manage VGA communications with displays and SRAM read/write access. This because, in particular, for this project, we chose to use a framebuffer (represented by the board's SRAM), to comfortably write (in terms of timing) the next scene to be rendered on screen while outputting the current one. If you're not familiar with VGA in such low-level terms and you're interested in knowing more, we suggest you to read our files inside docs folder or these webpages (https://eewiki.net/pages/viewpage.action?pageId=15925278, https://en.wikipedia.org/wiki/Framebuffer).
Inside folder docs, you can find some documents, where all the files in this repository (that were not generated automatically by our IDE), among many other things, are described in detail, if you are interested.
There are some files and folders (db, incremental_db and output_files) that were automatically generated by our IDE: we will not explain their functionality here; if you're interested, please refer to our docs folder or to Quartus documentation.
Mastermind is published under MIT License. Special thanks to Primiano Tucci, for his Tetris implementation, and to Derek Wang, for his VGA-Text-Generator.
Copyright (©) Davide Di Donato, Silvia Damiani & Marco Valli 2018.