Skip to content

Monobolag is a monopoly inspired clone running on a microcoded CPU+VGA Processor implemented in VHDL with custom assembly language.

License

Notifications You must be signed in to change notification settings

wind1s/Monobolag

Repository files navigation

Monobolag

Monobolag is a monopoly inspired clone running on a microcoded CPU+VGA Processor implemented in VHDL with custom assembly language and assembler. The project runs on a Nexys3 FPGA development board with a 640x480 VGA screen and requires a hexadecimal numpad peripheral device. Programming is done via UART cable with a assembled bin file using the custom assembler. This project was made as a part of the project course TSEA83 Computer Hardware and Architecture at Linköpings University. This integrated computer is not perfect. There are timing issues with memory access, no pipeline massively reducing speed and no interrupt support. Although these limitation where made to meet deadlines and the software was designed with this in mind.

Assembler

The assembler works for most instructions but supports only 1 file at the moment and a "data" json file. There are minor bugs in the assemlber relating to labels containing other labels as substrings.

Usage

To start the game, the Nexys3 card must first be programmed. Run make monobolag.prog`` and if necessary, generate the bitgen file with make monobolag.bitgen`` in the same folder then run the previous command.

To program the design with the monobolag program, navigate to the src folder in the assembler branch. From here run program.py with a .bin file as the first argument which has been generated by the monoler.py assembler. There is a ready-made monobolag.bin``` or else monobolag is compiled with monoler.py which takes a ``.asm file and associated ``.json data file. To restart the game, the computer is reprogrammed with ````program.py.

Example of how to compile and program in Linux.

python3 monoler.py monobolag/monobolag.src monobolag/monobolag.json
sudo python3 program.py output.bin

Example of how to program directly with a ready-made monobolag file.

sudo python3 program.py monobolag.bin

Block diagram

The VHDL code is constructed after these block diagrams describing the processor.

Overview diagram

This is an overview of the processor construction. Overview block diagram

CPU diagram

CPU construction which gets programmed from the UART, sends data to VRAM, reads input from hex numpad. CPU diagram

UART Programmer Diagram

Controls the CPU if there is a program signal sent over UART from a external device (like a laptop) UART Programmer block diagram

VGA motor diagram

Overview of the VGA motor diagram which reads pixel data from sprites ROM and VRAM. VGA motor diagram

Subdiagram of pixel chooser PIX which interleaves pixel data from sprite ROM and VRAM. PIX diagram

Subdiagram of sprite ROM where monobolag game sprites are saved. Sprite ROM diagram

About

Monobolag is a monopoly inspired clone running on a microcoded CPU+VGA Processor implemented in VHDL with custom assembly language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published